Expectation
The expected value of random variable is defined as
It is easy to check that
where the notation is defined as . Since we consider a finite sample space, the range of is always finite. Denote by and the minimum and maximum values in respectively.
It is easy to check that . This is simply because for every , we have , so
Let and be random variables. Then
If are real numbers and are random variables, then
The indicator variable of event is a random variable that takes values, i.e., such that
In other words, this is the (random) predicate indicating whether . It is easy to check that the expected value of an indicator variable is the probability of (do you see why?).
Indicator variables play a central role in probability.
Prove: Every random variable can be written as a linear combination of indicator variables.
Let where is an indicator random variable for event . Therefore, . This just follows from the linearity of expectation.
In a random graph probability space , calculate the expected number of edges.
Let be the number of edges. So we can write as a sum of the pairs where is an indicator of whether there is an edge connecting and . That is, . By the linearity of expectation:
Calculate the following expectations for the probability space (see Coin tossing).
- The number of heads.
- The number of runs of consecutive heads (e.g., has 3 runs of consecutive heads).
Calculate the expected number of Hamiltonian cycles (contain every vertex) in a random graph.