John Faben's Homepage
  • Home
  • CV
  • Maths
    • Research >
      • Mouse Maze
      • My PhD Thesis
    • Teaching >
      • Counterparty Credit Risk
      • Outreach
  • Bridge
  • Blog
  • HIPE

Riddler Express: Penalties

14/7/2018

0 Comments

 
 This week's Riddler Express is, inevitably, about the World Cup again. It's one of those that begs to be solved empirically (which I've done here: https://github.com/johnfaben/riddler/tree/master/Penalties), but is probably also relatively easy to solve exactly, so I'll give that a go below. ​
This year’s World Cup has been chock full of exciting penalty shootouts. Historically, about 75 percent of soccer penalty kicks are successful. Given that number, what are the chances that a shootout goes past its fifth kick for each team and into the even more exciting sudden-death portion of the penalty-kick period?
0Here's my first try. There are three ways for a shoot-out to end early. After three penalties, when one team is 3 ahead, after four penalties, when one team is 2 or more ahead, or after 5 penalties, when one team is 1 or more ahead. It ends after three about 0.7% of the time (one team makes all three of their 3/4 shots, and the other team misses all three, and 3*3*3/4*4*4*4*4*4 = 27/4096). 

It ends after four if one team is 2 or more ahead after the first penalty, but was not 3 ahead after the fourth. This is... wait, this is going to get tricky. Why am I bothering to consider how many penalties are actually taken?!? That will lead to some horrible conditional probabilities, and all I really care about is whether it is over after 5 penalties. 

Here's my second try. There are 6 ways for a shootout to go to sudden death. The teams score 0 each, 1 each, 2 each, 3 each, 4 each or 5 each. 

The probabilities of these outcomes are: 

0 each: 
((1/4)^5)^2 = 1/1048576 ~= 0.00001%
1 each
(5C1 *3/4*(1/4)^4)^2 = 225/1048576 ~= 0.002%
2 each: 
(5C2 * (3/4)^2 * (1/4)^3)^2 = 8100/1048576 ~= 0.77%
3 each: 
(5C3 * (3/4)^3 * (1/4)^3)^2 = 72900/1048576 ~= 6.95%
4 each: 
(5C4 * (3/4)^4 * 1/4)^2 = 164025/1048576 ~= 15.64%
5 each: 
((3/4)^5)^2 = 59049/1048576 ~= 5.63%
So the final probability is 304300/1048576, or roughly 29%. 

How does that match up with what I found with a simple simulation? 
In 10000000 trials, draws happened 29.02% of the time
0 - 0: 0.00%
1 - 1: 0.02%
2 - 2: 0.77%
3 - 3: 6.95%
4 - 4: 15.64%
​5 - 5: 5.63%

Not bad... not sure whether this should make me trust my maths more or trust my ability to code up tiny simulations more, probably a bit of both.

I would note that the Python version is much easier to adapt to different success rates... England had a 66% record in shoot-outs going into this World Cup, although they scored 4/5 against Colombia, bringing it to 70% overall, whereas Germany have scored 94%... a quick tweak to the script suggests that England would take Germany to sudden death just 21% of the time, losing in the first five kicks 73% of the, and winning just 6 times in 100. Luckily for England, Germany didn't make it past the group stages... 
0 Comments

Riddler Classic: rectangles

14/7/2018

1 Comment

 
This week's Riddler Classic is slight variation on a classic puzzle. In fact, it's a special case of the classic puzzle, but despite that, I think is probably actually harder than the original. Inspired by James Barton's 15 minutes of fame last week, I thought I'd write up my solution to this one. 

Here's the puzzle: 
Say you have an “L” shape formed by two rectangles touching each other. These two rectangles could have any dimensions and they don’t have to be equal to each other in any way. (A few examples are shown below.)
Using only a straightedge and a pencil (no rulers, protractors or compasses), how can you draw a single straight line that cuts the L into two halves of exactly equal area, no matter what the dimensions of the L are? You can draw as many lines as you want to get to the solution, but the bisector itself can only be one single straight line.
Picture
How to go about this? Well, the first thing to notice that any line which goes through the centre of an individual rectangle bisects the area of that rectangle exactly. To see this, consider what happens if you rotate the rectangle through 180 degrees - the line will meet itself, and the two pieces will sit on top of one another. So not only does every line through the centre of a rectangle divide into two pieces of equal area, it actually divides it into two congruent pieces. 

So how does that help us? The key is to realise that an 'L shape' is actually two rectangles - one filled in, and one blank. It's easy to construct the sides of the 'blank' rectangle by just extending top and right hand side of the 'L' (the dotted black lines in the right hand diagram). You can then find the centres of both rectangles by drawing their diagonals (the blue and red crosses). 

Now, the line which passes through the centres of both of these rectangles bisects the area of the big rectangle and also bisects the area of the small rectangle, so it must bisect the area of the L shape as well (half of the big rectangle is equal to half of the small rectangle plus half of the L). 
Picture
Ok, nice puzzle - but what about the the classic puzzle I mentioned earlier? Well, there's no reason in this puzzle for the little rectangle and the big rectangle to be lined up so neatly. (in fact, there's not really any reason for them to be anywhere near each other). The 'classic' version of this puzzle that I've heard before is about cutting a cake with special frosting on one section, and dividing the special frosting exactly in two, for which the solution is pretty much exactly the same. 
Picture
There are some interesting extensions to this new puzzle. It's pretty clear that wherever you put the icing on an rectangular cake, and whatever shape it is, you can always divide both cake and icing exactly in two with a single straight cut (rotate the knife around the centre of the cake, it will eventually pass over the whole of the icing, so at some point it must divide it exactly in two), although you won't necessarily be able to construct this with just a straightedge. But for what other shapes of cake and icing is it possible to do this in general? And when you do need the icing to be carefully placed to allow it to work? 

As I said, I think the L shape puzzle is actually probably harder than the more general version, because the way the rectangles are arranged makes it possible to draw so many more lines - if you're given the 'tilted' version, there's basically only one thing you can try with a pencil and straightedge. With the 'L shaped' version, it's possible to go down a variety of dead ends joining up corners of the L with each other before you get to the answer. 
1 Comment

    John Faben

    This is a blog. It doesn't currently contain anything, but one day it might, in which case this note will be incorrect, unless it changes.

    Archives

    August 2020
    July 2020
    February 2019
    August 2018
    July 2018
    June 2017
    March 2017
    September 2016
    July 2016

    Categories

    All

    RSS Feed

Proudly powered by Weebly