The bernoulli distribution allows us to calculate the probabilities for a random variable that takes only two values – 0 and 1.

**What is a Bernoulli trial?**

An experiment in which there are only two possible outcomes – success and failure. An example of a bernoulli trial is the tossing of a coin since there are only two possible outcomes in this case – heads or tails. We denote either one of the outcomes, say heads as success and the other outcome is called failure.

The bernoulli random variable is defined so that it takes the value 1 when success occurs and 0 when failure occurs.

**Bernoulli Distribution PDF Formula:**

Let ‘p’ denote the probability of success. Hence, the probability of failure is equal to ‘1-p’. The probability distribution of the bernoulli random variable is given as,

P(X=x) = \begin{cases}p, & \text{if } x=1\text{ (success occurs) } \\ 1-p, & \text{if } x=0\text{ (failure occurs) }\end{cases}The CDF (cumulative distribution function) F(x) for the Bernoulli Distribution is given as,

F(X) = \begin{cases}1-p, & \text{if } x=0 \\ 1 & \text{if } x=1\end{cases}**Properties:**

- The expected value/mean of the bernoulli distribution is given as, E(X) = p
- The variance of the bernoulli distribution is given as, V(X) = p(1-p)
- The moment generating function (mgf) of the bernoulli distribution is given as, M_X(t) = (1-p)+pe^t
- The sum of ‘n’ independent bernoulli random variables, follows the binomial distribution with parameter ‘n’ and ‘p’.