2
$\begingroup$

Here is the graph. (It is the same as below.)

Data Set to Find Equation

The points are symmetrical over the $y$-axis, but I cannot find an equation that accurately represents this graph.

$\endgroup$
1
  • $\begingroup$ Essentially $y=abs(x)$ $\endgroup$ Jul 16, 2020 at 14:05

3 Answers 3

3
$\begingroup$

Well, observe that $y-x$ for $x>0$ are almost in arithmetical progression: $0, 3, 4.5, 6, 9, 12, 15, 30$. So we construct Lagrange polynomials for $y=y(t)$, $x=x(t)$ where $t=\frac{2}{3}(y-x)$: $$x=t(t - 1),\ y=t(t + \frac{1}{2}).$$ We might leave this as an answer, but let's obtain $y(x)$. $$t^2-t-x=0$$ $$t = \frac12 \left(1 \pm \sqrt{4 x + 1}\right)$$ $$t=\frac23(y-x)\Rightarrow y=\frac32 t+x$$ $$y=\frac34 \left(1 \pm \sqrt{4 x + 1}\right)+x$$ Now let's resolve the $\pm$. \begin{array}{|l|c|c|c|c|c|c|c|c|} \hline x&0&2&6&12&30&56&90&380\\ \hline y_1&0&1/2&3&15/2&45/2&91/2&153/2&703/2\\ \hline y_2&3/2&5&21/2&18&39&68&105&410\\ \hline \end{array} $$\hbox{So }y(x)=\begin{cases} \frac34 \left(1 + \sqrt{4 |x| + 1}\right)+|x|,&\hbox{for }x\ne 0,\\ 0,&\hbox{for }x= 0. \end{cases}$$


Edit: python script for computing the Lagrange polynomials

from sympy import *
R=Rational
from sympy.abc import x
xs=[0,2,6,12,30,56,90,380]
ys=[0,5,10+R(5,10),18,39,68,105,410]
def lp(xs,ys):
    monomes=[(x-R(i)) for i in xs]
    lps=[prod(monomes[:i]+monomes[i+1:]) for i in range(len(xs))]
    return simplify(sum(R(j)*f/f.subs({x:R(i)})
        for i,j,f in zip(xs,ys,lps)
                        ))
xs_=[(i-j)/R(3,2) for i,j in zip(ys,xs)]
print(lp(xs_,xs),lp(xs_,ys))

And it's output

x*(x - 1) x*(x + 1/2)

About $y-x$: observing $y-x$ is rather artificial and it is, but once you obtained it, you see that every $y-x$ is divisible by $3$, it's natural to divide by $3$. Also there's $1.5$ so it's natural to multiply by $2$ to get integer values. That's why $\frac 23$.

$\endgroup$
2
  • $\begingroup$ How did you know that for the lagrange polynomials 𝑡=2/3(𝑦−𝑥)? Also, how were these obtained: 𝑥=𝑡(𝑡−1), 𝑦=𝑡(𝑡+1/2)? $\endgroup$
    – thampel1
    Jul 20, 2020 at 10:39
  • $\begingroup$ @thampel1 please see the edits. Thanks. $\endgroup$ Jul 20, 2020 at 12:26
3
$\begingroup$

That looks suspiciously like $a \lvert x \rvert$ for some $a$... at least the branches look linear. If they aren't, some tweak should get you there.

Without any idea of the origin of the data, or the process that produces them (or they are representing), it is hard to hypothesize a matching functional form.

$\endgroup$
2
$\begingroup$

$y=|x|$ would be a good fit, although if you look at the data points carefully, the line actually has slope a little greater than $1$. To be as accurate as possible, take the average of all $\frac YX$ values for $X\gt 0$, which comes out to be $\approx 1.48$ and take this as the slope instead, giving the equation $$y=|1.48 x|$$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .