kevinabrandon / kbWar

A simulation of the card game WAR!
MIT License
3 stars 0 forks source link

What is the probability of getting an infinitely long game? #15

Open kevinabrandon opened 9 years ago

kevinabrandon commented 9 years ago

In some of my earliest versions of the program, I found that I would get an infinitely long game in about 1 out of 10 games. It says that on the README.md, Results.md and also the wiki.

However, my recent simulations are showing it to be much higher ~ 4 out of 10 games. What changed? Maybe adding multiplayer?

Maybe we can get a higher or lower chance of getting an infinitely long game depending on how we take the cards from the players and put them back to the bottom of the winners deck. (always player-one's cards on top of player-two's versus, always the winner on top of the loser?) Did something like this change causing the higher rate?

Anyway, this should be looked into.

Here's a new probability distribution created by a 100K simulation. The distribution doesn't show the infinitely long games, only the ones that were finite. For this simulation 41.2% ended in an infinite loop. Probability distribution - case with infinitely long games.