aadi.ink

A Tiny Discount Calculation

Keywords: #fun
December 23, 2024

Suppose there are tiered discount rates: say $10\%$ up to $5000$, $15\%$ above $5000.$ Now suppose I need things that cost $b$ before any discount is applied. Assuming $b < 5000$, I get the 10% discount, having to pay $90\% \times b$. Could I perhaps add some more items to be eligible for the 15% discount and still end up paying less than $90\% \times b$?

If I add an item worth $x$ such that $b+x = 5000$ then the discounted amount will be $85\%\times 5000 = 4250$. I will save money if this is less than the original $90\%\times b$. $$ 4250 < 90\%\times b \iff b > \frac{4250}{0.9} = 4722.\bar{2}\ .$$ This inequality means that for initial (undiscounted) amounts of $4722.22$ or higher, adding exactly enough to reach 5000 will give me more stuff while costing less than the original.

Great! But there’s a slight issue. Products aren’t that flexible in price, so we may not be able to add something (or things) that cost exactly $x=5000-b$. If I go too much over 5000, then I might cancel out the additional discount by increasing the total. Let’s modify the previous calculation by putting that value in instead of 4250. Assume $b+x > 5000$. $$ 85\% \times (b+x) < 90\% \times b \iff 85\%\times x < 5\% \times b \iff x < \frac b{17}$$ An upper bound for $x$. But our assumption puts in a lower bound for $x$ too: $$ 5000 - b < x < \frac{b}{17}.$$ This makes sense – $x$ needs to be large enough to get to $5000$, but not too much so that we can actually save money.

Great! But there’s a slight issue. Not all discounts are like this, so how do I decide next time when there’s something else I want and the store is throwing a similar puzzle at me? Let’s generalise more! Let $r_1 < r_2$ be the discount rates, $t$ be the threshold between them. Repeating the previous calculations:

We assume $b \le t$ and $b+x > t$. The saving money condition is $$(1-r_1)b > (1-r_2)(b+x) \iff (r_2-r_1) b > (1-r_2)x$$ $$ \iff x < b\times\frac{r_2-r_1}{1-r_2}.$$ Perhaps the earlier form was better $$(r_2-r_1)b > (1-r_2)x.$$ $(r_2-r_1)b$ is the extra savings on the original amount by getting the higher discount rate. That should be more than the amount we end up paying for the extra discount which is $(1-r_2)x$! I find it beautiful that all we did was start with a condition we want and then manipulate it to get a different but equivalent condition. This new condition somehow says more than the original. Seems so obvious now but somehow it wasn’t so obvious in the beginning – at least to me.

Just for completeness, the full condition becomes $$ t-b < x < b \times \frac{r_2-r_1}{1-r_2}\iff t < x + b < b\times\frac{1-r_1}{1-r_2}.$$


Let’s flip sides: suppose I am a corporate salesperson and I don’t want the discounts to be such that people get more stuff and still for literally less money. Can I still have a tiered discount rate but make this impossible?

Putting this in terms of our earlier notation, we want $(r_2-r_1) b \le (1-r_2)x$ for all $x$ and all $b$ such that $x+b> t$. But we have variables on both sides of this inequality ($b$ on the left, $x$ on the right) and hence no matter what $r_1, r_2$ are, we can make $x$ really small, and $b$ really large to be able to satisfy this inequality. This is assuming $1-r_2 > 0, r_2 > r_1$. If we make $r_2 < r_1$ then the left side is always negative so this inequality always fails – so that’s one way to do what we want: reduce the discount offered for higher amounts spent. But that’s ridiculous, right? As a salesperson we want to encourage more expenditure. The next assumption to break is $r_2 > 1$ but that’s a discount rate of more than 100% – paying people for buying stuff will surely not help the profit margin.

What else could I do? Remember the last condition that was there just for completeness? Well, if that inequality exists, but no product (or combination of products) can actually cost enough to add up to a value between those two bounds ($t-b$ and $b\times \frac{r_2-r_1}{1-r_2}$) then we can still advertise a sensible tiered discount but ensure that every upsell actually makes the company more money instead of less. The most straightforward way to go about this would be to restrict the discount such that it applies only to products above a certain price point, or only for certain combinations.

Let me try to make an example. Keeping numbers simple: $r_1 = 0, r_2 = 0.25$. This reduces the condition to $\ t-b < x < \frac{b}{3}.$ Suppose all products cost 499 (or multiples of 499 like 999, 1499, etc.) but the threshold is $t=1000.$ $b$ can only be $0, 499, 998$ or $999$ before crossing the threshold. So $b/3$ can be $0, ~166, ~333$. None of these are above the minimum $499$, so $x< b/3 $ is impossible! The only way to cross the threshold is to buy three things worth $499$ each, but then the 25% discount cuts down the price by 1/4, not 1/3. That verifies the example!