Answer:
54 marbles
Step-by-step explanation:
The question is a word problem leading to a simultaneous equation
Let 'x' represent the initial number of marbles with Sam, and let 'y' represent the initial number of marbles with Mary,
If Mary gives Sam 5 marbles, we have;
x + 5 = 2 × (y - 5)...(1)
If Sam gives Mary 4 marbles, we get;
x - 4 = y + 4...(2)
From equation (1), we get;
x + 5 = 2 × (y - 5) = 2·y - 10
x = 2·y - 10 - 5 = 2·y - 15
x = 2·y - 15...(3)
From equation (2), we have;
x - 4 = y + 4
∴ x = y + 4 + 4 = y + 8
x = y + 8...(4)
Equating the two values of 'x' in equation (3), and equation (4), we get;
2·y - 15 = y + 8
2·y - y = 8 + 15 = 23
∴ y = 23
From equation (4), we get;
x = y + 8 = 23 + 8 = 31
x = 31
The total number of marbles they have altogether = x + y
However, x + y = 23 + 31 = 54
Therefore;
The total number of marbles they have altogether = 54 marbles.