I need an equation for a website I'm programming

Inputs = 4, 6, 8, 10, 12, 14, 16
b = 3, 4, 4, 5, 5, 5, 5
c = 7, 12, 15, 20, 24, 28, 31*

When 'a' is inputs then I need 'b' and 'c' to equal the number in the same order as the 'a' inputs.
Ex. If a = 4, then b = 3 and c = 7 If a = 6, then b = 4 and c = 12

*not a typo
Guest

### Re: I need Help please!!

Also, to help solve this. if the equation causes decimal places, I can choose to either round them or delete them.
So if the equation makes c's numbers look like 3.1, 4.1, 4.3, 4.8, 5.1, 5.3, 5.4 then that's fine. Thanks!!
Guest

### Re: I need Help please!!

Do you need a programming in c++
Guest

### Re: I need Help please!!

Given any "n" data points there exist a polynomial of degree n-1 that fits those points. Here you have two sets of data points, (a, b) and (a, c), each with 7 data points so a 6 degree polynomial will fit each.

One method of getting that polynomial is "Newton's divided difference" scheme. If, for example, the data points are $$(x_0, y_0)$$, $$(x_1, y_1)$$, $$(x_2, y_2)$$ then "Newton's divided difference" would give $$y= y_0 \frac{(x- x_1)(x- x_2)}{(x_0- x_1)(x_0- x_2)}+ y_1\frac{(x- x_0)(x- x_2)}{(x_1- x_0)(x_1- x_2)}+ y_2\frac{(x- x_0)(x- x_1)}{(x_2- x_0)(x_2- x_1)}$$

For (a, b), we have data points (4, 3), (6, 4), (8, 4), (10, 5), (12, 5), (14, 5), (16, 5) so the 6th degree polynomial is
$$b= 3\frac{(x- 6)(x- 8 )(x- 10)(x- 12)(x- 14)(x- 16)}{(4- 6)(4- 8 )(4- 10)(4- 12)(4- 14)(4- 16)}+ 4\frac{(x- 4)(x- 8 )(x- 10)(x- 12)(x- 14)(x- 16)}{(6- 4)(6- 8 )(6- 10)(6- 12)(6- 14)(6- 16)}+ 4\frac{(x- 4)(x- 6)(x- 10)(x- 12)(x- 14)(x- 16)}{(8- 4)(8- 6)(8- 10)(8- 12)(8- 14)(8- 16)}+ 5\frac{(x- 4)(x- 6)(x- 8 )(x- 12)(x- 14)(x- 16)}{(10- 4)(10- 6)(10- 8 )(10- 12)(10- 14)(10- 16)}+ 5\frac{(x- 4)(x- 6)(x- 8 )(x- 10)(x- 14)(x- 16)}{(12- 4)(12- 6)(12- 8 )(12- 10)(12- 14)(12- 16)}+ 5\frac{(x- 4)(x- 6)(x- 8 )(x- 10)(x- 12)(x- 16)}{(14- 4)(14- 6)(14- 8 )(14- 10)(14- 12)(14- 16)}+ 5\frac{(x- 4)(x- 6)(x- 8 )(x- 10)(x- 12)(x- 14)}{(16- 4)(16- 6)(16- 8 )(16- 10)(16- 12)(16- 14)}$$

And similarly for c.

Of course, there are infinitely many non-polynomial functions that will fit any finite number of data points.
Guest