Statistical Analysis of War


Introduction

For a while I was playing the card game War with my son a lot.  I mean, a lot.  It's a pretty low-brainpower game, so I had time to think.  I thought about War, the statistics of the game, and possible strategies to win.  Following in the footsteps of the esteemed Kellog and Smith, I decided to run some stats and see what I could discover.

Rules

I used what I consider fairly standard US rules for the game:

Questions

  1. How are the length of the game and the number of wars affected by the size of the deck?
  2. Are there any simple strategies that can affect the outcome of the game?
  3. Is there a correlation between minimum take profit and winning the game?  Take profit is the difference between the winning card and the losing card in a round.  My theory was that taking cards using just-slightly-better cards would help win the game because it saves your better cards for better uses.

Execution

I wrote this Python script to collect statistics.  The script runs 1000 reps of the game in a few different configurations and gathers the following information:
The configurations run by the script are as follows:

Results

The script produced this output, which I imported into Excel.  As you might have expected, the length of the game is non-linearly proportional to the size of the deck, and the number of wars in a game is inversely proportional:





As for the strategies, the table below summarizes the results.

Balance of Wins, Number of Rounds,
and Percent of Rounds in War

Player 1 Strategy
Player 2 Strategy
Sort Hand
Shuffle Hand
Sort Take
Shuffle Take
Shuffle Take
281
3.4%

370
5.2%

349
5.1%

369
5.2%
Sort Take
243*
3.4%

360
5.1%

240
5.6%

Shuffle Hand
287
3.9%

372
5.1%


Sort Hand
42
6.0%



Notes:
* This combination is the only one that produces stalemates.

A few things can be gleaned from this table:
Finally, my theory on the take profit did not bear out.  In all cases, the winner's take profit was larger than the loser's, showing that the winner did not consistently use slightly-better cards when taking.  I think this is because of two things:
Perhaps modifying the methodology to calculate take profits based only on the first run through the deck would produce better results.

Chez Zeus:Statistical Anaylysis of War

Anti-©2005 Dr. Zeus.
Last modified: Wed Mar 21 14:03:33 2007