Showing posts with label concepts. Show all posts
Showing posts with label concepts. Show all posts

Monday, 17 October 2011

Limitless e, Part Two

We have now this equation for working out the number of ones, \(y\)'s, \(y^2\)'s, \(y^3\)'s that you will get no matter how many brackets you start with (or rather, no matter to what power you try to raise those backets).

\[1+my+\frac{m(m-1)}{2\!}y^2+\frac{m(m-1)(m-2)}{3\!}y^3+\ldots\]

With a little thought we can see that this pattern is going to continue for \(y^4\)'s, \(y^5\)'s and every other power of \(y\).  Why?  Well each higher power of \(y\) is created by multiplying that many \(y\)'s together.  To make sure you create every possible combinations of rows you follow the procedure we established last time.  First you fix one \(y\),  then the rest of the available \(y\)'s, but one, and then you float the remaining \(y\) around all the the other columns available spaces.  Once you have used that last \(y\) in every available column, you change position of the \(y\) you fixed last, and then you float the remaining \(y\) again.  You keep going until your very first fixed \(y\) has been in every available column.

So the total possible rows you get for any power of \(y\) is the the same number of groups of columns (reducing by one each time to represent all the \(y\)'s slotting into place) multiplied together as the power. So if you want to know how many total rows that generate \(y\)'s to the power of two you have, you do (total columns) multiplied by (total columns less one).  If you want to know the same for \(y\) to the power four, you have (total columns) multiplied by (total columns less one) multiplied by (total columns less two) multiplied by (total columns less three).  You can see in each multiplication there are the same number of terms as the power of \(y\) you are trying to find.

Of course that just gives you the total amount of rows that will be generated.  You still need to get rid of the duplicates.  That can be achieved by dividing the total number of rows created in the last step by the total number of ways you can arrange that number of \(y\)'s together.  That will always be the total number of \(y\)'s (choices of position for the first \(y\)) multiplied by the choices of position for the second \(y\) placed, and so on down to the last \(y\) for which there is only one position left.  Remember we are talking about the different ways of organising the \(y\)'s in the spaces for \(y\)'s already in the lines generated by the procedure in the previous paragraph.  We are NOT organising the \(y\)'s in every possible space in those rows.  The number that does the dividing is always going to be the same number as we are raising \(y\) to the power of, multiplied by all the whole numbers between it and zero (because we are using up a \(y\) position each time.  We show this by using the \(!\) symbol after the number that starts that mutiplication.

We have already written down what the first four terms look like when we multiply \(m\) brackets together.  Having thought about the arguments above we can also say what ANY term of that equation will look like.  If we want to know the \(k\)th term we would change the symbol \(k\) in the following to the number of the term we wanted to know:

\[\frac{m(m-1)(m-2)\ldots (m-(k-1))}{k\!}y^k\]

That looks a bit tricky.  Previously we have seen that the dots in a row mean "and so on" when added onto the end of a series of numbers.  Here, albeit it appears between two terms in the top line of a division, it means exactly the same.  It just really means "keep putting in brackets with one more being deducted from \(m\) each time, until you get to the bracket where the number being deducted is one less than \(k\)".  We do not want to go all the way to \(k\) because then we would have one too many brackets being multiplied.

I am not just being lazy by not writing in all these brackets, I literally cannot do so because I do not know what value \(k\) has, so I do not know how many backets to write in until I pick a \(k\)! \(k\) may even be two, in which case I was wrong in writing in the \((m-2)\) bracket (because I should really have stopped at \((m-1)\) because one is one less than \(k\) when \(k\) is two). The idea behind the way that I have written that line is that I have given all the clues that will be needed for the whole line to be constructed once \(k\) is known, even if I have to add in or subtract brackets.

What happens if we set \(k\) to four?   We get this:

\[\begin{align}
&\frac{m(m-1)(m-2)\ldots (m-(4-1))}{4\!}y^4\\
&\frac{m(m-1)(m-2)(m-(3))}{4\!}y^4\\
&\frac{m(m-1)(m-2)(m-3)}{4\!}y^4
\end{align}\]

That is the term that will always tell us the number of \(y\) to the fourth powers once we multiply out our brackets.  If we say that we have four brackets, like we had above, \(m\) will be four, and the number of \(y\) to the fourth powers will be:

\[\begin{align}
&\frac{4(4-1)(4-2)(4-3)}{4\!}y^4\\
&\frac{4(3)(2)(1)}{4\!}y^4\\
&\frac{4(3)(2)(1)}{4\cdot 3\cdot 2 \cdot 1}y^4\\
&\frac{24}{24}y^4\\
&1\cdot y^4
\end{align}\]

Or, one \(y^4\).  Which if you look above you will find is exactly the number we were expecting.  So or logic seems sound.  If you are a bit devious of mind, you may well ask, "what happens if I set \(k\) to be more than \(m\)", or in other words, what if I ask this equation how many \(y^4\)'s I will get when I am only multiplying together, say, two brackets.  The answer must be zero, because to get to \(y^4\) you must be multiplying four \(y\)'s together.  If we only have two brackets, we will only have, at most, two \(y\)'s to multiply together.  So what does this look like?

\[\begin{align}
&\frac{2(2-1)(2-2)(2-3)}{4\!}y^4\\
&\frac{2(1)(0)(-1)}{4\!}y^4\\
&\frac{0}{4\!}y^4
\end{align}\]

Anything multiplied by zero is zero. So it doesn't matter what else we have in the top line of that division, as soon as a zero hoves into view the whole thing turns to zero.  Zero divided by anything (apart from zero) is also zero.  So we end up with zero \(y^4\)'s.  Which is what we expected.  We can also say that if \(m\) is less than \(k\) we will always end up creating at least one bracket on that line where a number equal to \(m\) is subtracted from \(m\), which reduces the whole thing to zero.

So we are finally able to restate our limiting definition of \(e^x\):

\[\begin{multline}
e^x=\lim_{m \to \infty} 1+my+\frac{m(m-1)}{2!}y^2+\frac{m(m-1)(m-2)}{3!}y^3+\ldots\\
+\frac{m(m-1)(m-2)\ldots (m-(k-1))}{k!}y^k
\end{multline}\]
(Remember that we have defined \(y=\left (\frac{x}{m} \right )\), so we need to replace every \(y\) accordingly)

We have now got rid of the pesky raising to the power, but we still have the problem of this being a limiting function. Let's see if we can get rid of that.  How do we do that? What I am going to do is just say, "to hell with approaching infinity let's just make \(m\) infinity and see what happens". In particular I am going to look at each term in turn to see whet effect infinity has.

The first is always one.  We agreed that no matter how many times you multiply one by one you still get one.

The second is \(my\) at the moment, but we need to reintroduce \(\left (\frac{x}{m} \right )\).  This makes it:

\[m\cdot \frac{x}{m}\]

That is also:
\[\begin{align}
&\frac{m}{1} \cdot \frac{x}{m}\\
&\frac{m\cdot x}{1\cdot m}\\
&\frac{m\cdot x}{m\cdot 1}\\
&\frac{m}{m}\cdot \frac{x}{1}
\end{align}\]

So no matter what \(m\) is, even infinity, once you divide it by itself you get one.  So the second term is going to be \(x\) an its own. It has to be because the two infinte \(m\)'s cancel each other out.

Let's look at the third term now:

\[\begin{align}
&\frac{m(m-1)}{2!}y^2\\
&\frac{m(m-1)}{2!}\cdot \left (\frac{x}{m}\right )^2\\
&\frac{m(m-1)}{2!}\cdot \frac{x^2}{m^2}\\
&\frac{m(m-1)}{m^2}\cdot \frac{x^2}{2!}
\end{align}\]

We can just swap around the bottom of those fractions because we are mutiplying them together. Look back up the the discussion about the last term if you want to see the steps. We would just have brought these together into one big division, reoganised the order of the terms and then separated out into these two fractions. Ok. Let's set \(m\) equal to infinity.

look at the first part of that multiplication.  We are setting \(m\) to infinity.  If we do that then \((m-1)\) is still infinity because infinity minus one is still infinity. Agreed? Given that is the case, we get:

\[\frac{\infty(\infty-1)}{\infty^2}\cdot \frac{x^2}{2!}\]

All together now, what is infinity minus one? Yes! Infinity. So we actually have:

\[\frac{\infty(\infty)}{\infty^2}\cdot \frac{x^2}{2!}\]

Which is:

\[\frac{\infty^2}{\infty^2}\cdot \frac{x^2}{2!}\]

What is anything (even infinity squared) divided by itself? Yes - one.

\[1\cdot \frac{x^2}{2!}\]

So the horrible looking third term actually just dissolved down to a nice simple looking fraction. This is also going to be our pattern. Think about it. We have exacly the same number of brackets on the top line of each division as the power we raise the \(y\) to which is multiplied by that division. So here we had two brackets and we squared \(y\). Next time we add a power and a bracket, because we have three brackets and we cube \(y\). This pattern continues. It means we can always be sure, no matter which term in this infinitely long series that we are looking at, that the power of \(m\) on the bottom of the fraction exactly balances the number of brackets containing \(m\) on the top of the fraction. When we set \(m\) to infinity that makes all the brackets on the top contain infinity, no matter what number they try to decuct from infinity. And that means that we have the same number of infinities multiplying together on the top and bottom of the division. If we have the same on the top and bottom we know that just equals one.

So we can say that when we set \(m\) to infinity, the \(k\)th term (assuming that the term at the very beginning is the zeroth term) of the series is \(\frac{x^k}{k!}\), which looks very neat indeed. So we can now write out \(e^x\) as an infinite series:

\[e^x=1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\frac{x^4}{4!}+\ldots\]

If only we could write the first two terms of the series in the form \(\frac{x^k}{k!}\) we could even write out a nice summation symbol for all this. Well, let's just see. The first term (as opposed to the zeroth term) is \(x\). What would happen if we tried to work out the first term using our rules? Well, it would be \(\frac{x^1}{1!}\). One factorial (\(1!\)) is just one. And \(x\) to the power of one is just \(x\). So we end up with \(\frac{x}{1}\) which is just \(x\) which is exactly what we want - so that works fine.

How about the zeroth term? Well we agreed ages ago that anything to the power of zero is one. That applies just as much to \(x^0\), so our rule \(\frac{x^0}{0!}\) becomes \(\frac{1}{0!}\). But surely \(0!\) is zero, right?

Nah. We assumed that anything to the power zero was going to be zero, but it turned out to be one. Same thing happens for much the same reason here. Here's what happens.

Any normal factorial, \(3!\) or \(2!\) for instance, is just the factorial of the number one smaller mutiplied by the number of the factorial. So \(3!=3\cdot 2!\), and \(2!=2\cdot 1!\). If \(0!\) was zero, then this would not work with \(1!\), because that would turn into \(1\cdot 0!=1\cdot 0=0\) when we know that it is actually one. So to preserve the way the whole factorial system works, \(0!\) has to be one.

Going back to the zeroth term (\(\frac{1}{0!}\)) this gives us \(\frac{1}{1}\), or one. Which is the first term in our series. Woopee!

This means we CAN write the sum which generates the series like this:

\[\sum_{k=0}^\infty \frac{x^k}{k!}\]

What we are trying to do here is state what \(e^x\) is. So let's test all this with \(e^1\). Looking at our sum we can see that the \(x\)'s all appear on the top of the fractions. So all we need to do is replace them all with ones. So:

\[e^1=1+1+\frac{1^2}{2!}+\frac{1^3}{3!}+\frac{1^4}{4!}+\ldots\]

And of course one to any power is just one, so this simplifies to:

\[e^1=1+1+\frac{1}{2!}+\frac{1}{3!}+\frac{1}{4!}+\ldots\]

Let's work out those factorials:

\[e^1=1+1+\frac{1}{2}+\frac{1}{6}+\frac{1}{24}+\ldots\]

So we can see roughly what is going on, we'll stick to the first five terms here. We'll also convert them all into twenty fourths:

\[\begin{align}
e^1 &\approx \frac{24}{24}+\frac{24}{24}+\frac{12}{24}+\frac{4}{24}+\frac{1}{24}\\
e^1 &\approx \frac{65}{24}\\
e^1 &\approx 2.708333333
\end{align}\]

Well, that's not bad at all after only five terms. It is definitely heading in the right direction. Let's sum up then. We have gone from:

\[e=\lim_{n \to \infty} (1+\tfrac{1}{n})^n\]

to

\[\sum_{k=0}^\infty \frac{x^k}{k!}\]

or

\[e^x=1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\frac{x^4}{4!}+\ldots\]

Monday, 10 October 2011

Limitless e, Part One

Limitless e

So last time we worked out HOW to raise the number \(e\) to an imaginary power - specifically the imaginary power that we are focussed on namely \(e^{x}\). We were still using our definition of e as the limit of a function when one of the variables increased in size towards infinity. This function:

\[e^{x}=\lim_{m \to \infty} (1+\tfrac{x}{m})^{m}\]

That function was a little different to our first definition of \(e\) because it is actually the function that gives us \(e\) to the power of \(x\). Which is handy. When we ran through everything I decided that while the function seemed to work perfectly it did not actually tell us anything about WHY these numbers combine in this fashion.

So let's take a different tack. Let's stop defining \(e\) as the limit of a function as you change a variable. Let's try to define it purely in terms of a one variable function. In otherwords, what I want to do is get rid of the \(m\) in the above function.

Right-o. How do we do that? Well, what we have is this:

\[(1+\tfrac{x}{m})^{m}\]

We want to get rid of the \(m\). The \(m\) just tells us how many times we need to multiply together the stuff in the brackets. Let's say that \(m\) was two. The function would look like this:

\[(1+\tfrac{x}{2})^{2}\]

Which would expand into this:

\[(1+\tfrac{x}{2})\cdot (1+\tfrac{x}{2})\]

Now we have the same kind of problem as the red and blue baskets with apples and oranges in them. Only this time we have exactly the same things in each bracket. it doesn't change the way we deal with it though, we just need to unpack the first bracket like this:

\[1\cdot (1+\tfrac{x}{2})+\tfrac{x}{2}\cdot (1+\tfrac{x}{2})\]

And then we can unpack the second bracket like this:

\[1\cdot 1+1\cdot \tfrac{x}{2}+\tfrac{x}{2}\cdot 1+\tfrac{x}{2}\cdot \tfrac{x}{2}\]

Which turns into:

\[1+ \tfrac{x}{2}+\tfrac{x}{2}+\tfrac{(x)^2}{2^2}\]

And finally:

\[1+ 2\cdot \tfrac{x}{2}+\tfrac{x^2}{4}\]

That's fair enough, and perfectly logical. However, what we want to do is not just multiply two brackets together, but to multiply \(m\) brackets together. How on earth do we do that? What we are going to do is to look closely at exactly what we get out of the brackets when we multiply them together, and how that changes when we add more and more brackets to the mix. We want to see if we can work out a general rule to tell us what we will get without having to go through all that tedious multiplication and addition that I just did above.

To help us with this process I am going to simplify our brackets a bit. Instead of \((1+\tfrac{x}{m})\), which is a bit of a mouthful, I am going to replace the \(\tfrac{x}{m}\) bit with the letter \(y\). So our bracket now looks like this: \((1+y)\). That's much nicer to look at. All we have to do is remember that when we are finished, we need to replace \(y\) where ever we find it with \(\tfrac{x}{m}\).

Right, to get a feel for what we are talking about lets look at three examples, \((1+y)^2\), \((1+y)^3\), and \((1+y)^4\). I won't do much talking in between, let's just have a look at the logical steps.

First of all \((1+y)^4=(1+y)\cdot(1+y)^3\), and \((1+y)^3=(1+y)\cdot(1+y)^2\). So we just need to work out the power two answer and then multiply through by another bracket, and so on. So, power two:

\[\begin{align}
&(1+y)^2\\
&(1+y)(1+y)\\
&1(1+y)+y(1+y)\\
&1\cdot1+1\cdot y+y\cdot1+y\cdot y\\
&1+y+y+y^2\\
&1+2y+y^2
\end{align}\]

Now power three:

\[\begin{align}
&(1+y)(1+2y+y^2)\\
&1(1+2y+y^2)+y(1+2y+y^2)\\
&1\cdot 1+1\cdot 2y+1\cdot y^2+y\cdot 1+y\cdot 2y+y\cdot y^2\\
&1+2y+y^2+y+y(y+y)+y^3\\
&1+2y+y^2+y+y^2+y^2+y^3\\
&1+2y+y^2+y+2y^2+y^3\\
&1+2y+y+3y^2+y^3\\
&1+3y+3y^2+y^3
\end{align}\]

Now power four:

\[\begin{align}
&(1+y)(1+3y+3y^2+y^3)\\
&1(1+3y+3y^2+y^3)+y(1+3y+3y^2+y^3)\\
&(1+3y+3y^2+y^3)+y(1+3y+3y^2+y^3)\\
&1+3y+3y^2+y^3+y\cdot 1+y\cdot 3y+y\cdot 3y^2+y\cdot y^3\\
&1+3y+3y^2+y^3+y+3y^2+3y^3+y^4\\
&1+4y+3y^2+y^3+3y^2+3y^3+y^4\\
&1+4y+6y^2+y^3+3y^3+y^4\\
&1+4y+6y^2+4y^3+y^4
\end{align}\]

Let's summarise what we have found so far:

\[\begin{align}
(1+y)^2&=1+2y+y^2\\
(1+y)^3&=1+3y+3y^2+y^3\\
(1+y)^4&=1+4y+6y^2+4y^3+y^4
\end{align}\]

Can we start to describe our results? Well, first of all each result starts with a one. Secondly each result ends with a single \(y\) to the same power as we were raising the bracket to. Thirdly, inbetween, the one and the single \(y\) we have some amount of every power of \(y\). In other words, reading from left to right, you have no \(y\)'s, then some number of just \(y\) and then some number of \(y^2\) then \(y^3\) and so on. We never miss a power of \(y\).

These are all fairly obvious. The last observation may have passed you by. Look at the numbers we multiply the \(y\)'s by. They are symmetrical! In the third power row you get three three, and in the fourth power row you get four - six - four. This is promising, because it suggests that there is a pattern to be discovered! Let's have a try at working out how we get to those numbers.

Why does each line start with a one? Remember the process that we used to generate these lines. We are multiplying together numerous brackets. The way we multiply brackets together is to multiply the individual terms in each bracket by every other term in all the other brackets. That's easy for only two brackets, because in each multiplication you only have two things being multiplied. With three or four brackets, we are going to have three or four items being multiplied.

To generate the first row above we went throught the whole term by term routine, but then when generating the other lines, we just mutlpied the last line by another bracket as a short cut. Let's actually look at what would have happened with three brackets, from scratch as it were:

\[(1+y)(1+y)(1+y)\]

First we multlply the first term in each of the brackets:

\[1\cdot 1\cdot 1\]

That gives us our number one. The more brackets you have the more ones go into that multiplication, but even with \(m\) number of ones in that multiplication the result is still going to be one. That's where the one comes from. What next? Lets have the first terms of the first two brackets and then the second from the last:

\[1\cdot 1\cdot y\]

That gives us a y on it's own (the ones just collapse down to tell us we end up with one multiplied by \(y\)). And the same thing will happen when the \(y\) in the middle bracket is multiplied by the ones in the other two. That looks like this:

\[1\cdot y\cdot 1\]

And finally we will also get the same result from choosing the \(y\) in the first bracket and ones in the last two:

\[y\cdot 1\cdot 1\]

If we then add up all those \(y\)'s we end up with, drumroll, \(3y\), which is what we were expecting. If you think about it there is no way for us to get any other individual \(y\)'s. There are only two options from each bracket a one or a \(y\). And if you multiply two or more \(y\)'s together you cannot end up with a \(y\) as opposed to a \(y^2\) or a \(y^3\). So the only options for getting \(y\)'s are to pick only one \(y\). We can only do that for as many brackets as we have. So that means if we have \(m\) brackets we will get \(m\) \(y\)'s. So far, with \(m\) brackets, we can say that we will have:

\[1+my+\ldots\]

If we move onto \(y^2\)'s things get a bit trickier. We have to keep track of all the combinations we have tried so far, and that is getting complicated. So I am going to use a table to keep track of things.


That shows us the result for the first line. Now let's add on the other options that we have worked through so far:


In order to do things as systematically as possible when using multiple \(y\)'s, I am going to fix one, and then move the other one around. This means that I won't accidentally miss any of the possible arrangements. I'll fix one in the third bracket first, putting the other bracket in the second and then first brackets:


Good. Now lets put the fixed \(y\) in the second bracket, and we'll use the last and then first for the other \(y\):


And last of all we will fix the \(y\) in the first bracket and use the last and then second brackets for the other \(y\):


Hang on. We have ended up with six \(y^2\)'s. We were only expecting three. What has gone wrong? If you look at the first and third \(y^2\) rows you will see that they are identical. They both represent a one in the first bracket mutiplied by a \(y\) in the second and third brackets. But once we have done that combination once, we can't do it again. So we have over estimated. If you look closely, you will see that each \(y^2\) line is duplicated once. Because we have twice as many \(y^2\) as we need we need to divide the result by two. Six divided by two is three, which IS what we were expecting. Why did we end up with twice as many as we were expecting? Look at this line:


How did we create that twice? Well once we had the fixed \(y\) in the first column, and then we had it in the second column. But both times we generated the same row. There are two \(y\)'s in the row, so there have to be two copies of the row in our whole table. Why? You have one copy for when the first \(y\) is fixed and one copy for when the second \(y\) is fixed. Good.

Next question. How did we end up with six rows? Well we were creating our rows by a careful systematic process. FIrst we picked a row for the fixed \(y\). We had three rows to choose from. Then we placed our floating \(y\). We no longer had three rows to choose from, because the fixed \(y\) was taking up a row. So we had one less that three, or two, rows to choose from. For each of the rows the fixed \(y\) was in, we had two options for the floating. That gave us three multiplied by two, or six total rows. Can we then come to any conclusions about the number of \(y^2\)'s we will have with \(m\) number of brackets?

We will have \(m\) choices of rows for our first \(y\), and then \(m-1\) options for our second \(y\). We will, however, end up with more rows then we need, because we will get one for each possible rearrangement of the fixed and floating \(y\)'s. With two possible \(y\)'s (fixed and floating) there are two possible ways to position them in each different row. So if the total variety of rows we get are \(m\) multiplied times \(m-1\), we then need to divide that by the number repeated rows, which for two types of \(y\) will be two. So we can say that the total number of \(y^2\)'s we will get is \(\frac{m(m-1)}{2}y^2\). We can add that on to our running total like this:

\[1+my+\frac{m(m-1)}{2}y^2+\ldots\]

Let's pause for a moment and check that this works with two brackets. With two brackets \(m=2\) so we get:

\[\begin{align}
1+2\cdot y+\frac{2\cdot (2-1)y^2}{2}+\ldots\\
1+2y+\frac{2\cdot (1)y^2}{2}+\ldots\\
1+2y+\frac{2\cdot y^2}{2}+\ldots\\
1+2y+\tfrac{2}{2}\cdot y^2+\ldots\\
1+2y+1\cdot y^2+\ldots\\
1+2y+y^2+\ldots
\end{align}\]

So far so good - that's what we got when we did it manually - but what about the \(\ldots\) bit? Given that we do not need it (because the first three terms are all we need) it must be zero, so we will see why next time.

Just before we go onto the next one, with our current table, there will be one final line to add:


That just confirms for three brackets multiplied together that we will end with one \(y^3\), becuase with only three brackets to choose from there will only ever be one way of multiplying one item from each to get a \(y^3\) and that is by choosing \(y\) in each bracket.

Right. On to four brackets. Let's think about our table. The first row is going to be all ones, representing the only way you can multiply all the ones together. Next will be the rows with one \(y\) in each row. There will be four rows of them, because there are four sets of brackets to choose an individual \(y\) from. Lets show that now:


Same old, same old. Now lets do the \(y^2\)'s. Just like last time, we will fix one \(y\) and then float one \(y\) around. This looks like this:


So you can see that for every \(y_{fixed}\) we have the other \(y\) in each of the other columns. So the total number of rows should be four multiplied by four minus one (three). That comes to twelve which is exactly the number of rows we find above. Excellent. As with the last time, if you ignore the disctinction of \(y_{fixed}\) as opposed to \(y\), you have twice as many rows than you need, because you can rearrange \(y\) and \(y_{fixed}\) in two ways for each possible row. So again you need to divide by two. Twelve divided by two is six, which is just what we found when we did this manually.

Now. What about \(y^3\)? Before we start, lets think through logically that should happen. We will have three \(y\)'s to choose from the brackets available. If we do the same as last time we will fix one \(y\), from four different options, but then we will have two other \(y\)'s to pop in. For the second \(y\) you have one less brackets to choose from. And for the third \(y\) we have one less bracket again to choose from. So the total number of rows we will generate is four multiplied by three multiplied by two. That's going to be twenty four in total. How many duplicates are we going to get? Well, for each possible unique row we have three places for \(y\)'s. Does that mean we get triple the number of rows we need instead of double like last time? No.

Obviously, we can't be right, because we already know the answer is four (from when we did it manually above). But twenty four divided by three is eight, not four. Four is twenty four divided by six not three. So where does the six come from? If you have a row with three \(y\)'s in it, how many different ways can you order the \(y\)'s? With one \(y\) there was only one way to put it in a row with one space for it, so the answer is one. With two spaces and two \(y\)'s, you can place the first \(y\) in two places, with the other one falling into the only remaining place. So the answer is two multiplied by one, or two. For three \(y\)'s you have three choices for the first \(y\), then two places for the second \(y\) and only one for the last \(y\). The answer is then three mutiplied by two mutiplied by one. That comes to six, which is the number we predicted. So we can say that the total possible number of rows is going to be \(m\) (for the first \(y\)) multiplied by \(m-1\) (for the second \(y\)) multiplied by \(m-2\) (the places left for the last \(y\)). Each row generated by that process has three \(y\)'s in it. There are three multiplied by two mutiplied by one ways to organise three \(y\)'s in three places, so we end up with six times as many rows as we need.

The number of \(y^3\)'s generated from \(m\) brackets is going to be \(\frac{m(m-1)(m-2)}{6}y^3\). We get the six from three times two times one. So we can expand our formula to:

\[1+my+\frac{m(m-1)}{2}y^2+\frac{m(m-1)(m-2)}{6}y^3+\ldots\]

If it wasn't obviously already, when we are looking at higher and higher powers of \(y\) from more and more brackets, this pattern is going to continue. For whatever power of \(y\) we are interested it, we are always going to have the total number of possible columns available for each \(y\) you need to place. That will always be one fewer as you place the \(y\)'s. For each of the unique lines that process generates, there will the same number of copies as there are ways to organise the number of \(y\)'s that you are placing.

We are stuck with the complicated \(m(m-1)(m-2)\ldots (m-(m-1)\) mess, but can we do anything with the three mutiplied by two mutiplied by one stuff? The answer is yes. This kind of stuff crops up from time to time, and there is a simple notation for it. You just write \(3!\) to represent three mutiplied by two mutiplied by one and \(4!\) is four multiplied by three mutiplied by two mutiplied by one. And so on. That turns our formula into:

\[1+my+\frac{m(m-1)}{2!}y^2+\frac{m(m-1)(m-2)}{3!}y^3+\ldots\]

Which is a bit neater. We'll see where this takes us next time.

Monday, 5 September 2011

Polar Form, Rectangular Form and TRIGONOMETRY

So how have we finally come to a topic called trigonometry. Is this not just a hellish torture for school pupils who have to learn crap mnemonics? Well, not quite.

Last time we looked at the two forms of complex numbers. The rectangular form identified the location of our complex number on the complex plane by it’s real and imaginary parts. You mark them off on the relevant axes, and then draw a rectangle. The corner opposite the origin (the zero point) is your complex number. Fine. The other way to describe EXACTLY the same number, the polar form, was to note down which direction to point in at the origin and then how far to move to get to the number. So with the rectangular form you draw a rectangle, with the polar form you draw a line at some angle.

So we need to describe the angle when placing a value on our complex number. I picked a really easy complex number to get to last time, which was just at a \(45^{\circ}\) angle, or one eighth of the whole circle. I could work out the angle without any particular bother, because the real and imaginary parts of the number were the same. If we are dealing with any other complex numbers, we will need to deal with more complicated angles. How, then, would we go about converting any complex number in rectangular form to polar form and vice versa?

First of all I like to ask the question “Can we do that?” I mean, do we have enough information available to actual perform the task? For instance, I once struggled for quite some time trying to work out how to get the area of a piece of ground when the only information I had was the lengths of each of the four sides. I was staring idly into space trying to get an answer when my eyes focused on the mechanism use to automatically close my door. I am talking about the things described in this article. I realised that the two arms of the door closer, the door frame and the door itself made up four fixed length sides of an area. However I saw when the door opened and closed that the area enclosed by the sides went from very long and slim to very broad and fat. The area was obviously changing depending on the angles. I then stopped trying to find a solution to the area of the ground, because I realised that I could not find one without some more information, namely the angles between the sides of the area of ground.

(Second reasonable question, why are we doing this? It turns out, as we will see, that it is dead easy to add complex numbers in rectangular form, but hard to multiply them. Conversely it is easy to multiply numbers in polar form, but hard to add them. So if we can swap between the two forms, we get the best of both worlds. Also, it turns out that the process of converting between sides and angles is going to be key to the understanding of this whole project, so we will have to look at all this eventually.)

So, do we have enough information from the angle and length only to derive the length of the sides of the rectangle? Lets draw out roughly what I am talking about:

[pic of rect and polar]

See the polar form line? It has a fixed angle and length? What happens if we change either the angle or the length? The point that the line reaches will change won’t it? And if that point changes, then the lengths of the rectangle that reach that point will also have to change? Yes. And vice versa, if we change the lengths of either of the sides of the rectangle, that will force the length AND the angle to change as well? Yes. So one set of rectangle lengths is equal to one, and only one, set of line and angle sizes. So, if we have the rectangle lengths OR the angle and line length, we DO have enough information to work out the one from the other. Good stuff. At least this won’t be an afternoon wasted.

Let’s start with the number \(\sqrt{5}\angle 30^{\circ}\). How do we find the rectangular form of this number? Let’s see what it looks like first:

[pic of number]

Well, it looks like it ends up at roughly our old friend \(2+i\), but I may not have drawn the line with sufficient precision. Is it exactly \(2+i\)? The first thing to do is to test that the length of the line fits. When we convert to rectangular form, we are dealing with a right angled triangles. Why? Because a defining characteristic of rectangles is that they have four right angles in them. So with the rectangular form that we are converting to, the angle where the line from the number hits either the real or the imaginary axis will be a right angle. The absolute value line cuts through the middle of this rectangle creating two triangles. Pythagoras’ theorem tells us that the square of the length of the absolute value line must equal the square of the lengths of the other two sides added together. The other two sides are of course, the size of the real and imaginary parts of the number marked off on those axes.

We said that it looks like our candidate number is \(2+i\), so if we guess that the other two sides have lengths of two and one, then we get \(2^2=4\) and \(1^1=1\) and four plus one is five, and we know our line is \(\sqrt{5}\) long, so that fits. It does appear that \(2+i\) is correct. But, it only MIGHT be correct. There are lots of points which have a line length of \(\sqrt{5}\); they lie on a circle with that radius. That circle goes through the number \(2+i\). Because the circle goes through that number it also goes through other numbers that are very very close indeed to \(2+i\) (actually as close as you like). That means that just because our line length fits our guess, we cannot stop there. We need to confirm that the angle we have, \(30^{\circ}\) points directly at the number \(2+i\) and not to a number very close to it.


So how are we going to do this? Well, let's try to work out what the relationship is between the size of the angle, and the real and imaginary parts of the complex number. In other words, if you change the size of the angle, what happens to the size of the real and imaginary parts? Remember, though, we are looking only at changes in the real and imaginary parts and the angle, so we will be leaving the length of the line itself fixed so it cannot be a factor in what happens.

Right. If we have a fixed length, and a varying angle at one end, what is going to happen to the other end of that line? Glittering prizes for anyone who said it will mark out a circle. Remember that our definition of a circle was all points a fixed distance from a fixed point? Here we have that fixed point, the origin, and a fixed distance, the length of the line attached to the origin (otherwise known as the absolute value of our complex number). And we also just said above that there are lots of points with a length of \(sqrt{5}\) which lie on a circle with that radius about the origin.

As our angle increases, one point remains at the origin, and the other point will trace out the shape of a circle around the origin.

[pic] [pic] [pic]

This all looks a bit messy with the square root floating about there. Even if the absolute value was something nice like two or seven, rather than a square root, if we study this arrangement in detail we will only be able to draw conclusions about this arrangement. We want to be able to reach more general conclusions that will help us find out what angles do to the real and imaginary parts of complex numbers with ANY absolute value. We therefore want to get rid of the square root. To get rid of it, I am going to shrink the circle down so that it just has a radius of one. The units we use are unimportant. This is OK, as long as we remember that we need to scale all the other measurements to get answers. The good news is that we do not need to do any scaling on the angle. Angles do not change when the size of the things meeting at an angle change. Basically any rules that we discover about the behaviour of the line lengths and angles here, will be true for bigger circles, as long as we remember to scale them back up properly. So our circle now looks like this:

[pic]

Lets give the various things we are going to talk about some names. A circle with a radius of one, is known as a unit circle. We also have an angle here, which I am going to call Angie, because I am sick of one letter names for variables. Let’s call the line with unchanging length Abby. Abby is one unit long. Good. Now remember that the circumference of a circle is \(\pi\) times the diameter. The diameter here is two Abbies. So the whole circumference is \(2\cdot \pi \cdot Abby\). But we have already decided that Abby is one, so that makes the circle \(2\pi\) long.

Next we are going to name the point where Abby meets the circle, Polly. As Angie changes in size Polly is going to move around the circle. We can then draw two new lines along the real and imaginary axes. The line on the real axis corresponds the Polly’s real value, and the one on the imaginary axis corresponds to Polly’s imaginary part. The real axis line we will call Raul, and the imaginary axis line we will call Imogen. This all looks like this:


OK, starting places please! Where does Polly start if the angle is actually closed all the way? We agreed that we start measuring angles on positive side of the x axis, so Polly will be on the circle where it meets the positive real axis here:


Now, what can we say about our characters at this size of Angie? Well, Raul is one unit long, all the way to Polly. Imogen is actually zero, because Polly has not lifted off the real axis. So this number on the complex plane at Polly, has no Imaginary part – in other words it is just a real number. Now let’s open up the angle to one quarter of the circle. Polly is now right at the very top of the circle. It is now Raul's turn to be zero, and Imogen is now exactly one unit long because Polly is actually ON the imaginary axis, directly above the origin. Now the number has no REAL value.


You can see in the picture that the computer has written Imogen and Abby on top of each other because with this size of Angie, they are actually exactly the same size.

If we move Polly further round the circle, anticlockwise, Imogen is going to start shrinking, and Raul is going to start growing into a negative length:


So in that picture Raul is now negative because it is to the left of the zero on the real axis. We can keep picturing what happens to Raul and Imogen at different sizes of Angie, OR we could calculate what happens for each of the three hundred and sixty different whole angles, and then make an animation of the result. That would be handy.



So as the angle increases in size, Polly travels around the circle, Raul grows, while Imogen shrinks, until Raul is at maximum size, and Imogen at zero, and then the process reverses. At any point, either Raul or Imogen is growing and the other shrinking. The important fact to notice is that any point on the circle has a unique value of both Raul and Imogen. This means if you are given the lengths of Raul AND Imogen, you can work out the size of the angle. Can you do that if you are only given the size of Raul OR Imogen? No. Say you are told that Imogen is half a unit long. Well, Imogen is half a unit long twice - first on the way UP to Polly being at the top of the circle, and second on the way DOWN from Polly being at the top. So you also need to know something about Raul (whether it is positive or negative), to tell whether the Imogen in question is that on the left or right of the imaginary axis. In fact, if all you know is whether Raul and Imogen are positive or negative, you can tell which quarter of the circle Polly will be on. For instance, if both are positive, Polly will be in the first quarter. If Raul is negative, but Imogen is Positive, Polly will be in the second quarter. If both are negative, Polly is in the third quarter, and if Raul is positive but Imogen negative, Polly will be in the fourth and final quarter.

Let’s talk about Polly’s journey as well. When Polly reached the very top of the circle, we said that Angie was one quarter of a circle. How far has Polly traveled? Remember that Polly is stuck on the circle. So if we ask how far Polly has traveled to get to the top of the circle, what we are really asking is what is the length of that quarter of the circle. How do we find that out? Well, remember that we know, exactly, how long the circumference of our unit circle is. It is \(2\pi\) long. So a quarter of that total distance would be \(\tfrac{1}{2}\pi\), or \(\tfrac{\pi}{2}\). So the distance covered by Polly from the start to the very top of the circle is exactly \(\tfrac{\pi}{2}\) units. When Polly is all the way over at the left hand side, the total distance traveled is exactly \(\pi\) units. In fact, instead of talking about the amount of “turn” at the centre of the circle to define the angle, we could just talk about the distance covered by Polly. If we decided to do that, and I am going to do that from now on, we would be using something called radian measure. This just measures the distance around the circle in units called radians. There are exactly \(2\pi\) radians in the unit circle. So instead of saying \(180^{\circ}\), we would say \(\pi\) radians.

Let's quickly convert our polar form complex number into radians. It looks like this in degrees: \(\sqrt{5}\angle 30^{\circ}\). So what is thirty degrees in radians? It is going to be some fraction of \(\pi\). If \(180^{\circ}\) is \(\pi\) radians, then one degree is \(\tfrac{\pi}{180}\) radians. That means that thirty degrees is just thirty times that amount, which is \(\tfrac{30\cdot \pi}{180}\). That's a bit of a mouthful though, and we can simplify it by spotting that one hundred and eighty can be divided up into six parts, each of size thirty. In other words, or mathematical notation, \(\tfrac{30}{180}=\tfrac{1}{6}\). What we have done there is to say that the ratio of thirty to one hundred and eighty is the same as the ratio of one to six. So there are six thirties in one hundred and eighty and six ones in six, so the ratios represented by both of those fractions are the same. Instead of \(\tfrac{30\cdot \pi}{180}\) radians, we can say \(\tfrac{\pi}{6}\) radians. Our polar form number using radian measure looks like this: \(\sqrt{5}\angle \tfrac{\pi}{6}\). We do not typically need to write radians after the angle units. If an angle does not have the degree symbol, and involves \(\pi\) in any capacity, you are safe to assume it is in radians.

I like radians because they are a much more sensible form of measurement. You can see exactly what they are on the unit circle. You could try to measure the size of an angle in radians using only a bit of string (lay it along the line of the circle one unit from the origin life it up and lie it flat along a ruler, there's your angle size). You can't do that with degrees.

OK, let's get back to the relationship between Angie, Raul and Imogen. If you want to find the size of Imogen for any given size of Angie, you just use a function with Angie as the input variable. Good, that sounds simple. What does the function look like then? The function is not the same as functions we have looked at before. These had letters in place of variables, and algebraic notation. In other words they were algebraic functions. You get different kinds of functions. Remember our very first function hotbeverage of drink flavouring? No algebra there was there? So what is the function we use to find the size of Imogen for any specific value of Angie? It is a geometric function, meaning that it involves drawing pictures. Just like the pictures above in fact. The steps in the function are:

Draw a unit circle on the real and imaginary axes, centered at the origin.
Start at the point where the circle meets the real axis on the positive side.
Moving along the unit circle until you have traveled the distance equal to the angle in radians.
Measure the height you are above, or as the case may be below, the real axis.
The distance is the value of Imogen you want.

This function has a name. It is called the sine function. None of this was explained to me in school. Exactly what the sine function was, was a complete mystery. It is hardly difficult. It only involves the measurement of two lines, the circumference of the unit circle, and the distance away from the real axis. Anyway, we write thes function down like this \(sin(angle)\). If we use variables instead of precise numbers for the size of the angle, we leave out the brackets around the angle. Also, we don't tend to use letters of the latin alphabet (the one this is written in), we use the greek alphabet instead.

(I am only calling the horizontal axis the real axis here because we are dealing with complex numbers. The sine function works perfectly well if you change from real and imaginary to horizontal and vertical, or x and y, or any other labels you want to give the axes. What is important is that you are measuring the lengths of two lines on a two dimensional plane (a flat surface). So the sine function is not restricted to the complex plane, and indeed was discovered, or invented if you have that world view, millennia before the complex plane).

What about Raul? We've left it behind just now. There is another function for working out Raul. It looks almost exactly the same as the sine function:

Draw a unit circle on the real and imaginary axes, centered at the origin.
Start at the point where the circle meets the real axis on the positive side.
Moving along the unit circle until you have traveled the distance equal to the angle in radians.
Measure the distance you are to the right, or as the case may be left, of the imaginary axis.
The distance is the value of Raul you want.

This is called the cosine function. We write it as \(cos(angle)\), and the same rule apply if using variables as applied to the sine function.

So, back to our complex number. We want to find out what number we get with the angle \(\tfrac{\pi}{6}\) at length \(\sqrt{5}\) from the origin. First of all let's look at that angle on the unit circle:


You can see that I am now drawing the “angle” ONTO the unit circle itself instead of down about the origin. This shows us exactly what we are talking about in our geometric function above. We have completed the first three instructions. We now just need to measure the height we are above the real axis. Lets stick show this:


There's our Imogen! It's a bit difficult to see what value it has though, because I haven't drawn on any other markings. Let's zoom in a bit to the intersection between the dashed line and the imaginary axis:


If you think that Imogen looks like it is a half, then you are right. No matter how closely you measure Imogen, it is perfectly a half. Right, what about Raul?


OK, lets zoom in again to see if we can find it more accurately:


Well, that's not really helping this time. It is between eight and nine tenths. To save zooming time, I will say that no matter how carefully you measure Raul, it does not resolve into a nice fraction. It is actually an irrational number. I can actually prove what it is exactly! How? Look at the diagram. You have the green line, the dashed line and the real axis. We know the length of the green line, it is one unit. We also know the value of the dashed line – it's Imogen, and we just measured it in the last step – it is a half. The dashed line meets at a right angle, so we can use pythagoras to get the length of Raul. So the length of the green line squared has to equal the length of the dashed line squared plus the length of Raul. Lets algebra this sod:

\[Green^2=Imogen^2+Raul^2\]
\[Green^2-Imogen^2=Raul^2\]
\[(1)^2-(\tfrac{1}{2})^2=Raul^2\]
\[1-\tfrac{1}{4}=Raul^2\]
\[\tfrac{3}{4}=Raul^2\]
\[Raul=\sqrt{\tfrac{3}{4}}\]

What can we do with the square root of a fraction? Well, let's think of it as raising the fraction to a power instead. So:

\[Raul=(\tfrac{3}{4})^{\tfrac{1}{2}}\]

And if you raise a fraction to a power, that is the same as raising the top part by the power and the bottom part by the power. So:

\[Raul=\frac{3^{\tfrac{1}{2}}}{4^{\tfrac{1}{2}}}\]

We know what the square root of four is, that's just two. To save time I will just tell you that the square root of three is irrational, so we just leave it as the square root of three. That gives us:

\[Raul=\frac{\sqrt{3}}{2}\]

If you ask your calculator what the square root of three divided by two is, you will get a number which goes on for ever, but is somewhere between eight and nine tenths.

OK, so we have our sine and cosine functions of the angle. How do we turn these into the rectangular form of the complex number? There is actually only one stage left to go. We just need to scale the numbers back up. When we scaled down the number to the unit circle, we saw the absolute value of \(\sqrt{5}\) becoming one. To get from one back to \(\sqrt{5}\), we just multiply one by \(\sqrt{5}\). If we are multiplying one length by this scale factor, we need to multiply all lengths by the same factor.

So the real part of our complex number is going to be Raul (\(\tfrac{\sqrt{3}}{2}\)) multiplied by \(\sqrt{5}\). That will be \(\frac{\sqrt{5}\cdot \sqrt{3}}{2}\). To multiply two square roots together, you just multiply the two numbers being square rooted, and then take the square root of that. (Think about it: \(\sqrt{2}\cdot \sqrt{2}\) is the same as \(\sqrt{4}\)). So the real part of the complex number is \(\tfrac{\sqrt{15}}{2}\). If you think that looks like a horror, you are right. It certainly is not two, which was our guess. What about the imaginary part of the number? That's going to be Imogen (a half) multiplied by \(\sqrt{5}\), or just \(\tfrac{\sqrt{5}}{2}\). Again, that's a horror, and certainly is not one, which was our guess. This can be confirmed, if we measure the actual real and imaginary parts of the number using dashed lines:


As you can see when we plot this out properly, you can see that the real value is a little bit less than two, and the imaginary value is a little bit more than \(i\), or one. If you run the numbers we calculated above through a calculator to get a decimal representation, you will see they match this geometric one.

So we can say that the following polar form equals the following rectangular form:

\[\sqrt{5}\angle \tfrac{\pi}{6}=\tfrac{\sqrt{15}}{2}+\tfrac{\sqrt{5}}{2}i\]

We can say more generally that given any polar form number with an absolute value of \(r\) and an angle of \(\theta\) (\(r\angle \theta\)) the rectangular form of that number will be \(r\cdot cos\theta + r\cdot sin\theta i\). The bit at the end looks a little ambiguous. Do we mean \(sin(\theta \cdot i)\) or \(sin(\theta)\cdot i\)? To avoid this potential confusion, I am going to move the \(i\): \(r\cdot cos\theta + r\cdot i\cdot sin\theta\). We may as well lose the dots for multiplication as well: \(rcos\theta + risin\theta\)

What about going back the other way? You basically just do everything in reverse. Let's consider the number \(2+2i\) that we looked at before. What you do is simple Pythagoras to get the absolute value (we did this last time). So that absolute value is \(\sqrt{2^2+2^2}\) or \(\sqrt{8}\). Easy. Now, what about the angle, which we will call \(\theta\)?

To get the real and imaginary parts we multiplied the sine and cosine of the angle by the absolute value. So to GET the sine and cosine of the real and imaginary parts, we just DIVIDE those parts by the absolute value. That gets us to:

\[sin\theta=\frac{2}{\sqrt{8}}\]
\[cos\theta=\frac{2}{\sqrt{8}}\]

Those are the co-ordinates for the point on the unit circle we are interested in. So let's mark these off as values for Imogen and Raul:


Now let's find the point on the unit circle that corresponds to those values:


The two dashed lines that we have just projected represent the OPPOSITE of the sine and cosine functions. These are known as the arcsine or arccosine functions. They take a value on the axes and convert it into possible distances around the unit circle for those functions.

But, here's the thing, the function arcsin, doesn't know whether the point on the circle you are trying to find is to the left or right of the imaginary axis. Equally, the function arccosine doesn't know if the point is above or below the real axis. So the honest output of the function \(arcsine(imogen)\) should be either the distance to Polly OR Polly-A. Equally, the honest output of the function \(arccosine(raul)\) shoud be either the distance to Polly OR Polly-B. This is really the same as the honest answer to the square root of four being both plus and minus two. There are two equally good answers. Ask your calculator though, and it will only tell you about plus two. Ask your calculator about \(arcsine(imogen)\) and it will only tell you about distances on the right hand side of the imaginary axis. Ask about \(arccosine(raul)\) and it will only tell you about distances above the real axis.

We'll come back to this problem, but for now, we can see the only possible distance is where \(arcsine(imogen)=arccosine(raul)\). This is where the two dashed lines meet, and this must be the Polly we are after. Remember that if we only had one or the other of imogen or raul, we would be in trouble, because we wouldn't know which of the two possible Pollys was the correct one. Finally, lets work out how far around the circle you have to go from the starting point to get to Polly:


If you actually measure the distance around the circle to Polly, you will find it is exactly one eighth of the circle, or \(\tfrac{\pi}{4}\) radians. So that gives us our angle for the polar form:

\[2+2i=\sqrt{8}\angle \tfrac{\pi}{4}\]

Now, the problem at this stage is finding an easy way to express this as a general rule. Let's look at the function to turn a polar form complex number into a rectangular form. The polar form has two variables, the absolute value of the number, and the angle. We are using the variables \(r\) for the absolute value, and \(\theta\) for the angle. So the function to convert one to the other is going to have TWO variables going into it. We write that like this: \(f(r,\theta)\). And setting the whole thing out we get:

\[f(r,\theta)= rcos\theta + risin\theta\]

Now it makes perfect sense. Moving on, how do we write the same kind of function to show the relationship between Raul, Imogen and the distance around the unit circle to Polly? How do we, in otherwords, turn the step of “look for where the two lines cross, and that's your Polly” into mathematical notation? What we need is a function that takes a variable and then asks a question. Weird? Yes, but very useful. What am I talking about? Well, the function is going to have two variables going into it again. This time they are just the real and imaginary parts of the complex number. We'll call them \(a\) for the real part and \(b\) for the imaginary part. So our new function for converting a rectangular number to a polar one is going to be written like this: \(g(a,b)\). The function is going to start in any case with the absolute value of the complex number being set to the square root of \(a^2+b^2\), which is the same, whatever the angle.

But we cannot just write out a simple one line function can we? No, because we know that the exact length of \(\theta\) is going to depend on the reverse sine or cosine function of one part, and whether the other part is positive or negative. It is actually easier to work with the reverse of the cosine function for this, because it always produces a positive number. Basically the arccosine function always tells you how far you need to move away from the starting position, and then you just need to know which side of the real axis you are. You could work with the arcsine function, but it has the problem that it spits out negative distances. This is not a massive problem - a negative angle, just really means go round the whole circle and then back up that quantity, but it is an unnecessary hassle.

So, we can actually write out our function as follows:
\[\begin{equation*}
g(a,b)= \left\{ \begin{array}{lr}
\sqrt{a^2+b^2} \angle arccos\left(\tfrac{a}{\sqrt{a^2+b^2}}\right) & \text{if } b >= 0,\\
\sqrt{a^2+b^2} \angle 2 \pi-arccos\left(\tfrac{a}{\sqrt{a^2+b^2}}\right) & \text{if } b < 0.
\end{array} \right.
\end{equation*}\]

If that looks fucking horrendous, yes it is pretty much the worst thing we have seen in this adventure so far. Lets have a go at translating it into english shall we? It says that you have two options for finding the polar form of the rectangular number with real part \(a\) and imaginary part \(b\). No matter which option you choose, the absolute value is always the square root of \(a\) squared plus \(b\) squared. If the imaginary part is greater than or equal to zero, then the angle is the arccosine of the real part divided by the absolute value of the number. If the imaginary part is less than zero, then the angle is \(2\pi\) (or the full circle) minus the arccosine of the real part divided by the absolute value of the number.

Actually, lumping zero in with the positive imaginary parts is a red herring. It doesn't matter which club zero joins. If the imaginary part is zero, then Polly has to lie on the real number line. There are only two places on the real number line where polly can lie. So if the imaginary part is zero, then the value of the real part will tell you whether it is one or the other. In other words, \(arccosine(-1)=\pi\), and \(arccosine(1)=0\). So in either case it doesn't matter if you take the first option and ADD the result to 0, or start with \(2\pi\) and SUBTRACT the result, you end up in the same place. We are assuming, incidentally, that the position on the circle with a distance of \(0\) is the same as the position \(2\pi\). Which is a safe assumption to make for now.

So there you go, Polar to Recangular:
\[f(r,\theta)= r\cdot cos\theta + risin\theta\]
and Rectangular to Polar:
\[\begin{equation*}
g(a,b)= \left\{ \begin{array}{lr}
\sqrt{a^2+b^2} \angle arccos\left(\tfrac{a}{\sqrt{a^2+b^2}}\right) & \text{if } b >= 0,\\
\sqrt{a^2+b^2} \angle 2 \pi-arccos\left(\tfrac{a}{\sqrt{a^2+b^2}}\right) & \text{if } b < 0.
\end{array} \right.
\end{equation*}\]

Monday, 11 July 2011

Are Infinite Sums Infinite?

So, infinite sums. We covered these. These are an infinitely long list of numbers which you add up. If we want to add up all of the positive whole numbers we would write out:

\[\sum_{x=1}^\infty x\]

If we wanted to add up all the even numbers we would write out:

\[\sum_{x=1}^\infty 2\cdot x\]

Of course, both of these additions is a pointless exercise, because the answers are themselves infinite. There are an infinite amount of whole numbers, and if you add them all up you get infinity. Hell, even if you just added one to itself an infinite amount of times you would also get infinity:

\[\sum_{x=1}^\infty \tfrac{x}{x}\]

(Any number divided by itself is automatically one).

Does this always hold true? Do infinite sums ALWAYS add up to infinity? What about this sum:

\[\sum_{x=0}^\infty \frac{1}{2^x}\]

Looks a bit more complicated doesn't it? First of all notice that I am going to start adding from the zero'th position in the series. So first of all I plug in 0 for \(x\). I get one divided by two to the power of zero. Remember that anything to the power of zero is one. So the first term in this series is one divided by one, or one.

The next term is one divided by two to the power of one. Anything to the power of one is a just one copy of itself. So this is just two. So the term is one divided by two or a half. So far our sum is one plus a half.

The next term is one divided by two squared. Two squared is four, so this is one quarter. The next term is going to be one over two cubed, or an eighth and so on. Basically the series is one plus a whole long list of the inverses of the powers of two. Looks a bit like this:

\[1+\tfrac{1}{2}+\tfrac{1}{4}+\tfrac{1}{8}+\tfrac{1}{16}+\tfrac{1}{32}+\tfrac{1}{64}+\tfrac{1}{128}+\tfrac{1}{256}+\tfrac{1}{512}+\ldots\]

Does that add up to infinity as well? Hmm. Maybe not - look at each term, they all get smaller very very quickly. If they get smaller quickly enough, then adding them all up may not reach infinity.

Lets try some mathematical wizardry. Lets create a variable, which we will call \(x\). Actually, no, lets call it \(S\) for series instead. now let us give make the variable equal to the series that we have created from our sum. To keep things simple we'll cut down the number of terms on display:

\[S=1+\tfrac{1}{2}+\tfrac{1}{4}+\tfrac{1}{8}+\tfrac{1}{16}+\ldots\]

OK, now we will divide each side by two:

\[\frac{S}{2}=\frac{1+\tfrac{1}{2}+\tfrac{1}{4}+\tfrac{1}{8}+\tfrac{1}{16}+\ldots}{2}\]

If we divide a long series of additions by two, that is the same as dividing each individual number in the series by two. Starting with the one at the beginning, that will become a half, and then the half becomes a quarter and the quarter an eighth and so on. Can you see that we are effectively just throwing away the one, and moving every other entry in the series one to the left. Because the series is infinitely long, it is still infinitely long because infinity minus one is still infinity. So once we have done all our divisions by two we get:

\[\frac{S}{2}=\tfrac{1}{2}+\tfrac{1}{4}+\tfrac{1}{8}+\tfrac{1}{16}+\ldots\]

OK. What can we do with that then? Look up two equations to the one where we first defined what \(S\) was going to be. You can see that it is one plus a string of fractions. Now look at the equation above. We have established that one half of \(S\) is a string of fractions. Now consider the string of fractions itself. It looks similar. In fact it looks identical, and it will remain identical no matter how many terms you write down for either one. So far, so good. We can now say that \(S\) is one plus that string of fractions, but we know that the string of fractions is actually \(\tfrac{S}{2}\) so we can actually write:

\[S=1+\frac{S}{2}\]
And if we subtract one half of \(S\) from both sides we get:

\[S-\frac{S}{2}=1\]

\(S\) minus half of \(S\) is obviously just the other half of \(S\), so:

\[\frac{S}{2}=1\]

\[S=1\cdot2\]

\[S=2\]

So we have proved that the whole series up there adds up to two, even though there are an infinite amount of terms in it.

Monday, 4 July 2011

Inifinite Sums

We are moving on to the last symbol shortly, \(i\). Before we do so I just want to lay a little ground work with infinite sums.

You do not need to actually know about infinite sums to understand about imaginary numbers. So why are we bothering to look at them now? Two reasons. Firstly because the notation for these sums looks frightening, but isn't, and it crops up from time to time in maths texts. So it helps to know what we are looking at. Secondly, and more importantly, imaginary numbers sound a bit, well, imaginary, and actually they are very, very real and can be demonstrated using infinite sums - which do not actually involve any imaginary numbers at all.

So what the hell are we talking about? We all know what sums are - right? Colloquially they are arithmetical exercises, and also perhaps algebraic exercises. You "do your sums" if you are carrying out these types of exercises. In a more formal sense "sum" can be used as a synonym of "add". So if I "sum" two numbers I add them together. So, infinite sums are not homework that never, never, ends, but instead an addition operation that never, never ends. By way of example this is a sum:

\[1+2+3+4+5+6\]

and this is an infinite sum:

\[1+2+3+4+5+6+\ldots\]

The dots at the end just mean, and so on. Incidentally, these dots are called an ellipsis. The pattern is obvious - the numbers being added increase by one each time. So instead of writing out all the natural numbers (which would take literally for ever), you just stick the dots on the end. The result of the first sum is twenty one, the result of the second sum is infinity.

Even if we are just writing out the first sum above, it does take up quite a bit of space. We can use a notation to represent this sum in much less space, albeit it looks quite scary to start with. So, what we want to do is firstly work out how we describe each individual number to be added. We intuitively know that the numbers above are a pattern. There is an obvious logic behind the numbers. Each one is one larger than the last one. A list of numbers like this, with a logic behind how you get the next one, is called a series of numbers. So what we want to do is work out how to get any particular number in the series if we are just told which position it has in the series. How do we show that? We use functions! Remember a function just takes a variable (like the position in the series) and then does things to it to produce a result.

Once we have done that, we need to show that we are adding lots of things together. We need to have some sort of symbol to represent lots of addition. We also need to show which position in the series we are going to start counting from, and when to stop. That should do it.

In fact the symbol used in maths is this:

\[\sum\]

All that says is that what follows it is going to be added up. We put our formula for working out the numbers to the right of the symbol like this:

\[\sum f(x)\]

We then show what position we start in the series below the symbol:

\[\sum_{x=1} f(x)\]

Which for us in our example above is the first position, so we start with \(x\) equal to one. Remember, the one just means the first position in the series which goes into the function, not the outcome of the function. Lastly we need to show at which position in the series we want to stop adding entries. We do this by putting that number at the top of the symbol:

\[\sum_{x=1}^6 f(x)\]

So that complicated mess of stuff just means take a series where you generate each entry by putting the position of the entry in the series into the function, put the numbers one to six into the function in turn, and add up all the outcomes. To generate the series above the function \(f(x)\) is just \(x\) because the output of the function is the same as the input.

To symbolise adding up the infinite series illustrated above, you would put infinity at the top of the summation symbol to show that you just kept adding and adding forever:

\[\sum_{x=1}^\infty f(x)\]

What if you wanted to add up all the even numbers? Remember in our proof of the irrationality of \(\sqrt{2}\) we said that any even number was a number that could be divided by two to give another whole number. So \(f(x)\) would be \(2\cdot x\). That would make the first entry in the series two multiplied by one, the second two multiplied by two and the third two multiplied by three, or 2, 4, 6 etc etc ellipsis.

It is traditional that instead of \(x\) the variable we use to denote the position in the sequence is \(n\). Typically we would also dispense with the \(f(n)\) stuff and we would write \(a_n\) instead. That's a bit bloody weird though, using two variables for one number. All that means is that \(a\) is the \(n^{th}\) number in the series. I prefer to stick with \(f(x)\) or at least set out the function, because that way you can be sure what is generating the series of numbers.

Monday, 20 June 2011

What is a Limit, Part Two?

There is one further thing we need to say about limits before we move on. Instead of making your input number get closer and closer to the number at which everything falls apart, you can also make your input number just get bigger and bigger. This can also help us answer the unanswerable, because you cannot really make your input number infinitely large (you would need an infinitely powerful calculator to work out the answer), but you can say what would happen if you did.

Lets look again at our original function:

\[x+1\]

Lets switch the sign again:

\[x-1\]

Lets add an \(x\) to it:

\[2x-1\]

And lets divide it by \(x\):

\[\frac{2x-1}{x}\]

This time, lets call the function \(g(x)\), so we distinguish it from the last one. . What is \(g(1)\)? Well that is two times one (two) less one (one) divided by one. One divided by one is one. Algebraically:

\[\frac{2\cdot 1 -1}{1}\]

\[\frac{2-1}{1}\]

\[\frac{1}{1}\]

\[1\]

What about \(g(10)\)? That is two times ten (twenty) less one (nineteen) divided by ten. Nineteen divided by ten is one and nine tenths. So:

\[\frac{2\cdot 10 -1}{10}\]

\[\frac{20-1}{10}\]

\[\frac{19}{10}\]

\[1.9\]

Multiplying the input number by 10 has not made a massive difference to the output - it just added on 0.9. The reason why is that while the input number gets larger it appears on both the top AND bottom of the function so it multiplies and divides. Each operation (multiplication and division) just about cancels the other out. So what if we go really big? Lets try \(g(10000)\):

\[\frac{2\cdot 10000 -1}{10000}\]

\[\frac{20000-1}{10000}\]

\[\frac{19999}{10000}\]

\[1.9999\]

So no matter how big the number you stick in, you double it and divide it by itself which nearly cancels one of the copies completely, and would cancel it BUT FOR the one that you take away on the top line. This also works for whatever number you stick in - it does not have to be 1, 10, 100, 1000 or so on, it is just that the results from other numbers look a bit messy. What we are seeing here is that the bigger and bigger the starting number you put in, the closer and closer the output is to two. In mathematical terms we describe this as:

\[\lim_{x \to \infty} \frac{2x-1}{x}=2\]

Which means that as \(x\) gets closer to infinity (\(\infty\)) the output of the function gets closer to two.

Monday, 13 June 2011

What is a Limit, Part One?

The limit of something, is the maximum amount of something you can have. It can be natural or artificial. There is usually a drink drive limit, which is an artificial level of alcohol set by the state, that you are allowed to have in your system and legally drive. So if you have more alcohol than that you are known as being over the limit. Then there are natural limits, such as the limit of human hearing - dogs can hear sounds beyond that limit.

In maths limits are important because they help us get the answers to questions that we cannot ask. If that sounds odd, it is supposed to. There are some questions that we want to ask, but if we do we get nonsensical answers. As an example, lets build a function. Lets start with the function we used when talking about functions the first time:

\[x+1\]

Now, lets change the sign from addition to subtraction:

\[x-1\]

Lets divide it by itself:

\[\frac{x-1}{x-1}\]

And finally lets multiply the \(x\) on top by itself once.

\[\frac{x^2-1}{x-1}\]

Right. Lets call this \(f(x)\). What is \(f(2)\)? Well it is two times itself (four) less one (three) divided by two less one (one), so three divided by one. Or in algebra:

\[\frac{2^2-1}{2-1}\]

\[\frac{4-1}{2-1}\]

\[\frac{3}{1}\]

\[3\]

What \(f(5)\)? Well...

\[\frac{5^2-1}{5-1}\]

\[\frac{25-1}{5-1}\]

\[\frac{24}{4}\]

\[6\]

Looking at this there seems to be an obvious connection between \(x\) and \(f(x)\). The function just seems to add one to \(x\). 3=2+1, and 6=5+1. We started with \(x+1\), and it appears we have got back there! So \(f(1)\) should be two. Lets see if it is:

\[\frac{1^2-1}{1-1}\]

\[\frac{1-1}{1-1}\]

\[\frac{0}{0}\]

Hmm. Zero divided by zero. That's just a mess. Is that infinity or zero? It is meaningless. It does not work because as soon as \(x\) is one, you get zeros everywhere because you are subtracting one from one on the top and bottom. So \(f(1)\) is special because of the way the function is built.

How does the concept of a limit help us to get an answer to \(f(1)\)? Well, we could ask what \(f(0.5)\) and \(f(1.5)\) are. The answers are 1.5 and 2.5 respectively. That matches what we thought - the function ends up adding one to your starting number. It also supports our guess for \(f(1)\) before we tried it, which was two. Lets get a bit closer to one, and try again this time with \(f(0.9)\) and \(f(1.1)\). The results are 1.9 and 2.1 respectively. Again, just what we would expect. The closer we get to \(f(1)\) the closer the result gets to two. If we try with something silly like \(f(0.99999)\) we get 1.99999. That pattern is going to repeat for as many nines as we add onto the end of the number we plug in.

The way we answer this question is to say that as the number we plug into the function gets closer and closer to one, the result of the function gets closer and closer to two, but because it breaks when we put in exactly one, we never get to exactly two. That's what a limit is. In mathematical script it looks like this:

\[\lim_{x \rightarrow 1} \frac{x^2-1}{x-1}=2\]

Spoken out loud that says the limit of the function (blah blah describe the function blah blah) as ecks approaches one is two.

Monday, 23 May 2011

Functions & Algebra

OK, before we can progress look at \(e\) (and to the joys of proving the irrationality of the square root of two) we need to stop for a minute to think about functions. This is yet another fairly basic element of mathematics that was glossed over completely in my formal maths education.

So what is a function? In a basic sense, a function is a list of mathematical operations that you carry out on a variable. Hmm. I think what this scenario requires is an ill thought out analogy. Tradition dictates that it should involve some sort of hot drink.

So lets have our hot drink function. It would state:

1. Boil Kettle
2. Put boiled water in mug
3. Put drink flavouring in mug.
4. Stir mug

Those instructions are good enough to make coffee, tea, hot orange, or a cup-a-soup. The only bit of the instructions that would have to be changed is the "drink flavouring" bit. That could be instant coffee for coffee, a tea bag for tea, some orange squash for hot orange, or a sachet of cup-a-soup powder for the soup. All we have to do is change that bit, and follow the rest of the instructions to the letter, and we get a different drink at the end. The "drink flavouring" bit is the VARIABLE, meaning that it is the bit which can change, if we want to change the hot drink we end up with.

Once we have listed all these instructions once, it would be dull to write them out every time. So instead we use a shorthand system. Lets give the group of instructions a name: "hotbeverage". To show that the outcome of the hotbeverage instructions depends on the drink flavouring variable, we put that in brackets after the name: hotbeverage(drink flavouring). If you were reading the notation aloud, you would say "hotbeverage of drink flavouring". Which makes some sense.

That notation means that you can change what goes in the brackets (tea bag, soup powder etc) and you STILL FOLLOW exactly the same instructions, and you end up with something else. If you decided that you were going to make hot orange, you would write that as hotbeverage(orangesquash). You have replaced the placeholder with the ingredient. Someone reading that would know that you meant "follow the list of instructions that I have called hotbeverage replacing the variable 'drink flavouring' with orangesquash".

Now, lets bring some algebra into this. First question, what the fuck is algebra? Answer, a very useful system of mathematical thinking that Muslims came up with in the middle ages, based on earlier work of Hindus, all at a time when western society was trying to work out how the Romans had built the bloody aqueducts. You can tell the word has Arabic origins because of the 'al' - much like alchemy, and algorithm.

So what actually is it? Well, in the example above we had a variable - something that we could change to change the outcome of the function. Algebra is a way of working with these variables. Sometimes that are referred to as 'unknowns' which is coming at the thing from a different angle. Before we had the concept of algebra, mathematical thinking was really done using geometry. So if you saw an ancient mathematician scribbling away on papyrus, or a sand board, they would be drawing lines and circles and so on, NOT the kind of symbols and operations that we use these days. The difference that algebra brought to the table, so to speak, was the ability to think more abstractly.

The Muslims made the leap from lines and circles to abstract ideas, but they could only express those ideas in long wordy sentences. Such as "if you take the third part of the first party raised to the second power and then find the root of the difference between that and the fifth part of the....". You get the drift. Much later than the Muslims, Western Europeans started using letters of the alphabet in place of the unknowns. They also started using the symbols we have already looked at to show what operations you were doing to numbers or these unknowns. So finally instead of drawings, or long wordy sentences, we finally had the numbers, letters and symbols that we now recognise as 'algebra'.

Tradition has it that we use letters from the end of the alphabet to represent these variables or unknowns, starting with \(x\). We have already used a letter from the Greek alphabet to represent a number - \(\pi\). Is \(x\) the same? No. \(\pi\) is always the same number a little bit more than 3, roughly \(\tfrac{22}{7}\). It does not vary. We just use the letter symbol, because we would never finish writing out the number otherwise. \(\pi\) does not vary - it remains constant, and so we call it a ... constant. It is like the symbol for two, '2', or five, '5'. Those symbols always means two or five. In the same way \(\pi\) always means just a little bit more than three.

So we normally use \(x\) to represent the first variable, and then \(y\) and \(z\) if there are more variables. In other subjects where algebra is bring used, you find different letters, or even other Greek letters. Physics is bloody littered with different letters ('s' usually stands for a variable which is the speed of something, 'd' for distance, 'v' for velocity (not the same as speed but never mind that now) and so on). So, a typical algebraic equation would look like this:

\[x+1=3\]

We are now supposed to follow some formal algebraic rules to get a statement that starts with:

\[x=\]

The bit on the right side of the = tells us what \(x\) actually is in this example. In this case, the rules we follow are to deduct 1 from each side of the equation:

\[x=2\]

We now know what \(x\) is. We can plug 2 into the place of \(x\) in the first equation:

\[2+1=3\]

Yep, that is correct. Richard Feynman explained algebra best when he said that it is just a puzzle game, where the goal is to find out what \(x\) is! You can look back at the original statement \(x+1=3\) and rephrase it as the question, "what number, if you add one to it, makes three?" Then it is just a puzzle which is easily solved.

That was an example of an algebraic equation. That English language question I translated it into was how algebra was done before the symbols were invented. Could ancient mathematicians have solved this using their lines and circles? Yes. What you do is draw a long line. And then take a compass set to a specific, and completely arbitrary, width. Stick the point anywhere along the long line. Draw a circle. The circle will cross the line at two points, the same distance from the pointy end of the compass. You now have three points, the original bit where you stuck the compass in, and two where the circle crosses the line. Can we answer the question what plus one is three? No, because we only have two identical line segments.

So now stick the compass pointy bit on either of the new points and (without changing the width of the compass) draw another circle. One crossing point will be the very first pointy bit, and the second will be a new point on the line. We now have four points and three equal segments of line. We now have three identical line segments. In this step we added one identical line segments, so the answer to the question must be "how many line segments did we have before we added this third one", and the answer as we saw a second ago was "two".

It should be obvious, but it bears repeating. Whenever you hear of an ancient mathematical proof or theorem, and you think "that's a doddle, I could have done that, and I am an idiot", remember they didn't have symbolic algebra. They had tools to draw circles, and tools to draw straight lines. That was it. And they still managed to come up with good stuff. Geniuses.

Anyway, we started to talk about functions. We have seen a function written out in normal language, so what does a function look like in symbolic algebra? Well, we have already seen one of those as well. A function is basically just the side of the equation that \(x\) is on. So in the above example, the function is:

\[x+1\]

The instructions we follow are really just to add 1 to our variable. We need to give our function a name, and traditionally we give it a name one letter long. We start using the letter \(f\), for the first function we use. If we need to use more than one to solve a problem, we give the next one the name \(g\). And so on. It would be terribly complex if we chose letters nearer \(xyz\) because you would start to get confused between the names of functions and the names of variables. That would be bad.

There is nothing special about the letters chosen, by the way. A variable called \(x\) is not one greater or less than a variable called \(y\). We could just as well be using pictures of clouds, buses, or lawnmowers. It is nothing more than a marker. Same thing applies to the names chosen for functions. I said earlier that we put the variable in brackets after the name of the function. So we end up with:

\[f(x)\]

That means the function is called \(f\) and it involves a variable called \(x\). We know what the function looks like, so we can describe the whole thing as:

\[f(x)=x+1\]

We can then replace the \(x\) with two like this:

\[f(2)=2+1\]
\[f(2)=3\]

We can now talk about \(f(x)\) rather than repeating all the steps every time. This is not too onerous with \(x+1\)) but we will see some more insane functions in due course. Much like the beverage example above you would say that this is "eff of ecks".

The important difference here is that an equation has an equals sign in it, whereas a function does not. OK, pedant, yes the example just about has an equals sign, but that is just telling you what the function is. The actual function (the bit on the right of the equals sign) only has a variable, the sign for addition, and a number. It has no equals sign. An equation, on the other hand, tells you that two different looking thinks are equivalent to each other, whereas a function is list of things that you do to \(x\), say, to get a result.