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?