I have the first part I am just struggling to repeat the exp

I have the first part. I am just struggling to repeat the experiment 100 times and also 1000 times

For the sample I have:

>> x=0:10;
>> y=binopdf(x,30,.2);
>> bar(x,y);

How do I repeat the experiment \"n\" number of times?

IEN 310 Matlab Assignment Understanding Distributions, their Means, and their Variance et us assume that we have a class with 30 students, 6 girls and 24 boys. I take a sample of size 10 Q1. L (with replacement). Create a bar chart with the number of girls in the sample as the x-axis and the probability of getting the specific number of girls in the sample (calculated using the binomial distribution) as the y axis. Call this plot Figure 1. Next, repeat the experiment 100 times. Plot the number of girls in sample as the x-axis and the frequency of getting the specific number of girls in the sample as the y axis (on a bar plot). Call this plot Figure 2 Next, repeat the experiment 1,000 times. Plot the number of girls in sample as the x-axis and the frequency of getting the specific number of girls in the sample as the y axis (on a bar plot). Call this plot Figure 3 he y axis (on a bar plot),. Call this plot Next, repeat the experiment 10,000 times. Plot the number of girls in sa frequency of getting the specific number of gir Figure 4 ic number of girls in the sample as the y axis (on a bar plot). Call this plot mple as the x-axis and the Now and conured fong Figures 2-4 find the mean, variance, and standard deviation a) Compare and contrast Figures 1-4. For the data collected for generating Figures 2-4 find the mean, varian thenbers with the theoretical values for the using the definitions. Compare and contrast these numbers re 1 by assuming a Poisson distribution. Call it Figure 0 02. Repeat the setting in Q1 but create Figure Change the sample size to Next, repeat the experiment with sample size 50 a 100 axis and the frequency of getting the specific numberPot Call this plot Figure 2 Next, repeat the experiment with sample size 50 a 1,000 axis and the frequency of getting the specifie number of ex setting in Q1 but create Figure I by assuming a Poisson di 50. Recreate Figure 0 but Call it Fi le size 50 a 100 times. Plot the number of sample senumber of girls in the sample as the y axis (on a bar the number of girls in sample as the x- axis (on a bar plot) Plot the number of girls in sample as the uency of getting the specihic number of girls in the number s0 a 1,0d f girls in the sample as the y axis (on a bar plot). he number of girls in sample as the y 10000 times. Plot the number of 000 times..de in the sample as the v es, Plot the number of girls in samp y-axis Iot Figure 3

Solution

for x=0:100 % for repeating 100 times.

y=binopdf(x,30,.2);

bar(x,y);

end

---------------------------------------------------------------------------------------------------

for x=0:1000 % for repeating 1000 times.

y=binopdf(x,30,.2);

bar(x,y);

end

--------------------------------------------------------------------------

% set your n value like n=10000 or something you want

for x=0:n % for repeating n times.

y=binopdf(x,30,.2);

bar(x,y);

end

-----------------------------------------------------------------------------

I have the first part. I am just struggling to repeat the experiment 100 times and also 1000 times For the sample I have: >> x=0:10; >> y=binopdf(x,
I have the first part. I am just struggling to repeat the experiment 100 times and also 1000 times For the sample I have: >> x=0:10; >> y=binopdf(x,

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site