Let x be the number of apples and y be the number of oranges. We can set up a system of equations based on the given information:
Total number of fruits: x + y = 12 (12 pieces of fruit)
Total cost: 0.5x + 0.25y = 5 ($5 spent)
Now we need to solve this system of equations to find x and y. Here are two methods:
Method 1: Substitution:
Solve the first equation for x: x = 12 - y
Substitute this expression for x in the second equation: 0.5(12 - y) + 0.25y = 5
Simplify and solve for y: 6 - 0.5y + 0.25y = 5
Combine like terms: 0.25y = 1
Divide both sides by 0.25: y = 4
Substitute y back into the first equation to find x: x = 12 - 4 = 8
Therefore, Tanya bought 8 apples and 4 oranges.