Problem 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?
green <- 5
red <- 7
num_ways <- choose(red, 5) + (green * choose(red, 4))
num_ways
## [1] 196
There are 196 ways
Problem 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?
# Define the number of senators and representatives in the committee
senators <- 14
reps <- 13
subcommittees <- choose(reps, 4) * choose(senators, 1) + choose(reps, 5)
# Print the result
print(subcommittees)
## [1] 11297
There are 11,297 ways.
Problem 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?
Problem 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.
not_3 <- (49/52) * (48/51) * (47/50)
p_at_least_one_3 <- 1 - not_3
print(paste("Odds of at least 1 three",round(p_at_least_one_3, 4)))
## [1] "Odds of at least 1 three 0.1663"
Problem 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.
How many different combinations of 5 movies can he rent?
docs <- 17
mystery <- 14
combinations <- choose(docs + mystery, 5)
# Print the result
print(combinations)
## [1] 169911
There are 169,911 possible options of 5!
How many different combinations of 5 movies can he rent if he wants at
least one mystery?
# Define the number of documentaries and mysteries
docs <- 17
mystery <- 14
combinations <- choose(docs + mystery, 5) - choose(docs, 5)
print(combinations)
## [1] 163723
There are 163723 combinations with at least 1 mystery.
Problem 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.
num_brahms <- 4
num_haydn <- 104
num_mendelssohn <- 17
num_schedules <- choose(num_brahms,3)* choose(num_haydn,3) * choose(num_mendelssohn,3)
print(format(num_schedules, scientific = TRUE, digits = 3))
## [1] "4.95e+08"
There are 4.95e+08 options.
Problem 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. 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_options <- 6+6+7+5
total_choices <- 13
fiction_options <- 5
total_combo <- choose(total_options,total_choices)
fiction_combo <- choose(fiction_options, fiction_options) * choose((total_options-fiction_options), (total_choices-fiction_options))
print(format(total_combo-fiction_combo, scientific = TRUE, digits = 3))
## [1] "2.42e+06"
There are 2.42e+06 combinations.
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.
total_options <- 6+6+7+5
total_choices <- 13
play_options <- 6
total_combo <- choose(total_options,total_choices)
play_combo <- choose(play_options, play_options) * choose((total_options-play_options), (total_choices-play_options))
print(format(total_combo-play_combo, scientific = TRUE, digits = 3))
## [1] "2.46e+06"
There are 2.46e+06 options
Problem 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.
correct_events <- factorial(5) * factorial(5) * factorial(2)
total_events <- factorial(10)
prob <- correct_events / total_events
print(round(prob, 4))
## [1] 0.0079
There is a 0.79% chance of this occurring.
Problem 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.)
win_rate <- (52-8)/52
loss_rate <- 1-win_rate
win_value <- 4
loss_value <- -16
ev <- (win_value*win_rate)+(loss_value*loss_rate)
print(round(ev,2))
## [1] 0.92
The Expected value is 0.92
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.
print(round(ev*833,2))
## [1] 768.92
if you played 833 rounds, your expected value would be 833*ev, which
is 768.92, indicating that you would be net positive.
This would be a fantastic arbitrage bet!