This can be calculated using the combination formula:
$C(n, k) = \frac{n!}{k!(n-k)!}$
In this case, n = 40 (total number of balls) and k = 5 (number of balls drawn). So, the total number of combinations is:
$C(40, 5) = \frac{40!}{5!(40-5)!} = \frac{40!}{5!35!}
Show more…