# Bernoulli distribution

Definition 3.3.1 (Bernoulli distribution). An r.v. X is said to have the Bernoulli distribution with parameter p if P(X = 1) = p and P(X = 0) = 1 − p, where 0 < p < 1. We write this as X ~ Bern(p). The symbol ~ is read “is distributed as”. Any r.v. whose possible values are 0 and 1 has a Bern(p) distribution, with p the probability of the r.v. equaling 1. This number p in Bern(p) is called the parameter of the distribution; it determines which specific Bernoulli distribution we have. Thus there is not just one Bernoulli distribution, but rather a family of Bernoulli distributions, indexed by p. For example, if X ~ Bern(1/3), it would be correct but incomplete to say “X is Bernoulli”; to fully specify the distribution of X, we should both say its name (Bernoulli) and its parameter value (1/3), which is the point of the notation X ~ Bern(1/3). Any event has a Bernoulli r.v. that is naturally associated with it, equal to 1 if the event happens and 0 otherwise. This is called the indicator random variable of the event; we will see that such r.v.s are extremely useful.

Definition 3.3.2 (Indicator random variable). The indicator random variable of an event A is the r.v. which equals 1 if A occurs and 0 otherwise. We will denote the indicator r.v. of A by IA or I(A). Note that IA ~ Bern(p) with p = P(A).

These are the definitions in Introduction to Probability book, however, as been stated in the Definition of Bernoulli distribution that 0 < p < 1 so that means it exclude 1 and 0 but in the Indicator random variable definition it states that when some event A occur P(A) = 1 and P(A) = p ( the small p here is the parameter) which leads us that p = 1 which contradicts what I understand from the first definition that 0 < p < 1 , I think it suppose to be p is bigger or equal to 0 and less or equal to 1, correct me if I said something wrong and explain to me what exactly I am missing?

The first definition describes the Bernoulli random variable $$X$$ that follows the Bernoulli distribution. It has the following probability mass function
$$f_X(x) = \begin{cases} p & \text{if }x=1, \\[6pt] 1-p & \text {if }x=0.\end{cases}$$
The second quote says that you can use Bernoulli distribution for random variables defined in terms of indicator random variable. In such a case, $$IA$$ is equal to $$1$$ if $$A$$ occurs and $$0$$ otherwise. The Bernoulli probability mass function is
$$f_{IA}(Ia) = \begin{cases} p & \text{if }Ia=1, \\[6pt] 1-p & \text {if }Ia=0.\end{cases}$$
$$P(IA=1) = p$$ saying it differently.
The quotes do not say that the probabilities could be $$1$$ or $$0$$. In fact, probability equal to $$1$$ would mean that the random variable is constant, so it's degenerate, it wouldn't follow Bernoulli distribution because there would be only one (not two) event possible for it.