I had a total of 129 marbles in 3 boxes at first. then I threw away 2/3 of the marbles from box1 ,added 15 marbles to box 2 and added some marbles to box 3 until the number of marbles in box 3 tripled. As a result, the ratio of the number of marbles in box 1 to the number of marbles in box 2 to the number of marbles in box 3 became 2:3:9. what is the total number of marbles in the three boxes now?

suppose the boxes 1,2,3 had x,y,z marbles, respectively.

Now, what has happened?
after step 1, we have x/3, y+15, 3z marbles in the boxes
At that point,
x/3 : y+15 : 3z = 2:3:9
So now you have to solve
3(x/3) = 2(y+15)
9(y+15) = 3(3z)
x+y+z = 129
-------------------
x = 72, y=21, z = 36
So the number of marbles has become
72/3 + 21+15 + 108 = 168