Sun Bin, allegedly descended from The Art of War author Sun Tzu, was a legendary Chinese military strategist who lived more than 2,300 years ago. After one king imprisoned and tortured him, forcing him to use a wheelchair for the rest of his life, he rose to fame as a military advisor for a rival king and lived to record two great victories against his former captor.
One of Sun Bin’s greatest exploits came not on the battlefield but on a racetrack. Like his supposed ancestor, who wrote, “Warfare is a way of deception,” Sun Bin discovered a “way of deception” in horse races that can be boiled down to a simple mathematical puzzle. For reasons that I cannot explain, the most general version of this puzzle remained unsolved and unexamined until 1980, when a college classmate of mine rediscovered it. Thirty years later he told me about the puzzle, and I was hooked. Besides transporting me back to ancient China, solving this problem took me back to my own roots as a mathematician.
I like to approach Master Sun’s problem through several simpler puzzles:
On supporting science journalism
If you’re enjoying this article, consider supporting our award-winning journalism by subscribing. By purchasing a subscription you are helping to ensure the future of impactful stories about the discoveries and ideas shaping our world today.
Puzzle One: Suppose you toss a coin six times. What is the probability of getting exactly three heads and three tails? What if you toss the coin 10, 100 times or any even number of times? How likely are you to get exactly the same number of heads and tails?
Puzzle Two: Now pick an even number, which we’ll call 2N, and a target number, N – k, which is less than N. If you flip a coin 2N times, do you think it is more likely that you will get exactly N heads or that you will get (N – k) or fewer heads? For example, are you more likely to get exactly 10 heads in 20 flips or to get eight or fewer heads in 20 flips? Experiment with different values of k and N and see if you can find a general rule.
The next two puzzles seem, on the surface, to have nothing to do with the first two.
Puzzle Three: Two teams, each with three players, are planning to compete in a match. Each team is supposed to rank its players from best to worst. The number one seed on one team is supposed to play the number one seed on the other, and so on. One coach is honest and ranks their players by true order of ability. The other coach is dishonest and decides to strategically rank their players in a different order. Can the latter coach tilt the odds in their favor? If so, what ranking strategy gives their team the greatest chance of winning the match? What if each team has 10, 100 or N players?
Puzzle Four: The dishonest coach decides to place bets on the individual games rather than the overall team match. For this purpose, they want to know what ranking strategy will give their team the greatest expected number of games won. If there are three players per team, what strategy is optimal, and how many individual games can the coach expect to win? What if there are 10, 100 or N players on each team?
The last two puzzles harken back to a popular legend featuring Sun Bin. According to the story, General Tian Ji and King Wei were planning a friendly series of horse races, and the general asked Master Sun, his trusted retainer, for advice. The wily strategist told Tian Ji to race his best horse against the king’s second best, his second best against the king’s third best and his worst against the king’s best. I call this Master Sun’s strategy. “Just bet heavily, my lord, and I can make you the winner,” Sun Bin said. And indeed, according to the legend, Tian Ji won two out of three races and took home 1,000 gold coins.
That is how the legend goes, but any modern mathematician would be skeptical. Certainly Sun Bin could not guarantee a win. But did the strategy improve Tian Ji’s chances of winning the match? And if so, by how much did it do so? Those questions lead us straight to Puzzles Three and Four.
Before I reveal the answers, we must go back and consider the first two puzzles.
In Puzzle One, the secret to computing the odds of any number of heads lies in the following arrangement of numbers, called Pascal’s triangle:
Amanda Montañez
Each number is generated by adding the two numbers immediately above it; the process can be continued indefinitely. To evaluate the probability of exactly three heads in six tosses of a coin, we look up the third element in the sixth row, which is 20. (Technical note: The top row is traditionally considered to be the zeroth row, and the leftmost element in each row is the zeroth element. So the zeroth element in row six is 1, the first element is 6, and so on.)
We divide 20 by 26, which equals 64, to get the exact probability of three heads in six tosses: 20⁄64 = 0.3125, or 31.25 percent—slightly less than 1⁄3. Are you surprised? More than two thirds of the time, you will not get three heads in six tosses.
As the number of tosses increases, it becomes less and less likely that you will get heads exactly half the time. You can see this visibly from a histogram, in which the height of each bar represents the probability of getting the corresponding number of heads. The peak height of the histogram decreases as the number of tosses, N, gets larger. The appearance of the histogram changes as well: the steps shrink and smooth out into a curve, creating what is known as a normal distribution.

Amanda Montañez; Source: Dana Mackenzie (data and reference)

Amanda Montañez; Source: Dana Mackenzie (data and reference)
This “view from infinity” provides an approximate—but remarkably good—estimate for the solution to Puzzle One. In 2N flips of a coin, the probability of getting exactly N heads (equal to the peak height of the histogram) is roughly 1⁄√πN. For example, if N = 50, then the probability of 50 heads in 100 tosses is roughly 1⁄√50π ≈ 0.0798, as shown in the figure.
You might wonder at the presence of π, or pi, in the equation, thinking, “What does a ratio between circumference and diameter have to do with flipping coins?” You may also be baffled by the square root. I can’t give you an easy explanation: every proof I have ever seen uses calculus, which is the mathematician’s version of a telescope that gives you a view from infinity.
Puzzle Two is a much more recent variant. It is trickier because we are now comparing the probabilities of two rare events. On one hand, we have an “exceptionally average” result: getting heads on exactly half the tosses. On the other hand, we have exceptionally large deviations from average: the “tail” of the normal distribution. Which one is rarer? It depends on where we start measuring the tail.
For N = 3, we again consult the sixth row of Pascal’s triangle: 1, 6, 15, 20, 15, 6, 1. We add these numbers from the left and ask when the sum first exceeds the central—and largest—number in the row. We notice that 1 + 6 < 20, so the probability of getting zero or one heads is less than the probability of getting three heads. But 1 + 6 + 15 > 20, so the probability of getting zero, one or two heads exceeds the probability of getting three.
To answer the question for N = 10, we need to compute the 20th row of Pascal’s triangle, which is already kind of tedious. It turns out that the crossover happens at eight heads. That is, we are more likely to get 10 heads than seven or fewer but less likely to get 10 heads than eight or fewer.
To solve the puzzle for N = 100, we would have to compute the 200th row of Pascal’s triangle, and I don’t know anyone (aside from computers) with that kind of patience. But the “view from infinity” gives us a shortcut. The area of the central rectangle is roughly 1⁄√πN. The area to the left of the crossover line can be estimated from the normal distribution. By comparing the two, we can show that the crossover happens at 89 heads.

Amanda Montañez; Source: Dana Mackenzie (data and reference)
In general, if the crossover happens at (N – k), then k ≈ √Nln(N)⁄2. (Here “ln” means the natural logarithm.) I’ll call k the “crossover number,” so for N = 100, the crossover number is 100 – 89 = 11. This solution is perhaps slightly less remarkable than our solution to Puzzle One, and for small values of N, the approximation is not as good. But I happen to like it better because I discovered it myself! It also turned out to be a key that let me unlock the solution to Puzzle Four.
A few months ago my wife and I ate dinner with a friend who is always interested in mathematical topics. I told her about Puzzles Three and Four and said that I was writing a book about them. “But where is the mathematics?” she asked me. It was an excellent question, and it brings up a little understood point. Math never arises in the real world in pure and unadulterated form, as you see in textbooks. Math is always hiding behind the scenes. To bring it out into the foreground, you must make a mathematical model of a real-world problem.
In Puzzles Three and Four, the clue is that I’m asking about probabilities. So somewhere there must be a source of randomness. I assume that the source of randomness is the assignment of players to the coaches—that is, the coaches drew the players blindly, as if drawing cards from a deck of 2N cards, with each possible draw being equally likely. You may disagree with this assumption; for example, in the story of Tian Ji, the king may have had access to better horses than the general did. But without making some assumptions, you’ll never get anywhere, and it’s best to start with simple ones. The card game model, which I call One-Round War, allows me to create a table that shows the probability that my ith best player beats the other team’s jth best player, for any pair i and j. Using this table, I can evaluate any proposed strategy and figure out which ones work better for me.
It’s important to note that in One-Round War, both players know the seeding of each card within each hand, so we know which card is our ith best and which is our opponent’s jth best, even though the cards are face down. We do not know the actual card values, though. In a fair version of this game, the players would take turns going first, but I am interested in a wildly unfair version in which I go second every time. That gives me the power to react to my opponent’s moves.
For example, suppose I draw cards {1, 3, 5} and my opponent draws {2, 4, 6}. If I play “honestly,” playing my best (5) against my opponent’s best (6), and so on, I will lose all three tricks. But if I use Master Sun’s strategy, playing my best (5) against my opponent’s second-best (4), and so on, then I will win two out of three.
For the case of six cards, we can show that Master Sun’s strategy wins 70 percent (14 out of 20) of the possible hands. As for Puzzle Four, Master Sun’s strategy will win, on average, 55 percent of the tricks. In both puzzles, Master Sun’s scheme is the best possible strategy utilizing only the ranks of the cards. After 2,300 years, Master Sun’s intuition is vindicated!
There is no evidence that Sun Bin ever considered the problem for N > 3. But modern mathematics gives us the tools to answer such questions. It was precisely this question, the basis of Puzzle Four for an arbitrary N, that my college friend Howard Stern, a fellow math major who passed away in 2016, told me about and that quickly turned into an obsession.
We’ve already seen that Master Sun’s strategy is based on the idea of sacrificing some lower-rated cards against your opponent’s stronger cards so that your remaining cards (the ringers) have a better chance of winning. This approach means that your entire hand consists of two types of cards: sacrificial cards and ringers. Stern proved that the sacrificial cards should always be played in reverse order. (Proving this yourself is an excellent challenge.) Your worst card should be paired against your opponent’s best, and so on. The ringers, on the other hand, should be played in direct order of strength.
After determining this, the devil is in the details. Which cards should you select as sacrificial cards? Which cards should they be played against? How many cards should you sacrifice, and how many should you designate as ringers? These were questions Stern could not answer.
The casual math enthusiast will probably find Puzzle Three to be more accessible than Puzzle Four. It requires no more math than we’ve discussed here, just common sense. Puzzle Four, on the other hand, fascinated and entertained me for a full year. My book Master Sun’s Problem, which came out from Princeton University Press on October 13, contains the full answer. It also tells the full historical story, as well as the tales of some other contributors: Stern, who introduced me to Puzzles Three and Four; journalist Gary Antonick, who let me turn his then column Numberplay in the New York Times into a crowdsourcing experiment; retired engineer Bill Courtney, who solved Puzzle Three; and operations research expert Richard Chatwin, who made a vital contribution to solving Puzzle Four.
Though I don’t want to give away too many spoilers, probably the most stunning discovery was that Puzzle Two and Puzzle Four are the same problem. More precisely, the solution to Puzzle Two is embedded within the solution to Puzzle Four. Remember the crossover numbers from Puzzle Two? We saw that the crossover number for 10 tosses of a coin is two and that the crossover number for 100 tosses is 11. These are exactly the same as the optimal number of cards to sacrifice when using Master Sun’s strategy. It’s another example of the amazing propensity of mathematics to unearth connections between things that did not seem to be related.
For example, if you’re playing a game of One-Round War with 100 cards against 100 cards, you should sacrifice 11 cards and designate 89 ringers. On average, none of the sacrificial lambs will win, but 86 of the 89 ringers will, and you will take the match by an astounding margin of 86 to 14.
Any good math problem should leave more questions in its wake. I deliberately did not include the possibility of upsets in my model. In our card game, the higher card always beats the lower one. But in horse races, the faster horse does not always win. How robust is Master Sun’s strategy under those circumstances?
Also, the scheme reminds me very much of gerrymandering, in which you deliberately lose some electoral districts by a large margin in order to win a lot of districts by a small margin. Can you devise an optimal gerrymandering strategy? In a state with 100 districts, would it be smart to draw a map with 11 losing districts and 89 winning ones? I highly doubt that the solution would translate so directly, but the analogy is worth thinking about.
The world is full of asymmetric or unfair contests. While we may wish there was a way to ensure that justice prevails, perhaps we would do well to take a lesson from ancient Chinese sages who understood how to play the asymmetric contests well.
