I'm assuming Petra is only removing blue marbles, and she is keeping the 2 red marbles the whole time.
If so, then she starts with 49 blue marbles and ends up with 49-x blue marbles after removing x blue marbles. Overall she starts with 49+2 = 51 marbles total and ends up with 51-x marbles total after taking away x blue marbles.
(49-x)/(51-x) represents the proportion of blue marbles after we take those blue ones away. We want the proportion to be 0.90
(49-x)/(51-x) = 0.90
49-x = 0.90(51-x)
49-x = 0.90(51)+0.90(-x)
49-x = 45.9-0.90x
-x+0.90x = 45.9-49
-0.10x = -3.1
x = -3.1/(-0.10)
x = 31