Tuesday, 29 March 2011

Imaginary Numbers

When you first begin studying mathematics you are taught that only positive numbers can be square rooted, and this is true for conventional mathematics and it is not too often that you need to square root a negative number; but what if it does arise? How would that even happen?


Well, usually you never really need to square root a negative number. But when plotting quadratic graphs it is always a possibility that the square root of a negative may come up.


You may remember that if b²-4ac < 0 then the quadratic has no real roots, emphasis on the word no real roots. A quadratic equation will always have roots, just imaginary numbers will be involved if b²-4ac < 0.


But what is an imaginary number? It is denoted by the character i and this is representative of √-1. Like all square roots, √-1 has two answers, ±i.


So say, for example we had a quadratic equation where b²-4ac < 0. We could, in fact, solve it. If we had a quadratic equation, 3x²+8x+11=0 we could solve this by completing the square or using the formula, I prefer to complete the square but you would get the same outcome regardless:

If you do not understand this, do not panic! Simply submit a
comment and I will respond, explaining how to do this using
other methods.
Okay, it allows you to discover solutions to previously impossible quadratics, big woop? Well, imaginary numbers are in fact incredibly important! The Schrödinger Equation (the fundamental equation in quantum mechanics) using imaginary numbers. 

The Schrodinger Equation

Engineers also using imaginary numbers as a way to view "phase", this is however denoted by 'j' as 'I' is used for current. Potential energy is also necessary to be seen when carrying out these calculations, this creates a complex number in the form, a+bi, where 'a' and 'b' are integers and 'i' (or 'j'!) is an imaginary number.

But how are complex numbers represented? They are represented as numbers on a complex plane, with the x-axis being the real axis and the y-axis being the imaginary axis. It is rare that you would find an imaginary number used on its own, it will often be in partnership with another, regular number, as a complex number.
The representation of a complex
 number on a complex plane.
Imaginary Number Facts:
  • You can in fact do xi, it isn't the easiest thing to do, but it is perfectly possible and you will be able to it after a little bit of practice, for the whole breakdown on why please visit my newer blog post: imaginary exponents.
  • Another noteworthy idea is that an imaginary number can also be square rooted! These are roughly (0.707106+0.707106i) and (-0.707106-0.707106i), or as a fraction (1/√2)(1/i) and (-1/√2)(1/i). Try to square them, you will see it works.
  • Imaginary numbers follow a pattern when put to differing powers, this pattern goes: 1, i, -1, -i. You can find out what ix is simply by checking what the remainder is when x is divided by 4. If the remainder is equal to 0 then it will equal i. If it has a remainder of 1 then the answer will be 1, remainder 2 will equal -1 and finally a remainder of 3 will be -i.

Monday, 28 March 2011

Maths and the Real World

"Go deep down into anything and you will find mathematics" - Dean Schlicter


Often a lot of students who first begin algebra or quadratic equations fail to see how this has any implications on the real world. The aim of secondary school seems less to inform about the uses and necessities of mathematics and more on driving the knowledge into your head.


But maths in all its bewildering complexity and brute simplicity is all around us whether we choose to acknowledge it or not. Science is all compromised from formulas and predictions, all of which is algebra. Some of the greatest and most eloquent works in science are equations.


The basis of quantum mechanics, the Schrödinger Equation,  is a relatively complex form of algebra involving constants and variables to plot possible points at which a particle can be at. Almost the entirety of mechanics relies on inputting numbers to calculate forces and other movements. And engineering is virtually completely maths. The importance of algebra is clear for all to know.
Obviously this is incredibly advanced and I do not want
you to focus too much on the content and meaning of the
equation, more on the algebra behind it and how this can
be used, regardless of the difficulty level
.
However, my love for maths does not come from number crunching. Altering one number into another via some function, is of course the most obvious way in which maths is related to everything, but it is not the beautiful way.


Bertrand Russell famously said that: "Mathematics, rightly viewed, possesses not only truth, but supreme beauty". And the majesty that maths holds can be represented by the elegance of space. Space is perhaps one of the only ways to think of infinity, the size of which we can currently see is 46 billion years, or around 45,000,000,000,000,000,000,000,000 kilometres in radius. Estimates of planet sizes, dark matter and even black holes; all are only possible with maths and how it is implied to the real world and the universe.

Nature also likes to throw in a little bit of maths occasionally, times of the year when animals hibernate and mate are often prime years as they're harder to predict because of a lack of a pattern. The fibonacci spiral is seen in many natural phenomena, as well as perfect shapes occurring regularly.
The fibonacci spiral is seen in many shells, the stretch that
maths has really has no limit
.

I will also do a future post discussing the economy, how it works and how maths is applied to that.

Thursday, 24 March 2011

Python: Interaction and Variables

The majority of programs require some form of question and answer based interaction. And in Python it is a must know, it is also very easy to get to grips with too.

All variables have to be defined so they can be called up at a later stage in your program, this itself is not overly useful (other than perhaps when a large variable consistently comes up, like Pi).

This is no different with variables that need interaction. It is used so that whatever value the user inputs can be called up at a later point, makes sense right? There are only two main things you need to remember when setting interactive variables is whether the answer you want will be numerical or text based.
name = raw_input ("What is your name? ")
age = input ("How old are you? ")
The key differences here are 'raw_input' and 'input'. You use 'raw_input' for text based data and 'input' for numerical data, easy. The name is just what you apply to the variable that you use when you call it up, just remember that once the user inputs a name to this interactive variable it will not automatically be displayed, in order to do that you must print their variable, my example should make more sense.
name = raw_input ("What is your name? ")
age = input ("How old are you? ")
print "Hello,", name, age, "is a great age!"
This small program would look like this when ran:
What is your name? Mersenne
How old are you? 16
Hello, Mersenne 16 is a great age!
Remember how that if you want to show the solution to a mathematical problem you separate the problem with a comma? Well that's the same with variables you have defined, if you can remember these few simple rules you can begin to create more complex programs that involve user interaction.