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

R programming (Poisson distribution) 1. Suppose that the number of people who en

ID: 3305976 • Letter: R

Question

R programming (Poisson distribution)

1. Suppose that the number of people who enter an elevator on the ground floor is a Poisson random variable with mean X. Sup are N floors above the ground floor and each person who enters the elevator is equally likely to get off at any of the N floors, independently of where the others get off. Thus in any given "trip" up, the number of stops that the elevator makes before discharging all of its passengers is random. Write some R code that takes two variables pose that there lambda, N and returns a (random) number representing the number of stops that the elevator makes before discharging all of its passengers. Use this code to estimate the average number of stops made by the elevator before discharging all of its passengers when X-10 and M-25

Explanation / Answer

lambda=10

N=25

for random we can use the rpois command as follows

First, define the variable N and lambda then

R=rpois(N, lambda)