Reflection Matrix

It’s been a while since my last math post. It seems that my previous assertion correlating the quality of question with the period of final exams could not have been further from the truth. It now seems quite likely that the occurrence of a few “good” questions on Yahoo Answers in a short period of time a few weeks back was more of a fluke rather than the norm.

Problem: Find the standard matrix for the linear transformation which reflects points in the x-y plane across the line y = \frac{-2x}{3}.

Solution: To find the matrix representing a given linear transformation all we need to do is to figure out where the basis vectors, i.e.

\vec{e_{1}}=\begin{bmatrix} 1\\ 0 \end{bmatrix} and \vec{e_{2}}=\begin{bmatrix} 0\\ 1 \end{bmatrix}

are mapped under the transformation.

This is easy to see from the fact that since \vec{e_{1}} and \vec{e_{2}} form a basis of \mathbb{R}^{2} any element

\vec{u}\ \epsilon \ \mathbb{R}^{2}

can be written as

\vec{u} = a \cdot \vec{e_{1}} + b \cdot \vec{e_{2}}

for some a,b\ \epsilon\ \mathbb{R}.

Now let

A : \mathbb{R}^{2} \to \mathbb{R}^{2}

be a linear transformation. Then, by definition

A(\vec{u}) = A(a \cdot \vec{e_{1}} + b \cdot \vec{e_{2}}) = a \cdot A( \vec{e_{1}} ) + b \cdot A( \vec{e_{2}} )

Thus, the image of any element \vec{u}\ \epsilon \ \mathbb{R}^{2} under a linear transformation is completely determined by the image of the basis of the transformation’s domain.

Let’s find the image of \vec{e_{1}}=\begin{bmatrix} 1\\ 0 \end{bmatrix} under a reflection across the line given by y = \frac{-2x}{3}. First, we need to find a line perpendicular to y = \frac{-2x}{3} that passed through the point p_{1} = (1, 0).

In general, a line perpendicular to y = mx + b is given by y = \frac{-x}{m}, i.e in our case, y = \frac{3x}{2}. To find the one particular line with the same slope, that passes through p_{1} = (1, 0), we need to simply plug in the values of x = 1 and y = 0 into the line equation and add a constant value so that the equality will hold. Then we have

(0) = \frac{3(1)}{2}+b

Thus, the line perpendicular to y = \frac{-2x}{3} that passes through p_{1} = (1, 0) is given by y = \frac{3x}{2} – \frac{3}{2}

reflection matrix chart
The lines given by equations (1) – red and (2) – green

Now let’s find the point q_{1} = (x, y) at which our two lines y = \frac{-2x}{3} and y = \frac{3x}{2} – \frac{3}{2} intersect. This is done easily by solving the two line equation simultaneously:

y = \frac{-2x}{3} \ (1)

y = \frac{3x}{2} – \frac{3}{2} \ (2)

Equating (1) and (2) (and multiplying by 6 for simplicity) gives

-4x = 9x – 9

x = \frac{9}{13}

which then gives

y = \frac{-6}{13}

Thus, our two lines intersect at

q_{1} = \left (\frac{9}{13}, \frac{-6}{13} \right )

Now, let {p_{1}}’ = (x, y) be the reflection of p_{1} = (1, 0) across y = \frac{-2x}{3}. Since {p_{1}}’ and p_{1} are symmetric across q_{1} (because that is how the reflection is actually constructed) it follows that

x = q_{1}x – \left | p_{1}x – q_{1}x \right | = \frac{9}{13} – \left | 1 – \frac{9}{13} \right | = \frac{5}{13}

y = q_{1}y – \left | p_{1}y – q_{1}y \right | = \frac{-6}{13} – \left | 0 – \frac{-6}{13} \right | = \frac{-12}{13}

so

A( \vec{e_{1}} ) = \begin{bmatrix} \frac{5}{13} \\ \frac{-12}{13} \end{bmatrix}

Similarly as above, we find the image of \vec{e_{2}}=\begin{bmatrix} 0\\ 1 \end{bmatrix} under a reflection across the line given by y = \frac{-2x}{3}. The line perpendicular to y = \frac{-2x}{3} that passed through the point p_{2} = (0, 1) is given by

y = \frac{3x}{2} + 1 \ (3)

The lines given by equations (1) – red, (2) – green, and (3) – blue

Equating (1) and (3) (and multiplying by 6 again) gives

-4x = 9x + 6

x = \frac{-6}{13}

and so

y = \frac{4}{13}

Therefore, (1) and (3) intersect at

q_{2} = \left (\frac{-6}{13}, \frac{4}{13} \right )

and the image {p_{2}}’ = (x, y) of p_{2} = (0, 1) under the reflection across y = \frac{-2x}{3} is given by

x = q_{2}x – \left | p_{2}x – q_{2}x \right | = \frac{-6}{13} – \left | 0 – \frac{-6}{13} \right | = \frac{-12}{13}

y = q_{2}y – \left | p_{2}y – q_{2}y \right | = \frac{4}{13} – \left | 1 – \frac{4}{13} \right | = \frac{-5}{13}

which yields

A( \vec{e_{2}} ) = \begin{bmatrix} \frac{-12}{13} \\ \frac{-5}{13} \end{bmatrix}

Finally, the matrix A : \mathbb{R}^{2} \to \mathbb{R}^{2} for the linear transformation which reflects points in the x-y plane across the line y = \frac{-2x}{3} is given by

A = \begin{bmatrix} \frac{5}{13} & \frac{-12}{13} \\ \frac{5}{13} & \frac{-5}{13} \end{bmatrix}

It turns out (although I’m not going to show to derivation here) that in general, the matrix for a linear transformation which reflects points in the x-y plane across an arbitrary line y = mx + b is given by

A = \begin{bmatrix} cos2\theta & sin2\theta \\ sin2\theta & -cos2\theta \end{bmatrix}

where \theta is the angle that the line makes with the positive x-axis, i.e

\theta = arctan(m) if m \geq 0

and

\theta = arctan(\left | m \right |) + \frac{\pi }{2} if m < 0

Triton’s Atmosphere More Mysterious Than Previously Thought

The first ever infrared analysis of the atmosphere of Neptune’s moon Triton revealed the presence carbon monoxide and methane. As summer hit the moon’s southern hemisphere, observations made at the Very Large Telescope (VLT) based at the European Southern Observatory (ESO) showed the thin atmosphere to vary with seasons.

triton atmosphere
Artist’s impression of how Triton, Neptune’s largest moon, might look from high above its surface. The distant Sun appears at the upper-left and the blue crescent of Neptune right of center – Credit: ESO/L. Calçada

“We have found real evidence that the Sun still makes its presence felt on Triton, even from so far away. This icy moon actually has seasons just as we do on Earth, but they change far more slowly,” says Emmanuel Lellouch, the lead author of the paper reporting these results in Astronomy & Astrophysics.

On Triton, where the average surface temperature is about minus 235 degrees Celsius, it is currently summer in the southern hemisphere and winter in the northern. As Triton’s southern hemisphere warms up, a thin layer of frozen nitrogen, methane, and carbon monoxide on Triton’s surface sublimates into gas, thickening the icy atmosphere as the season progresses during Neptune’s 165-year orbit around the Sun. A season on Triton lasts a little over 40 years, and Triton passed the southern summer solstice in 2000.

Based on the amount of gas measured, Lellouch and his colleagues estimate that Triton’s atmospheric pressure may have risen by a factor of four compared to the measurements made by Voyager 2 in 1989, when it was still spring on the giant moon.

Carbon monoxide was known to be present as ice on the surface, but Lellouch and his team discovered that Triton’s upper surface layer is enriched with carbon monoxide ice by about a factor of ten compared to the deeper layers, and that it is this upper “film” that feeds the atmosphere. While the majority of Triton’s atmosphere is nitrogen (much like on Earth), the methane in the atmosphere, first detected by Voyager 2, and only now confirmed in this study from Earth, plays an important role as well.

triton moon
Voyager 2 raw image of Neptune’s satellite Triton taken from roughly 500,000 km. Evidence of complex surface features can be seen from this distance – Credit: NASA

Of Neptune’s 13 moons, Triton is by far the largest, and, at 2700 kilometers in diameter (or three quarters the Earth’s Moon), is the seventh largest moon in the whole Solar System. Since its discovery in 1846, Triton has fascinated astronomers thanks to its geologic activity, the many different types of surface ices, such as frozen nitrogen as well as water and dry ice (frozen carbon dioxide), and its unique retrograde motion.

Observing the atmosphere of Triton, which is roughly 30 times further from the Sun than Earth, is not easy. In the 1980s, astronomers theorised that the atmosphere on Neptune’s moon might be as thick as that of Mars (7 millibars). It wasn’t until Voyager 2 passed the planet in 1989 that the atmosphere of nitrogen and methane, at an actual pressure of 14 microbars, 70 000 times less dense than the atmosphere on Earth, was measured. Since then, ground-based observations have been limited. Observations of stellar occultations (a phenomenon that occurs when a Solar System body passes in front of a star and blocks its light) indicated that Triton’s surface pressure was increasing in the 1990′s. It took the development of the Cryogenic High-Resolution Infrared Echelle Spectrograph (CRIRES) at the Very Large Telescope (VLT) to provide the team the chance to perform a far more detailed study of Triton’s atmosphere.

Golden Nature: Closed-Form Formula For Fibonacci Sequence

Almost everyone has heard of this sequence: 1,\ 1,\ 2,\ 3,\ 5,\ 8,\ etc. It is named after Leonardo of Pisa who introduced it to the western world in one of the most influential books ever published in mathematics – Liber Abaci. This book introduced Europe to the Hindu numerals 0 through 9, the word zero, the notion of an algorithm and the subject of algebra.

The beauty of the Fibonacci sequence and the golden ratio (which is intimately connected to it) lies in that they are not just another mathematical construct, but occur throughout the nature.

Have you ever taken a look at a pine cone and noticed that the scales of the cone are in spirals? Have you ever counted the spiral in the clockwise and counterclockwise directions? I would be surprised if you have … but the counts turn out to be 5 and 8 (or 8 and 13 for bigger cones).

fibonacci sequence closed form

How about these? Care to count the petals?

fibonacci
13 petals
fibonacci 21
21 petals

… intriguing stuff indeed.

So, once again, I was reading through problems on Yahoo Answers. Most of the questions “reduce” (lol) to plugging numbers into well known equations, or using a calculator such as TI-89, or Mathematics, Maple, or even Google – basically, what engineers do. Yeah, you “heard” me right! It takes some effort to found a meaningful question that actually requires some knowledge and skills – see the difference between a mathematician and an engineer now? That said, here’s a one I couldn’t resist:

Problem: Find the term F_{386} in the following sequence F_{0}=-4,\ F_{1}=5,\ F_{2}=1,\ F_{3}=6,\ F_{4}=7,\ F_{5}=13

There is a more “elegant” way to tackle this problem and I may write about in the future (maybe quite soon actually), but for now I’ll ignore matrices, diagonalization and eigenspaces (although the reason why the following solution gives the correct result is tightly connected to linear algebra) and focus, instead, on the recursive nature of the Fibonacci sequence.

Solution: To find the term, “all” that is needed is to find the closed form for the n-th terms of the sequence F_{n}. In general, a Fibonacci sequence is given by

F_{n} = F_{n-1} + F_{n-2}\ (1)

and any particular sequence is fully determined by the initial two terms

F_{0} and F_{1}

In our example, we have

F_{0}=-4 and F_{1}=5

To find the closed form, let’s assume

F_{n}=(-4)\times t^{n}

Then using our recursive formula (1) we get

(-4)t^{n+1}=(-4)\left ( t^{n} + t^{n-1}\right )

and so

t^{2}=t + 1\Rightarrow t^{2} – t – 1 = 0\ (2)

Solving the quadratic from (2) gives

t_{1,2}=\frac{1\pm \sqrt{5}}{2}

Using this result, we can write the closed form formula for the n-th term of our sequence as

F_{n}=-4\left ( \ C_{1}\left ( \frac{1+\sqrt{5}}{2} \right )^{n}+C_{2}\left ( \frac{1-\sqrt{5}}{2} \right )^{n}\ \right ) (3)

where C_{1} and C_{2} are constant parameters determined by our initial conditions,

F_{0}=-4 and F_{1}=5

We can calculate these values by solving the following system of equations

F_{0} = -4\times t^{0}=-4 \left ( C_{1}\times t_{1}^{0} + C_{2}\times t_{2}^{0} \right )

F_{1} = -4\times t^{1}=-4 \left ( C_{1}\times t_{1}^{1} + C_{2}\times t_{2}^{1} \right )

Plugging in known values gives us

-4 = -4 \left (C_{1} \left ( \frac{1+\sqrt{5}}{2} \right )^{0} + C_{2} \left ( \frac{1-\sqrt{5}}{2} \right )^{0} \right )

5 = -4 \left (C_{1} \left ( \frac{1+\sqrt{5}}{2} \right )^{1} + C_{2} \left ( \frac{1-\sqrt{5}}{2} \right )^{1} \right )

Simplifying turns the above into

1 = C_{1} \left ( \frac{1+\sqrt{5}}{2} \right )^{0} + C_{2} \left ( \frac{1-\sqrt{5}}{2} \right )^{0} = C_{1} + C_{2} \ (4)

\frac{-5}{4} = C_{1} \left ( \frac{1+\sqrt{5}}{2} \right ) + C_{2} \left ( \frac{1-\sqrt{5}}{2} \right ) \ (5)

Now we need to solve (4) and (5) for C_{1} and C_{2}. Although I said I was going to leave matrices alone, this is a perfect situation to use them. I prefer to use the procedure described below for a system of two equations with coefficients such as these. Substitution or elimination method would, of course, work, but they involves messy arithmetic which can be so easily error prone in situations such as this one.

We have the following system:

\begin{pmatrix} 1 & 1 \\ \frac{1+\sqrt{5}}{2} & \frac{1-\sqrt{5}}{2} \end{pmatrix} \begin{pmatrix}C_{1}\\ C_{2}\end{pmatrix} = \begin{pmatrix}1\\ \frac{-5}{4}\end{pmatrix}\ (6)

In general, to solve the equation

Au=v

we use

A^{-1}Au=A^{-1}v

which turns into

u=A^{-1}v

Hence, to solve (6) we need to find the inverse of our matrix. This is fairly simple for a 2 by 2 matrix … Let

A=\begin{pmatrix}a & b\\ c & d\end{pmatrix}

then

A^{-1}=\frac{1}{ad-bc}\begin{pmatrix}d & -b\\ -c & a\end{pmatrix}

and so

\begin{pmatrix} 1 & 1 \\ \frac{1+\sqrt{5}}{2} & \frac{1-\sqrt{5}}{2} \end{pmatrix}^{-1} =\frac{-1}{\sqrt{5}}\begin{pmatrix} \frac{1-\sqrt{5}}{2} & -1 \\ \frac{-1-\sqrt{5}}{2} & 1 \end{pmatrix}

Our equation (6) then becomes

\begin{pmatrix} 1 & 1 \\ \frac{1+\sqrt{5}}{2} & \frac{1-\sqrt{5}}{2} \end{pmatrix}^{-1}\begin{pmatrix} 1 & 1 \\ \frac{1+\sqrt{5}}{2} & \frac{1-\sqrt{5}}{2} \end{pmatrix} \begin{pmatrix}C_{1}\\ C_{2}\end{pmatrix} = \begin{pmatrix} 1 & 1 \\ \frac{1+\sqrt{5}}{2} & \frac{1-\sqrt{5}}{2} \end{pmatrix}^{-1} \begin{pmatrix}1\\ \frac{-5}{4}\end{pmatrix}

\begin{pmatrix}C_{1}\\ C_{2}\end{pmatrix} = \frac{-1}{\sqrt{5}}\begin{pmatrix} \frac{1-\sqrt{5}}{2} & -1 \\ \frac{-1-\sqrt{5}}{2} & 1 \end{pmatrix} \begin{pmatrix}1\\ \frac{-5}{4}\end{pmatrix}

which gives us

C_{1}=\frac{-2(1-\sqrt{5})-5}{4\sqrt{5}}\ (7)

C_{2}=\frac{2(1+\sqrt{5})+5}{4\sqrt{5}}\ (8)

Finally, by plugging (7) and (8) into (3) we get

F_{n}=-4\left (\left ( \frac{-2(1-\sqrt{5})-5}{4\sqrt{5}} \right )\left ( \frac{1+\sqrt{5}}{2} \right )^{n}+\left ( \frac{2(1+\sqrt{5})+5}{4\sqrt{5}} \right )\left ( \frac{1-\sqrt{5}}{2} \right )^{n}\right ) (9)

We can now “easily” compute F_{386} which is given by

F_{386}=-4\left (\left ( \frac{-2(1-\sqrt{5})-5}{4\sqrt{5}} \right )\left ( \frac{1+\sqrt{5}}{2} \right )^{386}+\left ( \frac{2(1+\sqrt{5})+5}{4\sqrt{5}} \right )\left ( \frac{1-\sqrt{5}}{2} \right )^{386}\right )

Google returns F_{386} \cong 5.2783459\times 10^{80} which is just an approximation, but now we have a formula for the precise answer.

If you wish to check for yourself that out formula (9) is indeed correct, click on the terms below to see the computation by Google:

F_{0}=-4

F_{1}=5

F_{2}=1

F_{3}=6

F_{4}=7

F_{5}=13

On a side note – Raising a number to the power of 386 may seem like a long computation but it really requires only 10 multiplications! Don’t believe me?

Consider this:

\left ( \frac{1+\sqrt{5}}{2} \right )^{386}=\left ( \frac{1+\sqrt{5}}{2} \right )^{256}\left ( \frac{1+\sqrt{5}}{2} \right )^{128}\left ( \frac{1+\sqrt{5}}{2} \right )^{2}

To calculate

\left ( \frac{1+\sqrt{5}}{2} \right )^{256}

we use the fact that

1.)\ \left ( \frac{1+\sqrt{5}}{2} \right )^{2} = \left ( \frac{1+\sqrt{5}}{2} \right )\left ( \frac{1+\sqrt{5}}{2} \right )

2.)\ \left ( \frac{1+\sqrt{5}}{2} \right )^{4} = \left ( \frac{1+\sqrt{5}}{2} \right )^{2} \left ( \frac{1+\sqrt{5}}{2} \right )^{2}

3.)\ \left ( \frac{1+\sqrt{5}}{2} \right )^{8} = \left ( \frac{1+\sqrt{5}}{2} \right )^{4} \left ( \frac{1+\sqrt{5}}{2} \right )^{4}

8.)\ \left ( \frac{1+\sqrt{5}}{2} \right )^{256} = \left ( \frac{1+\sqrt{5}}{2} \right )^{128} \left ( \frac{1+\sqrt{5}}{2} \right )^{128}

As you can see, in every step (multiplication) we use the result from the previous one and so it takes only 8 steps (multiplications) to calculate

\left ( \frac{1+\sqrt{5}}{2} \right )^{256}

Finally, in the process of calculating

\left ( \frac{1+\sqrt{5}}{2} \right )^{256}

we get

\left ( \frac{1+\sqrt{5}}{2} \right )^{128} and \left ( \frac{1+\sqrt{5}}{2} \right )^{2}

as a bonus, and so to calculate

\left ( \frac{1+\sqrt{5}}{2} \right )^{386}

we now only need to use two more multiplications

\left ( \frac{1+\sqrt{5}}{2} \right )^{386}=\left ( \frac{1+\sqrt{5}}{2} \right )^{256}\left ( \frac{1+\sqrt{5}}{2} \right )^{128}\left ( \frac{1+\sqrt{5}}{2} \right )^{2}

This idea can be generalized to any

x\epsilon \Re

The (maximal) number of multiplications required to compute

x^{n}\ where\ 2^{p}

Star Wars Main Theme Guitar Tab

A Quick Guide to the Star Wars Theme Guitar Tabs:

I’ve played the guitar for some years but only recently I’ve discovered the version of Star Wars Main Theme played by Tomi Paldanius. As a true Star Wars fan i decided to tab it so share with the Star Wars Universe! This version is a bit simplified (only bass, melody and chords without inversions) but it works quite well.

Tomi Paldanius plays Star Wars – Main Theme

Tuning: Standard (EADGBe)

(repeat 2x)
e|—————————–3—————–3—————————|
B|—————3——-1p0———–3—1p0———3—1p0h1————-|
G|—————————2—————–2——————-2~——–|
D|-0-0-0-5—4—2–p0——————————————————-|
A|———————–3—–2–p0——-3—–2–p0—–3—————–|
E|————————————-3—————3———————|

e|—————————————————————————|
B|———–1p0——————————1p0—–3———————-|
G|—————2p0-0h2p0-2———————-2p0—–2——————|
D|-0-0-2—2—————–2/4—-0-0-2—2————0——————-|
A|—–3-3——————-3/5——–3-3———–1———————-|
E|—————————————————————————|

e|————————————–3-1———————————-|
B|———–1p0—————————-4-3-1——-1/3——————|
G|—————2p0-0h2p0-2———————-3-2-0———————-|
D|-0-0-2—2—————–2/4—-0-0———————-0-0-0-0———|
A|—–3-3——————-3/5———————————————|
E|—————————————————————————|

e|—————————–3—————–3——————-2-2-2-3-|
B|—————3——-1p0———–3—1p0———3—1p0h1—–1-1-1-3-|
G|—————————2—————–2——————-2-2-2-2—|
D|-0-0-0-5—4—2–p0——————————————————-|
A|———————–3—–2–p0——-3—–2–p0———3———–2-|
E|————————————-3—————3——————-3-|

| / slide up
| \ slide down
| h hammer-on
| p pull-off
| ~ vibrato
| + harmonic
| x Mute note
===============================================================================

Aliens Found on Mars: A Brief History

A Short and Quick History of NASA Finding Life on the Martian Planet.

The red planet has held a special place in humanity’s collective imagination for centuries. However, since the Viking landers actually travelled to the red planet, the question of whether there is life on Mars has taken several sharp turns. Just in the past few years, there has been some major controversies and developments. We’ll explore the major ones, from most recent all the way back to the ‘Martian Face’ that NASA photographed in the 90’s.

July 2018: NASA Accused of Burning Evidence of Life on Mars

viking lander nasas
Source: NASA.gov

This controversy comes from an actual NASA report, but it has been wildly misinterpreted. Here’s how it goes: researchers discovered data from an old test of Martian soil done by the Viking landers back in the 1970’s. The Viking landers found no evidence of organic molecules, which was puzzling since we did find evidence of them when the two Martian rovers sampled Martian soil.
Now, the soil contained a compound called perchlorate, which is very flammable. There’s very little oxygen or heat on Mars, so it normally doesn’t burn. But the NASA report suggests that the Landers accidentally burned evidence of the Martian organic compounds by burning it with the perchlorate.
The controversy is a whole lot of nothing. We know now that organic compounds do exist on Mars, so whether the Viking landers messed up the first tests doesn’t really matter.

Remember that these are organic compounds, which are the building blocks of life, but aren’t evidence of life itself.

June 2018: Organic Matter Found on Mars

NASA announced that they had discovered organic matter preserved in mudstones that are over 3 billion years old (Earth is 4.5 billion years old, for reference). The announcement also mentioned the fact that we see methane being released into the atmosphere of Mars. Methane is evidence of some kind of organic matter being released into the atmosphere. It’s not clear what this organic matter is, however.

Well, at least that’s what UFO spotters looking at this NASA Mars Rover picture saw:

aliens found on mars
What according to some appears to be a skull with eye sockets and a nose – Source: BARCROFT/NASA

I, personally, am more inclined towards a bowling ball, which would definitely indicate the presence of intelligent life on Mars, unlike here, on Earth.

mars face
The “famous” Face on Mars – part of the Cydonia region, taken by the Viking 1 orbiter and released by NASA/JPL on July 25, 1976. – Source: NASA/JPL
female figure mars
A photo of what appears to be a “female” figure taken on the red planet by the Spirit rover. – Source: NASA