Introduction to Probability, Grinstead, C. Snell, J., 1997
Page 338
Question 2

Question
Let S200 be the number of heads that turn up in 200 tosses of a fair coin. Estimate (a) P(S200 = 100). (b) P(S200 = 90). (c) P(S200 = 80).

Binomial Probability
P(X = k) = \(\binom{n}{k} \times p^k \times (1 - p)^{n - k}\)

a)P(X = k) = \(\binom{200}{100} \times 0.5^{100} \times (1 - 0.5)^{200 - 100}\)

n <- 200       #Number of trials
p <- 0.5       #Probability of getting a head
k <- 100       #number of heads 
#proability
dbinom<-dbinom(k,n,p)
dbinom
## [1] 0.05634848

b)P(X = k) = \(\binom{200}{90} \times 0.5^{90} \times (1 - 0.5)^{200 - 90}\)

n <- 200        #Number of trials
p <- 0.5        #Probability of getting a head
k <- 90         #number of heads 
#proability
dbinom<-dbinom(k,n,p)
dbinom
## [1] 0.02079869

c)P(X = k) = \(\binom{200}{80} \times 0.5^{80} \times (1 - 0.5)^{200 - 80}\)

n <- 200        #Number of trials
p <- 0.5        #Probability of getting a head
k <- 80         #number of heads 
#proability
dbinom<-dbinom(k,n,p)
dbinom
## [1] 0.001025104