For combinations we could use this homemade function
combination = function(size,sample) {
return(factorial(size)/(factorial(sample)*factorial(size-sample)))
}
combination(83,4)
## [1] 1837620
but lets just use R’s built in Choose function.
choose(83,4)
## [1] 1837620
For binomial distribution, we can use R’s dbinom function or the following formula.
(a)
choose(6,3)
## [1] 20
(b)
#dbinom(size = 5,prob = .2,4)
choose(5,4)*(.2)^4*(.8)^1
## [1] 0.0064
(c)
choose(7,2)
## [1] 21
(d)
choose(26,26)
## [1] 1
(e)
choose(4,3)*(.2)^3*(.8)^1
## [1] 0.0256
(f)
choose(6,2)
## [1] 15
(g)
choose(10,9)
## [1] 10
(h)
choose(8,5)*(.3)^5*(.7)^3
## [1] 0.04667544