Given:
The change all in nickels and pennies.
Let the number of nickels = x
Let the number of pennies = y
Total coins = 31
so, x + y = 31
1 nickel = 5 cents
1 penny = 1 cent
The change = $0.87 = 87 cents
so, 5x + y = 87
so, we have the following system of equations:
So, the number of nickels = x = 14
And the number of pennies = y = 17