Sunday, 10 May 2009

Zero as a limit

Well MST121, which is the Open University maths course I'm doing, has now reached the dreaded "Chapter C" in which we get to study "The Calculus".

Quite why calculus gets a definite article is a mystery to me, I mean I never studied "The Geometry" or "The Algebra" that I can remember.

Well the first thing that's presented is a demonstration of differentiation which, in essence, is finding out about the rate of how things change.

A nice way to think about this and one that helped me get my head around it is to think of a graph like this which shows distance travelled (on the y axis) versus time taken (on the x axis).



In this example the distance travelled in metres is the square of time taken in seconds so in maths-speak we say that distance (d) is a function of time (t) and that in this case the function is t squared; which you write like this

d = f(t) = t^2


OK so from this you can tell how far you have gone in how many seconds. But how fast are you going at any time? Well as speed is distance divided by time you can work out an average speed between two times, t and t + h by joining the points on the curve at t and t+h and dividing the distance covered by the time taken.

Now the time taken is (t+h) - t which is just h and the distance covered is the difference between the values of distance d at times t and t + h; but as we know that d = t^2 we can express these distances as (t+h)^2 and t^2.

So that gives us

(t+h)^2 - t^2
-------------
h

which simplifies to
 
t^2 + 2th + h^2
---------------
h

and more simply:

2th
---
h

Now what we do is start to reduce h and keep reducing it to a limit of 0

Ah, you can't divide by zero though, we went through that on the last post didn't we, you get a black hole if you do.

"Yes", says my OU tutor who has a brain so large there's nothing left for dress sense, but we don't go to zero, we TEND to the LIMIT of zero so think of h getting infinitessimally small, so small it doesn't count. So small you can just get rid of them leaving:

2t

And there you go, the first derivative of t^2. So after 5 seconds you've travelled 25 metres and you're going at 10m/s

Wel it does work but there's something inside of me that doesn't quite like it. I'm just a bit concerned that it's a bit of a fiddle throwing away these very tiny numbers. Apart from that at least I'm feeling pretty comfy with differentiation so far.

By the way if you type "Zero as a limit" into Google you get a load of song lyrics to a Human League tune from the 80's. Was the floppy haired one a mathematician I wonder?

Tuesday, 28 April 2009

Divide By Zero


Despite what you might have read on teh interwebs you don't get a black hole if you divide by zero. But what do you get?

If you try it on a calculator you get an error or "can't divide by zero" message, although oddly if you are writing a computer program like this one...

double DivByZero(double n)
{
return n/0;
}


...you may well get a special value passed back which is either "Positive Infinity" or "Negative Infinity" which is a plausable number, but mathematically speaking wrong.

Lets look at the infinity business first. Imagine you divide 1 by a half (0.5), you get 2. Now divide 1 by a tenth (0.1), you get 10, now divide 1 by a hundredth (0.01), you get 100. So as the number you divide by gets progressively smaller and smaller the result gets larger and larger and this is true regardless of the number that is being divided.

In maths-speak what they say is that as the divisor (the number on the bottom) tends to zero then the result tends to infinity. Of course if the number being divided is negative then the result tends to a larger and larger negative value, "negative infinity".

The important thing to notice here is the "tends to zero" bit. The number is approaching zero, becoming exceedingly small but it is never actually zero. This works fine for computers where the rules say that all floating point operations have to have a defined result but we still have not actually divided by zero.

Why you can't actually divide by a real zero is that it makes maths itself break.

To see why you need to look at what division is. Basically put it is multiplication backwards. If you take a number, say 6 and divide it by 2 you get 3, now if you multiply it by the same number 2 you get back to 6. We say that division is the inverse function of multiplication.

Right, so let's for now pretend that you can divide by zero and you get this number "infinity" as a result: so 1 divided by 0 is infinity and infinity multiplied by 0 must be 1. Except it isn't as anything multiplied by zero is zero.

You could do the same thing with 2 divided by zero, three divided by zero, in fact any number divided by zero Now the same calculation can't have different results as the only way this could happen is if the result of a divide by zero as being every possible number simultaneously; so the correct answer to what do you get when you divide by zero is "the result is undefined".

"Simples" as that irritating meerkat on the telly says.

Mathematics For Dragons

Hello everyone (all two of you who follow my witterings anyway).

This is going to be an offshoot of my normal blog Grumpy Dragon (Warning, adult language, swearing, cursing and stuff) where I'm going to make the occasional post about adding up as I wander through my Open University maths degree.

If you're at the Open University, a student or just interested in sums you might like to have a read. The rest of you will probably be bored witless.