play_n_games: Play "n" games - Function

Description Usage Arguments Details Value Examples

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

Description

This function will be using the play_game() function to simulates and test the game a hundred times. The game will be using a loop to run the function "n" times (n=100 in this came).

Usage

1
play_n_games(n = 100)

Arguments

The

function will run the game utilizing the function ""loop.count""play_game()", the library (dplyr), the function "for(in)". Some of the variables used in this function are loop.count, results.list, and game.outcome.

Details

The function will be using a loop that will help to running the game continually up to 100 times to see the different results.

Value

The function will return the outcome of the strategy chosen. How many times a contestant could win if chooses to stay or how may times the contestant could win if chooses to switch?

Examples

1

sandralili/montyhall documentation built on Dec. 22, 2021, 10:14 p.m.