This problem is all about ratios. You can solve by trial and error, which may be a simple way to understand it.
First, calculate the total amount for the 3-hour and 4-hour classes -
3-hour class: $48 x 3 hours = $144
4-hour class: $48 x 4 hours = $192
Next, use trial and error -
Suppose, 25 classes of each hour were were given. It would look like this
25 3-hour classes: 25 x $144 = $4800
25 4-hour classes: 25 x $192 = $3600
Add the total: $4800 + $3600 = $8400
That's not quite $8592. Therefore, you will have to assume that there were more 4-hour classes given.
Let's try 30 4-hour classes and 20 3-hour classes -
20 3-hour classes: 20 x $144 = $2880
30 4-hour classes: 30 x $192 = $5760
Add the total: $2880 + $5760 = $8640.
Now, we're way over the amount of 4-hour classes that were given. You can see now that your magic number of 4-hour classes is between 25 and 30 classes.
Let's try 29 4-hour classes and 21 3-hour classes -
21 3-hour classes: 21 x $144 = $3024
29 4-hour classes: 29 x $192 = $5568
Add the total: $3024 + $5568 = $8592
Therefore, 21 3-hour classes and 29 4-hour classes were paid for at the pottery studio.