There were some green and red apples in a box. Ted took up 2/11 of the green apples from the box. He replaced each of these green apples taken out with red apples. After that, he took out 2/5 of the green apples and 1/3 of the red apples. There were 108 green apples and 228 red apples left in the box in the end. What was the total number of green and red apples in the box at first?

to start, let there be g green and r red apples.

The amounts change after each step
9/11 g and r
9/11g and (r + 2/11 g)
3/5 (9/11 g) = 108
2/3 (r + 2/11 g) = 228
so, we have
g = 220 and r = 302

Here's another approach:

Focus on just green apples first.
g - (2/11)g -(2/5)(9/11)g = 108
Solve to find g = 220
Now red apples.
r + (2/11)(220) - (1/3)(r + (2/11)(220))
Solve to find r = 302

To solve this problem, let's break it down into steps:

Step 1: Let's assume that the total number of green apples in the box initially is G, and the total number of red apples is R.

Step 2: Ted took up 2/11 of the green apples, which means he took (2/11) * G green apples. After this, the number of green apples left is G - (2/11) * G = (9/11) * G.

Step 3: Ted replaced each of the green apples taken out with red apples, so the number of red apples increased by (2/11) * G. Therefore, the number of red apples is R + (2/11) * G.

Step 4: After the replacement, Ted took out 2/5 of the remaining green apples. This means he took (2/5) * (9/11) * G = (18/55) * G green apples. After this step, the number of green apples left is (9/11) * G - (18/55) * G = (27/55) * G.

Step 5: Ted also took out 1/3 of the red apples, which means he took (1/3) * (R + (2/11) * G) red apples. After this step, the number of red apples left is R + (2/11) * G - (1/3) * (R + (2/11) * G) = (2/33) * (5R - 2G).

Step 6: Finally, we are given that there were 108 green apples and 228 red apples left in the box. So, we have the following equations:
(27/55) * G = 108 --- Equation 1
(2/33) * (5R - 2G) = 228 --- Equation 2

We can now solve these equations simultaneously to find the values of G and R, which will give us the initial total number of green and red apples in the box.