Random Variable: A real-valued function defined on the sample space.
Range of Random Variable, R(X): All possible values X can take on.
Discrete Random Variable: A random variable with finite or countable R(X)
Two Types of Numerical Variables:
Probability Mass Function: P_X (i) = P(X = i), where i \in R(X)
Suppose we want to define X to be the number of heads we get after flipping a coin three times.
Our sample space would be:
In our sample space, heads can be gotten between 0—3 times. By putting the count above n, we can define the probability mass function in a table like so:
| i | P(X=i) |
|---|---|
| 0 | 1/8 |
| 1 | 3/8 |
| 2 | 3/8 |
| 3 | 1/8 |
| Total | 1 |
For example to find P(at most one heads), or P(X \le 1):
\begin{aligned} P(X \le 1) &= P(X = 0) + P(X = 1) \\ &= \frac{1}{8} + \frac{3}{8} \\ &= \frac{1}{2} \end{aligned}Q: Each of the following tables lists certain values of X and their probabilities P(x).
Determine whether each table represents a valid probability mass function.
| i | P(X=i) |
|---|---|
| 3 | 0.5 |
| 5 | 0.2 |
| 7 | 0.4 |
| i | P(X=i) |
|---|---|
| 0 | 0.3 |
| 1 | 0.9 |
| 2 | -0.2 |
| i | P(X=i) |
|---|---|
| 2 | 0.2 |
| 3 | 0.6 |
| 6 | 0.1 |
| 9 | 0.1 |
A:
Remember: A valid probability mass function will have its probabilities add up to 1.0, and each individual probability must be a valid probability (between 0 and 1).
Expectation of Random Variables; E(X) \lor \mu: Weighted average of a random variable’s outcomes.
\boxed{ E(X) = \sum_{i \in R(X)} i P(X=i) = \mu }
Q: Find the expectation of the random variable.
Ex: Flip a coin three times.
A:
\begin{aligned} E(X) &= \sum_{i \in \{ 0, 1, 2, 3 \}} i P(X=i) &= 0P(X=0) + 1P(X=1) + 2P(X=2) + 3P(X=3) &= 0 \times \frac{1}{8} + 1 \times \frac{3}{8} + 2 \times \frac{3}{8} + 3 \times \frac{1}{8} &= \frac{3}{2} \end{aligned}
| i | P(X=i) | i P(X=i) |
|---|---|---|
| 0 | 1/8 | 0 \times \frac{1}{8} |
| 1 | 3/8 | 1 \times \frac{3}{8} |
| 2 | 3/8 | 2 \times \frac{6}{8} |
| 3 | 1/8 | 3 \times \frac{3}{8} |
| Total | 1 | E(X) = \mu = \frac{3}{2} |
Variance of Random Variables:
\boxed{ Var(X) = E(X^2) - \mu^2 = \sigma^2 } \\~\\ \small\textit{where } E(X^2) = \sum_{i \in R(X)} i^2 P(X=i)
Binomial Random Variable: X ~ B(n,p)
Assumptions:
\boxed{ \text{Binomial: } \begin{cases} R(x) &= \{ 0, 1, ..., n \} \\~\\ P(X=j) &= \binom{n}{j} p^j (1 - p)^{n-j} \\~\\ &\text{: Prob. of $j$ successes out of $n$ trials} \\~\\ E(X) &= np = \mu \\~\\ Var(X) &= \sqrt{np(1-p)} = \sigma \end{cases} }
Poisson Experiment: When we want to know the probability that a specific number of occurrences takes place within a given interval of time, length, or space (X).
Assumptions:
Poisson v.s. Binomial R.V.
- Total number of occurrences is fixed for Binomial, but Poisson has theoretically infinite range.
Q: Collect a sample of 10 people in a hospital and examine whether each of them has lung cancer.
A: X = number of patient with cancer. Number of trials is fixed. Binomial.
Q: Go to a hospital and see how many lung cancer patients come a day.
A: X = number of patient with cancer / day. No finite number of trials. Poisson.\lambda: \text{mean num. of occurrences during the given interval}
\boxed{ \text{Poisson: } \begin{cases} R(x) &= \{ 0, 1, 2, 3,4 , ... \} \\~\\ P(X=j) &= \frac{e^{-\lambda}\lambda^j}{j!} \\~\\ &\text{: Prob. of exactly $j$ occurrences in given interval} \\~\\ E(X) &= \lambda \\~\\ Var(X) &= \lambda \qquad (SD = \sqrt{\lambda}) \end{cases} }
Q: \lambda = 6, find P(X=4)
A: P(X=4) = \frac{e^{-6}6^4}{4!} = 0.1339
Q: \lambda = 6, find P(X \le 1)
A: P(X=0) = P(X=1) = 0.0025 + 0.0149 = 0.0174
Q: \lambda = 6, find P(X \ge 2)
A: P(X \ge 2) = 1 - P(X<2) = 0.9826
Given: A restaurant has on average 10 customers per day.
Q: What is the probability they have exactly 5 customers on a given day?
A:
Let X: the # of customers a day ~ Pois(10)
P(X=5) = \frac{e^{-10}10^5}{5!} = 0.0378
Q: What is the probability they have more than 3 customers on a given day?
A: P(X>3) = 1 - P(X \le 3) = 0.9896
Q: What is the expected number of customers for tomorrow?
A: E(X) = 10
Q: What is the standard deviation of the number of customers?
A: We know Var(X) = 10
So SD = \sqrt{10}X: The # of independent trials until the first success occurs with probability of success p.
\boxed{ \text{Geometric: } \begin{cases} R(x) &= \{ 1, 2, 3, 4 , ... \} \\~\\ P(X=j) &= (1-p)^{j-1} p, \qquad 0 < p < 1 \\~\\ E(X) &= 1/p \\~\\ Var(X) &= (1-p)/p^2 \end{cases} }
Roll a die until you get a 4.
Let X: number of trials until 4 appears.
Then,
\begin{align*} R(x) &= {1,2,3,...} \\~\\ p &= 1/6 \\~\\ P(X=j) &= (1-p)^{j-1} p = \left \frac{5}{6} \right^{j-1} \frac{1}{6} \\~\\ E(X) &= 6 \\~\\ Var(X) &= 30 \end{align*}X: The number of objects with a specific trait out of a sample size n; where:
\boxed{ \text{Hypergeometric: } \begin{cases} R(x) &= \{ max(0,n+m-N), ..., min(m,n) \} \\~\\ P(X=j) &= \frac{\binom{m}{j} \binom{N-m}{n-j}}{\binom{N}{n}} \\~\\ E(X) &= \frac{nm}{N} \\~\\ Var(X) &= \frac{nm(N-n)(N-m)}{N^2(N-1)} \end{cases} }
Q: There is an urn with 10 black balls and 6 white balls. 5 balls will be drawn in a row without replacement. Find the probability that two balls are white.
A:
Let X = Number of white balls
R(X) = \{ 0, 1, ..., 5 \}
\begin{align*} P(X=2) &= \frac{\binom{m}{j} \binom{N-m}{n-j}}{\binom{N}{n}} \\ &= \frac{\binom{6}{2} \binom{16-6}{5-2}}{\binom{16}{5}} \\ &= 0.4127 \end{align*}
E(X) = \frac{nm}{N} = \frac{5 \times 6}{16} = \frac{15}{8}