# Expectation, Variance, and Standard Deviation of Bernoulli Random Variables ## Problem 747

A random variable $X$ is said to be a Bernoulli random variable if its probability mass function is given by
\begin{align*}
P(X=0) &= 1-p\\
P(X=1) & = p
\end{align*}
for some real number $0 \leq p \leq 1$.

(1) Find the expectation of the Bernoulli random variable $X$ with probability $p$.

(2) Find the variance of $X$.

(3) Find the standard deviation of $X$. Add to solve later

## Solution.

### Solution of (1)

As $X$ is a Bernoulli random variable, it takes only two values $0$ or $1$.
Thus, by definition of expectation, we obtain
\begin{align*}
E[X] &= \sum_{i=0}^1 P(X=i)x\\
&= P(X=0) \cdot 0 + P(X=1) \cdot 1\\
&= (1-p) \cdot 0 + p \cdot 1\\
&= p.
\end{align*}
Hence, the expectation of the Bernoulli random variable $X$ with parameter $p$ is $E[X] = p$.

### Solution of (2)

We calculate the variance of the Bernoulli random variable $X$ using the definition of a variance. Namely, the variance of $X$ is defined as
$V(X) = E[X^2] – \left(E[X]\right)^2.$ Here is an observation that makes the computation simpler: As the Bernoulli random variable takes only the values $0$ or $1$, it follows that $X^2 = X$. Thus, the variance can be computed as follows.
\begin{align*}
V(X) &= E[X^2] – \left(E[X]\right)^2 && \text{by definition of variance}\\
&= E[X] – \left(E[X]\right)^2 && \text{by observation $X^2=X$}\\
&= p – p^2 && \text{by result of (1)}\\
&= p(1-p)
\end{align*}

Thus, the variance of the Bernoulli random variable $X$ with parameter $p$ is given by
$V(X) = p(1-p).$

### Solution of (3)

The standard deviation is obtained by taking the square root of the variance. Hence, using the result of (2), the standard deviation of the Bernoulli random variable $X$ with parameter $p$ is
$\sigma(X) = \sqrt{p(1-p)}.$

## Related Problem

Problem.
Suppose that $X$ is a random variable with Bernoulli distribution $B_p$ with probability parameter $p$.

Assume that the variance $V(X) = 0.21$. We further assume that $p > 0.5$.

(a) Find the probability $p$.

(b) Find the expectation $E(X)$.

For a solution, see the post Given the Variance of a Bernoulli Random Variable, Find Its Expectation Add to solve later

### 1 Response

1. 01/27/2020

[…] For proofs of the formulas, see that post Expectation, Variance, and Standard Deviation of Bernoulli Random Variables. […]

This site uses Akismet to reduce spam. Learn how your comment data is processed.

###### More in Probability ##### Probability that Alice Wins n Games Before Bob Wins m Games

Alice and Bob play some game against each other. The probability that Alice wins one game is $p$. Assume that...

Close