Let us assume that Caleb had x marbles. As Ben had five times as many marbles as Caleb, therefore, Ben had 5x marbles with him.
It is given that Ben gave away 87 marbles, therefore, the number of marbles remaining
with Ben was:
MB = 5x - 87
It is also given that Caleb won 13 new marbles. Therefore, the number of marbles remaining with
Caleb was:
MC = x + 13
It is given that in the end, both Caleb and Ben had the same number of marbles. Therefore, equate the expressions obtained for the number of marbles left with Ben and Caleb and
solve for x.
MB = MC
5x - 87 = x + 13
5x - x = 13 + 87
4x = 100
x = 100/4
x = 25
Therefore, the number of marbles left
with Ben and Caleb were:
MB = 5x - 87
= 5 (25) - 87
= 38
Answer - Each of them had 38 marbles in the end.