开发者

Maths behind sliding scale pricing [closed]

Closed. This question is开发者_JS百科 off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

Improve this question

I'm trying to work out a simple calculation for the following:

a phone model has the maximum sale price of £85.00 and this is if only 1 unit is purchased and a minimum sales price of £50.00 - this is if 150 units and over are purchased in one.

How can I work out a way of the price if between 2 and 149 units are purchased??

Thanks, B.


Formula:

Y = 50 + ((85 - 50) / (150 - 1)) * (X - 1)

Result:

X = 1    -->   Y = 85
X = 33   -->   Y = 57.52
X = 150  -->   Y = 50


You probably don't have a linear model in such situations. I don't know the right English term, but you would have more like a piecewise or stepwise function here.

But nevertheless, you can get a linear function through interpolation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜