# How would I determine a single equation for a set of points

Four different functions are bounded by certain values along the $x$-axis. What I want to know is if there is one function that can describe all points in the set.

To be more specific, I have four bounds: $[1, 50]$, $[51, 68]$, $[69, 98]$, $[99, 100]$. Between each of the bounds, one specific function is used to determine the value (i.e. all values of $1 \le x \le 50$ are calculated as $y=x$, for all values $51 \le x\le 68$, the value is $y=x^2$, etc.).

My question is, how would I go about determining an equation to fit all of the points? I asked a buddy of mine, and he said that I would need a 99th degree polynomial, but that seems very wrong to me.

It seems that the best way is to do nothing, that is to use indicator functions of the segments. For instance, put $$f(x)={\mathbf 1}_{[1,50]} x+\mathbf 1_{[51,68]} x^2+\dots.$$