select_door: Contestant Selects A Door

Description Usage Arguments Details Value Examples

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

Description

This block of code will randomly select ONE of the three doors and return the result as the selection.

Usage

1

Arguments

The

select_door function calls upon a generic function with no arguments. The doors function uses logical vectors 1-3. The a.pick function uses the sample function to randomly generate a logical vector taken from the doors function.

Details

Since the contestant will not know the position of the car when they select a door, we do not need to share the information about the game set-up before the selection is made. We will create a vector containing three integers to represent a door number.

Value

The function returns a length three character vector that will represent the door number. The vectors can only be : 1, 2, or 3

Examples

1
2
3
  1
  2 
  3

scribenaz/montyhall documentation built on Jan. 31, 2021, 12:48 a.m.