You have N similar keys in the bag; only one of them opens the door to your apartment. When you come home, you take a random key from the bag and try to open the door with it. If it does not fit, you put it back in the bag and pull a random one again. What distribution would describe the number of the first successful attempt to open the door?
P(X=k)=1/N(1−1/N)^(k−1)
P(X=k)=C(k,N) * (1/N)^k * (1−1/N)^(N−k)
P(X=k)=1/N^(k−1) * (1−1/N)
P(X=k)=N^k * e^(-N) / k!
Imagine that for d days you know X1,...,Xn – numbers of keys you had tried to get into your apartment. Write down likelihood function for this sample and take a log of it. What do you have?
lnL(Xn,N)=(∑i=1^n Xi−n) * ln(1/N) + n * ln(1−1/N)
lnL(Xn,N)=ln(N) * ∑i=1^n Xi−n/N − ∑i=1^n ln(Xi!)
lnL(Xn,N)=n * ln(1/N) + (∑i=1^n Xi−n) * ln(1−1/N)
lnL(Xn,N)=(n/N − ∑i=1^n Xi) * ln(1−1/N) + (∑i=1^n Xi) * ln(1/N) + ∑i=1^n ln(CXi/N)
In the last 5 days, you had to try 8, 12, 7, 6, and 12 keys to get home. Let's find the maximum likelihood estimate for the number of keys in your bag N. Put these numbers into the log-likelihood formula, derive the score function, solve the score equation. You get N^MLE=
Estimate the variance of N^MLE. Provide the answer rounded to have one decimal point.
Using the asymptotic normality of the maximum likelihood estimate, calculate the lower bound of the approximate 95% confidence interval for N, provide the answer rounded to have one decimal point.