How many bit strings of length seven either begin with two 0s or end with three 1s?
A = begin w 2 0s
B = end w 3 1s
P(A or B) = P(A) + P(B) - P(A and B)
P(A) = (7-2)! = 5!
P(B) = (7-3)! = 4!
P(A and B) = (7 - 3 - 2)! = 2!
P(A or B) = 5! + 4! - 2!
b)
How many bit strings of length 10 either begin with two 0s or end with three 1s?
A = begin w 3 0s
B = end w 0 1s
P(A or B) = P(A) + P(B) - P(A and B)
P(A) = (10-3)! = 7!
P(B) = (10-2)! = 8!
P(A and B) = (10 - 3 - 2)! = 5!
P(A or B) = 7! + 8! - 5!
c)
How many ways to line 6 people up in a row if:
i)
The bride must be next to the groom:
Can imagine them as a unit that gets moved around
ii)
The bride is not next to the groom:
Can find by subtracting our answer in i) by the sample space
d)
A palindrome is a string whose reversal is identical to the string. How many bit strings of length N are palindromes?
Bit strings means 2 options per digit of N
For finding palindromes, we can array the first half of the digit, and match the second half to the first half.
A is the set of all bit string of length N that are palindromes
\displaylines{
\text{A is the event where } ,
x_1 + x_2 = 13 \
A = {(0, 13), (1, 12), (2, 11), (3, 10), (4, 9), (5, 8), (6, 7), \ (7, 6), (8, 5), (9, 4), (10, 3), (11, 2), (12, 1), (13, 0)}\
|A| = 14 \
|S| = 17^2 \
\text{Assuming that all events are equally likely: } \
P(A) = \frac{|A|}{|S|} = \frac{14}{17^2} = 0.0484
}
\displaylines{
\text{B is the event where } ,
x_1 + x_2 = 10 \
B = {(0, 10), (1, 9), (2, 8), (3, 7), (4, 6), (5, 5), (6, 4), (7, 3), (8, 2), (9, 1), (10, 0)} \
|B| = 11 \
|S| = 17^2 \
\text{Assuming that all events are equally likely: } \
P(B) = \frac{|B|}{|S|} = \frac{11}{17^2} = 0.0381
}
I think that it is more likely to get exactly two 10’s than four spades.
Solving Analytically…
P(exactly 2 10’s):
Find the probability of the event, and divide it by sample space since the naive definition of probability applies:
P(exactly 4 spades):
Find the probability of the event, and divide it by sample space since the naive definition of probability applies:
Final Answer:
Similar answers were obtained from the simulation, so we can confirm that it is more likely to obtain exactly two 10’s
Problem 4:
a)
Ways to arrange groups: . This is our sample space.
b)
Probability that they are not in the same group can be found by subtracting the ways that they are in the same group from the size of the sample space. Again using the naive definition of probability.
Problem 5:
You are a doctor. You have a medical test that given a person has
cancer the test sees a high (X=true) level of protein X in 92% of
patients.
Given the person is Healthy the test sees the protein X as
high(X=true) in 7.5% of patients.
Additionally it is known that 5% of the population is found to have
cancer at the time of being screened.
A new patient with high levels of protein X wants to know how
probable is it that he is cancer free.
HP = High Protein
C = Cancer
There is a 60.8% chance that he is cancer free, given he has high protein X