2/5 of a box of 40 chocolates were pralines. After some pralines were eaten, the fraction of pralines in the box became 1/3. How many pralines were eaten?

2/5 * 40 = 16 pralines

3/5 * 40 = 24
24 * 1/3 = 8
16 / 8 = 2 pralines were eaten

2/5 * 40 = 16 pralines

40 - 16 = 24 other chocolates
So we start with:
16 + 24 = 40
After x pralines are eaten, we have:
(16 - x) + 24 = 3(16 - x)
24 = 2(16 - x)
12 = 16 - x
x = 4

Check:
16 - 4 = 12
12 + 24 = 36
12 is 1/3 of 36.