Question 1204999
<font color=black size=3>
Normally we go from "before" to "after", but I'll go in reverse.
Ali ends with 'a' number of candies and Baba ends with twice as much 2a.
This forms the ratio a:2a and that simplifies to 1:2 aka "1 to 2".


Then let b represent the amount Ali gifted to Baba.
Ali would start with a+b candies
Baba starts with 2a-b


After: ali = a, baba = 2a
Before: ali = a+b, baba = 2a-b


Since b is the amount Ali gives to Baba, it is equal to 3/8 of the amount Ali had before giving their sweets.


b = (3/8)(a+b)
8b = 3(a+b)
8b = 3a+3b
8b-3b = 3a
5b = 3a
b = 3a/5
b = 0.6a


Then we find the ratio of their old amounts (a+b) over (2a-b)
Plug in b = 0.6a found just now.
(a+b)/(2a-b)
= (a+0.6a)/(2a-0.6a)
= (1.6a)/(1.4a)
= (1.6)/(1.4)
= 16/14
= 8/7


In short,
(a+b)/(2a-b) = 8/7
when b = 0.6a


The fraction 8/7 leads to the ratio <font color=red>8:7</font> aka <font color=red>8 to 7</font>
It means that for every 8 pieces of candy Ali started with, Baba has 7 pieces to start with.


Let's say hypothetically Ali started with 8 pieces of candy.
3/8 of that is 3 pieces, which is given to Baba.
Ali's amount drops to 8-3 = 5 pieces
Baba's amount increases to 7+3 = 10 pieces
Their new ratio is 5:10 which reduces to 1:2
</font>