determine_winner: Outcome

Description Usage Arguments Details Value Examples

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

Description

The outcome is determined by whether or not the final decision made by the player was a car or a goat. A winning outcome would be to have correctly chosen a car.

Usage

1
determine_winner(final.pick, game)

Arguments

'final.pick'

is the final door that the player has selected. 'game' is the game that was created at the beginning.

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 either a WIN or LOSE.

Examples

1
 `determine_winner( final.pick, game)`

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