My Math Forum (http://mymathforum.com/math-forums.php)
-   -   I'm stuck on these two problems. (http://mymathforum.com/advanced-statistics/38787-im-stuck-these-two-problems.html)

 kaybees17 October 13th, 2013 02:51 PM

I'm stuck on these two problems.

Hello, I've been trying to figure out these two problems, and I just can't seem to do it.

1.) A delicate part in a machine breaks, on average, 26 times per year. It takes two weeks to get a replacement part. How many of the delicate parts should be kept on hand so that the machine has no more than 1% downtime? The parts are expensive, so the stock should be minimal.
- I know it's supposed to be a Poisson problem, but I've never seen one like this.

2.) A character in On the Beach by Neville Shute says "if an infinite number of monkeys start playing with an infinite number of typewriters, one of them is going to write a play of Shakespeare." The shortest play of Shakespeare is a A Midsummer Night's Dream with about 72,000 characters, including all punctuation and spacing. Of these characters, there are 1440 instances of the letter f. Assuming that a monkey types 72,000 characters (allowing for all printable characters on a standard QWERTY keyboard), find:
(i) the probability that the monkey types too few f's (this is a cumulative binomial from 0-1439)
(ii) the probability that the monkey types just the right number of f's (binomial for 1440)
(iii) the probability that the monkey types just the right number of f's in the right places.

You may want to state your estimates in terms of logarithms. Monkeys may be assumed to show no preference for particular characters.
My teacher said to use a probability of 1/100 for the probability of typing an f.

Please someone help me, I have been trying to figure out these problems for days.

 kaybees17 October 13th, 2013 05:10 PM

Re: I'm stuck on these two problems.

Do I have any brave souls?

 jks October 14th, 2013 09:19 PM

Re: I'm stuck on these two problems.

Hi kaybees17,

I don't know about brave, more likely foolish, but here goes:

1) I must admit that I spent most of my time on the next problem. However, following your lead on the Poisson distribution, it seems to me that this problem boils down to the question:

What is the minimum n such that:

$e^{-1} \sum_{i=0}^n \frac{1}{i!}\ \geq \ 0.99 \ \Rightarrow \ \sum_{i=0}^n \frac{1}{i!} \ \geq \ 2.6911$

I arrived at this equation by reasoning that the expected value of a failure in the 2 week period was 1 (26/52 failures per week).

The minimum n that I came up with is 4. By my calculations there is a 98.1% chance of 0,1,2, or 3 failures in a 2 week period and a 99.6% chance of 0,1,2,3 or 4 failures. I hope this is correct.

2) Let's solve (i) last.

First, let's do (ii), the probability that the monkey types just the right number of f's (binomial for 1440):

The PMF equation is:

${72000 \choose 1440} (0.01)^{1440}(0.99)^{72000-1440}=\frac{72000!}{(72000-1440)!1440!}(0.01)^{1440}(0.99)^{72000-1440}$

$=\frac{72000!}{70560!1440!}(0.01)^{1440}(0.99)^{70 560} \$ and if we use Stirling's Approximation we get:

$\frac{\cancel{\sqrt{2\pi}}\sqrt{72000}\left(\frac{ 72000}{e}\right)^{72000}}{\cancel{\sqrt{2\pi}}\sqr t{70560}\left(\frac{70560}{e}\right)^{70560}\sqrt{ 2\pi}\sqrt{1440}\left(\frac{1440}{e}\right)^{1440} }(0.01)^{1440}(0.99)^{70560}$

Taking the natural log we get:

$\frac{1}{2}\log(72000)+72000\left(\log(72000)-1\right)-\left(\frac{1}{2}\log(70560)+70560\left(\log(70560 )-1\right)\right)$
$-\left(\frac{1}{2}\log(2\pi)+\frac{1}{2}\log(1440)+ 1440\left(\log(1440)-1\right)\right)+1440\cdot \log(0.01)+70560\cdot \log(0.99)$

$=7054.3-6631.4-709.2=-286.3$

So the probability is $\ \approx \ e^{-286.3}$

(iii) It seems to me that there are $\ 100^{72000} \$ possible patterns and $\ 100^{72000-1440} \$ correct ones. This gives a probability of:

$\frac{100^{72000-1440}}{100^{72000}}=100^{-1440} \ \approx e^{-6631.4}$

This also equals the probability of each of the 1440 places where there is an f being correct and the other places having any character, which is $\ (0.01)^{1440}$

EDIT: Oops, the above calculation is the probability that all of the f's are in the correct location, but there could be other f's in other locations. That is not what the question asks. The questions asks for the probability that the monkey types just the right number of f's in the right places. So I think the correct answer is:

$(0.01)^{1440}(0.99)^{72000-1440} \ \approx \ e^{-6641.4-709.2} \ \approx e^{-7340.6}$

(i) I think that the answer is for all practical purposes 1.0

The probability of the monkeys typing a certain number of f's peaks at 720, the expected value (72000*0.01). To at least verify that the probability is higher in this region, we have seen that the probability that the number of f's is 1440 is $\ e^{-286.3}$

Recalculating for 720 gives:

$\frac{1}{2}\log(72000)+72000\left(\log(72000)-1\right)-\left(\frac{1}{2}\log(71280)+71280\left(\log(71280 )-1\right)\right)$
$-\left(\frac{1}{2}\log(2\pi)+\frac{1}{2}\log(720)+7 20\left(\log(720)-1\right)\right)+720\cdot \log(0.01)+71280\cdot \log(0.99)$

$=4027.9-3315.7-716.4=-4.2 \$ so the probability of 720 is $\ \approx \ 0.015$

This reference shows that the distribution may be compared to a Normal Distribution with mean 72000*0.01=720 and variance sqrt(72000*0.01*0.99)=26.7

The standard deviation is sqrt(26.7)=5.16 so we can see that 1440 is many, many standard deviations from the mean. Therefore, the CDF for less than 1440 is 1.0

Editorial Note: I have not read the book (On The Beach) nor have I seen the movie, but Morrissey wrote a song based on the book / movie about people on the beach waiting for the nuclear fallout. It is called Every Day is Like Sunday. I like Morrissey's original version and 10000 Maniacs' cover. However, one of my favorite 'relax' songs is The Pretenders' cover. Kind of odd that a song with such a morbid theme is relaxing to me.

 All times are GMT -8. The time now is 03:46 AM.