Question: The ratio of purple sweets to red sweets in a jar was $3 : 4$
$40$ of the red sweets were then eaten.
The ratio of purple to red sweets became $5 : 4$
How many sweets of each colour were in the jar to begin with?
1. **State the problem:** We have an initial ratio of purple to red sweets as $3:4$. After eating $40$ red sweets, the ratio changes to $5:4$. We need to find the original number of purple and red sweets.
2. **Set variables:** Let the initial number of purple sweets be $3x$ and red sweets be $4x$ for some positive number $x$.
3. **After eating sweets:** The number of red sweets left is $4x - 40$.
4. **New ratio:** The new ratio of purple to red sweets is $5:4$, so
$$\frac{3x}{4x - 40} = \frac{5}{4}$$
5. **Solve the equation:** Cross-multiply:
$$4 \times 3x = 5 \times (4x - 40)$$
$$12x = 20x - 200$$
6. **Isolate $x$:**
$$12x - 20x = -200$$
$$-8x = -200$$
$$x = \frac{-200}{-8} = 25$$
7. **Find original sweets:**
Purple sweets = $3x = 3 \times 25 = 75$
Red sweets = $4x = 4 \times 25 = 100$
8. **Check:** After eating $40$ red sweets, red sweets left = $100 - 40 = 60$
New ratio = $\frac{75}{60} = \frac{5}{4}$, which matches the problem statement.
**Final answer:**
- Purple sweets initially: $75$
- Red sweets initially: $100$