Archive for July 2010

Problem Children

July 14, 2010

The title is perhaps a little misleading. This post will by no account help you deal with problem children (unless they enjoy quirky maths blogs, in which case you’re welcome). That is not the purpose of this blog, no sir. Very few issues involving problem children have mathematical solutions and that is something that just doesn’t sit right with me.

So now we know what this post is not about, I suppose it’s time to get cracking. The idea I’m covering today is conditional probability; what is the chance of one event given that another event has already occurred (more formally P(A|B)). For instance, while the probability of missing a leg or being a lion tamer may, individually, be quite low, the probability of missing a leg given that a person is a lion tamer is considerably higher (as well as an increased probability that everyone around them wishes they were lion tamers).

And you thought your first kiss was scary

Let me paint a scene for you. It’s a beautiful, warm night. The stars are out and the moon illuminates the night sky. The sound of music and laughter fills the air and you don’t notice any of this because you’re in the library idly browsing through the latest mathematical journals. It’s a typical Friday night (isn’t it?).

All of a sudden, the librarian appears out of nowhere and begins sorting some of the books nearby. After a few minutes in close proximity you decide to break the tension and talk. After exchanging pleasantries (“nice night, isn’t it?”) and a few arkwardries (“those glasses frame your face really well”) she mentions that she has two children, at least one of which is a boy. On this note she departs to organise another section, leaving you to ponder the implications of the conversation.

Unable to comprehend why she has been so cryptic about the gender of her children (a flirting technique, maybe?), you sit down and flick through a copy of ‘Macho Maths Weekly’ to calm your nerves.

So here’s the question: given that one of her children is a boy, what it the probability her other child is also a boy? All seems very simple, doesn’t it? If there’s a 50/50 chance a child is a boy or a girl, then the probability must be \frac{1}{2}. Thought I’d try and bluff you, didn’t I? All this talk of conditional probability used to distract you from the obvious answer. But as is usually the case with this blog, things aren’t quite that simple.

Pictured: the house of math

To work this out, we need to consider the different possibilities. With two children we have 4 combinations –

Girl Girl

Girl Boy

Boy Girl

Boy Boy

Since we’re given that one of them is a boy (ruling out ‘Girl Girl’), we are left with 3 equally likely possibilities of which only one includes another boy. we therefore conclude that the probability the other is a boy is \frac{1}{3}. Bet you didn’t see that coming.

What if she tells you she has a boy born on a Tuesday (ok, I really don’t know why she would do this, just run with it)? Surely it’s \frac{1}{3} again. How can the day he’s born have any effect on whether the other other child is a boy? Let’s have a look.

We have a few more combinations here, 27 to be precise. Again any possibilities not involving a boy born on tuesday are eliminated leaving –

Boy (Tues) Girl (Any) – 7 combinations (Girl (Mon), Girl (Tues), etc)

Girl (Any) Boy (Tues) – 7 combinations

Boy (Tues) Boy (Any) – 7 combinations

Boy (Any) Boy (Tues) – 6 combinations (As Boy (Tues) Boy (Tues) has already been accounted for)

We therefore have 27 equally likely outcomes, 13 of which involve another boy. The probability is therefore \frac{13}{26}! Oddly enough, the more detail she gives about her son, the closer the probability that her other child is a boy gets to \frac{1}{2}.

Who wouldn't want two boys?

Have children? Want to amaze your friends with simple probability tricks? Then please refrain from using the sentence “at least one of my children is a boy”. Only Social Services will take interest in statements like that.

Bookmark and Share

The Imaginary

July 12, 2010

Our imagination is a wonderful thing. It allows us to conjure up wondrous, impossible events and entertain ourselves with an alternate, exciting reality. It allows us to dream. We can be whatever, whoever, we want to be in our own little world and all because of our amazing ability to create the unbelievable. This all sounds a bit poetic for maths though, doesn’t it? And yet, even in the world of absolute truths we find a bit of the imaginary.

Well, imaginary numbers to be precise. Imaginary numbers, as you may have guessed, aren’t real. This may be a step too far for some of you. I’ll be trying to convince you about invisible numbers next, won’t I? Or inventing the God number and explaining how it controls the rest of the numbers (I’d go with 2, incidentally. It’s always had an air of superiority about it). But I kid you not with this one, the imaginary numbers definitely exist (though sentences like that make my head hurt).

I do wish they had been named differently, though. There is nothing quite so confusing as explaining that a number is imaginary and exists but is not real. People begin to look at you funny. Saying that, people tend to accept negative numbers fairly easily. Obviously there is the analogy with debt, but have you ever seen -2 cars, or walked past a group of -5 people? Still, I’ll let you make your mind up about how ridiculous imaginary numbers are. Time for a bit of an explanation.

A very different kind of explanation

Now, you may have been told that you cannot square root a negative number, even if you try really hard. This is because no number multiplied by itself is negative, so you can’t take the root of a negative number. All sounds pretty straightforward so far. You can even try it on your calculator if you like. Done? It didn’t like that, did it (some calculators are capable of this, but they’re always a little too smug about it for my liking)? If your calculator can’t find an answer then what hope do you have?

Ok, let’s not panic. We can do this. We just need to think about the problem a bit differently, use a little imagination. Imagination! That’s it! If there’s no real answer to square rooting a negative number, why don’t we create an imaginary one? All we have to do is define \sqrt{-1} as i and we’re done, imaginary numbers to the rescue. Simple, eh? All of our problems solved with one little trick. Not seeing it?

Consider \sqrt{-64}

\sqrt{-64}=\sqrt{64*-1}

\sqrt{64*-1}=\sqrt{64}*\sqrt{-1}

Therefore \sqrt{-64}=8i

Gotta love math humour

How easy was that? All it took was the addition of one letter and we have our answer. What we see is that the root of negative numbers produces an imaginary number. This is, of course, a great lesson for life: if you can’t work out the answer, just make it up.

What happens if we want to add some real numbers to our imaginary mix? Here things get a little complex. Literally. Complex numbers are numbers consisting of a real and imaginary part (in the same way Christmas has Santa and awkward family reunions) , such as 4+8i. However, it’s difficult to visualise that number, isn’t it? It’s like trying to imagine what love looks like, or a social life.

This is where Argand diagrams come in (in visualising complex numbers, not a social life). An Argand diagram is a graph with one real axis and one imaginary axis. Our complex number then becomes a point on the graph, making things much easier.

An Example of an Argand Diagram

Not so complex now

There you have it, the wonderfully weird world of imaginary numbers. Throw out your calculator, play with the imaginary and question your very perception of reality. What else are you going to do on a Monday?

Bookmark and Share

Toast

July 10, 2010

Toast – the champion of breakfast foods, the bastion of simple nutrition. A perfect blend of bread (toasted impeccably), butter, and your choice of favourite preserve combine to provide wheat based motivation. To start your day with a toast filled stomach is to march forth into the days beginning unafraid, undaunted. With its solid, wholesome support anything is possible.

Ok, so toast isn’t particularly interesting. It’s crispy bread with a bit of butter on it, it was never going to light up the world. It does have one interesting property, though. It seems to provide a perfect example of Murphy’s law: anything that can go wrong, will go wrong. This is because when dropped, as everybody knows, toast always lands butter side down. If it doesn’t, you must have buttered the wrong side.*

It must be a myth though, mustn’t it? After all, it’s a similar situation to flipping a coin and no one’s claiming that always has one outcome. The claim seemed to be debunked when the BBC show ‘QED’ tossed 300 pieces of toast into the air and found that only 152 of them landed butter side down, obviously proving that it’s all a load of nonsense. We only believe it favours one outcome because of our very selective memories. Job done.

Time to put your feet up

But that wasn’t the end of it. Many people pointed out that the experiment wasn’t really an accurate reflection of dropping a piece of toast in your kitchen. After all, who tosses their toast in the air? If you do, how can you grumble about it landing on the floor? Surely this would only serve to highlight your own ineptitude. Are there hundreds of clumsy and disgruntled toast jugglers out there? I digress.

The stage was set for a mathematician to seize the initiative. Robert Matthews, apparently having nothing better to do, spent a bit of time analysing the dynamics of falling toast (a mathematician’s ability to procrastinate in this manner is, I believe, what truly distinguishes them from other people). He found that the main factor determining which side the toast lands on is the height from which it’s dropped. I’ll explain.

Most dropped toast is the result of it slipping off the plate or tumbling out of your hand. This is where it gets interesting. As the centre of gravity moves outside the support (plate or hand), the toast pivots on the edge and falls off, rotating slowly as it does so. The size and weight of your average piece of toast mean that, in the time it takes to fall from your hand or table, it will have completed half of a rotation. This all amounts to a nicely buttered kitchen floor.

Physics will ruin your breakfast

This is a prime example of gravity and drag forces combining to ruin your morning (aside from making getting out of bed even harder). While you’ll struggle to alter the gravity problem (it’s pretty constant on the Earth’s surface, and the Martians only do cereal) you can change a few other factors.

Extremely thick slices (probably about loaf size), for instance, won’t rotate as quickly. You could also limit the amount of rotation by pushing the toast off the table with force or dropping it evenly. Alternatively, Matthews predicted that toast falling from a height of about 8ft should undergo one full rotation, landing acrobatically on its non-buttered side. As you can tell, mathematician’s are only interested in highly practical solutions.

Not content with the theory (and perhaps not satisfied with his demonstration of the fact mathematicians have far too much time on their hands), he enlisted the help of 1,000 schoolchildren to drop over 20,000 pieces of toast. The results? 62% of the toast landed face down. When the toast was dropped from a height of 8ft, however, it landed face up 53% of the time. Hurray for maths!

Huzzah!

So, looking to keep the dog hair off your beautifully crafted meal? Simply butter your loaf, take it to your 8 foot table and give it a good whack. You’ll never have to worry about spoilt toast again.

*Full credit to Ian Steward in his ‘Hoard of Mathematical Treasures’, I loved that joke.

Bookmark and Share

Happiness

July 8, 2010

Happiness is a state of mind or feeling characterized by contentment, love, satisfaction, pleasure, or joy. Whether that be from hanging out with friends, reading a humble maths blog or finally, at two o’clock in the morning after many, many attempts (and several deep periods of self-reflection), successfully completing a Rubik’s cube for the first time, happiness is the most sought after of human emotions. Its elusiveness (that Rubik’s cube took me to many dark places) makes it all the more satisfying.

But is happiness limited to humans? Many animals seem to experience happiness. The joy my dog takes in rolling in whatever decaying mess she can find is only matched by her guilt and confusion when I tear out of the house shouting and gesticulating wildly. Cats, I believe, purr contentedly when fed, before returning to their quiet, judgemental state.

He does not approve of your life choices

Can a number be happy? OK, I know. Obviously a number cannot experience happiness (though I always thought 3 looked a bit smug). To say that a number is happy is similar to remarking that your front door has a particularly cheery disposition today, or that your fridge has been looking a bit down lately. People will stop making polite conversation and instead nervously edge away.

I suppose, then, if we are to call a number happy we shall need a new definition of happiness. Try taking the sum of the square of the digits of a number, iterate this process and see what happens. If this process eventually leads to 1 then we have ourselves a happy number. If not then we’ve unfortunately found ourselves an unhappy number. I’ll show you what I mean.

Take 7.

7^2=49
4^2+9^2=97
9^2+7^2=130
1^2+3^2=10
1^2+0^2=1

And there we have a happy number!

Unhappy numbers eventually end up in the cycle

4,16,37,58,89,145,42,20,4,\ldots

Perhaps it’s unsurprising that 7 is the second happy number (after 1). All those years of being regarded as exceptionally lucky have obviously done a lot for its self-esteem. While I don’t quite comprehend why 7 is deemed so lucky (or why rabbits’ feet are considered lucky, I’m fairly confident the rabbit felt it was luckier attached to its leg) but it’s obviously quite pleased with the state of affairs. Interestingly 13 is also happy, not a twinge of guilt for all the bad luck it has bestowed on people.

Damn you 13!

Which would almost lead you to believe that 13 is a bit evil. That would be silly though, wouldn’t it? We’ve just about got our heads around it being happy, evil is a step too far. And 13 is most definitely not an evil number. It’s odious.

You see, a number is evil if it has an even number of 1s in its binary expansion. That means that if, when you write the number in base 2, there is an even number of 1s in the number you have yourself a very evil number indeed. If there are an odd number of 1s, you merely have an odious number on your hands.

For instance, 13 is, as I said before, an odious number.

13=1*2^3+1*2^2+0*2^1+1*2^0=(1101)_{base2}

Thereby making it odious.

Why you would call a group of numbers odious is beyond me. You would think that if one group of numbers is evil its opposing group would be good, or angelic. Obviously the person naming them had experienced many traumas at the hands of rogue integers and decided they should all be detestable in one way or another. Rather depressingly, there are far more unhappy numbers than happy ones and they’re evenly split between being evil or odious. It really makes you worry about the sad state of affairs our numbers are in, doesn’t it?

Bookmark and Share

Birthdays

July 6, 2010

Ah yes, birthdays. That time of the year where we mark time’s relentless march onwards. Where the young are dragged kicking and screaming into responsibility and maturity and the old are led stumbling and murmuring from their ability to kick and scream. Still, they’re not all bad. Statistics show that those who have the most tend to live the longest.

There are 365 possible birth dates (366 if we’re being picky) and it was equally likely for you to be born on any one of those days (well, not quite, but it certainly isn’t this blog’s place to go into that). This means that the chance of having your birthday is \frac{1}{365} 0r about 0.27%. Makes you feel pretty special, doesn’t it?

So, if I asked you for the minimum number of people I’d need in a room to have a better than 50% chance that two of them shared the same birthday, you wouldn’t even blink, would you? I mean, it all seems very simple. It must be half the number of days in the year. This would give \frac{183}{385} which, as required, is over 50%. Feeling pretty confident about this, aren’t we?

Pictured: You

The answer, in fact, is only 23. That’s right, having just 23 people in your room gives a better than 50% chance that two of them share the same birthday. 23! That’s a small bus of people, or the entire population of “soccer” fans in the USA. And yet, surprisingly, that’s all it takes.

Not convinced? It’s understandable. You’ve been in groups of 23 or more many times and only very rarely have you discovered that someone shares your birthday. But that wasn’t the question, was it? If the question was how many people do you need to have a better than 50% chance they share a birthday with you, the answer is of course 183. With 23 people there’s only a 6.3% chance that one of them shares a birthday with you.

However, I didn’t specify which two people had to share a birthday, it’s not all about you, you know. What we are doing is comparing each person to every other person, giving us 253 distinct pairs of people. While this doesn’t help much with the calculation, it does make the answer seem slightly less surprising.

The comparison process

Want some proof? Lets first think about the probability that none of the 23 people share the same birthday, and think about each person in turn.

The probability person 1 has a different birthday than people we’ve previously analysed is 1 (as he haven’t analysed anyone else).

The probability  person 2 has a different birthday than person 1 is \frac{364}{365} (this is the same as saying there is only a \frac{1}{365} chance of them sharing a birthday).

The  probability person 3 has a different birthday from person 1 and 2 is \frac{363}{365}.

And so on and so on, you get the idea. This continues until we reach the 23rd person.

This means that the probability of no one in a room of 23 people sharing a birthday is

1*\frac{364}{365}*\frac{363}{365}*\ldots*\frac{343}{365}=0.49270276

The probability that two of group do share a birthday is therefore

1-0.49270276=0.507297 or 50.7297%

See, I told you so. Interestingly, you only need 57 people to give a 99% chance that two of them share a birthday. The percentage gets unbelievably close to 100% the closer you get to 366 (99.9999999999999999999999999998% at 200 people) at which point the pigeonhole principle dictates it reaches 100% (if 365 people all have different birthdays, what is the chance that a new member has a different birthday to all of them, excluding leap years?)

Like this, but with people

So there you have it. Want to amuse yourself and impress your friends at parties? Simply badger everyone for their birthday, neatly arrange all of your results and wave goodbye to your social life. Who wants to be popular anyway?

Bookmark and Share

Irrationality

July 4, 2010


When I talk of irrationality, I mean, of course, irrational numbers. Now these numbers are not irrational in the same way your girlfriend is, these numbers go on and on and on forever and ever and ever. Ok, maybe there are some similarities, but unlike your girlfriend these numbers never repeat themselves.

Perhaps I should clarify (the extended girlfriend comparison made things a little complicated). An irrational number is one that cannot be expressed as the ratio of two integers, a fraction if you will. So while numbers like a third (0.333…) and a ninety-ninth (0.0101…) extend infinitely, they can be written as 1/3 and 1/99 respectively.

Pi (π = 3.1415…) is an example of an irrational number. “Hang on”, I hear you cry. “You’ve only quoted 5 numbers there, how do we know there’s no repeating sequence?” Well, you can either trust me or check for yourself. No, go on, I’ll wait. Nothing? Still, this doesn’t really prove anything, does it? It could repeat after the millionth digit, or the billionth. Proving it never repeats by checking every digit is like trying to prove you can hold your breath for an hour. It’s a remarkable effort, but you’ll definitely die before you reach the end.

No, George, that wasn't a challenge.

To add to the confusion, many of you may have used the approximation pi ≈ 22/7 (333/106 if you were really clever), which seems to show pi as the ratio of two integers. However, this doesn’t quite cut it after a certain number of decimal places. There is a proof of the irrationality of pi, but it’s a bit complicated for this blog.

A much simpler proof involves √2.
Start by assuming √2 is rational.
Then √2 = p/q where p and q are integers and p/q is in its simplest form.
Squaring both sides gives 2 = p²/q²
Multiply both sides by q² to give 2q² = p²q²/q² then cancel
So 2q² = p² meaning p² is even
Therefore p is even (it cannot be odd, as this would make  p² odd) and can be written as p = 2m
Then 2q² = (2m)² = 4m²
This simplifies to  q² = 2m²
By the same argument q is even and can be written as q = 2n
Going back to the start then, √2 = 2m/2n = m/n
But we specified at the start that p/q was the simplest form, so we’ve found a contradiction. Therefore √2 is irrational.

Pretty neat, huh? This is a beautiful example of proof by contradiction, a method whereby you assume the opposite to be true and then show that it is logically inconsistent. It’s like assuming your friend isn’t stealing from you, finding all of your bank statements in his house and concluding that you are an extremely poor judge of character.

Bookmark and Share

Winning The Lottery

July 3, 2010

I thought I’d start my blogging career with a bang, a desperate push for immediate attention if you will. And what better way than by explaining how to win the freaking lottery.

Wait, don’t click away! It’s not a scam (or even a particularly practical guide to winning the lottery, but we’ll get to that). We’ve all seen the scams, either claiming you have already mysteriously won huge sums of money or asking for you to pay for their foolproof technique for picking the right numbers. I am definitely not claiming to have millions of pounds to give you and I am not asking for any payment whatsoever. Being a student I will obviously accept any donations (monetary or alcoholic), but I’m not demanding anything. I’m nice like that.

Incidentally, one of my favourite lottery ‘techniques’ is to pick your numbers based on what kind of streak they’re on, presumably because some lottery balls are better at wiggling their way out of the machine than others (although, there’s likely to be some differences in probability given the minute discrepancies in the size and weight of the balls. While I’m confident the differences in probability are negligible, the thought is worth a little digression) . Do not pick numbers based on hot streaks. Please, it makes statisticians cry.

Pictured: Mario's 'hot' balls

Of course, there are ways to maximise your potential winnings. These include  keeping your numbers secret from friends and family and avoiding popular choices of numbers. The latter requires avoiding sequences played by thousands of other people, like 1 2 3 4 5 6 (the former requires a sociopathic dislike of everyone close to you). This rules out the terrifying prospect of winning the lottery but having to split it with thousands of less deserving people. Because when it comes to winning millions, nobody likes to share.

Unfortunately, none of this actually increases your chances of winning that jackpot. There is, however, an unbelievably simple, nay foolproof, way to double your chances every time you play. All you have to do is buy another ticket. Triple your chances? Buy a third! In fact, you can increase your chances of winning by whatever factor you wish by buying more and more tickets. I think you can see where I’m going with this.

So many chances!

All you have to do to guarantee you win is buy every combination of ticket (I did warn you it wasn’t a terribly practical guide). Simple, eh? Not quite. There are nearly 14 million combinations in the UK lottery and each one is going to cost you a pound. That’s a fairly massive investment. Still, it’s still worth it, right? If the jackpot is at £15 million that’s still a £1 million profit, not a bad weeks work if you ask me.

Unless someone else also wins, then you’re in trouble. That £7.5 million return isn’t looking great compared to your original investment, and that’s if only one other person wins. It’s looking less and less worth the risk with every additional leach on your prize money. But at what point does it become worth it? What size does the jackpot have to be for it to be profitable to buy every ticket?

Let x be the jackpot. If 40% of the time no one wins, 35% of the time there’s one winner, 15% of the time there’s two winners and 10% of the time there’s three winners, then the expected value of the investment would be (0.4 *x) + (0.35*½x) + (0.15*x) + (0.1*¼x) = 0.65x. This means that you would expect a profit when your investment is 65% or less of the jackpot. In the example of the UK lottery, buying every ticket would become profitable when the jackpot reached about £21.5 million (although even in this case you lose money if there’s another winner).

Ok, so the theory is pretty solid, but realistically its impossible. There’s no way anyone could raise millions and get all the tickets required to win. Unless you’re the Australian syndicate who won $27 million in the 1992 Virginia State Lottery in the USA. That’s right, these guys chucked a few quid together and literally bought as many lottery tickets as possible. Even then they only managed to buy about 70% of the combinations, resulting in what must have been the most tense lottery draw in history.

So, looking for something to do this summer? Grab some friends, find a few thousand investors and wait for a big rollover. You’ll be rolling in cash in no time.

Bookmark and Share