Finding the equation set with minimum coefficients

96 Views Asked by At

I have two sets of values $Y = \{y_1, y_2,\ldots, y_n\}$ and $P = \{p_1, p_2, \ldots, p_m\}$ . I need to find the equation set that satisfies all of the values that satisfy $Y$ and not $P$.

For example if I have values $Y = \{y_1, y_2, y_3\}$ and $P = \{p_1, p_2, p_3\}$ and I find equation sets that satisfy all of $Y$ and none of $P$. If there exist two distinct equation sets, then:

First Set:
$y = m_1x + c_1$ and $y = m_2x + c_2$
Solution represented as $(m_1, c_1, m_2, c_2)$.

Second Set:
$y = ax^2 + bx + c$
Solution represented as $(a, b, c)$.

Here the second set is the answer as it has the minimum number of coefficients. How do I solve this for more number of points?

If this question is not clear, Ill add more details.
Edit:
The equations can't be piecewise and system of equations can't take any of the values in $P$. (see comments for example)

1

There are 1 best solutions below

4
On

Let $Y=\{y_1,...,y_n\}$ and $P=\{p_1,...,p_n\}$. Any $n$ ordered pairs uniquely define a polynomial of degree $n-1$ which passes through each ordered pair. Form the ordered pairs $(1,y_1),...,(n,y_n)$. To find the unique polynomial $f(x)$, we use Lagrange interpolation:

$$f(x)=\sum_{i=1}^n y_i\ell_i(x)$$

where

$$\ell_i(x)=\prod_{1\leq j \leq n,\;j\neq i} \frac{x - j}{i - j}$$

The polynomial, being a function, passes the vertical-line test, and so does not pass through the points $(1,p_1),...,(n,p_n)$.

Example for $n=4$:

$Y=\{y_1,y_2,y_3,y_4\}$, so we list the $\ell_i$:

$$\ell_1(x) = \frac{x - 2}{1-2}\frac{x-3}{1-3}\frac{x-4}{1-4}=-\frac{x^3}{6}+\frac{3x^2}{2}-\frac{13x}{3}+4$$

$$\ell_2(x) = \frac{x - 1}{2-1}\frac{x-3}{2-3}\frac{x-4}{2-4}=\frac{x^3}{2}-4x^2+\frac{19x}{2}-6$$

$$\ell_3(x) = \frac{x - 1}{3-1}\frac{x-2}{3-2}\frac{x-4}{3-4}=-\frac{x^3}{2}+\frac{7x^2}{2}-7x+4$$

$$\ell_4(x)= \frac{x - 1}{4-1}\frac{x-2}{4-2}\frac{x-3}{4-3}=\frac{x^3}{6}-x^2+\frac{11x}{6}-1$$

Then the polynomial that passes through $(1,y_1),(2,y_2),(3,y_3),(4,y_4)$ is

$$f(x)=\left(-\frac{y_1}{6}+\frac{y_2}{2}-\frac{y_3}{2}+\frac{y_4}{6}\right)x^3+\left(\frac{3y_1}{2}-4y_2+\frac{7y_3}{2}-y_4\right)x^2+\left(-\frac{13y_1}{3}+\frac{19y_2}{2}-7y_3+\frac{11y_4}{6}\right)x+4y_1-6y_2+4y_3-y_4.$$