We know that there are 8 shirts and caps in total (because there are 8 friends). Therefore, we have the first equation:
x+ y= 8
All shirts cost: 6x (dollars) (because each shirt costs 6 dollars)
All caps cost: 3y (dollars) (because each cap costs 3 dollars)
The total price is 36 dollars, so we have another equation:
6x+ 3y= 36
x+y= 8 (1)
6x+ 3y= 36 (2)
Multiply (1) by 3, we have:
3x+ 3y= 24 (3)
Take (2) minus (3), we have:
(6x -3x)+ (3y -3y)= 36-24
⇒ 3x= 12
⇒ x= 12/3
⇒ x= 4
x+y= 8
⇒ y= 8-x= 8-4= 4
Final answer: x=4, y=4~
They will buy 4 shirts and 4 caps~