Question 213456
Let x = total number of apples


The first troll demands half of his apples plus 2, so after leaving the first troll, the prince has 
{{{x-(1/2)*x -2 }}}apples  
{{{(1/2)*x-2}}}


The 2nd troll demands half of what is left and 2 more, so now the prince has 
{{{(1/2)((1/2)*x-2)-2}}}
{{{(1/4)x-1-2}}}
{{{(1/4)x-3}}}


The 3rd troll demands half of what is left and 2 more, so now the prince has 
{{{(1/2)*((1/4)x-3)-2}}}


And this equals exactly 2 apples!
{{{(1/2)*((1/4)x-3)-2=2}}}


Now, work this backwards by adding +2 to each side:
{{{(1/2)*((1/4)x-3)=4}}}


Multiply both sides by 2:
(1/4)x-3=8


Add +3 to each side:
(1/4)x=11


Multiply both sides by 4:

x=44 apples.


Check:  If the prince starts with 44 apples, the first troll gets 22 +2 =24 apples.  The prince is left with 20.  The second troll demands 10+2, which leaves the prince with 8.  The third troll demands 4 apples plus 2, leaving the prince with 2 apples.  


Very nice problem!!  Poor princess!!


R^2  


Dr. Robert J. Rapalje, Retired
Seminole Community College
Altamonte Springs Campus
Florida