Practice: Random Variables
1) Type of Random Variable
Choose a STAT 20 student at random. Decide whether each of the following is a discrete or continuous random variable:
The number of courses the student takes this semester:
The student’s weight:
The student’s commute time (in minutes) to campus:
The number of pets the student has:
The (exact) time the student sleeps during a week:
The number of caffeinated beverages that the student drinks in a typical week:
- Discrete
- Continuous
- Continuous
- Discrete
- Continuous
- Discrete
2) Tossing a fair coin
Let \(X\) be the number of heads in five tosses of a fair coin. We are interested in finding the probability distribution of \(X\), that is: \(P(X = k)\)
What values will \(k\) take?
Use
dbinom()
to find the probability distribution of \(X\). In other words, obtain the values of \(P(X = k)\) for all values of \(k\).Sketch a graph of the probability histogram of \(X\).
Sketch a graph of the cumulative distribution function (cdf) \(F(x)\).
\(k = 0, 1, 2, 3, 4, 5\)
dbinom(x = 0:5, size = 5, prob = 0.5)
Graph of the probability histogram.
- Sketch a graph of the CDF.
3) Tossing a biased Coin
Let \(Y\) be the number of heads in four tosses of a biased coin where the chance of heads is 3/5.
Use
dbinom()
to find the probability distribution of \(Y\). In other words, write down the values of \(P(Y = k)\) for all values of \(k\).Sketch a graph of the cumulative distribution function (cdf) \(F(y)\).
dbinom(x = 0:4, size = 4, prob = 3/5)
CDF
4) Deck of cards
Consider a deck of 52 cards. Suppose we are interested in the number of hearts dealt in a hand of five. Call this number \(Z\).
Which of the following is the correct distribution of \(Z\)?
- Bernoulli
- Binomial
- Hypergeometric
- Poisson
- Bernoulli
Based on your answer for part a), find the probability distribution of \(P(Z=k)\). Do this with the corresponding R function for the chosen distribution.
option iii) Hypergeometric
dhyper(x = 0:5, m = 13, n = 39, k = 5)
CDF
5) Rolling a pair of dice
Consider two colored 6-sided dice: one of them is a blue die, and the other is a red die. You roll the dice, and look at the numbers on their top faces. Let \(W\) be a random variable that takes the following values:
- \(W = -1\) if the number in the blue die is less than the number in the red die.
- \(W = 0\) if the number in the blue die is equal to the number in the red die.
- \(W = 1\) if the number in the blue die is greater than the number in the red die.
For example, if the blue die lands 3 and the red lands 5, then \(W\) = -1. If both dice land 2, then \(W\) = 0. If the blue die lands 4 and the red lands 1, then \(W\) = 1.
Below is a sketch of the cumulative distribution function (cdf) \(F(w)\).
Based on \(F(w)\), find the probabilities:
\(P(W = -1)\)
\(P(W = 0)\)
\(P(W = 0.5)\)
\(P(W = 1)\)
\(P(W = -1) = 15/36\)
\(P(W = 0) = 21/36 - 15/36 = 6/36\)
\(P(W = 0.5) = 0\)
\(P(W = 1) = 1 - 21/36 = 15/36\)
6) Rolling a pair of dice (cont’d)
Refer to the colored dice of the previous problem. Let \(V\) be a random variable that takes the following values:
- \(V = 0\) if both dice land on even numbers.
- \(V = 1\) if both dice land on odd numbers.
- \(V = 2\) if one die is even, and the other is odd (regardless of color).
Find \(P(V = 0)\)
Find \(P(V = 1)\)
Find \(P(V = 2)\)
\(P(V = 0) = 9/36\)
\(P(V = 1) = 9/36\)
\(P(V = 2) = 18/36\)