Description Usage Arguments Details Value Examples
View source: R/monty-hall-problem (4).R
play_n_games( n=100 )
generates a simulation where 100 games are played
at random to determine the outcome of winning or losing.
1 | play_n_games(n = 100)
|
... |
Because the aim is to find the differences between staying and switching, we are working with a sample size of at least 100 games played at random to see the different outcomes of simulated games. |
Going through a simulation where a series of games are played at random helps identify which strategy is best, when attempting to determine if switching or staying is the better move to make to increase chances of winning.
The function returns the different outcomes, showing how many games out of 100 were "WIN" and how many were "LOSE" after running the simulation.
1 | play_n_games( n=100 )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.