change_door: Decide whether to change the contestants initial door...

Description Usage Arguments Details Value Examples

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

Description

change_door() decides for the contestant as to whether they are keeping their initial door selection or changing their initial selection.

Usage

1
change_door(stay = T, opened.door, a.pick)

Arguments

stay

= a true/false argument where we assign the "TRUE" value to if the contestant is sticking with their initial door selection and "FALSE" if they are staying with their initial selection. opened.door = the argument which has the returned door from the open_goat_door() function. a.pick = the arguement containing the contestants initial door selection from the select_door() function

Details

After the Monty Hall reveals a goat door in the "Let's Make a Deal" game show, the contestant must make a decision as to whehter they are going to keep their initial door selection or change their selection to the other available door. There was a famous debate about whether it was optimal to stay or switch when given the option to switch.

Value

The function returns a length 1 numeric vector indictating the contestants final door choice in the Monty Hall Problem game. The door choice will either be doors 1, 2, or 3.

Examples

1
  change_door( stay=T, opened.door, a.pick )

herbertm533/montyhall2 documentation built on Sept. 21, 2020, 12:03 a.m.