Two Interesting, Short Probability Questions
2019-02-28-
If you have
coins, and of them are special in the sense that they have head both front and back. And you pick one up randomly and flip it times and get 10 heads, what is the probability that the coin you picked is one of the special ones?
Solution: Say is the event that you get 10 heads, is the event you picked one of the special coins. Then, by Law of Total Probability, Now, from the Bayes Theorem, Say for , , and , the probability will be about . -
Say you have
ropes, or lines, or spaghetti. Each time you pick two ends and tie them up together. What is the expected number of loops?
Solution: This one is for bored people. So for each round, after you picked up two ends and connect them, they either form a circle, or they do not. In either case the total number of ropes available decreases by . Say in a round we have ropes left, then let be a Bernoulli r.v. denoting if a loop is formed, by Law of Total Probability, Summing over all rounds, and let be the r.v. of total number of loops formed. Second step is true since expectation is a linear operator. So for , this is aboutpy> expected_n_of_loops = lambda N: sum(1.0/(2*i - 1) for i in range(1,N)) py> expected_n_of_loops(100) # 3.2793170636734916
Note the generator expression, without of a list or a tuple, in the
sum()
function.