Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

12. People arrive at ashoe store at random Each person then looks at a random mu

ID: 3066198 • Letter: 1

Question

12. People arrive at ashoe store at random Each person then looks at a random mumber of shoes before deciding which to buy. (a). Let N be the mumber of people that arrive in an hour. Given that (b). Customer i tries on Xi pairs of shoes they do not like before finding EN-10, what would be a good distribution for N? a pair theý like and then purchase (X, E10,1,...)). Suppose that the chance they like a given pair of shoes in 0.8, independently of the other shoes they have looked at. What is the distribution of Xf? (c). Let Y be the total number of shoes that have been tried on, excluding those purchased. Supposing that each customer acts independently of other customers, give an expression for Y in terms of N and the X, then write functions for simulating N, Xi, and Y. (d). What is P(Y-0)? Use your simulation of Y to estimate PY-0). If your confidence interval includes the true value, then you have some circumstantial evidence that your siulation is correct.

Explanation / Answer

#a

##Poisson distn with lambda=10

N<-rpois(1,lambda=10)

#b

##Geometric with prob of success=0.8

xi<-rgeom(1,prob=0.8)

#c

##Negative Binomial with parameters N and p=0.8

y<-sum(rgeom(N,prob=0.8))#1st definition

y<-rnbinom(n=1, size=N, prob=0.8)##2nd definition

#d

prob_0=dnbinom(0,size=N,prob=0.8)

Y<-rnbinom(10000,size=N,prob=0.8)

p_0=sum(y[y==0])/10000

p_0