Let n represents the number of nickel
Let p represents the number of pennies
Let d represents the number of dimes
Let q represents the number of quarters
Recall that
1 nickel = $0.05
1 penny = $0.01
1 dime = $0.1
1 quarter = $0.25
From the information given,
n + p + d + q = 12-------------------------------------------------(1)
0.05n + 0.01p + 0.1d + 0.25q = 1.67-------------------------(2)
p = n --------------------------------------------------------------------(3)
n + d = q ----------------------------------------------------------------(4)
Solving the four equations simultaneously, we have
Substitute equations (3) and (4) into equations (1) and (2)
n + n + d + n + d = 12
0.05n + 0.01n + 0.1d + 0.25(n + d) = 1.67
3n + 2d = 12-----------------------------------------(5)
0.31n + 0.35d = 1.67--------------------------------(6)
multiply equation (6) by 200 and equation (5) by 35, we have
105n + 70d=420------------------(7)
62n + 70d =334--------------------(8)
subtract equation (8) from (7)
43n = 86
n=86/43
n=2
put n=2 into equation (8)
62(2) + 70d = 334
124 + 70d = 334
70d = 334 - 124
70d = 210
d = 210/70
d=3
but p = n = 2
p = 2
n + d = q
q = 2 + 3 = 5
Hence, max have
2 nickels, 2 pennies, 3 dimes, 5 quarters