Project Euler/227: Difference between revisions
From charlesreid1
(Created page with "==Problem Statement== Game with 2 dice, even number of players Players sit around a table, game begins with 2 opposite players, 1 die each. On each turn, the two players wi...") |
No edit summary |
||
| Line 16: | Line 16: | ||
In a game with 100 players, what is expected number of turns the game lasts? | In a game with 100 players, what is expected number of turns the game lasts? | ||
==Analysis== | |||
Since this is a large-numbered PE problem, a brute force solution probably won't get us all the way to the answer, but it can be useful to develop understanding of the problem. | |||
With games involving 100 players, there are probably a small number of games that would require orders of magnitude more operations to simulate than the average, and simulating enough games to get to 10 decimal places requires simulating millions and millions of games. | |||
Revision as of 17:51, 19 April 2025
Problem Statement
Game with 2 dice, even number of players
Players sit around a table, game begins with 2 opposite players, 1 die each.
On each turn, the two players with the die roll it.
If the player rolls 1, they pass the die to their left neighbor
If the player rolls 6, they pass sthe die to their right neighbor
Otherwise, they keep the die for the next turn
The game ends when one player has both dice after they have been rolled and passed. That player loses.
In a game with 100 players, what is expected number of turns the game lasts?
Analysis
Since this is a large-numbered PE problem, a brute force solution probably won't get us all the way to the answer, but it can be useful to develop understanding of the problem.
With games involving 100 players, there are probably a small number of games that would require orders of magnitude more operations to simulate than the average, and simulating enough games to get to 10 decimal places requires simulating millions and millions of games.