How to formally represent the solution of this problem?

63 Views Asked by At

A person buys hardboiled eggs from a shopkeeper wherein they ask the shopkeeper to give them half the total number of eggs the shopkeeper has and half an egg more and manages to do it a total of 9 times before there are no eggs left with the shopkeeper. So I solved it by representing the last transaction using the equation $x - \frac {x}{2} - \frac {1}{2} = 0$ wherein $x$ represents the number of eggs left before the last transaction can happen, which gives $x = 1$. Building up from there, the total number of eggs comes out to be 1032. How do I formally represent the solution to this problem?

1

There are 1 best solutions below

0
On

You could start from $y_0$ being the total number of eggs at the beginning. Then you know that after each step, the number $y_n$ of eggs left is

$$y_n = \dfrac{y_{n-1}}{2} - \dfrac{1}{2} = \dfrac{y_{n-1}-1}{2}$$

which easily leads, by induction, to the formula

$$y_n = \dfrac{y_0 - \sum_{k=0}^{n-1}2^k}{2^n}.$$

In particular, you get the equation

$$ y_9 = \dfrac{y_0 - \sum_{k=0}^{8}2^k}{2^9} = 0 \quad \Longrightarrow \quad y_0 = \sum_{k=0}^{8}2^k = \dfrac{1-2^9}{1-2} = 511,$$

where the last step is done with the usual trick for geometric series. You have probably made some counting mistakes, but your procedure is also fine (for $n$ small). Note that it makes sense that the result should be odd, so that at every step you actually buy an integer number of eggs.