Ali and Samuel both had the same amount of money after Samuel gave $15 to Ali. The ratio of Ali's money to Samuel's was 7:5. How much did each of them have at the beginning?

Let x be the amount of money Ali and Samuel had at the beginning.

After Samuel gave $15 to Ali, Ali had x + 15 and Samuel had x - 15.

Given that the ratio of Ali's money to Samuel's was 7:5, we can write the following equation:

(x + 15) / (x - 15) = 7/5

Cross multiply to get:

5(x + 15) = 7(x - 15)

Expand the equation:

5x + 75 = 7x - 105

Subtract 5x from both sides:

75 = 2x - 105

Add 105 to both sides:

180 = 2x

Divide by 2:

x = 90

Therefore, Ali and Samuel each had $90 at the beginning.