Description Usage Arguments Details Value Examples
View source: R/monty-hall-problem.R
In this function the host will be opening a door always (the exception is if the contestant already opened a "car" door). Hence, the door that the host will open is not a "door" car and no the already chosen door by the contestant.
1 | open_goat_door(game, a.pick)
|
Using |
the "if" function, the function will open the "goat" or "car" door. If the the first pick was a "goat" the "if" function will choose to open another door. If the first pick was a "car" door then the if statement, will be opening one of the reminding doors. |
If the contestant already got a "car" door in the previous function, the host can open one of the two remaining doors. But if the contestant got a "goat" door in the first selection, the host will open a "goat" door. "a.pick" variable will be saving the "goat" or "car" options.
The function could return a door with a "goat" door , or a "car" door depending of the first choice/results. If first door was "goat" then the host door will be always a door with the other "goat"
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.