play_game: Plays a single game

Description Usage Arguments Details Value Examples

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

Description

'play_game' generates a full game with both outcomes from either staying with the intial door, or switching doors.

Usage

1

Arguments

...

no arguments are used by the function.

Details

This function first creates a new game along with the contestant's first door pick. It then opens a goat door. Next it creates a final pick for poss possiblities of staying vs not staying. Afterwards, it determines which of the two final picks was the winner and loser. Finally, it creates the results in a data frame and retuns the results.

Value

The function returns a data frame showing the results of a single game with the winning and losing outcomes from staying or not staying.

Examples

1

Vodkard/montyhall documentation built on Feb. 27, 2020, 12:42 a.m.