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?
These are the two conditions where green < 2 and allowing for a drawing of 5 jelly beans. The outcomes of each are added to count the mutually exclusive events.
# calculates the number of ways to withdraw 0 green jellybeans and 5 red jellybeans
choose(5,0) * choose(7, 5) +
# calculates the number of ways to withdraw 1 green jellybean and 4 red jellybeans
choose(5,1) * choose(7,4)
## [1] 196
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?
These are the condition where reps make up at least 4 members of the committee. The outcomes of each are added to count the mutually exclusive events.
# calculates the number of ways you can have committees that have 4 representatives and 1 senator
choose(13, 4) * choose(14, 1) +
# calculates the number of ways where where all 5 committee members are reps
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?
The total outcome is the the product of the individual outcomes.
# calculate the the possible coin toss outcomes: 2 possibilities tossed 5 times
2^5 *
# calculates the possible outcome for 6 sided die thrown twice
6^2 *
# calculates 3 card withdrawal without replacement from deck of 52 cards
choose(52, 3)
## [1] 25459200
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.
# calculate number of possible combinations of drawing 3 cards from 52
all_outcomes <- choose(52,3)
# calculates the number of possible of combinations that do not include the four cards
no_threes <- choose(48, 3)
# calculate the difference/complement divided by all possible outcomes
(all_outcomes - no_threes)/ all_outcomes
## [1] 0.2173756
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?
169911
Step 2. How many different combinations of 5 movies can he rent if he wants at least one mystery? 163723
# calculate all possible outcome when selectiong 5 movies from 31 (17 documentaries + 14 mysteries)
all_outcomes <- choose(31, 5)
# calculate outcomes for movies with no mysteries (only documentaries)
no_mysteries <- choose(17, 5)
# calculates the complementary where at least one mystery
one_mystery <- all_outcomes - no_mysteries
# Display the results
all_outcomes
## [1] 169911
## [1] 163723
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.
# calculate the number of ways to choose 3 symphonies from each composer
brahms <- choose(4, 3)
haydn <- choose(104, 3)
mendelssohn <- choose(17, 3)
# calculate the total number of different schedules
total_schedules <- brahms * haydn * mendelssohn
# calculate scientific notation, rounding to the hundredths place
total_schedules_scientific <- format(total_schedules, scientific = TRUE, digits = 2)
#total_schedules_scientific
print(total_schedules)
## [1] 495322880
## [1] "5e+08"
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. 188663480226 or 1.9e+11
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. 31824
#STEP1
# calculate the total number of combinations of 13 books out of 24
total_outcomes <- choose(24, 13)
# calculate the total number of possibilities to choose all 5 non fiction books
non_fiction <- choose(5, 5)
# calculate the number of combinations for remaining 8 books from the other categories without the 5 non fictions books
not_nonfiction <- choose(19, 8)
# subtract the non fiction from total possibilities and then multiply by poetry, plays and novels combination from the total combinations
total_nonfiction <- (total_outcomes - non_fiction) * not_nonfiction
# Convert the number of valid combinations to scientific notation, rounding to the hundredths place
total_nonfiction_scientific <- format(total_nonfiction, scientific = TRUE, digits = 2)
# display
print(total_nonfiction)
## [1] 188663480226
## [1] "1.9e+11"
#STEP2
# calculates the possibility of choosing 6 plays
plays <- choose(6, 6)
# calculate combinations of selecting 7 books from the remaining 18 books (excluding plays)
remaining_books <- choose(18, 7)
# total possibilities with plays
plays * remaining_books
## [1] 31824
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.
Since order matters, we need to use the factorial to determine the number of possible arrangements
# calculate the total ways to plant trees
total_ways <- factorial(10)
# calculate ways to arrange the two tree types
ways_to_arrange_types <- factorial(2)
# calculate the total ways for either cypress or sycamore trees
total_ways_within_types <- factorial(5) * factorial(5)
# calculate the probability
probability <- (ways_to_arrange_types * total_ways_within_types) / total_ways
# Round the probability to four decimal places
probability <- round(probability, 4)
# Print the rounded probability
print(probability)
## [1] 0.0079
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. $0.92 expected value per hand
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. $766.36 over 833 hands
#STEP 1
# expected value for queen or lower
expected_gain <- 4
queen_lower <- 44/52 #exclude aces and kings
# expected value for kings/aces
expected_loss <- 16
king_ace <- 8/52 #only kings and aces
# expected value
expected_value <- round((expected_gain * queen_lower) - (expected_loss * king_ace), 2)
print(expected_value)
## [1] 0.92
## [1] 766.36