(d) Generate a sample of 10000 observations from the c Compare the shape of the histogram with that of t igure).

A First Course in Probability (10th Edition)
10th Edition
ISBN:9780134753119
Author:Sheldon Ross
Publisher:Sheldon Ross
Chapter1: Combinatorial Analysis
Section: Chapter Questions
Problem 1.1P: a. How many different 7-place license plates are possible if the first 2 places are for letters and...
icon
Related questions
Question

Q 6 and Q 7 PLEASE

need R studio

 

(d)
Generate a sample of 10000 observations from the distribution of X, and plot the corresponding histogram.
Compare the shape of the histogram with that of the density of X (try to superimpose them on the same
figure).
Question 6
Let X be a Gamma distribution with mean 8 and variance 16.
Let X1, X2, …, Xn be n independent random variables with the same distribution as X. Let Y₁ = Σï=1 Xi/n
be the sample mean.
(a)
Define a function which generates 10000 observations from Yn for any value of n.
My answer:
(b)
Plot the histogram of the generated observations from Yn for n = 1, n = 5, n = 25. What do you observe?
Can you compare Yɲ to a known distribution when n is large? Elaborate on your answer.
My answer:
(c)
Find an appropriate normal random variable which approximates Y25, and plot the histogram of the generated
observations from Y25 on the same graph as the density of that normal random variable for comparison.
My answer:
Question 7
Let N be the number of offspring of a female Seychelles warbler (a species of birds) during a one-year period.
One may assume that N has a Poisson distribution with mean 4.
Seychelles warblers are known to have an adaptive sex ratio bias: on high quality territories, females produce
90% daughters. Let X be the number of daughters of one female bird during a one-year period (on a high
quality territory).
(a)
What are the theoretical mean and variance of X?
My answer:
(b)
Conduct a two-step simulation analysis to verify these theoretical values by replacing the '#?' in the code
chunk with the appropriate commands (and remove the argument eval=FALSE before running the code or
knitting the file).
Transcribed Image Text:(d) Generate a sample of 10000 observations from the distribution of X, and plot the corresponding histogram. Compare the shape of the histogram with that of the density of X (try to superimpose them on the same figure). Question 6 Let X be a Gamma distribution with mean 8 and variance 16. Let X1, X2, …, Xn be n independent random variables with the same distribution as X. Let Y₁ = Σï=1 Xi/n be the sample mean. (a) Define a function which generates 10000 observations from Yn for any value of n. My answer: (b) Plot the histogram of the generated observations from Yn for n = 1, n = 5, n = 25. What do you observe? Can you compare Yɲ to a known distribution when n is large? Elaborate on your answer. My answer: (c) Find an appropriate normal random variable which approximates Y25, and plot the histogram of the generated observations from Y25 on the same graph as the density of that normal random variable for comparison. My answer: Question 7 Let N be the number of offspring of a female Seychelles warbler (a species of birds) during a one-year period. One may assume that N has a Poisson distribution with mean 4. Seychelles warblers are known to have an adaptive sex ratio bias: on high quality territories, females produce 90% daughters. Let X be the number of daughters of one female bird during a one-year period (on a high quality territory). (a) What are the theoretical mean and variance of X? My answer: (b) Conduct a two-step simulation analysis to verify these theoretical values by replacing the '#?' in the code chunk with the appropriate commands (and remove the argument eval=FALSE before running the code or knitting the file).
n. daughter<-c()
# initialises the vector which will contain simulated values of X
for (i in 1:10000) {
n.offspring<- #?
n. daughter<- #?
#ith simulation of N
# updates the vector n. daughter with the ith simulation of X
}
mean (n. daughter)
var (n.daughter)
(c)
What is the distribution of X? Compare the results of your simulations with the true probabilities using a
histogram.
My answer:
Transcribed Image Text:n. daughter<-c() # initialises the vector which will contain simulated values of X for (i in 1:10000) { n.offspring<- #? n. daughter<- #? #ith simulation of N # updates the vector n. daughter with the ith simulation of X } mean (n. daughter) var (n.daughter) (c) What is the distribution of X? Compare the results of your simulations with the true probabilities using a histogram. My answer:
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer