Subscribe by email

2011/10/29

Codebreakers: Bletchley Park's Lost Heroes

Most people have at least heard of Bletchley Park, the UK's codebreaking centre during World War II. Even if you haven't heard of the place, you've probably at least heard the name of the most famous code to be cracked by them: Enigma.

This BBC program details the history behind an even tougher code that is less well known, but appears to have been just as vital to the war effort as deciphering Enigma-encoded messages. The story is also one of the people behind the scenes, especially two mathematicians whose contributions, although invaluable, have gone largely unrecognised by history.

The Lost Heroes of the title are Bill Tutte and Tommy Flowers, both of whom made significant steps in the race to understand and decode messages sent by Nazi forces: Tutte made great strides in understanding with regards to machine-based ciphers, and Flowers designed and developed the world's first electronic computer, Colossus, in an effort to speed up the process by which messages were decoded.

Timewatch - Code-breakers: Bletchley Park's Lost Heroes: 

2011/08/18

What's my score?

I hadn't played Yahtzee in years, but the other night I settled down to possibly the best couple of games I've ever played.

For those not in the know, Yahtzee is a game from Hasbro (My copy's from MB Games... that's how long it's been!) that's been around since 1956. Put simply, it's a game in which players roll five dice and are given a score based on what is rolled.

We played two games, and they were probably my best ever scores (though that doesn't say much; I'm not exactly a pro). In my first game, I scored exactly 80% of the maximum possible mark (assuming no bonuses for extra "yahtzee*"s), and in the second I scored 89% of the maximum, rounded to the nearest whole

  1. What was my score in the first game?
  2. In the second game, what's the highest score I could have got? What's the lowest?
Have a go at the questions before looking at the answers below!


The solutions

I'll remind you here as well that there are usually many, many ways of solving problems, so if you haven't done it the same way as me that doesn't mean that you've done it wrong. In fact, if you do it a different way I'd like to see an explanation in the comments- it might even be a better** way of doing it!


Part 1)
Look at the information I've given you: I got 80% of the total possible score. Assuming you know something about percentages*** then all you need to know is the total possible score. If you don't know the game, here's a scorecard to look at:

You just need to think of the best possible score for each roll, and record it, then add anything up, taking into account any bonuses. The overall total should come to 375. Comment and ask if you're not sure how to get that.

Now all you need to do is work out 80% of 375, then you've got my score for game 1:

One way of doing this is to find 10% (divide by 10) and then multiply by 8 (as 8 lots of 10% is 80%). So:

375 / 10 = 37.5
37.5 * 8 = 300

  • My score for game 1 was 300 points exactly!


Part 2)
This one's trickier. The question asks for my highest and lowest possible scores because I didn't get exactly 89% - I rounded the answer. This means that finding 89% of the maximum possible score won't give the score I got, as it could have been a bit smaller or a bit bigger than that. In fact, if you work out 89% of 375...

375 / 100 * 89 = 333.75

... you don't even get a whole number, so it's actually impossible to get exactly 89% of the maximum score in a game of Yahtzee. So we'd have to make a guess. Luckily we can use the information given to make that guess as accurate as possible- we can find a sensible low- end for our guess, and a sensible high- end, and go somewhere in between. That's what the question means when it asks for the highest and lowest scores that I "could have" got.

To do this we need to look at that percentage first: I said I rounded it to the nearest whole percent, which was 89. So what are the lowest and highest answers I could have got before I rounded it? Any more than 89.5%, and I'd have rounded it up to 90%. Any less than 88.5%, and it'd have gone down to 88%. If we work out the two percentages in bold, we'll have our answers:

375 / 100 * 88.5 = 331.875
375 / 100 * 89.5 = 335.625

They're the highest and lowest scores, but now our common sense should kick in: there's no way of getting a decimal score in Yahtzee! That means the for the lowest score, we've got to pick 331 or 332, and for the highest, we must choose 335 or 336. But which one? Well, the lowest score that would end up being rounded to 89% would be 331.875. Any lower than that and we won't get 89%, so it must be higher than that: we pick 332. Using similar reasoning, but at the other end of the scale, we must pick 335 as the highest score that I could have got.

  • My score for game 2 was somewhere between 332 and 335 inclusive.


Is it possible to be any more accurate than this?





* In the game Yahtzee, a 'yahtzee' is rolling five of the same number in one turn, i.e. after three rolls you end up with 5 twos, or 5 sixes, etc.
** What makes one answer 'better' than another, assuming that both are correct? That might be a subject for another post...
** If you don't, ask me for a post ;-)

2011/02/22

If you fold a piece of paper 50 times, will it reach the Moon?

This post was prompted by @mikemcsharry 's tweet of a similar nature the other day. But is it true? For the pedants out there, I'm assuming that we're folding our imaginary sheet of paper exactly in half each time.

Stuff we need to know:
It's about 384,400 kilometres away, and counting.
  • How thick is a sheet of paper?
That all depends on the quality of paper and the manufacturer. Typical office paper (80 "gsm"*) is about 0.1mm thick, I think. As it makes sense to have everything in the same units, 0.1 mm is 0.0000001 kilometres.

Answering the question, part 1: How thick is a piece of paper folded 50 times?
I've seen this question tackled before, and the biggest mistake is to rush straight in and say "if we fold the paper 50 times, the paper will be 50 times thicker".

Think about it like this (feel free to grab a sheet of paper and try it):
  • Fold a piece of paper in half once. It's twice as thick as it was, right?
  • Fold it in half again. It's now twice as thick as it was last time- if you've got the paper in front of you, you can count the layers: it's four times as thick as the original piece of paper.
  • Fold it in half again. if you count the layers, you'll see that it's now eight times thicker than the original.
By now, it's fairly easy to see what's happening: each time you fold, you're doubling the thickness of your lump of paper. That means it's fairly easy to see the long, slow way of calculating the thickness of the paper after 50 folds:

Start off with the thickness of one sheet, and then double it. Double it again. Double once more. Double again. And again. And again. Keep going until you've done it 50 times. If you're into button-mashing** on a calculator, you could type this in:
  • 0.0000001 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 = 112,589,991
Because the original number (0.0000001) was in kilometres, we know that the answer must be. So if we fold a piece of paper 50 times, it would end up being 112,589,991 kilometres thick!

Answering the question, part 2: Would this reach the Moon?
This is the easy bit: we just have to compare the two numbers:
  • Distance to Moon: 384,400 km
  • Height of paper folded 50 times: 112,589,991 km
The second number is bigger (and, importantly, given in the same units), so we have our answer: yes, it would!

But it'd be boring to stop there...
  • 112,589,991 / 384,400 = 292.897999...
That means that our folded paper would reach nearly 300 times further than the Moon! So what's that far out?
  • Travelling inwards from Earth to the Sun, we'd cross the orbit of Venus just after climbing a bit more than a third of our stack of paper.
  • About 80% of the way up our stack, we'd cross Mercury's orbit.
  • We'd be about 3/4 of the way to the Sun when we were standing on top of our paper tower.
  • Travelling outwards from the Earth away from the Sun, we'd cross Mars's orbit a bit more than a tenth of the way up the stack.
  • We wouldn't quite reach the main asteroid belt, and we'd need more than 400 more of these paper towers to reach the next planet, Jupiter.

Why don't we do it, then?!
Give it a try! If you get past 8 folds (remember, you're folding the paper exactly in half each time!), I'll happily send you a Mars bar. Any more than 10 and I could probably be persuaded to give you my car.****






* Why they can't use standard notation, I don't know. "gsm" stands for 'grams per square metre', which would properly be written as "g/m2"
** I'm not into button mashing. There has to be an easier way - we can use powers:
  • 2 x 2 means the same as 22.
  • 2 x 2 x 2 means that same as 23.
  • 2 x 2 x 2 x 2 means that same as 24.
See the pattern? So,
  • 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 means the same as 250.
This means that we can write our calculation much more easily and accurately*** as:
  • 0.0000001 x 250 
*** We're typing less, so there's less chance of' 'user error'.
**** As a disclaimer, you're not getting my car.

2011/01/18

Your birth year + your age = 111. How?

There's a meme flying round the internet at the moment that tells you to...
... add the last two digits of your birth year to the age you will turn on your birthday this year (2011, for any time travellers). It tells you the answer will be 111.
For me, born in 1982 and turning 29 in October, this would be 82 + 29 = 111. Try it with your own details...

It works!

But how?
To complete this task, you need to know two pieces of information: the last two digits of your birth year, and the age you will turn this year.

Your birth year is easy- just take the two digits off the end: for me, it's 82.

You probably know your own age, but if we're going to figure out how this works, we need to think about it in a different way. To find out your age knowing only the year you were born in and what year it is now, you could subtract your birth year from this year. Using my info, that'd be...

 2011 - 1982 = 29

... which I can confirm is correct!

The thing is, we're only supposed to be using the last two digits of the year, so lets try...

 11 - 82

That gives us a strange value: -71. But consider that the leading two digits of the years we're using are different: 20 and 19 respectively, and remember that this is because we're in different centuries: a century is 100 years, so add this on and what do we get? 29!

So to find out the age this year of anyone who was born during the previous century using only the last two digits of the year, we could do the following:

 Age = 11 - the last two digits of their birth year + 100

This looks a bit clumsy, so I'm going to use the letter 'x' to represent 'the last two digits of their birth year':

 Age = 11 - x + 100

Lets clean it up further: We start off with 11, take something from it, and then add on 100. Why not deal with those two numbers at the same time? If I start with 11 and then later add 100, I may as well start off with 111 in the first place:

 Age = 111 - x


Right, that's the slightly complicated bit sorted. Lets put it all together:

The info we need:

  • Last two digits of birth year: we're calling this x.
  • Age this year: we're saying this is 111 - x
What we have to do:
  • birth year + age;
  • Using the notation we've defined above, that's: x + 111 - x
But wait... we're starting off with whatever x is, then adding on 111, then taking x off again. Whatever x turns out to be, it doesn't really matter because we're just getting rid of it, leaving just...

111

... all by itself!

An important point...
... just pointed out to me by @justfin is that, due to the fact that two-digit years go in 100-year cycles, anyone who's over 100 years old this year will find that they get an answer of 211 instead of 111!

Popular Posts

My Blog List

Creative Commons Licencing Information