I’ve always thought the card game of war was a stupid game. So, I spent a weekend analyzing it, so I have some numbers to present whenever someone wants to play. Hopefully the discussion will make it less boring, and I will be able to convince them that there are better games to play.
How to Play War
For those who are unaware, here is a brief description of the game. A standard deck of fifty-two playing cards is shuffled and divided evenly between two players. The players then each reveal the top card of their deck and the player with the higher card takes both cards and puts them on the bottom of their deck.
If the two cards have the same value (two queens for example), then “war” happens. The players each draw two more cards from their deck. The second card is compared; the winner takes all the cards (six in total).
The game then continues until one player wins all the cards.
You may notice that not a single decision was made in the entire game. There is nothing either player can do to impact the outcome of the game. Thats why I think it’s stupid, but it won’t stop me from doing some light statistical analysis on it.
Different Rules to Consider
What I described above is probably the most standard way to play war. But everybody plays this game just a little bit differently. So, when writing my simulation program, there are a few different rules I identified to try and cover the majority of play styles:
- Ace beats king – With this rule, ace beats king but still loses to everything else. (Note that just setting ace as high card has no effect on the game, ace just becomes the new king)
- Randomize winnings – When a player wins a round, are cards put on the bottom of their deck in the same order, or randomly? Most people don’t think about this, so it’s fairly random, but it does have big side effects for the overall game length.
- Discard deck – Are winnings put into a discard deck and completely reshuffled only when the player’s hand runs out?
- How many cards are played during “war” – The standard is one extra card is put down, but many people play with three extra cards.
- What happens if a player runs out during “war” – I say it’s a tie if both players run out at the same time, but if one player still has cards left, they win (even if they don’t have enough to make it to the next combat).
These are the main variations, but I also made a variation of my own:
- What if there is no war – By using a single deck, and ranking the suites it is impossible for there to be a war because one player will always have a higher card than the other.
Simulations
It took me about a day to write the code and do the simulations. You can find the code at the following link. https://github.com/brighamskarda/war-card-game
I did not include all the raw simulation data but in the dropdown below you can see all the commands I used.
Click to see commands
| Command | File |
|---|---|
.\war-card-game.exe -ace-beats-king=false -discard-deck=false -num-war-cards=1 -numgames=1_000_000 -random-push-back=false -random-push-pct=1 -suite-matters=false | results-01.csv |
.\war-card-game.exe -ace-beats-king=true -discard-deck=false -num-war-cards=1 -numgames=1_000_000 -random-push-back=false -random-push-pct=1 -suite-matters=false | results-02.csv |
.\war-card-game.exe -ace-beats-king=false -discard-deck=true -num-war-cards=1 -numgames=1_000_000 -random-push-back=false -random-push-pct=1 -suite-matters=false | results-03.csv |
.\war-card-game.exe -ace-beats-king=true -discard-deck=true -num-war-cards=1 -numgames=1_000_000 -random-push-back=false -random-push-pct=1 -suite-matters=false | results-04.csv |
.\war-card-game.exe -ace-beats-king=false -discard-deck=false -num-war-cards=3 -numgames=1_000_000 -random-push-back=false -random-push-pct=1 -suite-matters=false | results-05.csv |
.\war-card-game.exe -ace-beats-king=true -discard-deck=false -num-war-cards=3 -numgames=1_000_000 -random-push-back=false -random-push-pct=1 -suite-matters=false | results-06.csv |
.\war-card-game.exe -ace-beats-king=false -discard-deck=true -num-war-cards=3 -numgames=1_000_000 -random-push-back=false -random-push-pct=1 -suite-matters=false | results-07.csv |
.\war-card-game.exe -ace-beats-king=true -discard-deck=true -num-war-cards=3 -numgames=1_000_000 -random-push-back=false -random-push-pct=1 -suite-matters=false | results-08.csv |
.\war-card-game.exe -ace-beats-king=false -discard-deck=false -num-war-cards=1 -numgames=1_000_000 -random-push-back=true -random-push-pct=1 -suite-matters=false | results-09.csv |
.\war-card-game.exe -ace-beats-king=false -discard-deck=false -num-war-cards=1 -numgames=1_000_000 -random-push-back=false -random-push-pct=1 -suite-matters=true | results-10.csv |
.\war-card-game.exe -ace-beats-king=true -discard-deck=false -num-war-cards=1 -numgames=1_000_000 -random-push-back=false -random-push-pct=1 -suite-matters=true | results-11.csv |
.\war-card-game.exe -ace-beats-king=false -discard-deck=false -num-war-cards=1 -numgames=1_000_000 -random-push-back=true -random-push-pct=1 -suite-matters=true | results-12.csv |
.\war-card-game.exe -ace-beats-king=true -discard-deck=false -num-war-cards=1 -numgames=1_000_000 -random-push-back=true -random-push-pct=1 -suite-matters=true | results-13.csv |
.\war-card-game.exe -ace-beats-king=true -discard-deck=true -num-war-cards=1 -numgames=1_000_000 -random-push-back=false -random-push-pct=1 -suite-matters=true | results-14.csv |
.\war-card-game.exe -ace-beats-king=false -discard-deck=false -num-war-cards=1 -numgames=1_000_000 -random-push-back=true "-random-push-pct=0.01" -suite-matters=false | results-15.csv |
.\war-card-game.exe -ace-beats-king=true -discard-deck=false -num-war-cards=1 -numgames=1_000_000 -random-push-back=true -random-push-pct=1 -suite-matters=false | results-16.csv |
.\war-card-game.exe -ace-beats-king=false -discard-deck=false -num-war-cards=3 -numgames=1_000_000 -random-push-back=true -random-push-pct=1 -suite-matters=false | results-17.csv |
.\war-card-game.exe -ace-beats-king=true -discard-deck=false -num-war-cards=3 -numgames=1_000_000 -random-push-back=true -random-push-pct=1 -suite-matters=false | results-18.csv |
Results
Let’s take a look at some key findings
The Standard Game
Here are my findings for a standard game of war. There is no randomization, ace doesn’t beat king, only one extra card is played during a war.

This looks like a pretty standard histogram. It is skewed to the right, which is to be expected. But there is one important detail that is easy to miss. 46.8% of games are a tie! You read that right, if you play war with the precision of a robot, nearly half of all games are a tie.
Let’s add a little bit of randomization to simulate human players a bit better. In the following image, when a player puts cards at the bottom on their deck, they are shuffled. This more accurately represents how a human plays. They don’t really keep track of which order their cards are placed at the bottom of their deck.

Now this is a much more reasonable curve. Only 0.2% of games are ties now, and the longest game only lasted 529 rounds (no infinite cycles like were seen in 45% of the previous simulation’s games). This is really what you’re standard game of war looks like.
More Fun With Randomization
Alright, well what happens if a player only randomizes their cards 1% of the time. What if they use a discard pile and randomize all of their winnings together. Let’s see what that looks like
The following histogram is from a simulation set identical to the result-09 histogram except that the insertion to the bottom of the player’s deck is only randomized 1% of the time.

So, it turns out that randomizing insertion to the bottom of the deck even just 1% of the time is enough to avoid the horrible outcomes of no randomization, even if the games are a little long.
Now what happens if the players use a discard deck. Meaning that they put their winnings into a pile that is only shuffled when they need more cards.

The results are pretty much the same when compared to just randomizing cards when you put them on the bottom of your deck.
From this point forward, all games will have random push back enabled.
Other Factors That Could Affect Game Length
There are two other factors I wanted to compare for how they affect game length. The first being the rule where aces beat kings.

Turns out that doesn’t really affect the average game length.
How about having to draw three extra cards instead of one when a war happens.

And look at that, having bigger wars actually results in games that are significantly shorter. Thats good to know, I’ll be sure to use that rule whenever I’m forced to play this game.
Analyzing What Actually Results in A Win
Now that we’ve got some data on how long the game of war takes. I was interested in what actually determines the winner, and how strong the correlation is.
Let’s start with the standard rules from result-09.

The most interesting graph to me was the number of kings that each player starts with. If you have three out of the four available kings, you will win about 78% of the time.
I suppose that’s not very surprising, but the data does support that the number of power cards you have in your starting hand heavily affects your chances of winning.
I wonder if having ace beat king changes this up at all?

I thought these results were quite interesting. And I actually quite like how these probabilities turned out.
- It is still bad to have aces, but not as bad as before.
- The probability of winning just because you get 3-4 kings is much lower
- The overall percentage of wins based on number of face cards is relatively unchanged.
- As we proved before, the games aren’t any longer.
Now how does having 3-card wars affect the win percentages?

It doesn’t seem to do much, except maybe reducing the power of having 3 kings. What if ace beats king?

I thought that putting up three extra cards in a war would have more of an effect, but it seems to have just slightly reduced the effectiveness of aces.
What if Suite Matters?
I don’t know anybody that plays like this, but here are the statistics of suite mattering (meaning that ties are impossible).

Just as predicted, there are no ties, and the games just tend to get really long.

The power curves are much more linear as well. And upon further introspection, you really shouldn’t play the game like this. Since it is impossible to lose the king of spades. The person that gets the king of spades will always win. It is just a matter of how long.
Conclusion
Thank you for joining me on my little weekend adventure.
All models are wrong, but some are useful.
~George Box
If you skipped right to the end here is the TLDR:
- Giving up three cards instead of 1 during a war results in the shortest games.
- Having ace beat kings with 1-card wars reduces the power of the king, while not making aces good enough to actually be desirable.
- Make sure to randomize cards when you put them back in your deck
- A separate discard pile doesn’t matter.
Leave a Comment