play_game: Play the game

Description Usage Arguments Details Value Examples

View source: R/monty-hall-problem (4).R

Description

play_game() generates a scenario incorporating all of what we have built putting it all together to run a simulation of whether staying with your initial selection, or switching will yield a better outcome of winning.

Usage

1

Arguments

...

no arguments are used by the function.

Details

Going through the entire game, step by step, will allow for a better understanding of the game in an attempt to determine if staying with, or switching the initial selection is best to increase chances of winning at the game.

Value

The function returns different outcomes when it is run. It will determine if staying with initial selections wins or loses, same goes for switching.

Examples

1

bbeltran2395/montyhall documentation built on Dec. 19, 2021, 6:46 a.m.