Description Usage Arguments Details Value Examples
play_game(x,y,z)
returns the strategy and outcome for x number of doors, in which y number of goats and z number of
goats. x=y+z.
1 | create_game(doornumber, goatNum, carNum)
|
x |
Numeric. Number of doors in the game. |
y |
Numeric. Number of goats behind the doors. There are at least 2 goats behind the doors. |
z |
Numeric. Number of cars behind the doors. y+z = x and there is at least on car in the game. |
This function is a combination of a few different subfunctions: create_game, select_door, open_goat_door, change_door and determin_winner. create_game: It starts up the game and returns x number doors, with randomly assigned positions for y number of goats and z number of cars. select_door: It retruns the first selected door number which is randomly created by the function??? open_goat_door: It reveals a goat for the host. change_door: makes your final pick depending upon if you intend to stay or switch. determin_winner: decides if you win the car or not.
strategy and Outcome for the game. The function returns a dataframe which includes strings and numbers.
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.