# a) pbinom(6,30,0.12) # b) 1-pbinom(5,30,0.12) # c) dbinom(6,30,0.12) # d) sum(dbinom(2:5,30,0.12)) x<-seq(0,30) dens<-dbinom(x,30,0.12) n<-length(x) plot(x,dens,type='n',xlab='pocet pojistnych udalosti zpusobenych vloupanim', ylab='pravdepodobnost',main='Binomicke rozlozeni - pstni fce', pch=19,lwd=2,col='red') for(i in 1:n){ lines(c(x[i],x[i]),c(0,dens[i]))} points(x,dens,col='red',pch=19) #---------------------------------------------------------- distr<-pbinom(x,30,0.12) plot(x,distr,type='n',xlab='pocet pojistnych udalosti zpusobenych vloupanim', ylab='distribucni fce',main='Binomicke rozlozeni - distr.fce', pch=19,lwd=2,xlim=c(0,30)) for(i in 1:n){ lines(c(x[i],x[i+1]),c(distr[i],distr[i]))} points(x[2:30],distr[2:30],pch=19,col='red') points(x[2:30],distr[1:29],pch=19,col='white') points(x[2:30],distr[1:29],pch=1,col='red') arrows(x[30],distr[30],x[30]+1,distr[30],length=0.15) arrows(x[2],distr[1],-0.1,distr[1],length=0.15)