Skip to main content

Posts

Showing posts from February, 2013

The Expected Draws to Sum over One.

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.

Fifty Challenging Problems in Probability with Solutions (Dover Books on Mathematics)

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

$$P(z = X_1 + X_2) = f_{z}(z) = \sum_{x=0}^{z}f_{X_{1}}(x) f_{X_{2}}(z - x)$$

The probability density function of a distribution with rate parameter \(\lambda\) is given as

$$f(k,\lambda) = \frac{\lambda^{k}e^{-\lambda}}{k!}$$

Plugging this into the convolution formula gives us

$$ f_{z}(z) = \sum_{x=0}^{z}\frac{\lambda_{1}^{x}}{x!}e^{-\l…

Using a Biased Coin to make Unbiased Tosses

Q: You have a coin that is biased to either heads or tails with probability \(p\) and you don't which way. How do you generate fair tosses using just this coin?

Fifty Challenging Problems in Probability with Solutions (Dover Books on Mathematics)

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\)!

Some good books to learn …

Choosing the Fair Coin

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?

Fifty Challenging Problems in Probability with Solutions (Dover Books on Mathematics)

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…

Urns and Balls Puzzle

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?

The Probability Tutoring Book: An Intuitive Course for Engineers and Scientists (And Everone Else!)

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

$$ P(\text{no win}) = (1 - \frac{1}{n})\times (1 - \frac{1}{n})\ldots \text{n times}\\ = (1 - \frac{1}{n})^{n}$$

Note, that for large \(n\), the above has a limit which converges to

$$ \lim_{n\to\infty}(1 - \frac{1}{n})^{n} = \frac{1}{e…

The Case of Two Mariners

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\).

$$ d_{blended} = \omega\times d_1 + ( 1 - \omega)\times d_2 $$

The variance of the blended estimate would be given by

$$ Var(d_{blended}) = \omega^{2}\times s_{1}^{2} + (1 - \omega)^{2}\times s_{2}^{2} $$

We next proceed to find a value for \(\omega\) that minimizes the variance \(Var(d_{blended})\). For this …