#1.

(choose(5,1)*choose(7,4)) + (choose(7,5)*choose(5,0))
## [1] 196
#2.

(choose(13,4)*choose(14,1)) + (choose(13,5)*choose(14,0))
## [1] 11297
#3.

2^5 * 6^2 * choose(52,3)
## [1] 25459200
#4.

1 - ((choose(4,0)*choose(48,3))/choose(52,3))
## [1] 0.2173756

##5: Step1- (31,5)=169911 combinations of 5 movies he can rent

#5.

choose(31,5)
## [1] 169911

step2-combinations of 5 movies he can rent if he wants at least one mystery

((choose(17,4)*choose(14,1))+(choose(17,3)*choose(14,2))+(choose(17,2)*choose(14,3))+(choose(17,1)*choose(14,4))+(choose(17,0)*choose(14,5)))
## [1] 163723
#6.

solution6 <- choose(4,3)*choose(104,3)*choose(17,3)

format(solution6, scientific = TRUE, digit = 2)
## [1] "5e+08"

##7: step1-include no more than 4 nonfiction books

#7.

total_schedules <- sum(choose(5, 0:4) * choose(6 + 6 + 7, 13 - 0:4))
format(total_schedules, scientific = TRUE, digit =2)
## [1] "2.4e+06"

#step2-include all 6 plays

step2 <- sum(choose(6,6) * choose(6+7+5, 13-6))
format(step2, scientific = TRUE, digit=2)
## [1] "3.2e+04"
#8.

library(MASS)
## Warning: package 'MASS' was built under R version 4.3.3
fractions((factorial(5) * factorial(5))/factorial(10))
## [1] 1/252

##9: step1-value of the proposition

#9.
4*(44/52)-16*(8/52)
## [1] 0.9230769

step2- played this game 833 times

833 * (4*(44/52)-16*(8/52))
## [1] 768.9231