When a child breaks open her piggy bank, she finds a total of 76 coins, consisting of nickels, dimes, and quarters. The total value of the coins is $9. If the nickels were dimes, and the dimes were nickels, the value of the coins would be $8. How many nickels, dimes, and quarters were in the piggy bank?

nickels --- n

dimes ---- d
quarters --- (76-n-d)

5n + 10d + 25(76-n-d) = 900
5n + 10d + 1900 - 25n - 25d = 900
-20n - 15d = -1000
4n + 3d = 200 , #1

if nickels = d
dimes = n
quarters is still 76-n-d

5d + 10n + 25(76-n-d) = 800
5d + 10n + 1900 - 25n - 25d = 800
-15n - 20d = -1100
3n + 4d = 220 , #2

#1 times 4 : 16n + 12d = 800
#2 times 3: 9n + 12d = 660
subtract them
7n = 140
n = 20
back in #1:
80+3d=200
3d=120
d=40
then quarters = 76-20-40 = 16

there were 20 nickels, 40 dimes and 16 quarters in the bank

To solve this problem, we can set up a system of equations based on the given information.

Let's assume the number of nickels, dimes, and quarters in the piggy bank are represented by variables: N, D, and Q, respectively.

From the given information, we can create two equations:

1) N + D + Q = 76 (Equation 1 - represents the total number of coins)

2) 0.05N + 0.10D + 0.25Q = 9 (Equation 2 - represents the total value of the coins)

Now, let's consider the information given after the coins are switched around. In this case, the value of the coins is $8. We can set up another equation based on this information:

3) 0.10N + 0.05D + 0.25Q = 8 (Equation 3 - represents the total value of the switched coins)

Now, we have a system of three equations. We can solve this system to find the values of N, D, and Q.

First, we will need to perform some simplifications on the equations. Let's multiply Equation 2 and Equation 3 by 100 to eliminate decimals:

4) 5N + 10D + 25Q = 900 (Equation 4 - Equation 2 multiplied by 100)

5) 10N + 5D + 25Q = 800 (Equation 5 - Equation 3 multiplied by 100)

Now, we can solve this system of equations (Equation 1, Equation 4, and Equation 5) to find the values of N, D, and Q using any method such as substitution or elimination.

Let's use the substitution method:

From Equation 1, we can rewrite it as N = 76 - D - Q.

Substituting this into Equation 4 and Equation 5:

5(76 - D - Q) + 10D + 25Q = 900

10(76 - D - Q) + 5D + 25Q = 800

Now, simplify these equations:

380 - 5D - 5Q + 10D + 25Q = 900

760 - 10D - 10Q + 5D + 25Q = 800

Combine like terms:

-5D + 20Q = 520 (Equation 6)

15Q - 5D = 40 (Equation 7)

Now, we have a system of two equations (Equation 6 and Equation 7) with two variables (D and Q). We can solve this system to find the values of D and Q.

Let's multiply Equation 7 by 5:

75Q - 25D = 200 (Equation 8 - Equation 7 multiplied by 5)

Now, add Equation 6 and Equation 8:

-5D + 20Q + 75Q - 25D = 520 + 200

Combine like terms:

-30D + 95Q = 720 (Equation 9)

Now, we have a new equation (Equation 9) with D and Q as variables. We can continue solving this system using any method.

However, it seems that we made a mistake in setting up the equations based on the given information. Since we have three variables (N, D, and Q) and only two equations (Equation 1 and Equation 2), we cannot uniquely determine the values of N, D, and Q.

Therefore, it is not possible to determine how many nickels, dimes, and quarters were in the piggy bank with the given information.