Let \( x \) be the number of $1 bills and \( y \) be the number of $5 bills. We are given two equations based on the information provided:
-
The total number of bills: \[ x + y = 12 \]
-
The total value of the bills: \[ 1x + 5y = 40 \]
Now we can solve these equations step by step.
From the first equation, we can express \( x \) in terms of \( y \): \[ x = 12 - y \]
Next, we substitute \( x \) in the second equation: \[ 1(12 - y) + 5y = 40 \] This simplifies to: \[ 12 - y + 5y = 40 \] \[ 12 + 4y = 40 \] Subtract 12 from both sides: \[ 4y = 28 \] Now divide by 4: \[ y = 7 \]
Now that we have \( y \), we can find \( x \): \[ x = 12 - y = 12 - 7 = 5 \]
Thus, Hermione has:
- 5 $1 bills
- 7 $5 bills
The answer to how many $5 bills Hermione had is: \[ \boxed{7} \]