Question 296214
(x/2-15)=(x/2+15)/2-10
 b =(x/2+15)/2-10
 a=x/2-15
 k=x-a-b
We only need the first equation to solve for x the number of apples in the beginning
b= barry's apples at end
a= alice's apples at end
k equals number of apples left in basket at end
x= 50 apples in the  beginning
a takes 25 and puts 15 back  
a=10
basket has 40 now
b takes 20 and returns 10
b=10
basket has 30 now
Barry and Alice each have 10
30 left in the basket