Subscribe to this blog

Follow by Email

Search This Blog

Posts

Q: You have a random number generator that creates random numbers exponentially between \([0,1]\). You draw from this generator and keep adding the result. What is the expected number of draws to get this sum to be greater than 1.

A: Before getting into the solution for this, I'll go over an established theorem of exponential distributions.

If there exists two random variables which follow a exponential distribution with parameters \(\lambda_1\) and \(\lambda_2\) then their sum is given by the convolution of the two probability density functions. This is shown as

A: There exists a fairly simple and elegant solution to this puzzle. Instead of using just the out come of the toss, use the outcomes of pairs of tosses that result in the patterns HT or TH. All other patterns should be ignored. The first instance of \(\{\ldots HT\ldots\}\) should be treated as a "heads" and if the first instance in series is \(\{\ldots TH\ldots\}\) then it should be treated as "tails". Here is why it works. Assume \(P(Heads) = p\) and \( P(Tails) = 1 - p\). The probability of getting a head followed by a tails is \(p\times(1-p)\). Likewise the probability of getting a tails followed by a heads is \((1-p)\times p\) which is the exact same and is completely independent of \(p\)!

Q: There are three coins, one of them is fair, while the other two are biased with probabilities of heads being \(\frac{1}{4}\) and \(\frac{3}{4}\) respectively. A coin is chosen at random. How many tosses are needed to have a greater than \(50\%\) probability that it is fair?

A: If \(n\) tosses are done of which \(t\) are tails then the probability of seeing them is given by
$$P(n,t | p=50\%) = \dbinom{n}{t}\frac{1}{2^{n-t}}\frac{1}{2^{t}} = \dbinom{n}{t}\frac{1}{2^{n}}$$
Likewise, the probability of it being the biased coin with \(p=25\%\) is
$$P(n,t | p=25\%) = \dbinom{n}{t}\frac{1}{4^{n-t}}\frac{3^{t}}{4^{t}} = \dbinom{n}{t}\frac{3^{t}}{4^{n}}$$
and the probability of it being the biased coin with \(p=75\%\) is
$$P(n,t | p=75\%) = \dbinom{n}{t}\frac{1}{4^{t}}\frac{3^{n-t}}{4^{n-t}} = \dbinom{n}{t}\frac{3^{n-t}}{4^{n}}$$

Putting things in a Bayesian perspective, we want to know \(P(p=50\%|n,t)\) wh…

Q: There are a large number of urns with each urn having as many balls as there are urns. There is exactly 1 red ball within each urn and the rest are white. You are allowed to draw exactly one ball from each of the urns in sequence. If you ever get a red ball, you win a prize. What is the probability that you will win?

A: Assume there are \(n\) urns. This implies that there are \(n\) balls per urn with exactly 1 red ball and \(n-1\) white balls. The probability that you would draw a red ball from a given urn is \(\frac{1}{n}\) implying the probability that you would not win from a given urn is \(1 - \frac{1}{n}\). The probability of not winning at all is

Q:Two mariners report to the skipper of a ship that they are distances \(d_1\) and \(d_2\) from the shore. The skipper knows from historical data that the mariners A & B make errors that are normally distributed and have a standard deviation of \(s_1\) and \(s_2\). What should the skipper do to arrive at the best estimate of how far the ship is from the shore?

A: At a first look, it appears that the simplest solution would be to take the estimate of the navigator who has the lower standard deviation. If \( s_1 < s_2\) then pick \(d_1\) else pick \(d_2\).

But there is a way to do better than that. Assume you take a linearly weighted sum of the two with weight \(= \omega\).