Description Usage Arguments Details Value Examples
View source: R/Monty Hall Script.R
game()
returns the probablity of winning while staying or switching doors. The user
is able to determine how many doors they would like to use by determining the amount of goats
and cars.
1 | game()
|
... |
This function does not take any arguments |
This is a function is a form of the famous gameshow "Let's Make a Deal" that was presented by the famous Candian gameshow host Monty Hall. The original game consisted of three doors where two doors concealed goats and one door concealed a car. The player was asked to chose a door in hopes that it was the car. Once the door was selected, Monty Hall would then reveals one of the goats. This leaves the player's door and another door. The player is then given the option to either keep their initial door or switch with the remaining door. This simulation tests whether a player increases their odds by switching doors or staying with their initial door.
The function will first ask the player to enter the number of goats and cars. Then the function will return the probability of winning if a player choses to stay or switch.
1 | game()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.