How do you write an expression when given a table of values?

1 Answer
Jul 25, 2018

It depends...

Explanation:

I note that example problems of the kind "here's a table - what is the function?" can take various forms:

(1) The table contains two pairs of values and the expected answer is a linear function in the form #y = mx + c# or similar.

(2) The table contains more than two pairs of values, but still exactly linear, looking for a function of the form #y = mx + c#.

(3) The table contains several pairs of exact values, with an expected answer being a simple polynomial function, an exponential function or some other simple function (e.g. sinusoid).

(4) The table contains approximate values (e.g. measurements from an experiment), from which one is expected to find a line or a simple function of best fit. The type of function may or may not be specified.

The different types of problem require different techniques, but here's a general solution for cases (1), (2) and polynomial examples of case (3)...

Given a table with distinct #x# values #x_1, x_2,..., x_n# and corresponding #y# values #y_1, y_2,... y_n# consider the polynomial:

#((x-x_2)(x-x_3)...(x-x_n))/((x_1-x_2)(x_1-x_3)...(x_1-x_n))#

Note that when #x=x_1# this will take the value #1#, since the numerator and denominator will be the same, whereas when #x = x_2,...,x_n# it will take the value #0#.

With this in mind, consider the polynomial:

#f(x) = ((x-x_2)(x-x_3)...(x-x_n))/((x_1-x_2)(x_1-x_3)...(x_1-x_n))y_1 + ((x-x_1)(x-x_3)...(x-x_n))/((x_2-x_1)(x_2-x_3)...(x_2-x_n))y_2 + ... + ((x-x_1)(x-x_2)...(x-x_(n-1)))/((x_n-x_1)(x_n-x_2)...(x_n-x_(n-1)))y_n#

This is a polynomial of degree at most #n-1# which takes the value #y_1# when #x = x_1#, #y_2# when #x = x_2#, all the way up to #y_n# when #x = x_n#. That is, it is a polynomial function which fits that data.

From this point you might want to multiply out the expressions to get the polynomial into standard form.

In practice, there are often simpler ways to get to a nice linear or polynomial function.