coin.simu: Probability Distribution of Simulated Coins Flipping

Description Usage Arguments Details Value Examples

Description

Mean and probability plot of flipping fair or loaded coin

Usage

1
coin.simu(n, times, prob = NULL)

Arguments

n

number of trials in one simulation

times

number of simulations

prob

probability assigned to each possible outcome

Details

The default probabilty equals to 1/n. All the assigned probabilites must between 0 and 1.

Value

Mean value and corresponding probabilities for all simulated outcomes.

Examples

1
2
coin.simu(n = 4, times = 1000)
coin.simu(4, 1000, prob = c(0.3, 0.7))

Example output

     MEAN_VALUE FREQUENCY PROBABILITY
0          0.00        62       0.062
0.25       0.25       244       0.244
0.5        0.50       400       0.400
0.75       0.75       227       0.227
1          1.00        67       0.067
     MEAN_VALUE FREQUENCY PROBABILITY
0          0.00         7       0.007
0.25       0.25        95       0.095
0.5        0.50       250       0.250
0.75       0.75       417       0.417
1          1.00       231       0.231

clttools documentation built on May 2, 2019, 9:17 a.m.

Related to coin.simu in clttools...