Wednesday, 19 March 2014

Crunching the Numbers

This is a modified version of a post from March 2011 and is dedicated to David Moyes, a misunderstood genius just like me ;)

In interviewing scores of people for jobs in schools over the years, I have met many people who were quite happy to admit they felt uncomfortable with numbers, and mathematics in general.  My aim in this particular post is to explain some probability calculations in an accessible and readable way, and try to demystify some of the supposed difficulty.

Here’s a question: "What are the chances of Man Utd playing Chelsea AND Real Madrid playing Barcelona in the Champions League Quarter-Final draw?"  (Doesn't matter which team is at home in the first leg.)

The classic quarter-final draw has eight balls in one pot, which can be drawn out with no special seedings or restrictions, to give four ties, with home & away teams decided by the order of the draw.  The mathematics is exactly the same for the current Champions League quarter final draw and the Sixth Round of the FA Cup or the FA Vase.

Whatever happens, the chances of it happening will be 0.059523809%, and hopefully this post will prove it in a way that is relatively easy to understand.

Step One – How many alternative draws are there?

Imagine the balls are numbered 1 to 8.  They could emerge in the order 4>3>7>1>8>5>2>6 but this is only one of many possibilities.

To establish the pattern, let’s simplify things and consider a draw of only two teams.  There are TWO possibilities for the first ball out, 1 or 2.  However, whichever one comes out, there is only ONE ball left in the bag.  So the only possible sequences are 1>2 or 2>1 and a total of 2 x 1 = 2 possibilities.

For three balls in a bag, there are THREE different possibilities for the first ball out.  For EACH of these outcomes, there are TWO different possibilities for the second one out, and then the third is fixed because there is only ONE left.  This means 3 x 2 x 1 = 6 possibilities.  They are 123, 132, 213, 231, 312 and 321.  (This pattern does not appear in cup draws as there are an odd number of teams!)

Four balls in a bag is a classic semi-final draw, and I have covered this in a previous post.  Hopefully it is clear by the same logic that there are 4 x 3 x 2 x 1 = 24 possibilities, and the table in the post covers them all for the conspiracy theorists.

These numbers are known as factorial numbers and denoted by the ! symbol in conventional mathematical notation.  1! = 1, 2! = 2, 3! = 6 and 4! =24.  So the first number that we need for our quarter-final analysis is 8! = 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1 = 40320.  In other words, the sequence 43718526 that I mentioned above is only one of 40320 unique possibilities for the appearance of the balls.

(We will need to remember later that some of the different sequences have the same sporting outcome in our particular example.  If the teams appear in the order 12345678 then the matches will be the same as if they appear 78563412.  More of this later.)

(These numbers get pretty large in the earlier rounds of the competition.  Try working out the number of possible draws for the third round of the FA Cup, which has 64 teams!  It's about one hundred and twenty-seven thousand billion billion billion billion billion billion billion, using a billion to mean a million million.  Perhaps we'll come back to this next January, if you are still speaking to me.)

Step Two – What is the chance that Man Utd will play Chelsea?

In my question, I made no distinction about which team was home or away on the first leg, so common sense takes us the next step.  Assuming the draw is fair, Chelsea is one of seven possible opponents for Manchester United.  All of these opponents are equally likely, so the chance of any named one is 1 in 7 (expressed as betting odds), one seventh (expressed as a fraction of one) or 14.2857% (expressed as an approximate percentage chance).  You can see this by working out 100 divided by 7 on a calculator, and it is an example of a recurring infinite decimal.  One seventh is 0.142857142857142857…. with the six numbers repeating in the same order.

Putting this visually, the size of this rectangle represents all the possible 40320 draw outcomes.  The reason why this is a 5x7 grid will become clear shortly.

In one-seventh of these (5760 of them to be precise), Manchester United will play Chelsea.  In another 5760 of them, Manchester United will play Real Madrid.  Manchester United have to play someone, and 7 x 5760 = 40320 as all seven opponents are equally likely as we said.

So the green-shaded area represents the 5760 possible draws in which Manchester United would play Chelsea, and the other six teams are playing each other in all the various permutations.

Step Three
What is the chance that Man Utd will play Chelsea AND Real Madrid will play Barcelona?

For the second part of my question, we have to focus ONLY on these 5760 possible draws that put Manchester United and Chelsea together.  Real Madrid may play Barcelona in lots of possible draws in which, say, Manchester United played Bayern Munich and Chelsea played Dortmund.  Those would be irrelevant to the question, which is about the chance of two things happening simultaneously.  To mathematicians, the word AND is very different from the word OR in these types of problem.

So let’s assume that Manchester United are to play Chelsea, in one of those 5760 possibilities shaded in green.  Real Madrid must be playing one of five other opponents, equally likely.  So one-fifth of those 5760 outcomes will have Man Utd v Chelsea AND Real Madrid v Barca.  5760 divided by 5 is 1152.  In other words, 1152 of the 40320 possible draws will have these two pairings.  (The other two pairings could be either way round, it wouldn’t affect the answer to our question.)

Visually …

The dark-blue segment represents our answer in which Man Utd play Chelsea AND Real Madrid play Barca.  It is one-thirtyfifth of the whole rectangle.

So we have two ways to calculate the final answer.

The fraction one-thirtyfifth as a percentage is worked out by pressing 100 divided by 35 on a calculator and we see 2.85714%.  Again, those numbers would repeat in an infinite decimal.  The same answer is achieved by calculating the odds as 1152 divided by 43020 and multiplied by 100 to get a percentage.  2.85714% again – it’s really exactly the same destination, just reached by two different routes.

Step Four – Finally, why does any real draw have a 0.059523809% chance of happening?

Remember that there are 40320 unique draws – each one is a unique sequence of the eight balls.  The chance of any individual sequence, say 14528763, is 1 in 40320 (expressed as odds), 1/40320 (as a fraction) and 0.00248015873% as a percentage.  If you try 100 divided 40320 on your calculator it will either round it to something like 0.00248 or will show it in something called standard form as 2.48015873 x 10-3.  I’m guessing that if that means anything to you, you have easily understood the rest of this post so I am moving on quickly.  It’s a small chance – one in about forty thousand.

However, in this particular context it doesn’t really matter to us which order the four ties come out.  Remember I said earlier that we would need to come back to this point.  With four ties to be drawn, there are 24 possible ways of getting the same sporting pairs with the same home/away order (by the same logic as the semi final draws), so my final step is to say that this combination of teams in the right home/away order would have come up from 24 out of the 40320 possible outcomes, and the same type of calculation gives us 0.059523809%. 24 divided by 40320 multiplied by 100 if you want to check.

Remember, you will be able to say, “Well, that had a 0.059523809% chance of happening!” EVERY year after EVERY FA Cup Round Six draw.  The numbers will always be the same, and if that doesn’t win you gasps of admiration I’ll be amazed.

Postscript – What were the chances of an all-Spanish tie?

There are three Spanish teams in the draw, so there could be one all-Spanish tie, or none.  Going back to our visualisation, the green area represents all the possible 5760 outcomes in which Real Madrid play Barcelona.  Atletico could be playing any one of the other five teams.  The orange area represents all of those (another 5760) in which Real play Atletico, and Barcelona could be playing any one of the other five.  The purple area is for Barcelona playing Atletico.

We can see that as a fraction this is three-sevenths, or (3 x 5760) out of 40320 = 17280 / 40320.  Either route leads us to 42.8571% and those same digits in a different order!  Beautiful, I think you'll agree.

So there we are.  Welcome to my world.  I told you there'd be tangents, and remember, "Chance is a Fine Thing". :)

Saturday, 15 March 2014

I Was There

Apologies for the fact that this is the first MHR jaunt of 2014.  It’s not that I’ve not been blogging, more that I’ve not been anywhere.  The demands of full-time work as a secondary school team leader for science (my life since last Easter) have increased to the point where most weekends have been spent simply recovering or catching up.  I couldn’t safely cover the road miles.  I hope that this will change and I will soon be adding to my 529 football grounds.  However, when a friend from university days contacted me at 4pm on a Monday with the kind offer of a weekend escape …

Hopperational details
Date & Venue
Saturday 8 March 2014 at Murrayfield, Edinburgh
Result
Scotland 17 France 19
Competition
Six Nations Rugby Union
Hopping
First trip to Murrayfield.  Slightly surprised to count and find that this is only my 7th rugby ground of which 3 would be double-counted for “soccer”.  For the record my 4+3 are Grange Road (Cambridge University), The Reddings (Moseley), Twickenham and now Murrayfield with Vicarage Road, Loftus Road and the Madjeski Stadium as the duplicates.
Pre-match preparation
Easyjet Friday night to Edinburgh with lots of Frenchmen in cockerel hats, a bus ride to a pint of Tennants in the Kublai Khan Mongolian BBQ in Leith and a reunion with some university friends – the first time in over 20 years that this particular combination of characters has been together in one place.  You know who you are, you legends.  Cab ride to apartment for further reminiscing.  The years fell away.  Saturday morning Number 10 bus to Princes Street (no laughing at my Mr Sensible Edinburgh Bus Map, lads), walk up to the castle and along the Royal Mile for Deuchars IPA before settling to pies n’pints o’heavy.  Management of ageing bladders demanded coffee & cake pit stop half-way to the ground before we settled in front of the big screen in Murrayfield to watch Ireland’s demolition of Italy and drink Guinness.

This match in one sentence
Scotland could and should have won it, but gave a late, late chance to France who won the game with only seconds to spare.
So what?
France will get a chance to win the championship with a showdown in Paris against Ireland, depending on the earlier Italy v England result.
The drama unfolds
Lots written elsewhere about this game so this late blogpost is irrelevant as far as match analysis is concerned, so this is just an “I was there” post to at least remind readers that I still exist.

 An early penalty for Les Bleus
After a rousing set of pre-match rituals mostly involving bagpipes (whoever thought of Red Hot Chili Pipers is a genius) Scotland found themselves 0-6 down to two Maxime Machenaud penalties within 10 minutes.  The sense of anti-climax was immense but fortunately short-lived.  Stuart Hogg hoisted a kick into the in-goal area and in the swirly conditions followed up to claim a controversial try.  Greig Laidlaw converted to give the hosts a 7-6 lead.

Machenaud’s third penalty made it 7-9 before Scotland winger Tommy Seymour finished a set-piece move on the left for the second try of the game, Laidlaw converting again for 14-9 with only 22 minutes gone and a belting atmosphere inside the ground.  The rest of the first half was not pretty – Scotland missed a drop goal, France missed a penalty – but Scotland would be very happy with their half-time lead.

My host took the half-time opportunity to introduce me to the contents of his hip-flask, which is the nearest I have ever been to solvent abuse even in a lifetime of chemistry teaching.  I hoped that Scotland would keep it tight and make sensible game choices.  That's what I was thinking, but I had suddenly lost the power of speech.

Therefore, France took the lead within seconds with an 80m breakway interception try from Yoann Huget. Unbelieveable. Duly converted for a 14-16 scoreline.  The French forwards had not been impressive and the feeling was that the Scots had been overgenerous in helping their visitors to garner points – next score would be critical.  Laidlaw missed one penalty before Duncan Weir took over kicking duties and gave Scotland a 17-16 lead.  18 minutes to go.

They held out for 16 of them, easily enough.  It was not great to watch, but compelling. Then a soft infringement during France’s final flourish gave Jean-Marc Doussain an unmissable penalty chance.  17-19.  The whistle came, stunned silence and a sense of disbelief.  Except for the men with the cockerel hats, they were really rather happy.

Just as a footnote, I reckon if anyone had introduced me as a kid to rugby union and the culture of the sport and its spectators, I would have never flowed the crowd into “football”.  Post-match analysis took place after a pint of Orkney Stout (yum!) at Britannia Spice in Leith, and I was back on solids by Tuesday.  Epic weekend, great sporting spectacle, great mates, great city.

Edinburgh  Pix

Clips
1 - Scene-setter clip and then Tommy Seymour's try
2 - The French interception and breakaway try right at the start of the second half
3 - A tale of two Scottish pens, a Laidlaw miss and a Weir success
4 - Critically, this Weir penalty drifts wide of the posts
5 - The match-winning French penalty kick from behind a man in a cockerel suit!

4

What Next?
Watch @GrahamYapp on Twitter for details!