Let the number of small dogs Ryan walked be \( x \) and the number of large dogs be \( y \).
We have the following system of equations based on the information provided:
-
The total number of dogs he walked: \[ x + y = 8 \]
-
The total amount of money he made: \[ 5x + 8y = 49 \]
We can solve this system of equations. Starting from the first equation, we can express \( y \) in terms of \( x \): \[ y = 8 - x \]
Now, we can substitute this expression for \( y \) into the second equation: \[ 5x + 8(8 - x) = 49 \]
Expanding this gives: \[ 5x + 64 - 8x = 49 \]
Combining like terms, we can rewrite this as: \[ -3x + 64 = 49 \]
Next, we can isolate \( x \): \[ -3x = 49 - 64 \] \[ -3x = -15 \] \[ x = 5 \]
So, Ryan walked \( \boxed{5} \) small dogs.
To find the number of large dogs, we can substitute \( x = 5 \) back into the equation for \( y \): \[ y = 8 - x = 8 - 5 = 3 \]
Ryan walked 3 large dogs as well. Let’s check the total earnings: \[ 5(5) + 8(3) = 25 + 24 = 49 \]
The calculations confirm that Ryan indeed earned $49, verifying that he walked \( \boxed{5} \) small dogs.