Rowan bought some vanilla and chocolate cupcakes in the ratio of 5:4. After Rowan’s classmates ate an equal number of the two types of cupcakes, there were 40% fewer chocolate than vanilla cupcakes. In the end, there were 152 cupcakes left. How many cupcake of each type were eaten?

Vanilla: Chocolate

5 ||||||||||| 4
after eating equal number of vanilla and chocolate
chocolate = 60% vanilla (40% left means equal to 60%)
chocolate = 3/5 vanilla
vanilla/chocolate = 5/3
it means after eating (5 + 3) = 8 = 8 units are left
8 units = 152
1 unit = 19
Vanilla = 19 * 5 = 95
Chocolate = 19 * 3 = 57
if x unit are eaten then
(95 + x)/(57 + x) = 5/4
380 + 4x = 285 + 5x
=> x = 95
95 units of both vanilla and chocolate were eaten.

To solve this problem, we'll use algebraic equations. Let's represent the number of vanilla cupcakes as 'x' and the number of chocolate cupcakes as 'y'.

1. According to the given ratio, the vanilla and chocolate cupcakes were bought in the ratio of 5:4. This can be expressed as x/y = 5/4.

2. After Rowan's classmates ate an equal number of both types of cupcakes, there were 40% fewer chocolate cupcakes than vanilla cupcakes. We can express this as y = 0.6x (since 0.6 is 100% - 40% in decimal form).

3. In the end, there were 152 cupcakes left. This means that the total number of cupcakes (x + y) is equal to 152.

Now, let's solve these equations:

From equation 1, we can rewrite it as x = (5/4)y.

Substituting this value of x in equation 3, we get:
(5/4)y + y = 152
(9/4)y = 152
Multiplying both sides by (4/9), we get:
y = (4/9) * 152
y ≈ 67.56

So, there were approximately 67.56 chocolate cupcakes eaten.

To find the number of vanilla cupcakes eaten, we substitute this value of y into equation 2:
x = 0.6y
x = 0.6 * 67.56
x ≈ 40.54

So, there were approximately 40.54 vanilla cupcakes eaten.

Since we can't have fractional parts of cupcakes, we'll round the values to the nearest whole number.

Therefore, Rowan's classmates ate approximately 41 vanilla cupcakes and 68 chocolate cupcakes.

Let's assume that Rowan bought 5x vanilla cupcakes and 4x chocolate cupcakes.

After Rowan’s classmates ate an equal number of the two types of cupcakes, the number of chocolate cupcakes left is 40% fewer than the number of vanilla cupcakes left.

So, the number of chocolate cupcakes left is 100% - 40% = 60% of the number of vanilla cupcakes left.

Since there were 152 cupcakes left in total, the number of chocolate cupcakes left is 60/100 * 152 = 91.2 cupcakes. Since we can't have .2 of a cupcake, we can assume that 91 cupcakes were left.

The number of vanilla cupcakes left can be calculated by subtracting the number of chocolate cupcakes left from the total number of cupcakes left: 152 - 91 = 61 cupcakes.

Now let's calculate the number of cupcakes eaten:

Rowan originally bought 5x vanilla cupcakes and 4x chocolate cupcakes.
So, the number of vanilla cupcakes eaten is 5x - 61.
And the number of chocolate cupcakes eaten is 4x - 91.

Therefore, Rowan's classmates ate 5x - 61 vanilla cupcakes and 4x - 91 chocolate cupcakes.