There is a solution to a puzzle about candles, which I can't follow.
Here is the puzzle:
Imagine there are $N$ candles. Each of the candles takes $1$ hour to burn. Out of burnt $M$ candles you can make one new candle. What is the longest you can keep the room lit?
The book I have gives such solution:
If we take into account that after making a new candle, the number of burnt out candles reduces by $M-1$ and that finally we will still have one unused burnt out candle left, the answer can be computed using $$N + \frac{N-1}{M-1}$$
Specifically what is confusing me is why could we use $N-1$ as numerator and $M-1$ as denominator, based on this explanation: "If we take into account that after making a new candle, the number of burnt out candles reduces by $M-1$ and that finally we will still have one unused burnt out candle left..." ?
Can someone help? I am not a professional mathematician also and please explain in understandable terms, so far none of the answers have managed this.
To make the text solution clearer, I will assume that $M - 1$ divides $N- 1$. Otherwise, it should be
$$N + \left\lfloor \frac{N-1}{M-1} \right\rfloor.$$
It should be clear that an optimal strategy has at any time only one candle used to lit up the room.
Hence, we may proceed as follows: First, we use up all the $N$ candles one by one. This gives us $N$ hours and $N$ burnt candles, corresponding to the first term.
Obviously, to keep going, we take $M$ of those burnt candles and make a new candle out of them. When that one is burnt out, we gained one extra hour and used up $M$ burnt candles which now resulted in $1$ burnt candle. Abstractly, and this is what is meant by the solution, for every new hour we gain we use up $M-1$ burnt candles and are always left with (at least) one burnt up candle (namely, the last candle we lit).
Now, just to be really explicit here, let $H$ be the number of new hours gained. The above text says
$$N - H \cdot (M-1) \geq 1 \implies H \leq \frac{N-1}{M-1}.$$
And since $M-1$ divides $N-1$, the inequality can be attained.
Further comments: To expand on why the inequality turns into an equality, let's imagine that the first $N$ hours passed and we are left with those $N$ burnt candles. Let $H = (N-1) / (M -1)$. This is a positive integer since $M- 1 $ divides $N-1$. Now, leaving one candle aside, we can group the other $N-1$ burnt candles into $H$ groups of size $M-1$. For each of the $H$ groups, we can form a new candle with the set-aside candle and thus gain one hour from the new candle and are left again with a burnt candle. So, we gain in total $H$ more hours.