In the card game War you deal a standard 52 map deck between two players. The players 보다 flip cards v the higher card winning. In the case of ties (wars), every player theatre N extr cards one the player through the highest possible Nth map wins every the cards (subsequent ties follow the exact same rules). The video game can last a really long time and also seems to never last a quick time.

You are watching: Longest game of war card game

What is the expected variety of "turns" till the game is completed?

I learned come play war with N equal to 3 (i.e., a full of 10 cards space played in a war: the original tie, 3 confront down, and also a last comparison card).

For completeness i think the game is over if a player has actually less than 5 cards and also gets right into a battle (i.e., walk not have a final card to flip).

Assume that upon playing your last map from her hand, friend shuffle the win cards into a random order and also resume.

Assume the cards space in arbitrarily order to start.

play-time war
re-superstructure
enhance this inquiry
follow
edited Dec 3 "18 in ~ 20:28

Glorfindel♦
asked Dec 3 "18 at 16:08

6
| display 1 much more comment

12
War is actually not a game however an Automata, together players don"t have any options.

Wimpy Programmer already made this simulation, he uncovered that as soon as shuffling the win cards, the mean variety of turns is 262, the setting is 84, and also the max (on a sample the 100,000 trials) is 2,702 turns. He likewise found that without shuffles of the winning cards, the game could be endless.

He offered N=2 while you play with N=3, greater N shortens the game, but I don"t think that it will make a large difference.

re-superstructure
enhance this price
follow
edited Dec 9 "18 in ~ 23:08
answer Dec 5 "18 at 20:22

CohensiusCohensius
4
include a comment |
4
As a math problem, this is a case of a arbitrarily walk ("walking" N cards in ~ a step from your opponent"s deck to her deck, whereby N is typically one, yet can it is in 4 or 7 or whatever depending on ties.) that is frequently framed as the "gamblers ruin" problem. Skip the concern of ties and treating each throw of cards as an live independence trial, the average variety of turns is 26*26 = 676 turns.

Factoring in ties would reduce it fairly a bit based on N -- allowing for bigger steps occasionally. The average number of turns once the step size is 5 (i.e., every rotate is a war that is fixed on its very first tiebreak) is indistinguishable to playing through 6 cards each (26/5, rounded up). And 6*6 = 36 turns.

See more: What Is A Trunnion On An Ak 47, Trunnions & Blocks

So climate it"s just a matter of figuring the end the probability of huge steps. Ties can be expected around 3/51 of the moment (when girlfriend play a card, there are 3 cards that can tie it out of the 51 other cards). 48/51 = step dimension 1, 3/51 * 46/49 = step size 5, 3/51 * 3/49 * 44/47 = step dimension 9, and also so on. This provides an median step size of about 1.25. A game played v all steps equal to 1.25 would be intended to last about 21*21 = 441 transforms (26/1.25 = 21 cards every equiv). And then minimize that some an ext to factor in the possibility for sudden fatality when among the ties occurs as soon as a player is low on cards. (Sorry ns don"t have the details on exactly how to perform that exactly.)

EDIT: ns should additionally emphasize the this method assumes the trials are independent trials. That"s basically the difference between dice and also cards. Each throw of a dice is independent. But each draw is no -- it counts on what else has actually been drawn / what else remains. And also in the case of War, winning a psychological in basic improves your odds top top the Kth following attract (when you draw that map again). It"s a really mild (IMO) runaway leader result (mitigated by also receiving the shedding card, yet I still think the net is a gain). And also it will certainly multiply the advantage, if any, bestowed come one player end the other in the initial deal. The is, any kind of slight deviation towards the higher-numbered cards in the early stage deal will be amplified each successive expedition through the deck.