x <- 0:6 px <- dbinom(x, 6, 0.533) plot(x, px, type='h', main='Pstni fce', ylab='p(x)') points(x, px, col='red', pch=19) Fx <- pbinom(x, 6, 0.533) plot(x, Fx, type='n', main='Distr. fce', ylab='F(x)', xlim=c(-1, 8)) segments(x, Fx ,x+1 ,Fx ) points(x, Fx, pch=19, col='red') points( (x+1)[-7], Fx[-7]) arrows(6,1,7,1, length=0.1) arrows(0,0,-1,0, length=0.1) pnorm(140, 151.74, 11) pnorm((140-151.74)/11,0,1) 1-pnorm(160, 151.74, 11) 1-pnorm((160-151.74)/11, 0,1) pnorm(160,151.74, 11)-pnorm(140, 151.74, 11) par(mfrow=c(1,2)) x <- seq(from=100, to=200, length=512) fx <- dnorm(x, 151.74, 11) plot(x, fx, col='red', main='Hustota', ylab='f(x)', type='l', lwd=2) Fx <- pnorm(x, 151.74, 11) plot(x, Fx, main='Distr. fce', ylab='F(x)', col='red', type='l', lwd=2) 1-pbinom(5, 10, 0.533) mi <- 10*0.533 s <- 10*0.533*0.467 1-pnorm(6, mi, sqrt(s)) pbinom(180,300,0.533)-pbinom(159, 300, 0.533) mi <- 300*0.533 s <- 300*0.533*0.467 pnorm(180, mi, sqrt(s))-pnorm(160, mi, sqrt(s))