Math Equations

Sunday, June 22, 2014

A rational sinusoidal function

It is easy to get confused by the irrational nature of the sin function. One might think that you need irrational numbers to create a sinusoidal graph, but that's false. Consider \(z_a = (a+i)^2/(a^2+1) \quad (a \in \mathrm{Rat})\). It lies on the unit circle in the complex plane and its coordinates are rational. Here is a rational sinusoidal function: \(f(x) = \operatorname{Im}(z_a^x) \quad (x \in \mathrm{Int})\). This is what it may look like:

However, it has some irrational properties. According to WolframAlpha, \(\lim_{x\to\infty}z_x^x = e^{2i}\). The function \(f\) is probably injective for some values of \(a\).

Monday, June 16, 2014

Ugliest sequence ever

Let \(a_0 = 0, a_2 = 1\) and \(a_n = a_{\left\lfloor{n/2}\right\rfloor} + a_{\left\lfloor{n/2}\right\rfloor+1}\).

Wednesday, June 4, 2014

Basic interpolation

Say we've got \(n\) points through which we need to fit a polynomial. We'll solve the problem iteratively. First we'll find a polynomial that passes through one point, then we'll add a term to that polynomial to make it pass through another point, and then a third point will come into play -- etc.

Let the given points be \(\begin{array}{c}n\\(x_i, y_i)\\i=1\end{array}\) and let \(p_k\) denote the \(k\)th polynomial that we find. \(p_n\) is our final answer. \(p_k = \begin{cases}y_1 & \text{ if } k = 1\\ p_{k-1} + (y_k - p_{k-1}\bigg|_{x=x_k}) \prod_{i=1}^{k-1} \frac{x - x_i}{x_k - x_i} & \text{ if } 1 < k \leq n\end{cases}\).