Discrete Random Variables
Indicator/Bernoulli Random Variable
If we have an experiment that results in a boolean answer (yes/no) or (success/failure) with probability \(p\) for success and \(1-p\) for failure then we can use an indicator or a boolean random variable to represent its outcomes. We define the following:
Therefore, \(R_X = \{0,1\}\). Let’s look at the PMF of \(I\). Remember that the PMF of a random variable is just the probability that this random variable takes on a value \(k\) in \(R_x\). Therefore,
What the expected value of \(X\)? Recall that the expected value of a discrete random variable is defined as
Therefore,
We also know the variance
Binomial Random Variable
If we on the other hand have \(n\) independent trials of Bernoulli random variables with a probability of success \(p\), then we can use a binomial random variable to represent the number of successes in \(n\) trials. For example, if we are flipping a coin with probability of getting heads (success) equals to \(p\), then we can define a binomial random variable \(X\) to represent the number of heads in \(n\) trials.
Therefore, \(R_X = \{0,1,...,n\}\) and the PMF of \(X\) is:
The expected value, variance and second moment of a binomial random variable:
Example 1
Suppose we flip a fair coin \(4\) times. What is the probability of seeing exactly two heads.
Let \(X\) be the number of heads. \(X\) is a binomial random variable with \(n=4\) and \(p=0.5\). Therefore,
Example 2
(Book Example). Suppose we have 12 jurors and in order to convict a defendant you need 8 jurors to vote guilty. Suppose the probability of making the right decision by a juror is \(p\). What is the probability of making a right decision?
Suppose the defendant is guilty. This means that we need at least 8 jurors making the right the decision. Therefore, the probability is
However if the defendant is innocent then we need at least 5 jurors making the right decision
If the defendant is guilty with probability \(\alpha\) then the probability becomes
Poisson Random Variable
Consider a duration of time where events occur at an average rate of \(\lambda\). Let \(X\) be the number of occurrences in a unit of time. We have \(R_X = \{0,1,...,n\}\). The PMF of \(X\) is:
Example 1:
Given a web server, suppose that the server load averages 2 hits per second. Let \(X\) be the number of hits received in a second. What is \(P(X=5)?\)
Binomial and Poisson Random Variables
A Poisson random variable can also be used to approximate a binomial random variable if \(n\) is very large and \(p\) is small so that \(np\) is moderate. Let \(\lambda = E[X] = np\) which is the average number of successes you see in \(n\) trials. Then we will have
When \(n\) is very large, the term \(n(n-1)...(n-k+1)/n^k\) is approximately 1. The term \((1-\lambda/n)^k\) is also approximately \(1^k = 1\). On the other hand we have \((1-\lambda/n)^{n} \approx e^{-\lambda}\). So
Expected Value and Variance of a Poisson Random Variable
Both the expected value and variance of a Poisson random variable is \(\lambda\). Intuitively, we know Poisson approximates a binomial random variable when \(n\) is large and \(p\) is small with \(\lambda = np\). We also know that the expected value of a binomial random variable is \(E[X] = np\). Therefore, the expected value of a Poisson random variable should be \(\lambda\). Similarly, to compute the variance, we know the binomial random variable variance is \(np(1-p)\) and so \(\lambda(1-p)\) when \(p\) is very small is also \(\lambda\).
(Proof?)
Geometric Random Variable
Let \(X\) be a random variable for the number of trials until we see the first success. \(X\) is a geometric random variable with \(PMF\)
\(X\) has the following expected value and variance
The CDF of \(X\) is
Another way to derive this is to let \(C_i\) be the event where we succeed on the ith trial. We see that
Negative Binomial Random Variable
\(X\) is the number of independent trials until the \(r\)th success.
\(X\) has the following expected value and variance
References
My study notes from CS109 http://web.stanford.edu/class/archive/cs/cs109/cs109.1188/
First Course in Probability by Sheldon Ross.