Find a formula that describes the given day-price relation

45 Views Asked by At

Given data:

Days    Prices
0   0
1   1000
2   1000
3   1000
4   1600
5   2200
6   2800
7   3400
8   4000
9   4600
10  5200

Price is function of day.

I had my formula but always put negative result when I put 0 or 1 or 2 to the variable of days (days = [0, 1, 2], result is always negative). I've kind a stuck. Can you guide me steps by step to get a formula for my data? Thank you very much.

2

There are 2 best solutions below

2
On BEST ANSWER

If you plot the price as a function of the day, you notice taht the curve is composed by three different pieces. Then, as explained by the others answers, the following model represents exactly your data.

$ f(x) = \left\{ \begin{array}{ll} 0 & \textrm{if } x =0\\ 1000 & \textrm{if } x =1 \textrm{ or } x = 2 \textrm{ or } x = 3\\ 600 x - 800 &\textrm {if } x > 3 & \ \end{array} \right. $

1
On

Your answer is probably as good as we can get. To generalize to all the days, we can define a piecewise function. Let $f(x)$ be the desired function and $g(x)$ the one you have found. Then

$ f(x) = \left\{ \begin{array}{ll} 0 & \textrm{if } x =0\\ 1000 & \textrm{if } x =1 \textrm{ or } x = 2 \\ g(x) & \textrm{otherwise} \end{array} \right. $