coin: Theoretical Probability Distribution of Flipping Coins

Description Usage Arguments Details Value Examples

Description

Mean and probability of flipping fair or loaded coin

Usage

1
coin(n, prob = NULL)

Arguments

n

number of trials

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 possible outcomes.

Examples

1
2
coin(n = 4)
coin(6, c(0.1, 0.9))

Example output

  MEAN_VALUE PROBABILITY
1       0.00      0.0625
2       0.25      0.2500
3       0.50      0.3750
4       0.75      0.2500
5       1.00      0.0625
  MEAN_VALUE PROBABILITY
1  0.0000000    0.000001
2  0.1666667    0.000054
3  0.3333333    0.001215
4  0.5000000    0.014580
5  0.6666667    0.098415
6  0.8333333    0.354294
7  1.0000000    0.531441

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

Related to coin in clttools...