change_door: Change Doors?

Description Usage Arguments Details Value Examples

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

Description

1
2
3
 change_door allows the contestant the opportunity to
 switch the initially assigned door with the one
 remaining door opened

Usage

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

Arguments

stay=T

or stay=F: a character signifying TRUE or FALSE to the contestant's choice of keeping their current door (stay=T), or switching doors with the host (stay=F)

 open.door- an integer (1:3) returned from open_goat_door
 that signifies the goat door opened and removed from
 gameplay

 a.pick- an integer (1:3) returned as the contestant's
 initial pick

Details

1
2
3
4
5
6
7
8
9
 the function receives stay=T or stay=F

 if stay=T the function stores the integer stored in
 a.pick in final.pick

 if stay=F the function stores the door that is NOT
 the door determined by open_goat_door (goat.door)
 or the door that determined by select_door (a.pick)
 and stores the remaining integer (door) in final.pick

Value

1
2
3
4
 stores one of the following in final.pick:
      [1] 1
      [1] 2
      [1] 3

Examples

1

AmyTrumpower/montyhall documentation built on Dec. 17, 2021, 8:47 a.m.