Tuesday, January 13, 2026

Optimal Penalty

When you're taking a penalty in association football, how close to the post should you aim?
Inputs
Prob save, ball just inside post %
Probability of save at goal centre %
Striker's average inaccuracy meters

Calculated Results
Optimal target distance from post - meters
Optimal target distance from goal centre - meters
Probability of scoring - %


If you change some of the inputs above and hit enter, the results will update.

The striker's average inaccuracy is measured by asking the striker to kick the ball from the penalty spot directly to the centre of the goal at the same pace he hits penalties. We measure how close the ball was each time to the centre of the goal and take the average.

When someone is taking a penalty in football, the advantage of aiming near the post is that it may be less likely to be saved by the keeper than a shot going straight down the middle. However, when a player aims close to the post, it carries a risk of going wide. In this article we look the mathematics behind choosing the optimal spot to aim for.
As a starting point, we'll consider a one dimensional model: our striker will keep the ball along the ground.
We'll define the angle \(\theta\) to be the angle at the penalty spot between the centre of the goal and the spot that the ball arrives at the goal-line. When the striker takes his shot, he's not perfectly accurate. We'll assume that the ball is noramally distributed around the target. So the probability distribution of the ball will be: \[D(\theta) = \frac{1} {\sigma \sqrt{2 \pi} } \exp \left( {\frac{-( \theta - \tau)^2}{2 \sigma^2}} \right)\] where target angle \(\tau\) is the angle at the penalty spot between the centre of the goal and the point the striker is aiming for.
\(\sigma^2\) is the variance, it is a measure of the inaccuracy of the striker. A really accurate striker will have a low variance.

We let w be the striker's average inaccuracy, i.e. the average distance away from the centre ( when he's aiming at the centre).
Now we introduce the angle \(\lambda\) which is a another measure of the striker's inaccuracy. It is defined from the equation: \[tan( \lambda ) = \frac{w}{g}\] where g is the distance from the penalty spot to the centre of the goal.
So we could set this inaccuracy to be: \[ \lambda = \int_{-\infty}^{\infty} \vert \theta \vert D(\theta) d \theta \] When the striker is aiming for the centre of the goal we have \(\tau = 0\)
So we have: \[ \lambda = \int_{-\infty}^{\infty} \frac{\vert \theta \vert} {\sigma \sqrt{2 \pi} } \exp \left( {\frac{- \theta^2}{2 \sigma^2}} \right) d \theta \] Hence \[\lambda = \frac{\sigma \sqrt{2} }{\sqrt{\pi}}\] So, when we have w, we can have an estimate for \(\sigma\) \[ \sigma = \frac { \sqrt{\pi} } {\sqrt{2}} \hspace{5pt} tan^{-1} \left( \frac{w}{g} \right) \] If there were no goal-keeper, then the optimal strategy would be to aim for the centre of the goal, to minimise the chance of the ball going wide. But when there is a goal keeper it is easier for him to save the ball if it is near the centre, rather than by the post.
In our model we'll assume the that probability that the keeper will save the penalty is a function of the angle \(\theta\). In fact in the implemention above, we use a simple linear model for the probability of the penalty being saved: \[S(\theta ) = S(0) + \alpha \vert \theta \vert \] Above we let the user specify the probabilty of a penalty down the centre being saved (S(0)). The parameter \(\alpha \) is set by the probability of a penalty at the post being saved. Our model is symetric. The probabliltiy of a penalty being saved when it is a given distance from the centre is the same to the left as it is to the right.


For a given point that the striker could aim at, we have a distribution of the where the ball will go, for the outcomes on target we have the probability of scoring is 1 minus the probability of being saved. When we integrate over the distribution of ball positions, we can find out the probabilty of a goal being scored. We can write that mathematically, when we have a target, the probability of scoring is: \[P = \int_{goal} D(\theta) ( 1 - S(\theta)) d\theta \]
We can then find the target which has the maximum probability of scoring and this what we do in the javascript attached to this page to work out the results above.

The model could of course be extended in many ways. For example:
  • Set the probability of the ball being saved to something other than linear in theta
  • Allow the striker hit the ball off the ground
  • Consider the timing and pace of the strike
  • Use a model which is not necessarily symmetric to the left and the right of the centre.