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}\).

Sunday, May 18, 2014

A fun fact about divisibility

If and only if \(\textrm{gcd}(a, b) = 1\) there exists a positive \(x\) such that \(b | a^x - 1\). This means that all rational numbers can be expressed as \(\frac{z}{(a^x - 1)a^y}\) using any \(a \geq 2\).

Tuesday, April 22, 2014

A parametric curve


In the frame above you should see a figure being generated for you. If you look at it when it's done you'll see that it looks a lot like a pokeball with symmetry added to it, and it's actually a fractal which can be described as follows: there is the unit circle, and each circle contains four smaller circles which are tangent to themselves and the bigger circle.

Are the points of the fractal the points of a parametric curve? At first I was convinced that they are not because the curve must be continuous. However, because all points are connected (by tangency) that's not a problem. Then came the constraint that the particle, which we imagine moving along the curve, must not come to rest, and after a lot of thinking I came up with the motion shown in the figure. The speed is inevitably infinite from time to time because the length of the curve is, and we just have to accept that, but it shouldn't ever be zero because it gets greater as the circles get smaller (by a factor of \(\frac{8}{1 + \sqrt2}\) which you'll be able to verify once I've shown you my definition of the curve).

It should be noted that the curve that I'm going to present does not have a velocity at the points of internal tangency (e.g. \(t = 0\)). Because the direction exists even at those points, I'm sure it is possible to remedy this by using a substitution \(u = g(t)\) where \(g\) is some increasing function that is piecewise differentiable.

OK, let's start. We'll be using complex numbers rather than vectors as values of \(\bar{r}\) because complex numbers are great for doing rotations. Furthermore we choose \(t \in I = [0, 1)\). Define the first iteration of the fractal parametric curve to be the unit circle \(\bar{r}_0(t) = \exp{(2\pi i \cdot t)}\). Then suppose we know how to draw the nth iteration and define the next iteration to be four copies of the current one scaled down to fit inside a new unit circle (which is also part of the new iteration):
\[
\bar{r}_{n+1}(t) =
\begin{cases}
\frac{\bar{r}_n(8t) + \sqrt2}{1 + \sqrt2} \enspace\mathrm{if}\, 0 \leq t < \frac{1}{8} \\
\exp{(2\pi i \cdot 2(t - \frac{1}{8}))} \enspace\mathrm{if}\!\,\, \frac{1}{8} \leq t < \frac{1}{4} \\
i \bar{r}_{n+1}(t-\frac{1}{4}) \enspace\mathrm{if}\!\,\, \frac{1}{4} \leq t < 1
\end{cases}
\]
(The \(1 + \sqrt2\) comes from the ratio between two successive radii and can be found trigonometrically.)

By induction, we know what all iterations look like. To get \(\bar{r}(t)\), we take the limit \(\bar{r}_n(t)\) as \(n \to \infty\). The limit exists because I've set it up so that in most cases \(\bar{r}_n(t) = \bar{r}_{n+1}(t)\) ultimately. In the cases where that's not true, the value will be enclosed by \(n+1\) circles with exponentially decreasing radii, the greatest of which is the unit circle. Because every circle but the unit circle is inside of the previous one, the circles will converge around a single point which will be the limit.

That's it basically. Some interesting points are those which lie on infinitely small circles. For these points the direction of the curve might not exist. One such point is \(t = \frac{4}{7}, \bar{r}(t) = 1 - \sqrt2\). Can you catch 'em all?

Edit: another interesting thing is that \(\bar{r}_n(\frac{4}{7})\) seems to lie on a line for all \(n\). Are there other \(t\) with this property?

The center of gravity of a triangle

This is the simplest way that I've come up with so far to find the center of gravity of a triangle. Look at the figure below. The height of the triangle is h. Suppose there is a center of gravity P whose distance to the bottom line is hc. Divide the triangle into four congruent triangles. The height of the center triangle is h/2, so the distance from its top line to P is hc/2. Looking at the picture we now see that hc + hc/2 = h/2, i.e. c = 1/3.


Wednesday, April 16, 2014

Sum of nested square roots

I found this identity today in a test.
\[
\sqrt{\sqrt2+1} + \sqrt{\sqrt2-1} = \sqrt{2\sqrt2+2}
\]
It is interesting because it's of the somewhat rare form square root plus square root equals something simpler. Related to this is my post Rational sum of irrationals, where I come to the conclusion that the sum of two irrational square roots of fractions cannot be rational (that would make it simpler!), and also possibly my post on the fibonacci sequence, in which the sum of two exponentially growing irrational numbers equals an integer.