play_game: Play the game

Description Usage Arguments Details Value Examples

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

Description

A simulation of the entire play using from creating the game, selecting the door, showing the goat, deciding to switch doors, and determining a WIN or LOSE.

Usage

1

Arguments

...

no arguments are used by the function.

Details

The game setup replicates the game on the TV show "Let's Make a Deal" where there are three doors for a contestant to choose from, one of which has a car behind it and two have goats. The contestant selects a door, then the host opens a door to reveal a goat, and then the contestant is given an opportunity to stay with their original selection or switch to the other unopened door. There was a famous debate about whether it was optimal to stay or switch when given the option to switch, so this simulation was created to test both strategies.

Value

The function returns a dataframe showing the outcome for each strategy (i.e. stay or switch doors).

Examples

1
`play_game()`

cjbecerr/montyhall documentation built on March 1, 2020, 12:17 a.m.