expt {clttools} | R Documentation |
General experiment with basic probability
expt(x, n, prob = NULL)
x |
vector, possible outcomes in one trial of experiment |
n |
number of trials |
prob |
probability assigned to each possible outcome |
The default probabilty equals to 1/n. All the assigned probabilites must between 0 and 1.
Mean value and corresponding probabilities for all possible outcomes.
expt(x = c(1:3), n = 4) expt(c(2:4), 3, prob = c(0.3, 0.5, 0.2))