play_game_loop: Monty Hall game where user defines number of goats and cars...

Description Usage Arguments Value Examples

View source: R/play_game_loop.R

Description

Monty Hall game where user defines number of goats and cars which is run N times

Usage

1
play_game_loop(goats, cars, N = 10000)

Arguments

goats

Numer of goats that will be hidden behind doors.

cars

Number of cars that will be hidden behind doors.

N

Number of loops of the play_game() function.

...

further arguments passed to or from other methods.

Value

The number of goats added to the number of cars makes the total number of doors to choose from. N is then how many simulations it will run. N*2 is the number of datapoints in the dataframe.

Examples

1
2
3
4
5
## Monty Hall Problem with 2 goats, 1 car, and run 100 times.
play_game(goats = 2, cars = 1, N = 100)

## Monty Hall run with 10 goats, 5 cars, the standard 10,000 times.
play_game(10, 5)

ndavis4904/MontyHall documentation built on Sept. 10, 2021, 11:04 a.m.