1. A bag contains 5 green and 7 red jellybeans. How many ways can 5 jellybeans be
withdrawn from the bag so that the number of green ones withdrawn will be less than
2?

Solution:

First, lets see in how many ways we can get green jelly beans that is < 2 out of 5.

\[\binom{5}{1} = \frac{5!}{(5-1)! \cdot 1!} = \frac{120}{24} = 5\]

(Q_1_first <- choose(5,1))
## [1] 5

Second, we have to find in how many ways 4 red jelly beans out of 7.

\[\binom{7}{4} = \frac{7!}{(7-4)! \cdot 4!} = \frac{5040}{144} = 35\]

(Q_1_second <- choose(7, 4))
## [1] 35

Lastly, find the all red jelly beans and no green jelly beans

\[\binom{7}{5} = \frac{7!}{(7-5)! \cdot 5!} = \frac{5040}{240} = 21\]

(Q_1_third <- choose(7,5))
## [1] 21

Now, combining the possibilities,

we have,

(Q_1_first *  Q_1_second) + Q_1_third
## [1] 196
2. A certain congressional committee consists of 14 senators and 13 representatives. How many ways can a subcommittee of 5 be formed if at least 4 of the members must be
representatives?

Solution,

5 subcommittee, at least 4 from representative and 1 from either representative or senators

first, possibilities of having 4 represatative and 1 senator.

\[\binom{13}{4} \cdot \binom{14} {1} = 715 \cdot 14= 10010\]

(q2_first <- choose(13, 4) * choose(14, 1))
## [1] 10010

second, possibility of having all 5 representative

\[\binom{13}{5}= \frac {6,227,020,800} {4,838,400}= 1287\]

(q2_second <- choose(13, 5))
## [1] 1287

Now, total possibilities:

q2_first + q2_second
## [1] 11297
3. 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?

Solution:

since the events are independent, we can consider the outcomes separately:

\[\begin{equation} \text {coin tossed 5 times = }2^5 = 32 \\\\ \text {six sided dice rolled 2 times = } 6^2 = 36\\\\ \text {3 cards drawn from a deck of 52 cards, without replacement} = \binom {52}{3} \end{equation}\]

32 * 36 * choose(52,3)
## [1] 25459200
4. 3 cards are drawn from a standard deck without replacement. What is the probability that at least one of the cards drawn is a 3? Express your answer as a fraction or a decimal number rounded to four decimal places.

Solution:

A deck of card consist of 52 cards and there are four 3s in a set of heart, spade, diamond, and club.

So, we can reverse the method by finding the probability of not getting 3s and subract by 1, without replacement

we get,

\[1 - (\frac {48} {52} \cdot \frac {47} {51} \cdot \frac {46} {50}) \approx 0.2174\]

1 - (48/52) * (47/51) * (46/50)
## [1] 0.2173756
5. Lorenzo is picking out some movies to rent, and he is primarily interested in
documentaries and mysteries. He has narrowed down his selections to 17 documentaries and 14 mysteries.

  a. How many different combinations of 5 movies can he rent?
  b. How many different combinations of 5 movies can he rent if he wants at least
one mystery?

Solution:

Lorenzo has narrowed to 31 movies from which 17 is documentaries and 14 is mysteries

part a: out of 31 movies, the combinations of 5 movices is \(\binom {31} {5} = 169,911\)

part b: If he wants one or more mystery then the combination will be

#for atleast 1 mystery movie
q5_1 <- choose(14, 1) * choose(17, 4)

#for atleast 2 mystery movies
q5_2 <- choose(14,2) * choose(17,3)

#for atleast 3 mystery movies
q5_3 <- choose(14,3) * choose(17,2)

#for atleast 4 mystery movies
q5_4 <- choose(14,4) * choose(17,1)

#for atleast 5 mystery movies
q5_5 <- choose(14,5)

(total <- q5_1 + q5_2 + q5_3 + q5_4 + q5_5)
## [1] 163723
6. In choosing what music to play at a charity fund raising event, Cory needs to have an equal number of symphonies from Brahms, Haydn, and Mendelssohn. If he is setting up a schedule of the 9 symphonies to be played, and he has 4 Brahms, 104 Haydn, and 17 Mendelssohn symphonies from which to choose, how many different schedules are
possible? Express your answer in scientific notation rounding to the hundredths place.

Solution:

from Brahms : \(\binom {4} {3}\) from Haydn : \(\binom {104} {3}\) from Mendelssohn : \(\binom {17} {3}\)

q6_total <- choose(4, 3) * choose(104, 3) * choose(17, 3) * factorial(9)

formatC(q6_total, format = "e")
## [1] "1.7974e+14"
7. An English teacher needs to pick 13 books to put on his reading list for the next school year, and he needs to plan the order in which they should be read. He has narrowed down his choices to 6 novels, 6 plays, 7 poetry books, and 5 nonfiction books.

  a. 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.

  b. 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.

Solution:

part a:

# 4 nonfiction books out of 5 & 9 other books out of 19(6 novels, 6 plays, 7 poetry)
# 3 nonfiction books out of 5 & 10 other books out of 19
# 2 nonfiction books out of 5 & 11 other books out of 19
# 1 nonfiction books out of 5 & 12 other books out of 19
# 0 nonfiction books & 13 other books out of 19

format((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)), scientific = T, digits = 3)
## [1] "2.42e+06"

part b:

# 6 plays out of 6 & 7 other books out of 18 other books (6 novels, 7 poetry, 5 nonfiction)
format((choose(6,6) * choose(18,7)), scientific = T, digits = 3)
## [1] "3.18e+04"
8. Zane is planting trees along his driveway, and he has 5 sycamores and 5 cypress trees to plant in one row. What is the probability that he randomly plants the trees so that all 5 sycamores are next to each other and all 5 cypress trees are next to each other? Express your answer as a fraction or a decimal number rounded to four decimal places.
# Define the number of sycamores and cypress trees
sycamores <- 5
cypress <- 5

# Define the total number of trees
total_trees <- sycamores + cypress

# Calculate the total number of permutations
total_permutations <- factorial(total_trees)

# Calculate the number of permutations where all sycamores are together and all cypress trees are together
block_permutations <- 2 * factorial(sycamores) * factorial(cypress)

# Calculate the probability
probability <- block_permutations / total_permutations

# Round the result to 4 decimal places
(probability <- round(probability, 4))
## [1] 0.0079
9. If you draw a queen or lower from a standard deck of cards, I will pay you $4. If not, you pay me $16. (Aces are considered the highest card in the deck.)

  a. Find the expected value of the proposition. Round your answer to two decimal
places. Losses must be expressed as negative values.

  b. 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.

solution:

Part a:

p_win <- 44/52
p_loss <- 8/52

exp_val <- 4*p_win + (-16 * p_loss)

round(exp_val, digits = 2)
## [1] 0.92

part b:

round(833 * exp_val, 2)
## [1] 768.92