Chapter 3 - Exercise 2

In how many ways can we choose five people from a group of ten to form a committee?

First i will do it manually:

This will be a combination problem:

10C5

= 10! / 5!×(10???5)!

= 10!/ 5!×5!

10×9×8×7×6×5×4×3×2×1 / (5×4×3×2×1) × (5×4×3×2×1)

= 30240/ 1×120

= 252

R Solution:

C <- function(n, m){
  A <- factorial(n)/(factorial(m)*factorial(n-m))
  return(A)
}
C(10, 5)
## [1] 252