\(\binom{5}{1} * \binom{7}{4} + \binom{7}{5}\)
choose(5,1) * choose(7,4)+choose(7,5)
## [1] 196
\(\binom{13}{4} * \binom{14}{1} + \binom{13}{5}\)
choose(13,4) * choose(14,1)+choose(13,5)
## [1] 11297
If a coin is tossed 5 times, and then a standard six-sided die is rolled 2 times, and finally a group of three cards are drawn from a standard deck of 52 cards without replacement, how many different outcomes are possible?
5 tosses of 2 possible outcomes combined with 2 rolls with 6 possible outcomes combined with 52 cards to select times 51 remaining cards to select times 50 remaining cards in the deck to select
(2 ** 5) * (6 ** 2)*(52*51*50)
## [1] 152755200
There are 3 different scenarios that need to be accounted for to calculate the total probability of this problem and since we are focused on the probability the order/combinations won’t affect the calculation 1) 1 of the cards drawn is a 3. I was almost tricked by only using the single probability for each selection without considering the permutations involved.
\(\frac{\binom{4}{1}\binom{48}{2}}{\binom{52}{3}}\)
\(\frac{\binom{4}{2}\binom{48}{1}}{\binom{52}{3}}\)
\(\frac{\binom{4}{3}\binom{48}{0}}{\binom{52}{3}}\)
Alternatively we could just use the complement for no 3’s
\(1-\frac{\binom{4}{0}\binom{48}{3}}{\binom{52}{3}}\)
one_three <- (choose(4,1)*choose(48,2))/choose(52,3)
two_three <- (choose(4,2)*choose(48,1))/choose(52,3)
three_three <- (choose(4,3)*choose(48,0))/choose(52,3)
sprintf('The probability of this scenario is: %f',round(one_three+two_three+three_three,4))
## [1] "The probability of this scenario is: 0.217400"
print(round(1-(choose(4,0)*choose(48,3))/choose(52,3),4))
## [1] 0.2174
#validation
round(1-(48/52)*(47/51)*(46/50),4)
## [1] 0.2174
Step 1. How many different combinations of 5 can he rent?
\(\binom{31}{5}\)
choose(31,5)
## [1] 169911
Step 2. How many different combinations of 5 movies can he rent if he wants at least one mystery?
more_work <- choose(14,1)*choose(17,4)+choose(14,2)*choose(17,3)+choose(14,3)*choose(17,2)+choose(14,4)*choose(17,1)+choose(14,5)
#complement
mov_comp <- choose(31,5)-choose(17,5)
mov_comp == more_work
## [1] TRUE
mov_comp
## [1] 163723
Besides choosing the different combinations, we need to also account for the number of different ways to arrange all 9 symphonies and incorporate the factorial of the total choices
six_answer <- factorial(9) * choose(4,3)*choose(104,3)*choose(17,3)
formatC(six_answer, format='e', digits = 3)
## [1] "1.797e+14"
Step 1. If he wants to include no more than 4 nonfiction books, how many different reading schedules are possible? Express your answer in scientific notation rounding to the hundredths place.
seven_complement <- factorial(13)*(choose(6+6+7+5,13)-choose(19,8)*choose(5,5))
seven_full <- factorial(13)*(choose(5,4)*choose(19,9)+choose(5,3)*choose(19,10)+choose(5,2)*choose(19,11)+choose(5,1)*choose(19,12)+choose(5,0)*choose(19,13))
seven_complement == seven_full
## [1] TRUE
format(seven_complement, scientific=TRUE, digits = 3)
## [1] "1.51e+16"
Step 2. If he wants to include all 6 plays, how many different reading schedules are possible? Express your answer in scientific notation rounding to the hundredths place.
seven_steptwo <- factorial(13) * choose(6,6) * choose(6+7+5,7)
format(seven_steptwo, scientific=TRUE, digits = 3)
## [1] "1.98e+14"
round((factorial(2)*factorial(5)*factorial(5))/factorial(10),4)
## [1] 0.0079
Step 1. Find the expected value of the proposition. Round your answer to two decimal places. Losses must be expressed as negative values.
4*(44/52)-16*(8/52)
## [1] 0.9230769
Step 2. If you played this game 833 times how much would you expect to win or lose? Round your answer to two decimal places. Losses must be expressed as negative values.
833 * (4*(44/52)-16*(8/52))
## [1] 768.9231