Let's assume that all the coins are 10-cent coins.
The total value would be 10 x 40 = 400 cents = $4
So, it would be $2.5 less than the actual total value,
We now know that not all the coins are 10-cent coins, so now we will replace 1 10-cent coins with a 20-cent coins.
Everytime we switch a 1 10-cent coins to a 20-cent coins, the value go up 10 cents. So, we need to switch 25 times (to make the value goes up $2.5)
-> There are 25 20-cent coins and 15 10-cent coins
Recheck : 25 x 20 + 15 x 10 = 500 + 15 = 650 cents = $6.5