hmk3[1]

# hmk3[1] - follows prob = binocdf(3,25,0.2 We could also sum...

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

Homework 3 3. 4. 5. 6.

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

View Full Document
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.
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

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

View Full Document
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

## This note was uploaded on 11/29/2010 for the course ECE 302 taught by Professor Gelfand during the Spring '08 term at Purdue.

### Page1 / 4

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

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

View Full Document
Ask a homework question - tutors are online