Applying successive discounts, an un-intuitive formula

I was reading a book where the author calculated the final price using a formula I can't understand how it was obtained. I would like to know how it was derived and how it could be generalized.

Example: Price is $$800$$ USD. Discounts applied are in the following sequence: $$20/100$$, $$5/100$$ and $$5/100$$ again.

The final price $$= \frac{800 * 4 * 19 * 19}{5 * 20 * 20}=577.60$$.

My question is how was the above formula derived? How could it be generalized, say given an item price to be $$p_0$$, a set of discounts ($$d_1$$,$$d_2$$,...,$$d_{n-1}$$) are applied in sequence to this price to get the final price $$p_n$$.

Note: I know how to calculate the same answer in different ways, but I found this formula not so obvious to me.

• $20/100 = 1/5, \; 5/100 = 1/20$, can you relate theses figures to those used in the final formula ?, Commented May 17 at 5:37
• "20% of'' means ''$\frac{20}{100}$ multipled by''.
– Paul
Commented May 17 at 6:24
• @True, I can produce a formula indeed but (sadly) it does not look like the one above...at all! Commented May 17 at 7:57
• @Paul, thanks, I get this. Commented May 17 at 7:57

When we talk about a "discount of $$d$$," where $$0 < d < 1$$, what we mean is that if the original price is $$P$$, then we are reducing the price by $$P \times d$$. So for instance, if $$P = 100$$, and the discount is $$d = 0.25 = \frac{1}{4} = 25\%$$, that means we are reducing the price by $$P \times d = 100 \times 0.25 = 25$$. The discounted price is $$P - P \times d = 100 - 25 = 75.$$
We can shorten this calculation into a single step: if $$d$$ is the discount rate, then $$P(1-d)$$ is the discounted price when $$P$$ is the original price.
Consequently, if we have a set of discount rates $$d_1, d_2, \ldots, d_{n-1}$$, and an original price $$p_0$$, the price after the application of all of the discounts is $$p_n = p_0 (1 - d_1)(1 - d_2) \cdots (1 - d_{n-1}).$$ This is precisely how the calculation was done in the example you cited: $$800 (1 - 0.20)(1 - 0.05)(1 - 0.05).$$
• Clear now. I was under the assumption that $p_{n-k}$ would be required which I could not simplify. However, your answer is elegant. Thank. Also, the fact that $(1 - 0.05)$ can be expressed as $(\frac{19}{20})$ was not obvious at fist sight. Commented May 17 at 8:32