People are mailing more and more packages these days and you

People are mailing more and more packages these days and you are asked to do a statistical analysis. Let x be the number of packages being mailed by a randomly selected customer at a certain post office. Suppose the distribution of X is as follows:

Solution

x=c(1,2,3,4)
y=c(0.4,0.3,0.2,0.1)
i=1
z=array(dim=2)
for(i in 1:1000)
{
z[i]=sample(x,2, replace = FALSE, prob = y)
i=i+1
}
Mean=mean(z)
Mean
freq=data.frame(table(z))
freq
Probability=freq$Freq/sum(freq$Freq)
Probability
data=cbind(table(z),Probability)
data
r=array(dim=1)
i=1
for( i in 1:1000)
{
r[i]=sample(x,1, replace = FALSE, prob = y)-sample(x,1, replace = FALSE, prob = y)
i=i+1
}
freq1=data.frame(table(r))
freq1
Probability1=freq1$Freq/sum(freq1$Freq)
Probability1
data1=cbind(table(r),Probability1)
data1

The R code is provided it will give you the Following results

Probability ditrubution of Mean(X bar)
1 393 0.393
2 306 0.306
3 204 0.204
4 97 0.097

Probability Distribution of R

Probability1
-3 26 0.026
-2 95 0.095
-1 210 0.210
0 313 0.313
1 197 0.197
2 115 0.115
3 44 0.044

 People are mailing more and more packages these days and you are asked to do a statistical analysis. Let x be the number of packages being mailed by a randomly

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site