# Compute P(45 < X < 55) for X Binomial(100,0.5)

sum(dbinom(46:54, 100, 0.5))

## Using "log = TRUE" for an extended range :

n <- 2000

k <

plot (k, dbinom(k, n, pi/10, log = TRUE), type = "l", ylab = "log density",

UE

lines(k, log(dbinom(k, n, pi/10)), col