The Mathematics of Playing Squash

Today, military strategists resort to the mathematics of decision theory in developing war games. So perhaps it’s not surprising that mathematics or, to be exact, the mathematical theory of probability, can be applied to the game of squash.

Mathematical modelling can describe the main features of the game pretty well and, at a practical level, can reveal the best strategies available to the squash player. In fact, it’s also proved useful over recent years in deciding whether the scoring rules of squash should be changed; first for professional tournaments, then for national and regional competitions and, finally, at club level.

And it’s all due to a 19th Century Russian mathematician.

Squash and the Markov Chain

Andrei Markov

Andrei Markov

Believe it or not, squash offers a simple example of a mathematical structure called a Markov chain. The theory of these non-deterministic random structures was  first developed at the end of the 19th Century by Russian mathematician Andrei Markov (1856 – 1922). According to fellow mathematician, Hungarian Lajas Takacs, Markov got the idea for his chain by studying the occurrence of vowels and consonants in the poetry of his compatriot Alexander Pushkin. But, despite its unlikely beginnings, the theory is now used in a wide range of contexts, from telecommunications to genetics and even sociological modelling.

A Markov Chain identifies a system that can occupy a ‘countably finite’ number of states, and which can make a transition from one state to another after a unit interval of time. The likelihood of a transition depends only on the system’s present state and not on its previous history.

So, let’s take a single game of squash as an example of a rule-based system. Starting at ‘love all’ (and omitting rallies which end in lets), the game moves from one state to another as points are scored. With each rally, one of two outcome states will be reached corresponding to whether the server wins or loses the rally. That outcome state becomes the ‘new’ present state for the game.

Whether a player wins a particular rally will obviously depend on a range of factors such as their skill, fitness, judgement and (not that I ever need it myself) luck. Whether a player serves or receives will also be a factor, so we can reasonably state that ‘Player A’ should win a certain fraction of rallies when serving and a certain fraction when receiving. In other words, the probability that A wins a rally when serving is pA and when receiving it’s qA. If we calculate the corresponding definitions for Player B, then (because the total probability of any rally being won is always 1) it’s evident that pB = 1 – qA and qB = 1 –pA because when A serves, B receives and vice versa. With me so far? Good.

The Probability of Serving and Receiving

The simplest possible game to imagine is one in which pA = ½ and pB = ½. In other words, both players can expect to win 50 out every 100 rallies when serving and when receiving. Clearly, in such a match, A and B are equally balanced.

But now, let’s denote the probability that A wins the current rally (and a point) when serving by the character PA and when receiving by QA. Subscript B will denote the corresponding probabilities for B, in other words PB = 1 –QA and QB = 1 – PA. The probability that A wins the current point, however, depends on whether A or B is serving.

In the example, where pA = ½ and pB = ½, the probability of A winning the point when serving, PA, is 2/3 but when receiving it is only 1/3. To understand this surprising statistic, we need to realise that the probability of winning the point is equal to the sum of each winning sequence of rallies possible in the game. In other words:

pA = ½ + ½4 + ½8 + ½16 +…

This is a geometric series which, when added up, approaches (but never quite equals) 2/3. So the probability of A losing the point must therefore be 1/3.

And how many winning sequences can there be in a game? Well, that’s what the superscripts are in the above equation. Just consider the possible sequences for the first 2 points (A win – A win, A win – B win, B win – A win or B win – B win). Four possible sequences.

Or, what about the possible sequences for the first 3 points:

A wins – A wins – A wins

A wins – A wins – B wins

A wins – B wins – A wins

A wins – B wins – B wins

B wins – A wins – B wins

B wins – A wins – A wins

B wins – B wins – A wins

B wins – B wins – B wins

That’s eight possible sequences, rising to sixteen for the first 4 points. Complicated, eh? Well, not really if you understand probability which I’m sure the gamblers amongst you do.

We can use this approach to analyse squash games between any two players of arbitrary standard; that is for any values of pA and qA and the simple expressions derived for PA and QA in terms of these. For example, a player with a pA of 2/3 and a qA of 3/5 may be expected to win two out of three service rallies and three out of five returns of serve.

But what can mathematical studies of the game of squash tell us about how to play the game? For that, we need to skip the difficult stuff and look at the results of a scientific study.

Squash Studies and Player Tactics

Scientists at the University of Glasgow and the Rutherford Appleton Laboratory in Oxford created a mathematical model of squash in the late 1980s. They tested the model in true scientific spirit with two of them playing an experimental series of 29 squash matches including 105 squash games over a 3 month period. Just think of two guys wearing white lab coats running around carrying squash rackets and you’ll get the picture.

As both of them had no idea whether their theory was accurate or not, there was no chance of them ‘cooking the books’. Nevertheless, the recorded frequency of the scientists’ game and match scores – and the point scores predicted by the model – were remarkably good with pA = 0.59 and qA = 0.56.

The scientists also came up with some interesting findings.

For example, a player receiving should always choose to set two. If A were to choose no set,  A would need to win the next point and, as we’ve seen above, the probability of doing this is QA. On the other hand, if A chooses set two, the winning sequences for the next two rallies are:

A wins – A wins

A wins – B wins

B wins – A wins

B wins – B wins

Three out of the four sequences will involve A regaining the serve meaning that A’s PA is more favourable to winning a point. Player A should, in fact, choose no set only if A’s pA is less than about 0.38, a situation which would place them in the company of higher  performing squash players.

Minding Your P’s and Q’s

Obviously, players (even scientists) can have off-days or may tire at different rates during a match. However, the  model reproduced the broad features of squash: the clear advantage of the first server, the setting choice, and the frequency with which a player wins a game  without their opponent scoring. It also shows that the probability of winning a point is much greater for the player who won the last point. And, perhaps more than anything else, this is the factor that gives squash its reputation of being such a highly competitive game; players need to fiercely contest every point.

So what tips does the mathematical model offer? The first is for players to estimate their p and q coefficients by assessing their performance against similar standard players. They can then choose set two or no set in a tie-breaker with some confidence.

Next, a player may attempt to vary their p and q. For example, they may choose to expend a lot of energy returning serve in the hope of increasing q even though a possible consequence may be a decrease in p. Whatever they choose, the model found that one result is almost always true: it is to the advantage of the stronger player to concentrate on service returns and, conversely, for the weaker player to concentrate on service by adopting, for example, hit and run tactics.

Last, but not least, the model allowed for a comparison of the European (hand in) and American (point a rally) scoring systems. Supposing that the most probable game scores for three pairs of players under British rules are 9-6 9-3 9-1. A calculation using the model showed that, when converted to American scoring, these translated into 15-13 15-11 15-5. Generally speaking, American rules were far kinder to the weaker squash player, in the sense that the likelihood of an ignominious defeat was small. Matches appeared to be much more closely contested although, in fact, the probability of a win for either player would not be much altered.

So the next time you play squash, be sure to insist on American scoring and try and get your opponent to assess their p and q during the match.

With any luck, they’ll lose concentration.

Squash, Mathematics and Fun

For an explanation of probability in squash scoring – including tree diagrams (!) – see Toni Beardon’s “Playing Squash” article on the excellent NRICH website. You can also test your probability knowledge by answering, or at least trying to answer, a question on the same site. Have fun!


The article “Calculating to Win” by David Alexander, Ken McClements and John Simmons originally appeared in the New Scientist on December 10th, 1988. It was subtitled, “If losing at squash dents your ego, don’t resort to feeble excuses such as tiredness or lack of concentration. Blame the mathematics of probability underlying the game.”

Squash and the War on Terror: Part 3 – End Game

Jansher Khan

Jansher Khan

In 2001, just weeks before the 9/11 attacks on the US, one of the greatest squash players in history announced his retirement from the professional game. During his career, Jansher Khan had won 99 squash titles including eight World Open and six British Open championships.

Along with his fellow squash champion and compatriot Jahangir Khan, Jansher was a national hero of Pakistan, not least in the eyes of the President, Pervez Musharraf, himself a keen squash player. Musharraf was a four-star General in the Pakistani Army who, since 1999, had led a military government following a bloodless coup against the democratically elected government of Prime Minister Nawaz Sharif.

Pervez Musharraf

Pervez Musharraf

But now, on the eve of the War on Terror, Jansher was unaware that his international  success was about to be celebrated in a way, and in a place, that would create another link between the game of squash and the unfolding events of global geo-politics. That celebration was to be centred on a city located 150 kilometres north of the nation’s capital, Islamabad, and 200 kilometres east of Jansher’s birthplace, Peshawar.

The city of Abbottabad.

Squash and the Generals

General Sir James Abbott

General Sir James Abbott

Abbottabad was named after the British Army General Sir James Abbott, who settled the town and district in 1848 after the annexation of the Punjab. Abbott (seen here in a portrait  dressed as an Indian noble) founded the town in 1853 and even wrote a poem about it before he returned to Britain. Due to its strategic location and pleasant climate, Abbottabad subsequently became, and still is, an important military cantonment and sanatorium, being the headquarters of a brigade in the Second Division of Pakistan’s Northern Army Corps. The Kakul district of the city also became the home of Pakistan’s Military Academy whose sports facilities still include squash courts.

It was here in 1961 that Pervez Musharraf began his military training and acquired his love of squash. In Pakistan, squash is the glue that binds the British-influenced officer class together. During his dramatic coup of October 12th 1999, Musharraf knew that he could count on his army colleagues to neutralise the incumbent prime minister and president. As he later wrote in his 2006 memoir ‘In the Line of Fire’, this was because “apart from being their chief, I played squash with the two commanding officers, Shahid Ali and Javed Sultan” of the elite Triple One Brigade. In fact, Ali and Sultan were playing squash when the coup happened, and interrupted their match to lead the Triple One into Islamabad to secure the civilian rulers’ homes so that Musharraf could seize power.

But less that two years after the coup, Musharraf was to find himself, and Pakistan, at the centre of the world’s attention for a very different reason. President George W. Bush had announced the US’s War on Terror and was looking for allies.

Squash and Abbottabad

Weeks after the 9/11 attacks, Musharraf allied Pakistan with the US against the Taliban government in Afghanistan in far from congenial circumstances. Five years later, on September 24th 2006, Musharraf was to reveal exactly what had happened during a US television interview. Richard Armitage, then US Deputy Secretary of State, had called Musharraf and threatened military action if Pakistan didn’t support the war on terror. According to Musharraf, Armitage warned him to “be prepared to be bombed. Be prepared to go back to the Stone Age.” Furthermore, during an interview with Jon Stewart of The Daily Show two days later, Musharraf said that US Secretary of State Colin Powell had also contacted him early in 2002 with a similar message: “You are with us or against us.”

Pervez Musharraf and Hosni Mubarak

Pervez Musharraf and Hosni Mubarak

But whatever the challenges he was facing both as President and as Head of the Army, Musharraf was still able to find time for his pet project: re-kindling the glory that was Pakistani squash. In 2003, he had become so concerned about the state of the game in Pakistan that he offered a 10 million rupee ($140,000) award for any Pakistani who achieved the World No. 1 ranking in squash. He also offered 5 million rupees to any Pakistani who won gold in the Asian Games or at the British Open. Musharraf pledged the money during the Chief of the Army Staff International Squash Tournament in Islamabad, won by two Egyptians – from the British-influenced squash-playing officer class typified by fellow  President, Army General and squash player Hosni Mubarak.

Jansher Khan Squash Complex

Jansher Khan Squash Complex

By 2004, another investment in the government-sponsored revival of Pakistani squash finally took form when the Jansher Khan Squash Complex was opened in Abbottabad. The Complex was located within jogging distance of Pakistan’s Military Academy and, by 2005, was being used to stage national and international squash trials and tournaments. But the Complex was also located within similar jogging distance of a non-descript high-security compound in the well-tended Abbottabad suburb of Bilal Town. A compound which, from early 2006 and known only to a few, was to be occupied by the most wanted man in the US War on Terror.

Osama bin Laden, the leader of Al Qaeda, had taken up residency in Abbottabad.

The Death of Osama Bin Laden

Osama Bin Laden

Osama Bin Laden

On August 18th, 2008 Pervez Musharraf resigned as President of Pakistan and went into self-imposed exile in London. Following his departure, Pakistan continued to play a vital role in the War on Terror and by early 2011 had captured or killed more than 700 members of Al Qaeda whilst losing over three thousand of its own soldiers. But despite all these efforts, Pakistan was regularly blamed by its partners for not doing enough, not least for its lack of success in finding Osama bin Laden.

The Al Qaeda leader was widely believed to be hiding in the tribal homelands of West Pakistan following his escape from Bora Bora in Afghanistan. But, in the early hours of May 2nd 2011, 24 US Navy SEAL commandoes arrived by helicopter in Abbottabad, breached the  wall of bin Laden’s compound using explosives, and entered the main building. Encounters between the SEALs and the residents took place in the building during which bin Laden was killed.

When informed of the raid, Pervez Musharraf described how, when he was in military training, he used to go running right by the spot where the world’s most wanted terrorist was found. “It surprises me it was next to the Pakistan Military Academy,” he told Britain’s Daily Telegraph. “The location is next to the place where I used to run nine miles, en route, maybe passing in front of the house. That is surprising.” he added.

In an unlikely way, Pakistani squash and the War on Terror were both back in the headlines.


Thanks to Alex Beam for his 2008 Vanity Fair article on Pervez Musharraf, ‘Big Man on the Court.’