play_n_games: Adding the game to a loop

Description Usage Arguments Details Value Examples

View source: R/Montyhall.R

Description

The game will be added to a loop in order to be played 100 times for inferential purposes.

Usage

1
play_n_games(n = 100)

Arguments

n

& i are numeric vectors.

Details

The game will be added to a loop and played 100 times, as the simulated results will help us get closer to the actual theoretical value (i.e. the proportion value of wins achieved by each strategy). Our loop consists of three parts; the collector, iterator & the binding step. In order to make it visually more appealing, by using the table proportions function, prob.table() in order to report results as proportions for each strategy.

Value

The function returns the results as proportion figures indicating the proportion of the wins and losses of each strategy

Examples

1

Ma112120/Montyhall documentation built on Dec. 17, 2021, 2:14 a.m.