#Question 2 page 150 Chapter 4 Conditional Probability
A coin is tossed three times. What is the probability that exactly two heads occur, given that (a) the first outcome was a head? (b) the first outcome was a tail? (c) the first two outcomes were heads? (d) the first two outcomes were tails? (e) the first outcome was a head and the third outcome was a head?
Heads is success and tails is failure
k = 2 success n =3 amount of trials.
Scenario where first outcome is head, so we need one more head. So 1 success out of 2 trials is what we need.
\(P(single scenario)=p^{k}*(1-p)^{n-k}\)
p1 <- (0.5^1)*(1-0.5)^1
p1
## [1] 0.25
Scenario where the first outcome is tails, so we need two heads on both last trials. so 2 success out of 2 trials.
p2 <- (0.5^2)*(1-0.5)^0
p2
## [1] 0.25
Scenario where the first two outcomes are heads. So we need 0 success out of the last trial.
p3 <- (0.5^0)*(1-0.5)^1
p3
## [1] 0.5
Scenario where the first two outcomes are tails. So we need 2 successes out of 1 trial. In this case, tiral count is less than the success we are looking for. The probability of getting two heads in the third trial is 0.
Scenario where the first out is head and the last outcome is head. We are looking for 0 successes out of the one left trial.
p5 <- (0.5^0)*(1-0.5)^1
p5
## [1] 0.5