Function that generates and displays m repeated samples of n Bernoulli trials with a given probability of success

bino.gen(samples = 10000, n = 20, pi = 0.5)

Arguments

samples

number of repeated samples to generate

n

number of Bernoulli trials

pi

probability of success for each Bernoulli trial

Value

simulated.distribution

Simulated binomial distribution

theoretical.distribution

Theoretical binomial distribution

Author

Alan T. Arnholt <arnholtat@appstate.edu>

Examples

bino.gen(samples=50000, n = 10, pi = 0.80)

#> $simulated.distribution
#> Successes
#>     2     3     4     5     6     7     8     9    10 
#> 0.000 0.001 0.006 0.027 0.089 0.202 0.304 0.264 0.107 
#> 
#> $theoretical.distribution
#>     0     1     2     3     4     5     6     7     8     9    10 
#> 0.000 0.000 0.000 0.001 0.006 0.026 0.088 0.201 0.302 0.268 0.107 
#>