play_n_games: Play game loops.

Description Usage Arguments Details Value Examples

View source: R/monty-hall-problem.R

Description

'play_n_games()' will play the Monty Hall game n amount of times and return a table of game outcomes.

Usage

1
play_n_games(n = 100)

Arguments

n

Set equal to any number to change how many times the game loop is played.

Details

The function will automatically run the game 100 times (n = 100). It will return a table reporting proportions of game outcomes based on two strategies. These proportions should be rounded to 2 decimal places.

Value

A table with proportions of LOSE and WIN outcomes from stay and switch strategies.

Examples

1
  play_n_games(n = 1000)

ekmcintyre/montyhall documentation built on Feb. 1, 2021, 12:24 a.m.