Math Equations

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.

Sunday, April 6, 2014

The other part of the fibonacci sequence

It is widely known that a closed form for the \(n\)th fibonacci number exists, namely
\[
F_n = \frac{r_1^n - r_2^n}{\sqrt5}\\
\qquad r_1 = \frac{1+\sqrt5}{2}\\
\qquad r_2 = \frac{1-\sqrt5}{2}
\]

This closely resembles the way that we use complex conjugates to extract imaginary parts from complex numbers \(z\):
\[
z = a + bi\\
z^* = a - bi\\
\operatorname{Im}(z) = \frac{z - z^*}{2i}
\]

Did you notice how in the fibonacci sequence we divide by the special number \(\sqrt5\) and here we are dividing by the special number \(i\)? This means that, in some sense, \(F_n\) is the 'imaginary' part of \(r_1^n\).  The 'real' part, then, should be \(E_n = r_1^n + r_2^n\) (possibly divided by \(2\)) by analogy with \(\operatorname{Re}(z) = \frac{z + z^*}{2}\).

Is there a recursive interpretation of \(E_n\)? Apparently, it's the same as for the fibonacci sequence:
n  | 0  1  2  3  4  5  6  7  8  9
E_n| 2  1  3  4  7  11 18 29 47 76 

Friday, April 4, 2014

On my mathematical notation

As you do things over and over, you tend to find shortcuts. In this post, I'll list the shortcuts I have found when writing maths. It may be extended in the future. To show the latex source, right click on the math.

\( a = \begin{cases}b\\c\end{cases} \) means "\(a =\) both \(b\) and \(c\), so \(b = c\)".

\(\begin{array}{c}b\\f(n)\\n=a\end{array}\) means the comma separated list \(f(a), f(a+1), f(a+2), \ldots, f(b)\). It mimics the common way to specify ranges in summation. It is ideal for use in tuples, sets and function argument lists.

I also like to vary the indentation, kind of like you do when programming. The basic rule is that you increase indentation by one step to indicate that the block on that level belongs to the line above it. I use it frequently to isolate the value of variables from the expression that they belong to:
\[
F = ma\\
\quad m = 4 \,\mathrm{kg}\\
\quad a = 10 \,\mathrm{m}/\mathrm{s}^2\\
F = 40 \,\mathrm{N}
\]

Thursday, April 3, 2014

Rational sum of irrationals

Of course there are irrationals whose sum is rational. An example would be 2-√2 and √2.

If we limit ourselves to sums like √a + √b = q, where a, b, and q are nonnegative fractions but √a and √b are irrational, what are the solutions?

Assume that there exists a solution. Multiply by (√a - √b)/q (q ≠ 0 because otherwise √a = √b = 0 which is rational). We get (a - b)/q = √a - √b, a rational expression which we may call r. Knowing that both q and r are rational, we deduce that (q + r)/2 = √a is rational, but that's a contradiction, so there cannot be any solutions.

We've just investigated rational sums of irrational numbers. The other day, I heard about algebraic sums of transcendental numbers. Supposedly, it is not known whether e + π is algebraic or not. Maybe that's something to delve further into?

The discrete heat problem - Part 2: Solving the characteristic equation

In the last post, we came to the conclusion that \(E = \sum_{j = 0}^{n-1} \binom{j+n}{2j+1} E_0^{(j)}\). This is an n-1'th degree inhomogenous linear equation. To solve it, we need to solve the characteristic equation \(\sum_{j = 0}^{n-1} \binom{j+n}{2j+1} r^j = 0\) for \(r\).

It seems that, in general, the solutions to the characteristic equation are \[r_i = -4\cos^2\frac{\pi i}{2 n} (1 \leq i < n)\] but I don't have a proof for this yet. I found the solutions by chance: by noticing that the solutions for low n involved the same square roots as cos did.

As I don't have a proof yet, I'll give you an example instead. Let \(n = 4\). Then the characteristic equation is
\[
\begin{eqnarray}
0 &=& \sum_{j = 0}^{3} \binom{j+4}{2j+1} r^j\\
&=& \binom{4}{1} + \binom{5}{3} r + \binom{6}{5} r^2 + \binom{7}{7} r^3\\
&=& 4 + 10r + 6r^2 + r^3\\
&=& (2+r)(2 + 4r + r^2)\\
&=& (2+r)(2+\sqrt{2}+r)(2-\sqrt{2}+r)
\end{eqnarray}
\]
whence we may read off the solutions \(r = -2, -2-\sqrt{2}, -2+\sqrt{2}\). This is just what the formula predicts:
\[
\begin{eqnarray}
r_1 &=& -4\cos^2\frac{\pi}{8} &=& -4\frac{1}{2}(1+\frac{1}{\sqrt{2}}) &=& -2-\sqrt{2} \\
r_2 &=& -4\cos^2\frac{\pi}{4} &=& -4\frac{1}{2} &=& -2\\
r_3 &=& -4\cos^2\frac{3\pi}{8} &=& -4\frac{1}{2}(1-\frac{1}{\sqrt{2}}) &=& -2+\sqrt{2}
\end{eqnarray}
\]

In conclusion, the formula is reasonable and will do without a proof for the moment.

The discrete heat problem - Part 1: Creating a differential equation

Stating the problem algebraically

The information we've got is enough to find the derivatives \(E'_i(t)\) as functions of \(E_j(t) (0 \leq j < n)\). We need to calculate the difference in temperatures between the body and its surroundings (as Newton put it) for each point. First, the point \((0, 0)\) is surrounded only by \((1, 0)\). Similarly, the point \((n - 1, 0)\) is surrounded only by \((n - 2, 0)\). All other points \((i, 0)\) are surrounded by both \((i - 1, 0)\) and \((i + 1, 0)\). We can now find the derivatives.

We'll drop the \((t)\)'s for a while. Read \(E^{(j)}_i\) as \(E^{(j)}_i(t)\).
\[
\begin{eqnarray}
E'_0 & = & E_1 - E_0 = - E_0 + E_1\\
E'_i & = & (E_{i - 1} - E_i) + (E_{i + 1} - E_i) = E_{i - 1} - 2E_i + E_{i + 1} (1 \leq i < n - 1)\\
E'_{n-1} & = & E_{n - 2} - E_{n-1}
\end{eqnarray}
\]

Rearranging terms, we get
\[
\begin{eqnarray}
E_1 & = & E_0 + E'_0\\
E_{i} & = & E'_{i - 1} - E_{i - 2} + 2E_{i - 1} (2 \leq i < n)
\end{eqnarray}
\]

Combining the equations into one massive differential equation

Looking at the latest set of expressions, we see that \(E_1\) depends only on \(E_0\) and its derivative. \(E_2\) depends on \(E_0\) and \(E_1\) plus derivatives, but if we substitute our expression for \(E_1\), we get \(E_2\) as a linear combination of only \(E_0\) plus derivatives. Continuing in a similar fashion, we conclude that every \(E_i\) can be written as a linear combination of only \(E_0\) plus derivatives. Thus for every \(i\), there must exist a sequence \(a_i\) independent of \(t\), such that \( E_i = \sum_{j = 0} a_{i, j}E_0^{(j)} \).

We'll now deal with finding \(a_i (1 \leq i < n)\). This section, I tell you, is beautiful. Aside from the conceptual inversion of our system of equations, we will find the coefficients in Pascal's triangle.

Let's look at our progress so far. We know \(a_0 = (1,)\) and \(a_1 = (1, 1)\) (corresponding to \(E_0 = E_0\) and \(E_1 = E_0 + E'_0\), respectively). For any \(i \geq 2\), we can find \(a_i\) if we know \(a_{i - 1}\) and \(a_{i - 2}\). It is possible to find a recurrence relation for \(a_i\):

\[
a_{i, j} = a_{i - 1, j - 1} - a_{i - 2, j} + 2a_{i - 1, j}
\]

This recurrence relation is similar to that of Pascal's triangle (\( p_{i,j} = p_{i-1,j} + p_{i-1,j-1} \)). As it turns out, if we construct a triangle of \(a_{i,j}\) similarly to how Pascal's triangle is constructed from \(p_{i,j}\), our new triangle is half of Pascal's (see the figure below, where the orange segments form our new triangle when moved together). We find that \( a_{i, j} = \binom{i+j}{2j} \).


Because energy is conserved, \( \sum_{i = 0}^{n-1} E_i(t) = \sum_{i = 0}^{n-1} E_i(0) \). Call this constant quantity E. Using the expressions obtained above for \(E_i\), we'll get a non-homogenous linear differential equation.

\[
\begin{eqnarray}
E &=& \sum_{i = 0}^{n-1} E_i(t)\\
&=& \sum_{i = 0}^{n-1} \sum_{j = 0}^{n-1} a_{i, j}E_0^{(j)}\\
&=& \sum_{j = 0}^{n-1} (E_0^{(j)} \sum_{i = 0}^{n-1} a_{i, j})
\end{eqnarray}
\]

The rightmost sum may be evaluated by looking at its final term in Pascal's triangle and going down one to the right. Our final result is:

\[
E = \sum_{j = 0}^{n-1} \binom{j+n}{2j+1} E_0^{(j)}
\]

The discrete heat problem - Part 0: Introduction

Newton's law of cooling states that "the rate of heat loss is proportional to the difference in temperatures between the body and its surroundings". Two years ago I began playing around with Newton's idea (although at the time I did not know it was attributed to him). The problems that have arisen since are the most rewarding ones that I have come across in my lifetime, and now, I'd like to share them with you.

I'll start with the one which I call the discrete heat problem: Consider the points \((i, 0) (i \in \mathbb{Z}; 0 \leq i < n; 2 \leq n)\). Each has an amount of heat, which we'll denote \(E_i(t)\) as a function of time. Suppose we are given \(E_i(0) (0 \leq i < n)\). Can we find explicit expressions for \(E_i(t)\)?

The problem can be solved one part at a time, each part being interesting on its own, so I have decided to split the problem into several posts. Here's an outline of my solution:

  1. Create a differential equation
  2. Solve the characteristic equation
  3. Create an associated linear equation (almost done!)
  4. Solve the linear equation (not done yet!)