mscroggs.co.uk
mscroggs.co.uk

subscribe

Blog

Archive

Show me a Random Blog Post
 2017 
 2016 
 2015 
 2014 
 2013 
 2012 

Tags

folding paper folding tube maps london underground platonic solids london rhombicuboctahedron raspberry pi weather station programming python php inline code news royal baby probability game show probability christmas flexagons frobel coins reuleaux polygons countdown football world cup sport stickers tennis braiding craft wool emf camp people maths trigonometry logic propositional calculus twitter mathslogicbot oeis pac-man graph theory video games games chalkdust magazine menace machine learning javascript martin gardner reddit national lottery rugby puzzles advent game of life dragon curves fractals pythagoras geometry triangles european cup dates palindromes chalkdust christmas card bubble bobble asteroids final fantasy curvature binary arithmetic bodmas statistics error bars estimation accuracy misleading statistics pizza cutting captain scarlet gerry anderson light sound speed

Archive

Show me a Random Blog Post
▼ show ▼
 2016-05-04 

Euro 2016 Stickers

Back in 2014, I calculated the expected cost of filling Panini world cup sticker album. I found that you should expect to buy 4505 stickers, or 1285 if you order the last 100 from the Panini website (this includes the last 100). This would cost £413.24 or £133.99 respectively.
Euro 16 is getting close, so it's sticker time again. For the Euro 16 album there are 680 stickers to collect, 40 more than 2014's 640 stickers. Using the same calculation method as before, to fill the Euro 16 album, you should expect to buy 4828 stickers (£442.72), or 1400 (£134.32) if you order the last 100.
This, however, does not tell the whole story. Anyone who has collected stickers as a child or an adult will know that half the fun comes from swapping your doubles with friends. Getting stickers this way is not taken into account in the above numbers.

Simulating a Sticker Collection

Including swaps makes the situation more complicated: too complicated to easily calculate the expected cost of a full album. Instead, a different method is needed. The cost of filling an album can be estimated by simulating the collection lots of times and taking the average of the cost of filling the album in each simulation. With enough simulations, this estimate will be very close the the expected cost.
To get an accurate estimation, simulations are run, calculating the running average as they go, until the running averages after recent simulations are close together. (In the examples, I look for the four most recent running averages to be within 0.01.) The plot below shows how the running average changes as more simulations are performed.
The simulations estimate the number of stickers needed as 4500. This is very close to the 4505 I calculated last year.
Now that the simulations are set up, they can be used to see what happens if you have friends to swap with.

What Should I Do?

The plots below shows how the number of stickers you need to buy each changes based on how many friends you have.
Stickers needed if you and your friends order no stickers.
Stickers needed if you and your friends all order the last 100 stickers. The last 100 are not counted.
In both these cases, having friends reduces the number of stickers you need to buy significantly, with your first few friends making the most difference.
Ordering the last 100 stickers looks to be a better idea than ordering no stickers. But how many stickers should you order to minimise the cost? When you order stickers, you are guaranteed to get those that you need, but they cost more: ordered stickers cost 14p each, while stickers in 6 pack multipacks come out at just 9.2p each. The next plot shows how the cost changes based on how many you order.
The expected cost of filling an album based on number of people in group and number of stickers ordered.
Each of the coloured curves represents a group of a different size. For each group, ordering no stickers works out the most expensive—this is expected as so many stickers must be bought to find the last few stickers—and ordering all the stickers also works out as not the best option. The best number to order is somewhere in the middle, where the curve reaches its lowest point. The minimum points on each of these curves are summarised in the next plots:
How the number you should order changes with the number of people in the group.
How the cost changes with the number of people in the group.
Again, having friends to swap with dramatically reduces the cost of filling an album. In fact, it will almost definitely pay off in future swaps if you go out right now and buy starter packs for all your friends...

Similar Posts

World Cup Stickers
How to Kick a Conversion
Tennis Maths
The End of Coins of Constant Width

Comments

Comments in green were written by me. Comments in blue were not written by me.
 Add a Comment 


I will only use your email address to reply to your comment (if a reply is needed).

To prove you are not a spam bot, please type "seat" in the box below (case sensitive):
 2015-10-21 

How to Kick a Conversion

This post also appeared on the Chalkdust Magazine blog.
If you're like me, then you will be disappointed that all of the home nations have been knocked out of the Rugby World Cup. If you're really like me, doing some maths related to rugby will cheer you up...
The scoring system in rugby awards points in packets of 3, 5 and 7. This leads a number of interesting questions that you can find in my guest puzzle on Alex Bellos's Guardian blog. In this blog post, we will focus on another area of rugby: conversion kicking.

Conversion Kicks

When a try is scored by putting the ball down behind the line, the scoring team gets to take a conversion kick. This kick must be taken in line with where the try was scored but it is up to the kicker how far away the kick should be taken. But how far back should the ball be taken to make the kick easiest?
Too close (red) and too far away (blue) will give small angles to aim at. Somewhere in the middle is needed (green).
One way to answer this question is to look to maximise the angle between the posts which the kicker will have to aim at: if the kick is taken too close to or too far from the goal line there will be a very thin angle to aim at. Somewhere between these extremes there will be a maximum angle to aim at.
When looking to maximise this angle, we can use one of the 'circle theorems' which have tormented many generations of GCSE maths students: 'angles subtended by the same arc at the circumference are equal'. This means that if a circle is drawn going through both posts, then the angle made at any point on this circle will be the same.
The angles made by the red and blue lines are equal because 'angles subtended by the same arc at the circumference are equal'.
A larger circle drawn through the posts will give a smaller angle. If a vertical line is drawn which just touches the right of the circle, then the point at which it touches the circle will be the best place on this line to take a kick. This is because any other point on the line will be on a larger circle and so make a smaller angle.
Using this method for circles of different sizes leads to the following diagram, which shows where the kick should be taken for every position a try could be scored:
The best place to take a kick?
This, however, is not the best place to take the kick.

Taking Account of Height

When a try is scored near the posts, the above method recommends a position from where the ball must be kicked at an impossibly steep angle to go over. To deal with this problem, we are going to have to look at the situation from the side.
When kicked, the ball will travel along a parabola (ignoring air resistance and wind as their effects will be small[citation needed]). Given a distance from the posts, there will be two angles which the ball can be kicked at and just make it over the bar. Kicking at any angle between these two will lead to a successful conversion. Again, we have an angle which we would like to maximise.
The highest (blue) and lowest (red) the ball can be kicked while still going over the bar.
However, the position where this angle is maximised is very unlikely to also maximise the angle we looked at earlier. To find the best place to kick from, we need to find a compromise point where both angles are quite big.
To do this, imagine that the kicker is standing inside a large sphere. For each point on the sphere, kicking the ball at the point will either lead to it going over or missing. We can draw a shape on the sphere so that aiming inside the shape will lead to scoring. Our sensible kicker will aim at the centre of this shape.
But our kicker will not be able to aim perfectly: there will be some random variation. We can predict that this variation will follow a Kent distribution, which is like a normal distribution but on the surface of a sphere. We can use this distribution to calculate the probability that our kicker will score. We would like to maximise this probability.
The Kent distribution can be adjusted to reflect the accuracy of the kicker. Below are the optimal kicking positions for an inaccurate, an average and a very accurate kicker.
The best place to take a kick for a bad kicker (top), an average kicker (middle) and a good kicker (bottom). All the kickers kick the ball at 30m/s.
As you might expect, the less accurate kicker should stand slightly further forwards to make it easier to aim. Perhaps surprisingly, the good kicker should stand further back when between the posts than when in line with the posts.
The model used to create these results could be further refined. Random variation in the speed of the kick could be introduced. Or the kick could be made to have more variation horizontally than vertically: there are parameters in the Kent distribution which allow this to be easily adjusted. In fact, data from players could be used to determine the best position for each player to kick from.
In addition to analysing conversions, this method could be used to determine the probability of scoring 3 points from any point on the pitch. This could be used in conjunction with the probability of scoring a try from a line-out to decide whether kicking a penalty for the posts or into touch is likely to lead to the most points.
Although estimating the probability of scoring from a line-out is a difficult task. Perhaps this will give you something to think about during the remaining matches of the tournament.

Similar Posts

Euro 2016 Stickers
How Much Will I Win on the New National Lottery?
Tennis Maths
World Cup Stickers

Comments

Comments in green were written by me. Comments in blue were not written by me.
 Add a Comment 


I will only use your email address to reply to your comment (if a reply is needed).

To prove you are not a spam bot, please type "driew" backwards in the box below (case sensitive):
 2014-06-21 

Tennis Maths

The Smallest Share of Points & Serving Stats

With World Cup fever taking over, you may have forgotten that Wimbledon is just a few days away.

Tennis Scoring

Tennis matches are split into sets (three sets for ladies' matches, five sets for men's), which are in turn split into games. The players take it in turns to serve for a game. The scoring in a game is probably best explained with a flowchart (click to enlarge):
To win a set, a player must win at least six games and two more games than their opponent. If the score reaches six games all, then a tie break is played. In this tie break, the first player to win at least seven points and two points more than their opponent wins. In the final set there is no tie break, so matches can last a long time.

Winning with the Smallest Share of Points

Due to the way tennis is split into sets and games, the player who wins the most points will not necessarily win the match. This got me thinking: what is the smallest proportion of points which can be won while still winning the tennis match?
First, let's consider a men's match. In order to win with the lowest proportion of points, our player should let his opponent win two sets without winning a point and win the other three sets. In the two lost sets, the opponent should win 0-6 taking every point: in total the opponent will win 48 points in these sets.
Leaving the final set for now, the other two sets are won by our player. To win these with the smallest proportion of the points, they should be won 7-6 on a tie break. In the 6 lost games, the opponent should take all the points. In the won games and the tie break, our player should win by two points with the lowest total score. (Winning with more than the lowest total score will mean both players win an equal number of extra points, moving the proportion of points our player wins closer to 50%, higher than it needs to be.)
Therefore, our player will win 4 points out of 6 in the games he wins, win 0 out of 4 points in the games he loses and wins the tie break 7 points to 5. This means that in total our player will 62 points out of 144 in the two won sets.
For the same reason as above, the final set should be won with the lowest total score: 6-4. Using the same scores for each game, our player wins 24 points out of 52.
Overall, our player has won 86 points out of 244, a mere 35% of the points.
If the match is a ladies' match then the same analysis will work, but with each player winning one less set. This gives our player 55 points out of 148, 37% of the points.
This result demonstrates why tennis remains exciting through the whole match. The way tennis is split into sets and games means that our opponent can win 65% of the points but if the pressure gets to them at the most important points, our player can still win the match. This makes for a far more interesting competition than a simple race to one hundred points which could quickly become a foregone conclusion.

Comparing Players with Serving Stats

During tennis matches, players are often compared using statistics such as the percentages of serves which are successful. Imagine a match between Player A and Player B.
In the first set, Player A and Player B are successful with 100% and 92% of their serves respectively. In the second set, these figures are 56% and 48%. Player A clearly looks to be the better server, as they have a higher percentage in each set. However if we look at the two sets in more detail:
Player APlayer B
First Set20/2067/73
Second Set45/8013/27
Total65/10080/100
Table showing successful serves/total serves.
Overall, Player B has an 80% serve success rate, while Player A only manages 65%.
This is an example of Simpson's paradox: a trend which appears in the set-by-set data disappears when the data is combined. This occurs because when we look at the set-by-set percentages, the total number of serves is not taken into account: Player A served more in the second set so their overall percentage will be closer to 56%; Player B served more in the first set so their overall percentage will be closer to 92%.
Tags: Sport, Tennis, News

Similar Posts

Euro 2016 Stickers
How to Kick a Conversion
World Cup Stickers
The End of Coins of Constant Width

Comments

Comments in green were written by me. Comments in blue were not written by me.
 Add a Comment 


I will only use your email address to reply to your comment (if a reply is needed).

To prove you are not a spam bot, please type "goo" in the box below (case sensitive):
 2014-05-26 

World Cup Stickers

With the FIFA World Cup approaching, sticker fans across the world are filling up their official Panini sticker books. This got me wondering: how many stickers should I expect to need to buy to complete my album? And how much will this cost?

How many stickers?

There are 640 stickers required to fill the album. The last 100 stickers required can be ordered from the Panini website.
After \(n\) stickers have been stuck into the album, the probability of the next sticker being the next new sticker is:
$$\frac{640-n}{640}$$
The probability that the sticker after next is the next new sticker is:
$$\frac{n}{640}\frac{640-n}{640}$$
The probability that the sticker after that is the next new sticker is:
$$\left(\frac{n}{640}\right)^2\frac{640-n}{640}$$
Following this pattern, we find that the expected number of stickers bought to find a new sticker is:
$$\sum_{i=1}^{\infty}i \left(\frac{640-n}{640}\right) \left(\frac{n}{640}\right)^i = \frac{640}{640-n}$$
Therefore, to get all 640 stickers, I should expect to buy:
$$\sum_{n=0}^{639}\frac{640}{640-n} = 4505 \mbox{ stickers.}$$
Or, if the last 100 stickers needed are ordered:
$$\sum_{n=0}^{539}\frac{640}{640-n} + 100 = 1285 \mbox{ stickers.}$$

How much?

The first 21 stickers come with the album for £1.99. Additional stickers can be bought in packs of 5 for 50p or multipacks of 30 for £2.75. To complete the album, 100 stickers can be bought for 25p each.
If I decided to complete my album without ordering the final stickers, I should expect to buy 4505 stickers. After the 21 which come with the album, I will need to buy 4484 stickers: just under 897 packs. These packs would cost £411.25 (149 multipacks and 3 single packs), giving a total cost of £413.24 for the completed album.
I'm not sure if I have a spare £413.24 lying around, so hopefully I can reduce the cost of the album by buying the last 100 stickers for £25. This would mean that once I've received the first 21 stickers with the album, I will need to buy 1164 stickers, or 233 packs. These packs would cost £107 (38 multipacks and 5 single packs), giving a total cost of £133.99 for the completed album, significantly less than if I decided not to buy the last stickers.

How many should I order?

The further reduce the number of stickers bought, I could get a friend to also order 100 stickers for me and so buy the last 200 stickers for 25p each. With enough friends the whole album could be filled this way, although as the stickers are more expensive than when bought in packs, this would not be the cheapest way.
If the last 219 or 250 stickers are bought for 25p each, then I should expect to spend £117.74 in total on the album. If I buy any other number of stickers at the end, the expected spend will be higher.
Fortunately, as you will be able to swap your duplicate stickers with your friends, the cost of a full album should turn out to be significantly lower than this. Although if saving money is your aim, then perhaps the Panini World Cup 2014 Sticker Book game would be a better alternative to a real sticker book.

Similar Posts

Euro 2016 Stickers
How to Kick a Conversion
Tennis Maths
The End of Coins of Constant Width

Comments

Comments in green were written by me. Comments in blue were not written by me.
 Add a Comment 


I will only use your email address to reply to your comment (if a reply is needed).

To prove you are not a spam bot, please type "b" then "e" then "a" then "r" in the box below (case sensitive):
© Matthew Scroggs 2017