First, we need to express what each person bought with an equation. Let's have the number of gloves = x, and the number of hats = y.
The first person bought two pairs of gloves and four hats for $48.50, so 2x + 4y = 48.50
The second person bought two pairs of gloves and two hats for $34.50, so 2x + 2y = 34.00
Now, we need to get one of the variables on its own for both equations. Let's go with x. After some rearranging, the equations now look like this:
x = (48.50 - 4y)/2 and...
x = (34.00 - 2y)/2
Now we can set the equations equal to each other and solve for y, so...
(48.50 - 4y)/2 = (34.00 - 2y)/2 -----> 97 - 8y = 68-4y ----> 29 = 4y ----> y = 7.25
We now know that one hat costs $7.25. Now we simply plug this value into one of the original equations to solve for the cost of a pair of gloves.
2x +4(7.25) = 48.50 ----> 2x = 19.50 ----> x = 9.75
Now we know that a hat costs $9.75. You can now plug these values into the other original equation to check your work.
Hope this helps!! Let me know if you need any other help!