# Math Help - Need a function

1. ## Need a function

Hi,

I need a function f(x) such that:

f(1)=10
f(2)=8
f(3)=6
f(4)=4
f(5)=2

2. I think what you want is a continuous function:

But the function $f(x) = 12-2x$ works

3. Originally Posted by rainer
Hi,

I need a function f(x) such that:

f(1)=10
f(2)=8
f(3)=6
f(4)=4
f(5)=2
plot these points on a graph ... note that the points will line up nicely.

remember y = mx+b ?

4. If we assume that f is of the form $f(x)=ax+b$ then $a=\frac{f(x_1)-f(x_2)}{x_1-x_2} \equiv -2 ~ \forall x_1,x_2 \in \{1,2,3,4,5\} \implies a = -2$

Now, substitute into $f(x) = -2x+b$ one of the given points. Namely, we can use $(5,2) \Rightarrow f(5) = 2 \Rightarrow 2 = -2*5+b \Rightarrow b = 2+10 = 12 \implies f(x) = -2x+12$