hmk3[1] - follows: prob = binocdf(3,25,0.2); We could also...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Homework 3 3. 4. 5. 6.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
7. 8. 9. 10. Matlab Exercises The following exercises involve the binomial distribution. You are asked to run the example and code given by making the following changes: Chance that an adult American suffers from a psychiatric disorder: 15% We randomly sample 25 adult Americans. We are interested in the probability that at most 4 of the selected people have such a disorder.
Background image of page 2
Given example and code: Suppose there is a 20% chance that an adult American suffers from a psychiatric disorder. We randomly sample 25 adult Americans. If we let X represent the number of people who have a psychiatric disorder, then X is a binomial random variable with parameters . We are interested in the probability that at most 3 of the selected people have such a disorder. We can use the MATLAB Statistics Toolbox function binocdf to determine , as
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: follows: prob = binocdf(3,25,0.2); We could also sum up the individual values of the probability mass function from to : prob2 = sum(binopdf(0:3,25,0.2)); Both of these commands return a probability of 0.234. We now show how to generate the binomial distributions shown in Figure 2.3. % Get the values for the domain, x. x = 0:6; % Get the values of the probability mass function. % First for n = 6, p = 0.3: pdf1 = binopdf(x,6,0.3); % Now for n = 6, p = 0.7: pdf2 = binopdf(x,6,0.7); Now we have the values for the probability mass function (or the heights of the bars). The plots are obtained using the following code. % Do the plots. subplot(1,2,1),bar(x,pdf1,1,'w') title(' n = 6, p = 0.3') xlabel('X'),ylabel('f(X)') axis square subplot(1,2,2),bar(x,pdf2,1,'w') title(' n = 6, p = 0.7') xlabel('X'),ylabel('f(X)') axis square...
View Full Document

Page1 / 4

hmk3[1] - follows: prob = binocdf(3,25,0.2); We could also...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online