Exercises
Use these exercises to check the chapter ideas. Work by hand first.
A fair die is rolled.
What is the probability of rolling an odd number?
Compute it first, then check your number.
If P(A) = 0.65, what is P(not A)?
Compute it first, then check your number.
Can [0.2, 0.3, 0.6] be a valid distribution over three exclusive outcomes?
Answer it first, then check.
Suppose X = 2 with probability 0.25 and X = 6 with probability 0.75.
What is E[X]?
Compute it first, then check your number.
If Var(X) = 16, what is the standard deviation?
Compute it first, then check your number.
A fair coin is flipped twice.
What is the probability of heads on both flips?
Compute it first, then check your number.
Suppose P(A and B) = 0.18 and P(B) = 0.6.
What is P(A | B)?
Compute it first, then check your number.
Suppose P(A) = 0.1, P(B | A) = 0.9, and P(B) = 0.3.
What is P(A | B)?
Compute it first, then check your number.
Which distribution models one yes/no outcome?
Answer it first, then check.
Does positive covariance by itself prove causation?
Answer it first, then check.
A classifier assigns:
cat: 0.6
dog: 0.3
car: 0.1
What is the probability of the event {dog, car}?
Compute it first, then check your number.
Hint
The labels have unequal probabilities.
Solution
The event probability is:
The labels have unequal probabilities, so we add their probability mass instead of counting two labels out of three.
Suppose P(A) = 0.5, P(B) = 0.4, and P(A and B) = 0.1.
What is P(A or B)?
Compute it first, then check your number.
Hint
The overlap would be counted twice by P(A) + P(B).
Solution
The overlap is subtracted once because it was included in both P(A) and
P(B).
Enter 1 if a mini-batch average loss is usually an estimate of expected loss,
not the exact expected loss over all possible examples.
Compute it first, then check your number.
Hint
Ask whether one mini-batch contains the whole population of possible examples.
Solution
Enter 1. A mini-batch average is computed from sampled examples. It estimates
the expected loss under the data distribution.
In Bayes' rule, enter 1 if the denominator P(B) turns the joint score
P(B | A)P(A) into the posterior P(A | B).
Compute it first, then check your number.
Hint
Conditional probability divides by the probability of the condition.
Solution
Enter 1. The numerator is the joint probability of A and evidence B.
Dividing by P(B) gives the probability of A after restricting attention to
cases where B happened.
Next
Use the hints only after you have tried the exercises. Use the solutions after you can explain where you got stuck.