monty: Monty Hall problem

Description Usage Arguments Value Examples

Description

This function simulates the probability that a game show contestant, searching for a new car behind a set of three closed doors, will win the prize upon switching their original door choice after a non- winning door is revealed. The problem was first proposed by Steve Selvin.

Usage

1
monty(n, shift = TRUE)

Arguments

n

The number of games to simulate.

shift

Whether to switch to a second door, a boolean value.

Value

A rational approximation of the probability that a player will win a new car after switching their original door choice after a non-winning door is revealed.

Examples

1
monty(10000)

benjcunningham/rcarlo documentation built on May 12, 2019, 11:56 a.m.