#R has four inbuilt function to generate binomial distribution
 
 #dbinom( x ,size,prob) it is used to find probability of complete value x=3 ,x=5 
 #x =value to find  ,size= no. of trils ,prob=prob of success
 dbinom(3 ,size=20 ,prob=1/6)
 #for values of all  0,1,2,3
 dbinom(0:3,size=20 ,prob=1/6)
 
 #pbinom  command give us values for the probability distribution function of X f(x)
 #x<=3
 #pbinom( x, size, prob)
 pbinom (3,size=20 , prob=1/6)
 dbinom(27,size=100,prob=0.25)
 
 #for p(x<=4)
 pbinom(4,size=12,prob=1/6)
 
 pbinom(6,size=12,prob=1/6)-pbinom(2,size=12,prob=1/6)
 
 #qbinom is used to find the value of which prob is given
 qbinom(0.95,size=10 ,prob=0.5)
 
 qbinom(0.25, size=51,prob=0.5)
 
 #rbinom(n,size prob) we use rbinom to get random values from given sample size and probabaility
 rbinom(10,size=50,prob=0.4)
 
 dbinom(2,size=20,prob=0.10)
 #at least 2 screws are defective
 1-pbinom(1,size=20,prob=0.10)
 
 dbinom(1,size=20,prob=0.10)+dbinom(2,size=20,prob=0.10)+dbinom(3,size=20,prob=0.10)
 
 #exactly 3 are not defective
  dbinom(3,20,0.90)
  
  #plot the graph
  x=c(15,25,35,45,55,65)
  y=c(302.38,193.63,185.46,198.48,224.30,288.71)
  plot(x,y,type="l",main="this is graph",xlab="age",ylab="time spent in library",col="red")
 
 
 
 
 
 

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: