1
$\begingroup$

This is my first question here, thus please have mercy. :)

I have minimum and maximum number of products and minimum and maximum price, and I want to calculate the discount depending of number of bought products.

minProducts = 1
maxProducts = 4000
minPrice = 0.8
maxPrice = 3.2
  • If they buy 4000 products then is the price 0.8 per product
  • if they buy 800 products then is the price 1.6 per product
  • and if they buy only one product then is the price 3.2.

How can I calculate the price per product if they buy for example 860 or 520 products?

Thanks in advance

1 Answers 1

0

If they buy $800-3999$ products, then they pay half price ($\frac{3.2}{1.6} = \frac12$), so 50%.

If they buy $4000+$ products, they pay quarter price, so 25%.

EDIT: I may be reading this wrong. Is the discount different for say 800 and 850 products?

In that case, I (and WolframAlpha) is unable to find a function that fits these criteria. See examples:

Linear fit fails, as the points are not colinear.

Similarly, I attempted with quadratic fit, cubic fit, exponential fit, and logarithmic fit.

Note that the polynomial fits (quadratic and cubic) are able to hit the points perfectly, but they result in some weird discounts somewhere in between.

  • 0
    Yes, it's actually different for every product. For example 800 = 1,6 and 801 = 1,6001 ...2017-01-06
  • 0
    @Boky - Ah, gotcha. See edited answer. It seems difficult to find functions that conserve the values you propose while keeping sane discounts in between.2017-01-06