Suppose $N$ points ($(x_1,y_1), (x_2,y_2), ... (x_N,y_N)$) are given from a curve $y=\sin(ax+b)$ where $a, b$ values are unknown. Before giving these $N$ points to you, $y$ coordinate of one point is randomly tampered so that it does not lie on the curve. Write a program to determine which point among $N$ points is NOT on the sinusoidal curve, whose $a$, $b$ values are unknown.
Any logic on how to approach this question, would be highly appreciate would be very thankful!
HINT :
Consider the point $P_1(x_1\:,\:y_1)$ and a point $P_k(x_k\:,\:y_k)\quad$ in $k>1$. $$\begin{cases} ax_1+b=\sin^{-1}(y_1)\\ ax_k+b=\sin^{-1}(y_k) \end{cases}$$ Solve the linear system for $a_k=a$ and $b_k=b$. See the note $(*)$ below.
Repeat from $k=2$ to $k=n$.
If all points where exactly on the sinusoid, all $a_k$ would be equal one to the others and all $b_k$ would be equal one to the others. This is not the case since one point is outside the sinusoid.
They are two possibility :
You detect the point among $P_2\:...\:P_n$ which gives a different result from the others : This is the point outside the sinusoid.
All the successive results are different one from the others. Then the point $P_1$ is not on the sinusoid.
(*) Note : The process of comparison will be a bit sophisticated, taking account that the function $\sin^{-1}$ is multivaluated (in extended sens). I let you manage this small difficulty.