A Bernoulli random variable (sometimes called a binary random variable) is any random variable with only two possible outcomes.
## Notation
$X \sim Bern(p)$
## PMF
$P(X = x) = p^x(1-p)^{1-x} \ I_{(0,1)}(x)$
## CDF
$
F(x) = P(X <= x) =
\begin{cases}
0 & x <= 0 \\
1-p & 0 < x < 1 \\
1 & x >= 1
\end{cases}
$
## Expectation
$E(X) = p$
## Variance
$V(X) = p(1-p)$
## Approximation of the Bernoulli Distribution with the Normal Distribution
The Bernoulli distribution can be approximated by the Normal Distribution when $n$ is sufficiently large. This is especially useful because at large $n$ the calculations for the Bernoulli distribution become incredibly computationally intensive.
For large $n$, $X$ can be approximated by a normal random variable with $\mu=np$ and $\sigma^2=np(1-p)$.
> [!Example] Example
> In a given day, there are approximately 1,000 visitors to a website. Of these, 25% register for a service. Estimate the probability that between 200 and 225 people will register for a service tomorrow.
>First, we calculate $\mu$ and $\sigma$ from our data.
>$\mu = np = 1000*0.25 = 250$
>$\sigma^2 = np(1-p) = 1000 * 0.25 * (1 - 0.25) = 187.5$
>Next we transform to the standard normal distribution.
>
>$P(200 <= X <= 225) = P(\frac{199.5 - 250}{\sqrt{187.5}} <= Z <= \frac{225.5 - 250}{\sqrt{187.5}}$
>Why use 199.5 and 225.5 in place of 200 and 225? This is called the "continuity correction". Because we are transforming a discrete variable to the continuous normal distribution, we want to split the difference between the two possible discrete values 199 and 200.
>
>Finally, we will look up the values in a look up table to arrive at the probability.
>$P(-3.688 <= Z <= -1.789) = \Phi(-1.789) - \Phi(-3.688) = 0.367$
>In this case, because the probability is what we were asked to evaluate, we do not need to transform back to the original scale. The probability is simply the probability.