If you’ve never played the card game “War” or don’t know the rules, then you are a person who values your time and does not like to waste it. This writing may not be for you. If you are one of those people and still want to venture on, read how the game is played first. Now that we’re all initiated, I’ll spend the rest of your valuable time answering questions you never asked and didn’t care to know the answers to, like - How random is this game? How much time should I expect to waste playing it? Disappointingly, I have no answers for: Why am I playing this? Who invented this? Or Why does my nephew want to play it again?
Methods
Before jumping into the results, I want to take a moment to go over how I analyzed this game. I wrote a short JavaScript application that simulates a game of War with a standard 52-card deck. To answer some of the questions about randomness, I needed to make a prediction before the game was simulated. A perfectly random game would defy prediction, and the success of the prediction would be only 50%. A perfectly deterministic game would be entirely predictable, and the success of the predictions would be 100%. Since the player makes no decisions during the game, the starting hand is the only input to the prediction. Therefore, before each simulated game, I assigned each hand a value between 0 and 1, with 0 meaning “no chance” and 1 “guaranteed win”.
Additionally, I collected other statistics within each simulated game to answer questions like the number of shuffles, wars, etc.
A Genetic Algorithm
Generating the score for each hand wasn’t necessarily straightforward. In War, Aces are extremely powerful, as they cannot be captured except during a war, winning at all other times. But knowing they are powerful is not sufficient. A quantitative value representing their power is needed to make a prediction; the same goes for Kings, Queens, on down to Twos. If that power is not quantified correctly, the prediction will be poor, and no determination can be made about how random the game is. I refer to the quantitative power of a particular card rank as a weight.
Rather than enshrining my own opinion as correct, I allowed the weights to evolve over many generations of simulated games. Starting with an initial set of weights, many simulated games were run (a generation), and their predictive quality was assessed. Then, the weights were arbitrarily adjusted up or down for each card, and another generation was evaluated. If the next generation produced better predictions, it became the new standard to beat. After thousands of generations, the changes ceased, indicating the current weights had at least found a local minimum, and it is possible no significantly better prediction than this could be made. During this time, different lineages were bred by averaging the weights of parent branches.
Histogramming
Scoring the strength of a hand also allowed me to classify the games being simulated in a histogram (or buckets). As an aside, the score of one hand (S) should be the inverse of the other (1 - S). Taking the lower score and dividing the range it must exist in (0 to 0.5) into 10 buckets allowed me to keep separate statistics based on how imbalanced the hands might be.
Results
Just how long is this awful game going to take me?
You know you don’t really want to play this game. You’re doing it to get your nephew to stop nagging you to play with him. If I can help you with one thing, it would be to set an expectation for how long you’re stuck playing this ridiculous game.
Let’s assume the following about how you play, although this could depend on your nephew:
Time to play a turn: 3 seconds
Time to execute a war: 10 seconds
Time to shuffle: 30 seconds
By simulating 1,000,000 games, I have determined the “average” game consists of:
295 turns
17 wars
39 times having to shuffle the two decks
When combining the assumptions with my findings, I estimate the most likely game time is 40 minutes.
You can probably handle that for the love of your young nephew, but your mileage may vary based on the strength of your hand.
The following is a graph of how long the game may take to play for different amounts of hand imbalance. As you might expect, a stronger hand (held by either player) will relieve you of the burden of this tedious game more quickly than evenly matched ones. If you have an outrageously good or bad hand, you could wrap this up in 13 minutes. The game might take three times as long if you're evenly matched.
Can I end this sooner?
You don’t have 40 minutes to burn, but you can’t even throw the game because you have no control at all in this decision-less hell. Even this time-honored option that saves you time and, according to your rationalizations, boosts your nephew’s confidence cannot be applied. You can, however, propose a change in the rules. As we will see later, most of the cards in the deck are irrelevant, so why have them at all? Let’s see how the stats play out as we remove these irrelevant lower cards.
This is a big improvement. Taking out everything lower than a “9” would make the game take less than 10 minutes, a fourfold improvement. If the hands are highly imbalanced,, you could be done in as little as 3 minutes.
A word of caution though, if both players run out of cards during a war, the game ends in a soul-crushing tie, wasting your time even further. As you remove cards from the deck, this situation goes from astronomically impossible at 52 cards to a not entirely unlikely 0.35% at 24 cards.
How random is the game?
We know the game is fairly long, but depending on your world view, you might appreciate the mystery of a very random game or the certainty of knowing the future provided by a deterministic game. If the game's outcome can be predicted, it may not be that random. Unfortunately, this maddening game will probably satisfy nobody. I achieved an approximately 62% prediction success rate using the genetic algorithm described above. The game is certainly not totally random, but it is also not entirely deterministic. We can build some confidence that the prediction method is sound by comparing the outcome accuracy to the predicted hand strength. If the prediction method declares a high imbalance of hands, you would expect accuracy to increase, whereas close hands, you would expect to be much more of a toss-up.
Looking at these numbers, you can see what we might expect - the prediction does well when one hand is filled with powerful cards. If both players have essentially the same hand, as you might expect, it's a coin flip, and no prediction ought to be possible.
Can the randomness be adjusted?
In short, yes. As we did before, you can house-rule an aspect of the game to change how random it is - the number of cards turned face down (the stakes) of a war. The more cards lost in a war, the more random the outcome. However, it also massively affects the length of the game. Offering no cards in a war will extend the game to over an hour, but offering five cards will cut the game's time to 25 minutes.
If you consider a prediction success of 50% to be totally random and a success of 100% to be totally deterministic, then we can compute randomness as:
1 - (prediction accuracy - 0.5) / 0.5
Given this formula, the randomness decreases, although not dramatically, depending on how you control this house rule.
How good is my hand?
If you’re asking this, you’re excited about War (tell me more about why), or you want a preview of how this game will likely go. How do you decide if your hand is good - clearly if you have all the aces you’re in good shape, but what if you only have one ace, but all the kings, is that still a good hand? We need to look at the weights as computed by the algorithm to make those decisions. The most obvious answer might be that a 2 is worth 2 points, a 3 is worth 3 up to an ace which is 14. In other words, a reasonable first guess is a linear one. Indeed I did use that as an initial value for weights in the algorithm. It quickly learned the value is, in fact, not linear, eventually converging to a curve that looks somewhat like a phase transition diagram.
Rounding the numbers to make them easier to reason about but still approximating this curve gives us the following values:
A: 20pts
K: 11pts
Q: 7pts
J: 6pts
10-6: 5pts
5&4: 4pts
3: 2pts
2: 0pts
Using this weighting function, the worst hand you could have is about 110 points, and the best is about 226 points, so if your total is over the midpoint (168), you would be favored to win. This also means you need to average 6 points per card to have a favorable hand. Thought of this way, anything below a Jack is hurting your chances to win.
Conclusions
This game is objectively dull. If I’m lucky, I may never play it again, yet I’ve spent a fair amount of time discussing it. This is explained by my belief that boredom is a choice. Even the most boring of subjects have interesting questions that can be asked and can be surprisingly entertaining.
I also know that if I have to play this game again, my rules would be:
No ties. If you both run out of cards during a war, reshuffle them and try again.
Extend the war “stakes” by 1. If I can’t make decisions, surprise me with a little more randomness and move the game forward faster. The one thrill of the game is seeing what cards you’ve captured when winning a war; one more card won’t hurt.
Shorten the deck by dropping 2-5. This won’t dramatically change the game but will make it go faster. If you like the game, why not fit more of them in within a time limit?
That game would look as follows:
60% predictability
0.01% ties (that I will reject)
90 turns
8 wars
19 shuffles
15 minutes long
That seems far more palatable to me. So when your nephew asks for some time with you, choose War; maybe it won’t be that bad.