In: Statistics and Probability
A sample of ten items is selected without replacement from a group of 100 object 40 of which are defective. What is the probability that this sample will contain three defective items?
using R for number of defective items in the sample being 0, 1, 2,3, …, 10. Graph the distribution.

> #we know that x follows Binomial distribution with
n=10,p=0.4
> x=0:10
> n=10
> p=0.4
> p=dbinom(x,n,p)
> data.frame(x,p)#distribution of number of defectives
   
x           
p
1   0 0.0060466176
2   1 0.0403107840
3   2      
0.1209323520
4   3    0.2149908480
5   4      
0.2508226560
6   5 0.2006581248
7   6    0.1114767360
8   7      
0.0424673280
9   8     0.0106168320
10 9       0.0015728640
11 10     0.0001048576
> plot(x,p)
