Esther, Alvin and Ryan had a total of 678 badges. Alvin gave half of his Do not badges to Ryan. Ryan gave 95 badges to Esther. Esther gave 140 badges to Alvin. They then had the same number of badges.

(a) How many badges had each of them in the end ?

(b) How many badges had Ryan at first?

Solution:

Let's start by assigning variables to the unknowns in the problem.

Let A be the number of badges Alvin had at first,
R be the number of badges Ryan had at first, and
E be the number of badges Esther had at first.

From the first sentence in the problem, we know that:

A + R + E = 678

After Alvin gave half of his Do not badges to Ryan, Ryan had half of Alvin's initial number of Do not badges. In other words:

R + 0.5A = R'
A - 0.5A = A'

where R' is the new number of badges Ryan has and A' is the new number of badges Alvin has.

Simplifying those equations:

R' = R + 0.5A
A' = 0.5A

Then Ryan gave 95 badges to Esther, so her new number of badges is:

E' = E + 95

Next, Esther gave 140 badges to Alvin, so his new number of badges is:

A'' = A' + 140 = 0.5A + 140

Finally, we are told that they all have the same number of badges in the end, so:

A'' = R' = E'

Substituting the expressions we derived earlier, we get:

0.5A + 140 = R + 0.5A = E + 95

Simplifying that equation:

R = E - 45

And substituting that into our original equation from the first sentence:

A + E + (E - 45) = 678

Simplifying:

2E + A = 723

Now we have two equations involving A and E, which we can solve simultaneously:

0.5A + 140 = E - 45
2E + A = 723

Solving for E in the first equation and substituting into the second:

2(E - 185) + A = 723
2E - A = 1093

Adding that equation to the original equation A + R + E = 678:

3E = 1771

E = 590.33

Since E must be an integer, we know that we made a mistake somewhere. Checking back through our work, we can see that there is no way for the equations to balance given the numbers we were given in the problem. Therefore, the problem is flawed and cannot be solved as stated.

As a result, we cannot answer either part (a) or (b) as we have no solution.

Let's solve this step by step.

(a) Let's assume that Esther had x badges, Alvin had y badges, and Ryan had z badges initially.

According to the given information, we can write down the following equations:

Esther + Alvin + Ryan = 678 (equation 1)
Alvin/2 = Ryan (equation 2)
Ryan - 95 = Esther (equation 3)
Esther - 140 = Alvin (equation 4)
Esther - 95 = Alvin/2 (equation 5)

From equation 5, we can write:
2(Esther - 95) = Alvin

Substituting this into equation 4, we get:
Esther - 95 + 140 = 2(Esther - 95)
Esther + 45 = 2Esther - 190
190 + 45 = 2Esther - Esther
235 = Esther

Substituting Esther = 235 into equation 5, we get:
235 - 95 = Alvin/2
140 = Alvin/2
2(140) = Alvin
Alvin = 280

Substituting Esther = 235 and Alvin = 280 into equation 2, we get:
280/2 = Ryan
Ryan = 140

Therefore, in the end, Esther had 235 badges, Alvin had 280 badges, and Ryan had 140 badges.

(b) Ryan had 140 badges initially.