Description Usage Arguments Value Examples
Each coin is given a probability of a success, independent of other coins. Ties are dealt with by recursion, though I barely understand how I got this to work. If all coins return 1 or all coins return 0 (an all-way tie), simply repeat the flip; nothing has changed. If any coins come out ahead, partition the different coins by 'rank' (rank 1 means a coin succeeded while others did not) and recursively run the simulation until all ties have been broken and each coin has been assigned a unique rank, 1 through N.
1 | coin_flip_game(thetas)
|
thetas |
Vector of probabilities of success for each coin |
A vector of ranks for each probability in thetas
1 | example_game <- coin_flip_game(c(0.5, 0.5, 0.7))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.