HTSimulation: Heads and Tails Simulation

View source: R/chapter1_annot.R View source: R/chapter1.R

HTSimulationR Documentation

Heads and Tails Simulation

Description

Simulates and summarizes the distribution of a trajectory of a trivial game based on n coin tosses, interpreted as Heads winning $1 and T losing $1.

Usage

HTSimulation(m, n, prob_heads = 0.5)

Details

The distribution is estimated by sampling m trajectories.

Returns a tibble with two columns each of length m: winnings: the total winnings at the end of the nth round. ahead: the total number of rounds during which the player was ahead.


tteravai/IntroProbR documentation built on July 31, 2023, 3:31 a.m.