Let the original number of stamps be
x for Naomi,
y for Macy,
z for Sebastian.
Because the total number of stamps is 234, therefore
x + y + z = 234 (1)
Mary gives 16 stamps to Macy and 24 staps to Sebastian.
The number of stamps owned becomes
x - 40 for Mary,
y + 16 for Macy,
z + 24 for Sebastian.
Mary has 3 times as many stamps as Macy, therefore
x - 40 = 3(y + 16)
x - 3y = 88 (2)
Macy has twice as many staps as Sebastian, therefore
y + 16 = 2(z + 24)
y - 2z = 32 (3)
We have the system of equations
x + y + z = 234 (4)
x - 3y = 88 (5)
y - 2z = 32 (6)
Subtract (5) from (4).
4y + z = 146 (7)
Substitute (6) into (7).
4(2z + 32) + z = 146
9z = 146 - 128 = 18
z = 2
y = 2z + 32 = 4 + 32 = 36
x = 234 - y - z = 234 - 38 = 196
Answer:
Naomi originally had 196 stamps.