Description Usage Details Value References Examples
This function simulates a game involving two players. Person A flips a fair coin initially, with the objective of getting a head. Person B rolls a fair six-sided die after Person A's move with the obejective of getting a 1, 2, 3, or 4. The game is repeated until one person is able to complete his or her objective first thereby winning the game. The winner of the game receives a 1 while the loser receives a 0.
1 | abgame()
|
The function plays one round of the game referenced in Example 1.4.8 (8th Edition). There is no input required to run this simulation. The function defines all possible outcomes of a coin toss or the rolling of a die, as well as calculates the probability of both the coin landing on heads, and the die landing on one through four.
results
contains the resulting score of one round of the game.
Hogg, R., McKean, J., Craig, A. (2018) Introduction to Mathematical Statistics, 8th Ed. Boston: Pearson.
1 2 3 4 5 6 7 8 9 10 11 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.