Exercise 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:

P(Green <2) = P(4 red & 1 green) + P(5 red & 0 green)

\[ \text{green }<2 = 4 \text{ red & } 1 \text{ green} + 5 \text{ red & } 0 \text{ green}\\ 4 \text{ red & } 1 \text{ green} = {5\choose 1}{7\choose 4}\\ 5 \text{ red & } 0 \text{ green} = {7\choose 5}{5\choose 0}\\ \text{green }<2 = {5\choose 1}{7\choose 4} + {7\choose 5}{5\choose 0} = 196 \]

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

Exercise 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

\[ \text{At least 4 representatives} = \text{4 representatives and 1 senators} + \text{5 representatives and 0 senators}\\ \text{4 representatives and 1 senators} = {13 \choose 4}{14 \choose 1}\\ \text{5 representatives and 0 senators} = {13\choose 5}{14 \choose 0}\\ \text{At least 4 representatives} = {13 \choose 4}{14 \choose 1} + {13\choose 5}{14 \choose 0} = 11297 \]

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

Exercise 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

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

Exercise 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

\[ P(\text{At least 1 card is a 3}) = 1 - P(\text{0 cards are a 3})\\ = 1 - \frac{{4 \choose 0}{48\choose 3}}{52\choose 3} \approx 0.2173 \]

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

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

Step 1. How many different combinations of 5 movies can he rent?

\[ {31\choose5} = 169911 \]

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

Step 2. How many different combinations of 5 movies can he 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

Exercise 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

\[ {4\choose 3}\times {104\choose 3} \times {17\choose 3} \]

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

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

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

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.

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"

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.

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

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

Solution

library(MASS)
fractions((factorial(5) * factorial(5))/factorial(10))
## [1] 1/252

Exercise 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.)

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

# king or ace
prob_lose <- (choose(8,1)*choose(44,0))/choose(52,1)
# queen or lower
prob_win <- (choose(44,1)*choose(8,0))/choose(52,1)

win<- 4
lose <- -16

expected_value <- prob_lose * lose + prob_win * win
print(round(expected_value,2))
## [1] 0.92

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.

num_trials <- 833
print(round(expected_value * num_trials, 2))
## [1] 768.92