play_n_games: Monty Hall simulation

Description Usage Arguments Details Value Examples

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

Description

Allows user to run the simulation for n times to know the WIN/LOSE probability.

Usage

1
play_n_games(n = 100)

Arguments

...

arguments used are number of simulations user specifies

Details

The function helps us understand game outcomes if contestant stays or switches and it takes into account the number of times the contestant plays.Results are stored in a data frame and returns probabilities of the two game strategies that are stay and switch.

Value

number of times where stay and switch strategies show WIN and LOSE outcomes.

Examples

1

malmufre/montyhall documentation built on Sept. 20, 2020, 12:46 a.m.