determine_winner: Determine if the contestant has won

Description Usage Arguments Details Value Examples

View source: R/monty-hall-problem (4).R

Description

determine_winner( final.pick, game ) generates the outcome of winning granted the contestant selects the door containing a car in his/her final pick. It also generates the outcome of losing if the contestant selects the door containing a goat in his/her final pick.

Usage

1
determine_winner(final.pick, game)

Arguments

...

Based on the game playing strategy if the final.pick equals " the return is a "WIN" if the final.pick equals "goat" the return is "LOSE" assigned.

Details

Selecting the final pick as either the door that has a car behind it, or a door that has a goat behind yields the results of winning or losing at the end of the game.

Value

The function returns "WIN" if final.pick is equal to "car", the functions returns "LOSE" if final.pick is equal to "goat".

Examples

1
  determine_winner( final.pick, game )

bbeltran2395/montyhall documentation built on Dec. 19, 2021, 6:46 a.m.