Euler’s Equation for Brain Melt

Focusing on quaternions really sends you off into a rabbit hole about imaginary numbers. Mathematician Euler must’ve thought so too, so let’s tear apart his equation:

e^ix = cosx + i*sinx

So the exponential function, “e to the i times x” where i is imaginary and x is real gives you the cosine of x plus the sine of x times i. While this seems like an awfully random equation, the derivation is rather straightforward. Functions, especially non-algebraic ones like exponentials, can be rewritten as algebraic terms added together in power series. The power series for the generic exponential function is as shown:

By adding more terms, the algebraic approximation comes closer to the actual value of the function, so writing to x^n/n! where n is a big number gets you pretty close to e^x. Simply give x any value and plug into e^x and compare it to substituting a value for x in the series.

In this example, the approximation used four terms and gives an answer of about 6.333 while e^2 is about 7.389. The answers are close, albeit not exact. Doing 20 terms would bring us a lot closer to the exact value of e^2.

 

With that in mind, let’s set x equal to i*x as seen in Euler’s equation. Doing that gives this series and we can use i^2=-1 to simplify:

More terms were added to show a developing pattern. Terms that have x raised to an odd power have an i while the even power terms do not have i. You can rewrite the series to show all the even terms and the odd terms. The nth term is assumed to be even, so the odd group goes the n+1 value since any even number plus one is an odd number.

Soup-headed math nerds may recognize something more than this pattern of even and odds with alternating signs of positive and negative. Look at the power series for cosine and sine:

The even terms of the e^ix series are exactly the terms for cosx! Seeing the sine part is a bit more tricky, but factoring out the i makes the series more noticeable.

The fact that these specific series appear is no simple coincidence. We can rewrite our initial exponential as shown:

This is exactly Euler’s equation. This is used for more than just soup-ifying brains, however, which brings me back to the last post’s concept. Imaginary numbers rotate real values in the complex plane. This formula can be used to determine the real and imaginary components of a vector.

Right triangle trigonometry allows us to use cosine and sine to determine the horizontal (real) and vertical (imaginary) components of a vector. The example used has length 1, but the length can be any value. This means that a vector can be rewritten in terms of cosine, and sine rather than in the form of a+bi

Imaginaries are so very real in math.

Stay Soupy.

 

Quaternionin’ my Brain to Mush

After a week of in and out of class discussions, quaternions were shoved into my skull. Here’s the lesson of a liquid-minded individual after chatting for hours:

Quaternions extend our 2D understanding of complex numbers into 4D by adding two more imaginary numbers in perpendicular dimensions. This gives us a general expression for a quaternion:

q = a + bi + cj + dk

a is a scalar value (real number) while b, c, and d are coefficients for our imaginary numbers. bi, cj, and dk are vectors because i, j, and k (the imaginaries) have their directions as shown:

As typically taught in high school, i^2=-1. In order for j and k to also fit this definition of imaginary (negative square root):

i^2 = j^2 = k^2 = -1

 

Initially, you might say, “Well if i^2 = j^2 then shouldn’t i = j?”. In typical algebra, sure, that’s true, but these imaginary numbers have directions since they’re each perpendicular to one another. Using the imaginary planes and your right hand shows some interesting calculations:

i * j = k     BUT    j*i = -k

This is determined by resting your knuckles at the starting value and curling your fingers into the value it is being multiplied by (right hand rule). Your thumb points in the direction of the last imaginary value, and you compare it to the picture. For i*j, your thumb points in +k direction, but j*i is opposite of k, making it -k.

 

This rule works fine, but this cyclical diagram makes it easier to quickly get a product. Going in the direction of the arrows yields a positive, so going against them will give a negative. Once again, you start at the value on the leftmost part of the equation…

start at i, move clockwise to j, and get positive k as an answer for i*j=k

and follow the arrow to the other value in the shortest path. the last number is the answer, and the way you moved is the direction.

 

This rule shows that multiplying parts of quaternions (specifically the different imaginary parts) is non-communitive. Most people are used to communitive properties such as:

a+b = b+a    or    5*3 = 15 = 3*5

 

The importance of this property shows up in the application of quaternions.

 

In the 2D complex plane, you can visualize an arrow drawn from the origin to some length on the real plane. This is a vector labelled as “v” with an arrow.

 

Then, adding the imaginary part to the arrow seems to rotate it by some angle, α (alpha).

This is just 2D, so rotating in 4D requires the two other imaginary numbers (j and k). One use for quaternion rotations is in the video game industry where 3D models are rotated in 4D to make characters and objects seen in the games!

One last thought:

Quaternions are 4D, but one of those dimensions is the real/scalar part. This part does not rotate, so it just gives a length. So, this 4D tool is used on 3D situations. How brain-melting to think about!

Stay soupy.

Dirac Attackin’ my Noggin

I had a discussion with my math professor that led to the linear algebra used in quantum mechanics. Here is part of that discussion transformed into a lesson based on my comprehension:

Linear algebra utilizes matrices to describe the universe and finds its best application in quantum mechanics. One physicist and mathematician in this field is Paul Dirac. Dirac devised a notation to describe matrices to make the complex math more palatable. This notation has several operations outside of just syntax, but this post will cover one idea: rewriting values in matrices as unit matrices being scaled and rotated.

Learning by example works best. Here’s our 2×2 matrix:

[7  -9

3  0]

The top row (7 and 9) is the row in Space 1, so the bottom row is the row in Space 2. The first column (7 and 3) is in Space 1, and the second is in Space 2. So, each space has a row and a column and is either 1 or 2. To translate this matrix, these space labels will be added:

             enter here

                1     2

exit    1    [7  -9

here  2     3  0]

You read this from the top to the right. For example, you enter through 1, are scaled by 7, and exit by 1. This is how it looks in Dirac notation:

|1>7<1|

Dirac notation is read from right to left, so you can see the entering at 1 followed by the scale of 7 and the exit through 1. These are the other numbers:

|1>-9<2|

|2>3<1|

|2>0<2|

This means that our 2×2 matrix can be written as a sum of these Dirac expressions.

[7   -9

3     0]          =    |1>7<1| + |1>-9<2| + |2>3<1| + |2>0<2|

Now that we can translate the matrix into a different form, let’s dig into some details. First the symbols:

<| is a bra. The bra acts as the receiver, and a dimension is put in it to signify what is receiving.

|> is a ket. The ket acts as a sender, so the dimension put in it shows what dimension that the result is being sent to.

All this receiving and sending… What does this mean? The Dirac notation used here translates a value in a matrix into new syntax by applying a unit matrix to the value and performing the operations. Look at the matrix and a unit matrix:

[7  -9          [1

3    0]         0]

We are going to pass the unit matrix into our matrix as so:

[1   0]

[7  -9

3    0]

In the column of Space 1, our unit vector has the value of 1, so the matrix is receiving through Space 1 this value. The 1 will reach the 7, so those two values will multiply: 7*1 = 7. This the scaling aspect. Our unit matrix is multiplied by 7. We can ignore the column in Space 2 because any number times 0 is 0. Plus, we’re doing one component at a time. Next, the value must exit, and it does through the row in Space 1. Putting the steps together gives that Dirac representation.

[7

0] = |1>7<1|

An important thing to note:

We turned the vertical matrix, multiplied it by a scalar, then turned it again when sending it out. These are rotations and become a HUGE deal in advanced linear algebra. For now, we’re just viewing the rotations as coordinates and space areas.  This is just one application of the Dirac notation and is barely just a taste of linear algebra, but the info was in fact enough to liquify my brain. Anytime I want a good mental stew, I revisit Dirac.

Stay soupy.