bigen: Binomal RV In moeinm98/distributions: Radnom variable generator

Description

`bigen`, takes two parameters p and n and repeats an experience with success probability p and repeat it n times. Then returns number of success.

`bigen.visual`, takes two parameters p and n like `bigen` and plots a Binomial distribution with taking 1000 data from `bigen`.

Usage

 ```1 2``` ```bigen(p, n) bigen.visual(p, n) ```

Arguments

 `p` `Success probability of a single experiment.` `n` `Number of repeating the experience`

Details

In probability theory and statistics, the binomial distribution with parameters n and p is the discrete probability distribution of the number of successes in a sequence of n independent experiments, each asking a yes<e2><80><93>no question, and each with its own boolean-valued outcome: a random variable containing single bit of information: success/yes/true/one (with probability p) or failure/no/false/zero (with probability q = 1 <e2><88><92> p). A single success/failure experiment is also called a Bernoulli trial or Bernoulli experiment and a sequence of outcomes is called a Bernoulli process; for a single trial, i.e., n = 1, the binomial distribution is a Bernoulli distribution. The binomial distribution is the basis for the popular binomial test of statistical significance.

The binomial distribution is frequently used to model the number of successes in a sample of size n drawn with replacement from a population of size N. If the sampling is carried out without replacement, the draws are not independent and so the resulting distribution is a hypergeometric distribution, not a binomial one. However, for N much larger than n, the binomial distribution remains a good approximation, and is widely used.

Examples

 ```1 2``` ```bigen(0.5, 10) ##{1...10} bigen.visual(0.5, 10) ```

moeinm98/distributions documentation built on May 17, 2019, 4:33 p.m.