A post where football meets science again 🙂 This time, it’s about probabilities.
On 11 December 2017 the UEFA Champions League draw will take place. There will be 16 teams which will be drawn one against each other. There are some restrictions:
– 8 teams are seeded, the other 8 are unseeded. A seeded team can only be drawn against an unseeded team
– teams from the same country cannot be drawn against each other
– teams that already met in the previous round cannot be drawn against each other
Based on these elements, I wanted to calculate the associated probabilities, or other words to reveal the question marks in the matrix below:

(first column – seeded teams, first line – unseeded teams, greyed cells – teams cannot be drawn).

Try 1: Thursday night

I make a quick PHP script to calculate all the possible permutations (8!=40320), then I eliminate the invalid options and find that only 4238 permutations are possible. I count all the possible team pairings as below:

I calculate the associated percentage for each pair (example for Liverpool-Real it’s 799 out of 4238=18.85%) and, after half an hour spent choosing a color scheme, I put everything in the matrix:

Then I realize that the numbers are slightly different from the ones circulated on social media:

Try 2: the entire weekend

I get a very nice explanation on Twitter from the author of the tool above:

Then I start to realize that my approach was incorrect.
In fact, my numbers were only valid if the draw process consisted of a single step – somebody picking up a random number from 1 to 4238 and then showing up the 8 pairings behind that number.
But in fact, the draw process consist of 8 steps or 8 events, each one depending on the previous one. We speak in this case of conditional probabilities, which are represented using a probability tree. The probability tree for a subset of 6 teams looks like this:

And indeed, the tree simulates the real draw process and reveals the same numbers as the ‘official’ ones:

Since the draw is in less than 12 hours, I have no time to make another script that generates the full tree (that would also be too big to put in a picture). But I trust the numbers from https://eminga.github.io/cldraw/ are correct 🙂


Amazon interview question

Written on 15 February 2014, 12:18am

Tagged with: , , ,

From Stack Exchange:

• 50% of all people who receive a first interview receive a second interview
• 95% of your friends that got a second interview felt they had a good first interview
• 75% of your friends that DID NOT get a second interview felt they had a good first interview
If you feel that you had a good first interview, what is the probability you will receive a second interview?

The easiest way (at least for me) to go is to turn those percentages into some real numbers. For instance:
– 100 friends that got a second interview; 95 of them felt that they had a good first interview
– 100 friends that did NOT get a second interview; 75 of them felt that they had a good first interview.
Now, if you ignore the fact that it’s pretty difficult to have 200 friends (let alone the fact that they all applied for a job at Amazon 🙂 ), the numbers say that:
– 95 + 75 = 170 friends had a good feeling after the first interview
– but only 95 of them had a second interview
– so the probability of you having a second interview is 95 / 170 = 0.558.
In other words, if you felt good after the first interview, you have more than 50% chances that you get a second interview.

Image: HollywoodReporter.com

Now, if you come up with the answer 55.8% to your Amazon interviewer, I think you would get some points. But not all of them. Because in the logic below there are 2 hidden assumptions: