PART2httpswwwcheggcomhomeworkhelpquestionsandanswersprovidep
PART2-https://www.chegg.com/homework-help/questions-and-answers/provide-procedures-matlab-code-q15638649
Solution
Estimate E(N) by generating 100, 1000, 10,000 and 100, 000 values. What is the true value of E(N)? For the expected value of N, note that P(N 2) = 1 P(N 3) = P(U1 + U2 · 1) = 1/2 P(N 4) = P(U1 + U2 + U3 · 1) = 1 3! P(N j) = 1 (j 1)! Now notice that P j=1 P(N j) can be written as P(N 1) = P(N = 1) +P(N = 2) +P(N = 3) +P(N = 4) +... P(N 2) P(N = 2) +P(N = 3) +P(N = 4) +... P(N 3) P(N = 3) +P(N = 4) +... P(N 4) P(N = 4) +... SUM= P(N = 1) +2P(N = 2) +3P(N = 3) +4P(N = 4) +... This shows that E(N) = P j=1 jP(N = j) = P j=1 P(N j) = 1+1+1/2+ ... = e.
