Monty_Hall: Monty Hall Simulator

View source: R/Personal_Functions.R

Monty_HallR Documentation

Monty Hall Simulator

Description

A simulator for the famous Monty Hall Problem

Usage

Monty_Hall(Games = 10, Choice = "Stay")

Arguments

Games

The number of games to run on the simulation

Choice

Wether you would like the simulation to either 'Stay' with the first chosen door, 'Switch' to the other door, or 'Random' where you randomly decide to either stay or switch.

Details

This is just a toy example of the famous Monty Hall problem. It returns a ggplot bar chart showing the counts for wins or loses in the simulation.

Value

A ggplot graph is produced. There is no return value.

Author(s)

Travis Barton

Examples

Monty_Hall(100, 'Stay')

LilRhino documentation built on April 28, 2022, 1:06 a.m.