# No broken eggs puzzle

Three men went to buy eggs from an eggs seller:

1. The first ordered half of the seller's stock plus half of an egg.
2. The second ordered half of what's left in the stock plus half of an egg.
3. The third ordered half of what's left in the stock plus half of an egg.

How many eggs did the seller have in his stock knowing that:

1. No eggs were broken in the process.
2. The seller's stock is now empty (no eggs left).

This can be easily solved starting from the third guy since no egg is left after he took the half of the egg.

Third guy:

Half of the egg has to be equal to half of the stock, because he took first half of the stock then the rest (which is half of an egg), resulting third guy got $1$ egg only.

Second guy:

When second guy bought whatever he says, there are 1 egg left. We know this from above. So $1$ egg+$\tfrac{1}{2}$ egg has to be equal to the half of the stock. So there were $3$ in the stock when second guy decided to buy some eggs, meaning he got $2$ eggs.

First guy:

With the same logic, after the first guy bought the eggs, there are $3$ eggs left. meaning $3$ and and a half should be the other half of the egg, resulting $7$ was the total number of eggs at the very beginning and first guy bought $4$ eggs actually.

• I like your explanation the most, because it allows to naturally generalise the principle, as for each new person,the number of eggs is a consecutive power of 2, e,g., 1, 2, 4, 8, etc. Which explains farruhota's answer. Sep 19 '17 at 1:04

In general, if $n$ people buy the eggs by the stated rule, the seller would have $2^n-1$ (Mersenne number) eggs. Because, after dividing by $2$ and removing a half, it results in $2^{n-1}-1$ and so on. Hence, for $3$ men $7$ eggs, for $4$ men $15$ eggs.

Here's another method to derive a starting clutch of 7 eggs.

Each round, the seller starts with $k$ eggs and finishes with $k-(\frac{k+1}{2}) = \frac{k-1}{2}$ eggs.

Suppose the seller started with $n$ eggs. Then over 3 iterations, we have:

$$n \to \frac{n-1}{2} \to \frac{n-3}{4} \to \frac{n-7}{8}$$

Since no eggs remain, $\frac{n-7}{8} = 0$, which yields $n=7$.

Incidentally, this also proves that the answer is unique for the question as posed. Further, It also generalises to a starting clutch of $7+8g$ eggs for any integer $g$ if the conditions were relaxed to allow any integer number of eggs remaining after 3 iterations.

Just for the sake of providing an analytical solution, let's call x the initial number of eggs, then we have:

The first ordered half of the seller's stock plus half of an egg. $$A = 1/2*x + 0.5$$ $$A = (x+1)/2$$ The second ordered half of what's left in the stock plus half of an egg. $$B = (x - A)/2 + 0.5$$ $$B = (1/2-1/4) (x + 1)$$ $$B = (x + 1)/4$$ The third ordered half of what's left in the stock plus half of an egg. $$C = (x - A - B)/2 + 0.5$$ $$C = (1/2 - 1/4 - 1/8)(x + 1)$$ $$C = (x + 1)/8$$

No eggs were broken in the process
A, B, C all integers
I don't think this info is relevant although it certainly helps for the more intuitive resolutions

The seller's stock is now empty (no eggs left). $$A + B + C = x$$

Combining the statements above we obtain: $$(1/2 + 1/4 + 1/8)(x + 1) = x$$ $$x + 1 = 8/7 * x$$ $$x = 7$$