Solutions to Probability and Bayesian Modeling
Jim Albert and Monika Hu
February 2020
Contents
Chapter 1 - Probability: A Measure of Uncertainty 1
Chapter 2 - Counting Methods 12
Chapter 3 - Conditional Probability 20
Chapter 4 - Discrete Distributions 35
Chapter 5 - Continuous Distributions 60
Chapter 6 - Joint Probability Distributions 80
Chapter 7: Learning About a Binomial Probability 96
Chapter 8: Modeling Measurement and Count Data 136
Chapter 9: Simulation by Markov Chain Monte Carlo 158
Chapter 10: Bayesian Hierarchical Modeling 184
Chapter 11: Simple Linear Regression 235
Chapter 12 Bayesian Multiple Regression and Logistic Models 267
Chapter 13 Case Studies 298
Chapter 1 - Probability: A Measure of Uncertainty
Exercise 1. Probability Viewpoints
In the following problems, indicate if the given probability is found using the classical viewpoint, the frequency
viewpoint, or the subjective viewpoint.
a. Joe is doing well in school this semester { he is 90 percent sure that he will receive an A in all of his
classes.
subjective
b. Two hundred raffle tickets are sold and one ticket is a winner. Someone purchased one ticket and the
probability that her ticket is the winner is 1/200.
classical
1
, c. Suppose that 30% of all college women are playing an intercollegiate sport. If we contact one college
woman at random, the chance that she plays a sport is 0.3.
frequency
d. Two Polish statisticians in 2002 were questioning if the newBelgium Euro coin was indeed fair. They
had their students flip the Belgium Euro 250 times, and 140 came up heads.
frequency
e. Many people are afraid of flying. But over the decade 1987-96, the death risk per flight on a US
domestic jet has been 1 in 7 million.
frequency
f. In a roulette wheel, there are 38 slots numbered 0, 00, 1, . . . , 36. There are 18 ways of spinning an odd
number, so the probability of spinning an odd is 18/38.
classical
Exercise 2. Probability Viewpoints
In the following problems, indicate if the given probability is found using the classical viewpoint, the frequency
viewpoint, or the subjective viewpoint.
a. The probability that the spinner lands in the region A is 1/4.
classical
b. The meteorologist states that the probability of rain tomorrow is 0.5. You think it is more likely to
rain and you think the chance of rain is 3/4.
subjective
c. A football fan is 100% certain that his high school football team will win their game on Friday.
subjective
d. Jennifer attends a party, where a prize is given to the person holding a raffle ticket with a specific
number. If there are eight people at the party, the chance that Jennifer wins the prize is 1/8.
classical
e. What is the chance that you will pass an English class? You learn that the professor passes 70% of the
students and you think you are typical in ability among those attending the class.
frequency
f. If you toss a plastic cup in the air, what is the probability that it lands with the open side up? You
toss the cup 50 times and it lands open side up 32 times, so you approximate the probability by 32/50
frequency
Exercise 3. Equally Likely Outcomes
For the following experiments, a list of possible outcomes is given. Decide if one can assume that the outcomes
are equally likely. If the equally likely assumption is not appropriate, explain which outcomes are more likely
than others.
a. A bowl contains six marbles of which two are red, three are white, and one is black. One marble is
selected at random from the bowl and the color is observed.
2
, Outcomes: {red, white, black}
not equally likely – white are more likely to be chosen
b. You observe the gender of a baby born today at your local hospital.
Outcomes: {male, female}
equally likely
c. Your school’s football team is playing the top rated school in the country.
Outcomes: {your team wins, your team loses}
not equally likely – your team is more likely to lose
d. A bag contains 50 slips of paper, 10 that are labeled “1”, 10 labeled “2”, 10 labeled “3”, 10 labeled “4”,
and 10 labeled “5”. You choose a slip at random from the bag and notice the number on the slip.
Outcomes: {1, 2, 3, 4, 5}
equally likely
Exercise 4. Equally Likely Outcomes
For the following experiments, a list of possible outcomes is given. Decide if one can assume that the outcomes
are equally likely. If the equally likely assumption is not appropriate, explain which outcomes are more likely
than others.
a. You wait at a bus stop for a bus. From experience, you know that you wait, on average, 8 minutes for
this bus to arrive.
Outcomes: {wait less than 10 minutes, wait more than 10 minutes}
not equally likely – more likely to wait less than 10 minutes
b. You roll two dice and observe the sum of the numbers.
Outcomes: {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}
not equally likely – some sums (7) are more likely to come up
c. You get a grade for an English course in college.
Outcomes: {A, B, C, D, F}
not equally likely — relatively unlikely for D or F
d. You interview a person at random at your college and ask for his or her age.
Outcomes: {17 to 20 years, 21 to 25 years, over 25 years}
not equally likely – students are relatively unlikely to be over 25 years
Exercise 5. Flipping a Coin
Suppose you flip a fair coin until you observe heads. You repeat this experiment many times, keeping track
of the number of flips it takes to observe heads. Here are the numbers of flips for 30 experiments.
131211261211113211215217333123
a. Approximate the probability that it takes you exactly two flips to observe heads.
P(2 flips) = 7/30
3