You are on page 1of 5

Experiment No.

: 03
Binomial, Poisson and Normal Distributions

Problem’s:

1. It is known that probability of an item produced by a certain machine will be


defective is 0.05. If the produced items are sent to the market in packets of 20, then
write down the R code to find the number of packets containing at least, exactly and
at most 2 defective items in a consignment of 1000packets.

2. A car hire firm has 2 cars which it hires out day by day. The number of demands for
a car on each day follows a Poisson distribution with mean 1.5. Write down the R code
to compute the proportion of days on which (i). neither car is used, (ii). at most one
car is used and (iii). some demand of car is notfulfilled.

3. The local corporation authorities in a certain city install 10,000 electric lamps in the
streets of the city with the assumption that the life of lamps is normally distributed. If
these lamps have an average life of 1,000 burning hours with a standard deviation of
200 hours, then write down the R code to calculate the number of lamps might be
expected to fail in the first 800 burning hours and also the number of lamps might be
expected to fail between 800 and 1,200 burninghours.

*********
RCODE:
> #BinomialDistribution
> n=20
> p=0.05
> q=1-p
> N=1000
> #1. Number of packetes containg at least 2 defective items in a consignment of 1000
packets:
> k=2
> N1=round(N*(1-pbinom(k-1,n,p)))
> N1[1
] 264
> #2. Number of packets containing exactly 2 defective items in a consignment of1000
packets:
> k=2
> N2=round(N*dbinom(k,n,p))
> N2[1
] 189
> #3. Number of packets containing at ,ost 2 defective items in a consignment of 1000packets:
> k=2
> N3=round(N*(pbinom(k,n,p)))
> N3[1
] 925
> # POISSONDISTRIBUTION
> lam=1.5
> #1. Proportion of days on which neither car isused:
> x=0
> p1=dpois(x,lam)
> p1
[1] 0.2231302
> #2. Proportion of days on which atmost one car isused:
> x=1
> p2=ppois(x,lam)
> p2
[1] 0.5578254
> #3. Proportion of days on which some demand of car is notfullfilled:
> x=2
> p3=1-ppois(x,lam)
> p3
[1] 0.1911532

> #NORMALDISTRIBUTION
> Mu=1000
> SD=200
> N=10000
> #1. Number of lamps might be expected to fail in the first 800 burninghours:
> x1=800
> N1=round(N*pnorm(x1,Mu,SD))
> N1
[1] 1587
> #2. Number of lamps might be expected to fall between 800 and 1200 burninghours:
> x1=800
> x2=1200
> N2=round(N*(pnorm(x2,Mu,SD)-pnorm(x,Mu,SD)))
> N2
[1] 8413

RESULT:
Binomial Distribution – N1 –264
N2 –189
N3 –925

PoissonDistribution– P1 –0.2231302
P2 –0.5578254
P3 –0.1911532

NormalDistribution- N1 –1587
N2 –8413
PROOF:
**THANK YOU**

You might also like