# Producing random numbers with the binomial distribution: randbinomial

### 8.3.3 Producing random numbers with the binomial distribution: randbinomial

The randbinomial command finds random numbers chosen according to the binomial distribution (see Section 8.4.3).

- randbinomial takes two arguments:
  - n, an integer.
  - p, a probability (a number between 0 and 1).
- randbinomial(n,p) returns an integer from 0 to n chosen randomly according to the binomial distribution with parameters n and p; i.e., the number of successes you might get if you did an experiment n times, where the probability of success each time is p.

#### Example.

Input:

randbinomial(100,0.4)

Output:

42