Question

In: Statistics and Probability

1.1 LetX∼Poisson(4). The r command dpois(0:9, 4) gives the probabilities that P(X=k) fork= 0,1,...,9. 1.1.1 Use...

1.1 LetX∼Poisson(4). The r command dpois(0:9, 4) gives the probabilities that P(X=k) fork= 0,1,...,9.

1.1.1 Use the plot() function to plot these probabilities and to connect the points with lines.

1.1.2 Use the barplot() function to make a barplot these probabilities.

1.2 The r command rpois(1000, 4) generates a sample of 1000values from the Poisson(4) distribution. Use the barplot()function to plot the empirical probabilities for X=k resultingfrom this sample

please include r code needed to generate plots

Solutions

Expert Solution

1.1)

Let X∼Poisson(4) . Now we calculate the probabilities that P(X=k) for k = 0,1,2.....,9

R Command:

> prob=dpois(0:9,4)
> prob

Output:
[1] 0.01831564 0.07326256 0.14652511 0.19536681 0.19536681 0.15629345
[7] 0.10419563 0.05954036 0.02977018 0.01323119

1.1.1)

Now we plot these probabilities and to connect the points with lines. [ for points with line code is type="b" ]

R Command:
> plot(prob,main="Probability Plot",xlab="Value",ylab="probability",type="b")

Output:

1.1.2)

Now we make a Barplot of these probabilities. To draw Barplot we need to construct a frequency table. Which is
done by the table() command.

R Command:

> count=table(prob)
> count

Output:
prob
0.0132311916910503 0.0183156388887342 0.0297701813048632 0.0595403626097264 0.0732625555549367

1 1 1 1 1

0.104195634567021 0.146525111109873 0.156293451850532 0.195366814813165
1 1 1    2

R Command:

> barplot(count,main="Probability Plot",xlab="value",ylab="frequency")

Output:

1.2) Now we generates a sample of 1000 values from the Poisson(4) distribution.

R Command:

> random=rpois(1000, 4)
> random

Output:
[1] 2 6 3 1 4 2 1 6 5 4 4 2 1 3 3 5 5 5 3 4 4 2 4 6 4 4 2 5 6 2 1 4 2 6 3 7 3 2
[39] 3 7 4 2 4 2 2 4 4 5 4 6 5 6 7 3 7 6 5 3 3 5 3 8 1 5 5 3 6 3 4 1 8 3 5 6 7 7
[77] 6 8 1 4 5 8 2 5 3 6 4 5 3 5 1 3 4 2 3 6 4 1 5 5 6 4 4 4 4 7 4 5 4 3 2 4 3 7
[115] 2 2 6 3 5 2 6 5 7 4 2 5 1 1 3 4 6 1 4 5 5 5 3 4 5 2 6 3 3 1 4 2 5 6 5 5 3 3
[153] 3 4 1 2 2 2 6 2 5 3 4 4 2 7 4 0 6 5 4 4 3 4 1 1 4 5 5 3 3 5 11 2 3 11 5 4 4 3
[191] 3 4 1 3 6 6 1 1 4 2 3 4 2 4 3 2 4 4 6 7 1 3 4 3 8 4 5 3 4 3 3 2 7 1 6 7 5 6
[229] 4 1 3 3 3 1 11 4 2 4 1 5 3 4 5 5 5 3 6 7 2 2 5 3 5 4 2 3 5 2 3 8 4 7 5 4 3 2
[267] 7 2 5 3 3 7 1 6 4 4 4 6 5 3 2 2 3 3 8 1 2 2 5 4 3 6 6 4 10 4 4 1 4 6 3 2 2 1
[305] 2 5 2 2 3 3 2 4 4 4 6 3 4 12 3 4 4 4 1 2 1 3 3 2 5 2 5 5 4 2 3 5 4 6 3 5 3 5
[343] 3 4 5 6 2 2 6 3 5 4 2 6 5 5 3 2 2 5 2 5 2 5 4 3 4 2 3 1 4 6 4 3 5 4 2 5 3 9
[381] 4 1 6 3 6 0 3 7 2 3 4 5 3 3 1 4 3 6 3 4 4 7 6 3 2 9 1 5 1 4 5 3 4 4 2 4 4 2
[419] 7 6 1 3 4 6 4 4 4 3 4 2 4 7 6 2 9 5 8 5 3 3 2 4 4 1 2 3 5 6 4 5 5 4 10 6 7 5
[457] 6 2 4 5 7 7 3 4 2 6 3 5 5 5 3 2 2 1 2 6 3 1 5 2 4 1 5 4 4 4 5 3 3 2 5 2 4 3
[495] 0 3 11 3 2 2 4 5 4 2 2 6 7 5 9 2 4 6 6 3 2 9 5 3 11 3 6 5 2 7 4 3 4 3 4 5 9 4
[533] 5 4 6 3 7 0 2 9 3 1 4 2 4 1 6 6 4 8 4 4 4 5 7 2 6 1 3 2 5 5 3 6 6 1 4 4 3 3
[571] 1 4 4 6 4 2 5 5 6 3 3 7 6 7 5 5 2 6 2 3 7 5 7 2 3 3 4 5 2 2 3 9 2 3 2 3 7 2
[609] 5 4 3 8 5 1 3 1 2 5 6 4 2 3 7 6 1 3 1 4 2 5 3 3 2 3 2 2 4 4 3 0 5 5 2 5 2 2
[647] 4 7 2 3 3 1 2 3 1 5 8 3 6 2 5 1 2 2 9 3 4 2 5 3 3 4 4 1 5 2 5 0 7 4 6 4 7 4
[685] 4 3 2 8 5 3 3 2 2 6 2 5 2 6 2 4 5 6 1 1 0 4 3 2 2 4 7 3 5 7 2 2 5 6 8 3 7 4
[723] 6 8 3 3 4 4 8 2 4 1 3 3 6 3 6 5 5 4 2 2 5 4 1 5 5 2 1 6 4 3 8 2 3 6 3 10 3 4
[761] 1 5 0 5 7 1 3 1 6 4 3 2 1 8 3 3 5 7 5 1 5 4 6 5 3 0 1 1 5 2 1 2 9 6 4 4 6 3
[799] 3 5 3 7 1 1 4 3 4 5 5 7 5 2 6 3 6 4 5 3 1 4 5 4 5 4 3 4 5 4 4 0 3 1 1 6 3 8
[837] 6 5 5 3 7 2 1 4 5 3 2 6 1 1 7 3 3 2 7 3 4 2 4 2 1 5 6 3 7 2 6 4 5 5 2 4 4 4
[875] 0 1 3 3 2 4 4 5 2 1 3 4 6 5 5 8 6 3 3 4 4 6 1 5 2 5 5 6 2 8 4 6 8 1 4 6 5 9
[913] 3 1 4 4 4 3 8 5 4 4 6 5 6 4 3 1 6 4 6 5 7 9 3 7 3 4 4 5 2 1 4 4 4 4 1 7 5 4
[951] 6 8 2 3 3 4 3 6 1 2 3 3 5 1 2 5 5 7 3 2 2 4 2 3 6 5 4 7 7 3 3 6 5 3 2 3 5 2
[989] 4 2 6 3 1 5 3 3 4 2 1 3

Now we compute the empirical probabilities for P(X=k) resulting from this 1000 sample.

R Command:

> Probability=dpois(random,4)
> Probability

Output:
[1] 0.1465251111 0.1041956346 0.1953668148 0.0732625556 0.1953668148 0.1465251111 0.0732625556 0.1041956346
[9] 0.1562934519 0.1953668148 0.1953668148 0.1465251111 0.0732625556 0.1953668148 0.1953668148 0.1562934519
[17] 0.1562934519 0.1562934519 0.1953668148 0.1953668148 0.1953668148 0.1465251111 0.1953668148 0.1041956346
[25] 0.1953668148 0.1953668148 0.1465251111 0.1562934519 0.1041956346 0.1465251111 0.0732625556 0.1953668148
[33] 0.1465251111 0.1041956346 0.1953668148 0.0595403626 0.1953668148 0.1465251111 0.1953668148 0.0595403626
[41] 0.1953668148 0.1465251111 0.1953668148 0.1465251111 0.1465251111 0.1953668148 0.1953668148 0.1562934519
[49] 0.1953668148 0.1041956346 0.1562934519 0.1041956346 0.0595403626 0.1953668148 0.0595403626 0.1041956346
[57] 0.1562934519 0.1953668148 0.1953668148 0.1562934519 0.1953668148 0.0297701813 0.0732625556 0.1562934519
[65] 0.1562934519 0.1953668148 0.1041956346 0.1953668148 0.1953668148 0.0732625556 0.0297701813 0.1953668148
[73] 0.1562934519 0.1041956346 0.0595403626 0.0595403626 0.1041956346 0.0297701813 0.0732625556 0.1953668148
[81] 0.1562934519 0.0297701813 0.1465251111 0.1562934519 0.1953668148 0.1041956346 0.1953668148 0.1562934519
[89] 0.1953668148 0.1562934519 0.0732625556 0.1953668148 0.1953668148 0.1465251111 0.1953668148 0.1041956346
[97] 0.1953668148 0.0732625556 0.1562934519 0.1562934519 0.1041956346 0.1953668148 0.1953668148 0.1953668148
[105] 0.1953668148 0.0595403626 0.1953668148 0.1562934519 0.1953668148 0.1953668148 0.1465251111 0.1953668148
[113] 0.1953668148 0.0595403626 0.1465251111 0.1465251111 0.1041956346 0.1953668148 0.1562934519 0.1465251111
[121] 0.1041956346 0.1562934519 0.0595403626 0.1953668148 0.1465251111 0.1562934519 0.0732625556 0.0732625556
[129] 0.1953668148 0.1953668148 0.1041956346 0.0732625556 0.1953668148 0.1562934519 0.1562934519 0.1562934519
[137] 0.1953668148 0.1953668148 0.1562934519 0.1465251111 0.1041956346 0.1953668148 0.1953668148 0.0732625556
[145] 0.1953668148 0.1465251111 0.1562934519 0.1041956346 0.1562934519 0.1562934519 0.1953668148 0.1953668148
[153] 0.1953668148 0.1953668148 0.0732625556 0.1465251111 0.1465251111 0.1465251111 0.1041956346 0.1465251111
[161] 0.1562934519 0.1953668148 0.1953668148 0.1953668148 0.1465251111 0.0595403626 0.1953668148 0.0183156389
[169] 0.1041956346 0.1562934519 0.1953668148 0.1953668148 0.1953668148 0.1953668148 0.0732625556 0.0732625556
[177] 0.1953668148 0.1562934519 0.1562934519 0.1953668148 0.1953668148 0.1562934519 0.0019245370 0.1465251111
[185] 0.1953668148 0.0019245370 0.1562934519 0.1953668148 0.1953668148 0.1953668148 0.1953668148 0.1953668148
[193] 0.0732625556 0.1953668148 0.1041956346 0.1041956346 0.0732625556 0.0732625556 0.1953668148 0.1465251111
[201] 0.1953668148 0.1953668148 0.1465251111 0.1953668148 0.1953668148 0.1465251111 0.1953668148 0.1953668148
[209] 0.1041956346 0.0595403626 0.0732625556 0.1953668148 0.1953668148 0.1953668148 0.0297701813 0.1953668148
[217] 0.1562934519 0.1953668148 0.1953668148 0.1953668148 0.1953668148 0.1465251111 0.0595403626 0.0732625556
[225] 0.1041956346 0.0595403626 0.1562934519 0.1041956346 0.1953668148 0.0732625556 0.1953668148 0.1953668148
[233] 0.1953668148 0.0732625556 0.0019245370 0.1953668148 0.1465251111 0.1953668148 0.0732625556 0.1562934519
[241] 0.1953668148 0.1953668148 0.1562934519 0.1562934519 0.1562934519 0.1953668148 0.1041956346 0.0595403626
[249] 0.1465251111 0.1465251111 0.1562934519 0.1953668148 0.1562934519 0.1953668148 0.1465251111 0.1953668148
[257] 0.1562934519 0.1465251111 0.1953668148 0.0297701813 0.1953668148 0.0595403626 0.1562934519 0.1953668148
[265] 0.1953668148 0.1465251111 0.0595403626 0.1465251111 0.1562934519 0.1953668148 0.1953668148 0.0595403626
[273] 0.0732625556 0.1041956346 0.1953668148 0.1953668148 0.1953668148 0.1041956346 0.1562934519 0.1953668148
[281] 0.1465251111 0.1465251111 0.1953668148 0.1953668148 0.0297701813 0.0732625556 0.1465251111 0.1465251111
[289] 0.1562934519 0.1953668148 0.1953668148 0.1041956346 0.1041956346 0.1953668148 0.0052924767 0.1953668148
[297] 0.1953668148 0.0732625556 0.1953668148 0.1041956346 0.1953668148 0.1465251111 0.1465251111 0.0732625556
[305] 0.1465251111 0.1562934519 0.1465251111 0.1465251111 0.1953668148 0.1953668148 0.1465251111 0.1953668148
[313] 0.1953668148 0.1953668148 0.1041956346 0.1953668148 0.1953668148 0.0006415123 0.1953668148 0.1953668148
[321] 0.1953668148 0.1953668148 0.0732625556 0.1465251111 0.0732625556 0.1953668148 0.1953668148 0.1465251111
[329] 0.1562934519 0.1465251111 0.1562934519 0.1562934519 0.1953668148 0.1465251111 0.1953668148 0.1562934519
[337] 0.1953668148 0.1041956346 0.1953668148 0.1562934519 0.1953668148 0.1562934519 0.1953668148 0.1953668148
[345] 0.1562934519 0.1041956346 0.1465251111 0.1465251111 0.1041956346 0.1953668148 0.1562934519 0.1953668148
[353] 0.1465251111 0.1041956346 0.1562934519 0.1562934519 0.1953668148 0.1465251111 0.1465251111 0.1562934519
[361] 0.1465251111 0.1562934519 0.1465251111 0.1562934519 0.1953668148 0.1953668148 0.1953668148 0.1465251111
[369] 0.1953668148 0.0732625556 0.1953668148 0.1041956346 0.1953668148 0.1953668148 0.1562934519 0.1953668148
[377] 0.1465251111 0.1562934519 0.1953668148 0.0132311917 0.1953668148 0.0732625556 0.1041956346 0.1953668148
[385] 0.1041956346 0.0183156389 0.1953668148 0.0595403626 0.1465251111 0.1953668148 0.1953668148 0.1562934519
[393] 0.1953668148 0.1953668148 0.0732625556 0.1953668148 0.1953668148 0.1041956346 0.1953668148 0.1953668148
[401] 0.1953668148 0.0595403626 0.1041956346 0.1953668148 0.1465251111 0.0132311917 0.0732625556 0.1562934519
[409] 0.0732625556 0.1953668148 0.1562934519 0.1953668148 0.1953668148 0.1953668148 0.1465251111 0.1953668148
[417] 0.1953668148 0.1465251111 0.0595403626 0.1041956346 0.0732625556 0.1953668148 0.1953668148 0.1041956346
[425] 0.1953668148 0.1953668148 0.1953668148 0.1953668148 0.1953668148 0.1465251111 0.1953668148 0.0595403626
[433] 0.1041956346 0.1465251111 0.0132311917 0.1562934519 0.0297701813 0.1562934519 0.1953668148 0.1953668148
[441] 0.1465251111 0.1953668148 0.1953668148 0.0732625556 0.1465251111 0.1953668148 0.1562934519 0.1041956346
[449] 0.1953668148 0.1562934519 0.1562934519 0.1953668148 0.0052924767 0.1041956346 0.0595403626 0.1562934519
[457] 0.1041956346 0.1465251111 0.1953668148 0.1562934519 0.0595403626 0.0595403626 0.1953668148 0.1953668148
[465] 0.1465251111 0.1041956346 0.1953668148 0.1562934519 0.1562934519 0.1562934519 0.1953668148 0.1465251111
[473] 0.1465251111 0.0732625556 0.1465251111 0.1041956346 0.1953668148 0.0732625556 0.1562934519 0.1465251111
[481] 0.1953668148 0.0732625556 0.1562934519 0.1953668148 0.1953668148 0.1953668148 0.1562934519 0.1953668148
[489] 0.1953668148 0.1465251111 0.1562934519 0.1465251111 0.1953668148 0.1953668148 0.0183156389 0.1953668148
[497] 0.0019245370 0.1953668148 0.1465251111 0.1465251111 0.1953668148 0.1562934519 0.1953668148 0.1465251111
[505] 0.1465251111 0.1041956346 0.0595403626 0.1562934519 0.0132311917 0.1465251111 0.1953668148 0.1041956346
[513] 0.1041956346 0.1953668148 0.1465251111 0.0132311917 0.1562934519 0.1953668148 0.0019245370 0.1953668148
[521] 0.1041956346 0.1562934519 0.1465251111 0.0595403626 0.1953668148 0.1953668148 0.1953668148 0.1953668148
[529] 0.1953668148 0.1562934519 0.0132311917 0.1953668148 0.1562934519 0.1953668148 0.1041956346 0.1953668148
[537] 0.0595403626 0.0183156389 0.1465251111 0.0132311917 0.1953668148 0.0732625556 0.1953668148 0.1465251111
[545] 0.1953668148 0.0732625556 0.1041956346 0.1041956346 0.1953668148 0.0297701813 0.1953668148 0.1953668148
[553] 0.1953668148 0.1562934519 0.0595403626 0.1465251111 0.1041956346 0.0732625556 0.1953668148 0.1465251111
[561] 0.1562934519 0.1562934519 0.1953668148 0.1041956346 0.1041956346 0.0732625556 0.1953668148 0.1953668148
[569] 0.1953668148 0.1953668148 0.0732625556 0.1953668148 0.1953668148 0.1041956346 0.1953668148 0.1465251111
[577] 0.1562934519 0.1562934519 0.1041956346 0.1953668148 0.1953668148 0.0595403626 0.1041956346 0.0595403626
[585] 0.1562934519 0.1562934519 0.1465251111 0.1041956346 0.1465251111 0.1953668148 0.0595403626 0.1562934519
[593] 0.0595403626 0.1465251111 0.1953668148 0.1953668148 0.1953668148 0.1562934519 0.1465251111 0.1465251111
[601] 0.1953668148 0.0132311917 0.1465251111 0.1953668148 0.1465251111 0.1953668148 0.0595403626 0.1465251111
[609] 0.1562934519 0.1953668148 0.1953668148 0.0297701813 0.1562934519 0.0732625556 0.1953668148 0.0732625556
[617] 0.1465251111 0.1562934519 0.1041956346 0.1953668148 0.1465251111 0.1953668148 0.0595403626 0.1041956346
[625] 0.0732625556 0.1953668148 0.0732625556 0.1953668148 0.1465251111 0.1562934519 0.1953668148 0.1953668148
[633] 0.1465251111 0.1953668148 0.1465251111 0.1465251111 0.1953668148 0.1953668148 0.1953668148 0.0183156389
[641] 0.1562934519 0.1562934519 0.1465251111 0.1562934519 0.1465251111 0.1465251111 0.1953668148 0.0595403626
[649] 0.1465251111 0.1953668148 0.1953668148 0.0732625556 0.1465251111 0.1953668148 0.0732625556 0.1562934519
[657] 0.0297701813 0.1953668148 0.1041956346 0.1465251111 0.1562934519 0.0732625556 0.1465251111 0.1465251111
[665] 0.0132311917 0.1953668148 0.1953668148 0.1465251111 0.1562934519 0.1953668148 0.1953668148 0.1953668148
[673] 0.1953668148 0.0732625556 0.1562934519 0.1465251111 0.1562934519 0.0183156389 0.0595403626 0.1953668148
[681] 0.1041956346 0.1953668148 0.0595403626 0.1953668148 0.1953668148 0.1953668148 0.1465251111 0.0297701813
[689] 0.1562934519 0.1953668148 0.1953668148 0.1465251111 0.1465251111 0.1041956346 0.1465251111 0.1562934519
[697] 0.1465251111 0.1041956346 0.1465251111 0.1953668148 0.1562934519 0.1041956346 0.0732625556 0.0732625556
[705] 0.0183156389 0.1953668148 0.1953668148 0.1465251111 0.1465251111 0.1953668148 0.0595403626 0.1953668148
[713] 0.1562934519 0.0595403626 0.1465251111 0.1465251111 0.1562934519 0.1041956346 0.0297701813 0.1953668148
[721] 0.0595403626 0.1953668148 0.1041956346 0.0297701813 0.1953668148 0.1953668148 0.1953668148 0.1953668148
[729] 0.0297701813 0.1465251111 0.1953668148 0.0732625556 0.1953668148 0.1953668148 0.1041956346 0.1953668148
[737] 0.1041956346 0.1562934519 0.1562934519 0.1953668148 0.1465251111 0.1465251111 0.1562934519 0.1953668148
[745] 0.0732625556 0.1562934519 0.1562934519 0.1465251111 0.0732625556 0.1041956346 0.1953668148 0.1953668148
[753] 0.0297701813 0.1465251111 0.1953668148 0.1041956346 0.1953668148 0.0052924767 0.1953668148 0.1953668148
[761] 0.0732625556 0.1562934519 0.0183156389 0.1562934519 0.0595403626 0.0732625556 0.1953668148 0.0732625556
[769] 0.1041956346 0.1953668148 0.1953668148 0.1465251111 0.0732625556 0.0297701813 0.1953668148 0.1953668148
[777] 0.1562934519 0.0595403626 0.1562934519 0.0732625556 0.1562934519 0.1953668148 0.1041956346 0.1562934519
[785] 0.1953668148 0.0183156389 0.0732625556 0.0732625556 0.1562934519 0.1465251111 0.0732625556 0.1465251111
[793] 0.0132311917 0.1041956346 0.1953668148 0.1953668148 0.1041956346 0.1953668148 0.1953668148 0.1562934519
[801] 0.1953668148 0.0595403626 0.0732625556 0.0732625556 0.1953668148 0.1953668148 0.1953668148 0.1562934519
[809] 0.1562934519 0.0595403626 0.1562934519 0.1465251111 0.1041956346 0.1953668148 0.1041956346 0.1953668148
[817] 0.1562934519 0.1953668148 0.0732625556 0.1953668148 0.1562934519 0.1953668148 0.1562934519 0.1953668148
[825] 0.1953668148 0.1953668148 0.1562934519 0.1953668148 0.1953668148 0.0183156389 0.1953668148 0.0732625556
[833] 0.0732625556 0.1041956346 0.1953668148 0.0297701813 0.1041956346 0.1562934519 0.1562934519 0.1953668148
[841] 0.0595403626 0.1465251111 0.0732625556 0.1953668148 0.1562934519 0.1953668148 0.1465251111 0.1041956346
[849] 0.0732625556 0.0732625556 0.0595403626 0.1953668148 0.1953668148 0.1465251111 0.0595403626 0.1953668148
[857] 0.1953668148 0.1465251111 0.1953668148 0.1465251111 0.0732625556 0.1562934519 0.1041956346 0.1953668148
[865] 0.0595403626 0.1465251111 0.1041956346 0.1953668148 0.1562934519 0.1562934519 0.1465251111 0.1953668148
[873] 0.1953668148 0.1953668148 0.0183156389 0.0732625556 0.1953668148 0.1953668148 0.1465251111 0.1953668148
[881] 0.1953668148 0.1562934519 0.1465251111 0.0732625556 0.1953668148 0.1953668148 0.1041956346 0.1562934519
[889] 0.1562934519 0.0297701813 0.1041956346 0.1953668148 0.1953668148 0.1953668148 0.1953668148 0.1041956346
[897] 0.0732625556 0.1562934519 0.1465251111 0.1562934519 0.1562934519 0.1041956346 0.1465251111 0.0297701813
[905] 0.1953668148 0.1041956346 0.0297701813 0.0732625556 0.1953668148 0.1041956346 0.1562934519 0.0132311917
[913] 0.1953668148 0.0732625556 0.1953668148 0.1953668148 0.1953668148 0.1953668148 0.0297701813 0.1562934519
[921] 0.1953668148 0.1953668148 0.1041956346 0.1562934519 0.1041956346 0.1953668148 0.1953668148 0.0732625556
[929] 0.1041956346 0.1953668148 0.1041956346 0.1562934519 0.0595403626 0.0132311917 0.1953668148 0.0595403626
[937] 0.1953668148 0.1953668148 0.1953668148 0.1562934519 0.1465251111 0.0732625556 0.1953668148 0.1953668148
[945] 0.1953668148 0.1953668148 0.0732625556 0.0595403626 0.1562934519 0.1953668148 0.1041956346 0.0297701813
[953] 0.1465251111 0.1953668148 0.1953668148 0.1953668148 0.1953668148 0.1041956346 0.0732625556 0.1465251111
[961] 0.1953668148 0.1953668148 0.1562934519 0.0732625556 0.1465251111 0.1562934519 0.1562934519 0.0595403626
[969] 0.1953668148 0.1465251111 0.1465251111 0.1953668148 0.1465251111 0.1953668148 0.1041956346 0.1562934519
[977] 0.1953668148 0.0595403626 0.0595403626 0.1953668148 0.1953668148 0.1041956346 0.1562934519 0.1953668148
[985] 0.1465251111 0.1953668148 0.1562934519 0.1465251111 0.1953668148 0.1465251111 0.1041956346 0.1953668148
[993] 0.0732625556 0.1562934519 0.1953668148 0.1953668148 0.1953668148 0.1465251111 0.0732625556 0.1953668148

Now we make a Barplot of these probabilities. To draw Barplot we need to construct a frequency table. Which is
done by the table() command.

R Command:

> count=table(Probability)
> count

Output:
Probability
0.00064151232441456 0.00192453697324368 0.00529247667642012 0.0132311916910503 0.0183156388887342

   1 5 3 12 11

0.0297701813048632 0.0595403626097264 0.0732625555549367 0.104195634567021 0.146525111109873

23 54    87 103 153

0.156293451850532 0.195366814813165
158   390

R Command:

> barplot(count,main="Barplot",xlab="probability",ylab="frequency",col="dark red")

Output:

[ Note: All the r code needed to "compute probability", "line plot", "barplot", "generate random sample" are included and also all the output and all the graph are included ]


Related Solutions

Let V = {P(x) ∈ P10(R) : P'(−4) = 0 and P''(2) = 0}. If V=...
Let V = {P(x) ∈ P10(R) : P'(−4) = 0 and P''(2) = 0}. If V= M3×n(R), find n.
4. a. Suppose Z~Normal(0,1). Find P(1<Z<2). (3pts) b. Suppose X~Normal(-2,1). Find P(X>0 or X<-3). (3pts) c....
4. a. Suppose Z~Normal(0,1). Find P(1<Z<2). (3pts) b. Suppose X~Normal(-2,1). Find P(X>0 or X<-3). (3pts) c. Suppose X~Normal(2,4). The middle 88% of the X values are between what two values? (3pts)
A random variable X has a distribution p(X=k) = A / (k(k+1)), k = 1,2,...,4, where...
A random variable X has a distribution p(X=k) = A / (k(k+1)), k = 1,2,...,4, where A is an constant. Then compute the value of p(1<=X<=3) The answer will be either: 2/3, 3/4, 5/6, or 15/16 A discrete random variable X is uniformly distributed among −1,0,...,12. Then, what is its PMF for k=−1,0,...,12 The answer will be either: p(X = k) = 1/12, 1/13, 1/14, or 1
Assume that X has a Poisson distribution with mean of 3.7. Calculate the followings. P(X=1) P(1<X<4)...
Assume that X has a Poisson distribution with mean of 3.7. Calculate the followings. P(X=1) P(1<X<4) P(1<X<2) P(2<X<4) P(X=1.5) P(X=0) P(X<-2) Standard Deviation of X Mean of X
Which of the following functions are one-to-one? Group of answer choices f;[−3,3]→[0,3],f(x)=9−x2f;[−3,3]→[0,3],f(x)=9−x2 f;R→R,f(x)=x3f;R→R,f(x)=x3 f;[0,∞]→[0,∞],f(x)=x2f;[0,∞]→[0,∞],f(x)=x2
Which of the following functions are one-to-one? Group of answer choices f;[−3,3]→[0,3],f(x)=9−x2f;[−3,3]→[0,3],f(x)=9−x2 f;R→R,f(x)=x3f;R→R,f(x)=x3 f;[0,∞]→[0,∞],f(x)=x2f;[0,∞]→[0,∞],f(x)=x2
1. Use the R command X <- iris to assign Fishers’ iris dataset to the data...
1. Use the R command X <- iris to assign Fishers’ iris dataset to the data matrix X. Using the head(X) command summarize what each column of the dataset is measuring and represents. Assign Y as a new matrix of dimension 150 by 4 which has the values of X without the species label. 2. Compute and interpret (in summary English) each of the summary statistics X,S,R using R. 3. Visualize the dataset by making a scatterplot of Sepal Length...
Suppose a 9-sided and a 4-sided die are rolled. Find these probabilities. a. P(roll sum of...
Suppose a 9-sided and a 4-sided die are rolled. Find these probabilities. a. P(roll sum of less than 5 or roll doubles) b. P(roll a sum greater than 6 for the first time on the sixth roll)
Updated! Python Code 4. Enhanced transmission method Use the same probabilities ?0 ; ?0; and ?1...
Updated! Python Code 4. Enhanced transmission method Use the same probabilities ?0 ; ?0; and ?1 as before and consider the following experiment: p0=0.6 ; e0=0.05; e1=0.03 • You create and transmit a one-bit message S as before. In order to improve reliability, the same bit “S” is transmitted three times (S S S) as shown in Figure 2. • The received bits “R” are not necessarily the same as the transmitted bits “S” due to transmission errors. The three...
If X follows a binomial(5, 0.15), determine (a) P(X = 0). (b) P(X ≤ 4). (c)...
If X follows a binomial(5, 0.15), determine (a) P(X = 0). (b) P(X ≤ 4). (c) P(X > 1).
Find the following probabilities for two normal random variablesZ=N(0,1) andX=N(−1,9). (a)P(Z >−1.48). (b)P(|X|<2.30). (c) What is...
Find the following probabilities for two normal random variablesZ=N(0,1) andX=N(−1,9). (a)P(Z >−1.48). (b)P(|X|<2.30). (c) What is the type and the parameters of the random variableY= 3X+ 5?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT