let x represents the dollars owned by Tom
and y represents the dollars owned by Peter.
Given that, the price of the game cartridge is
$45.
If Tom buys the game cartridge, then the
money left to Tom is x−45. and the ratio of
his money and the Peter's is 1:3.
That is, \( {x-45 \over y}={1 \over 3}.\)
\( {x-45 \over y}={1 \over 3}.\)
3x-135=y
3x-y=135
If Peter buys the game cartridge, then the
money left to Peter is y - 45. and the ratio of
his money and the Peter's is 3:5.
\( {y-45\over x}={3 \over 5}\)
3x=5y-225
x=5/3y-223/3
Substitute (2) in (1),
3x-y=135
3(5/3y-223/5)-y=135
y=90
Substitute y=90 in (2),
x=5/3(90)-225/3
x=75
Therefore, Tom has $75 and Peter has $90 at first.