Trudy brought a large bag of wine gums to school. She gave half to the first student she met, half the remainder to the next and half of what she had left to the third student. The last 5 wine gums she ate. How many were in the packet?

Let N be the number she brought.

N/2 + N/4 + 1/8 N = N -5
N - 7N/8 = N/8 = 5
N = 40

To solve this problem, let's work backwards.

We know that Trudy had 5 wine gums left after giving some to the third student. Let's call the number of wine gums she had left before giving some to the third student "x".

So, we can say that after giving away half of what she had left to the third student, Trudy had x - x/2 = x/2 wine gums left.

Now, we know that she gave half of what she had left to the next student. So, before giving some to the third student, Trudy had 2 * (x/2) = x wine gums.

Finally, we know that she gave half of what she had left to the first student. Therefore, the original number of wine gums Trudy had must be twice the number she had before giving some to the first student. So, 2 * x = 2x.

Since Trudy had 5 wine gums left, we have the equation 2x = 5.

To solve for x, divide both sides of the equation by 2: x = 5/2.

However, the quantity of wine gums must be a whole number, and not a fraction. So, we can conclude that there was no whole number solution to this problem. Therefore, we cannot determine the original number of wine gums Trudy had in the packet based on the information given.