play_game: Monty Hall Game

Description Usage Arguments Details Value Examples

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

Description

play_game() is a function that tests the Monty Hall game and tells what will happen if the CONTESTANT choose to stay or change his selection.

Usage

1

Arguments

...

no arguments are used by the function.

Details

THe function will play the game will be played by running the functions in order in a script. The game script will be in run a functions in the following order:

  1. One function that sets up the game (three doors, one car, two goats).

  2. One function that selects a door for your first guess.

  3. One function that reveals a goat for the host.

  4. One function that makes your final pick (depending upon if you intend to stay or switch). 5.One function that decides if you win the car or not.

Value

Strategy of the CONTESTANT : Stay or Switch and in each case the outcome: WIN or Lose

Examples

1

Rami-Assaad/montyhall documentation built on Dec. 18, 2021, 9:52 a.m.