Using the binomial coefficient formula =
Green Jellybeans = 5 Red Jellybeans = 7 Total jellybeans = 12
Either no green jellybeans are withdrawn or all five jellybeans withdrawn are red.
Number of ways: $ = 21 $.
Choose 4 red and 1 green jellybeans.
Number of ways: $ = 35 = 175 $.
Total number of ways to withdraw 5 jellybeans from the bag such that the number of green ones withdrawn will be less than 2:
$ 21 + 175 = 196 $ ways.
choose (7,5) + (choose (7,4) * choose(5,1))
## [1] 196
Case 1: Choose 4 representatives and 1 senator. Case 2: Choose 5 representatives and 0 senators. Case 3: Choose 4 representatives and 1 senator. These cases represent the different combinations of representatives and senators that fulfill the requirement of having at least 4 representatives.
Case 1:
sen <- 14
rep <- 13
# the 4 representatives
rep_13_ch_4 <- factorial(13) / (factorial(4)*(factorial(13-4)))
# 1 senator
sen_14_ch_1 <- factorial(14) / (factorial(1)*(factorial(14-1)))
# multiply
(rep_4_sen_1 <- rep_13_ch_4*sen_14_ch_1)
## [1] 10010
Case 2:
(rep_13_ch_5 <- factorial(13) / (factorial(5)*(factorial(13-5))))
## [1] 1287
adding case 1 and 2
rep_4_sen_1+rep_13_ch_5
## [1] 11297
checking in R
choose (13,5) + (choose (13,4) * choose(14,1))
## [1] 11297
coin_outcomes <- 2
die_outcomes <- 6
total_cards <- 52
coin_outcomes_5 <- coin_outcomes ^ 5
die_outcomes_2 <- die_outcomes ^ 2
card_outcomes_3 <- factorial(total_cards) / (factorial(3) * factorial(total_cards - 3))
total_outcomes <- coin_outcomes_5 * die_outcomes_2 * card_outcomes_3
cat("Total number of different outcomes:", total_outcomes, "\n")
## Total number of different outcomes: 25459200
Scenarios: All three cards drawn are 3. Two of the three drawn cards are 3 and one is something else. One of the three drawn cards is 3 and the other two are something else.
round(((choose(4,1) * choose(48,2)) + (choose(4,2) * choose(48,1)) + choose(4,3)) / choose(52,3),digits = 4)
## [1] 0.2174
Step 1: How many different combinations of 5 movies can he rent?
doc <- 17
myst <- 14
Total_movie <- 31
Choose_5movie <- choose(Total_movie, 5)
cat("Number of different combinations of 5 movies Lorenzo can rent:", Choose_5movie, "\n")
## Number of different combinations of 5 movies Lorenzo can rent: 169911
Step 2: . How many different combinations of 5 movies can he rent if he wants at least one mystery? 5 scnearios: Renting 1 mystery and 4 documentaries. Renting 2 mysteries and 3 documentaries. Renting 3 mysteries and 2 documentaries. Renting 4 mysteries and 1 documentary. Renting 5 mysteries and 0 documentaries.
mysteries <- 14
documentaries <- 17
mysteries_1_documentaries_4 <- choose(mysteries, 1) * choose(documentaries, 4)
mysteries_2_documentaries_3 <- choose(mysteries, 2) * choose(documentaries, 3)
mysteries_3_documentaries_2 <- choose(mysteries, 3) * choose(documentaries, 2)
mysteries_4_documentaries_1 <- choose(mysteries, 4) * choose(documentaries, 1)
mysteries_5_documentaries_0 <- choose(mysteries, 5) * choose(documentaries, 0)
total_combinations <- mysteries_1_documentaries_4 + mysteries_2_documentaries_3 + mysteries_3_documentaries_2 + mysteries_4_documentaries_1 + mysteries_5_documentaries_0
brahms <- 4
haydn <- 104
mendelssohn <- 17
total_schedules <- choose(brahms, 3) * choose(haydn, 3) * choose(mendelssohn, 3)
formatted_result <- format(total_schedules, scientific = TRUE, digits = 2)
cat("Total number of different schedules possible:", formatted_result, "\n")
## Total number of different schedules possible: 5e+08
novels <- 6
plays <- 6
poetry <- 7
non_fiction <- 5
total <- novels + plays + poetry + non_fiction
result <- choose(total, 13) - choose(5, 5) * choose(total - 5, 8)
formatted_result <- format(result, scientific = TRUE, digits = 2)
cat("Total number of different reading schedules possible:", formatted_result, "\n")
## Total number of different reading schedules possible: 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.
plays <- 6
total <- 6 + 6 + 7 + 5
result <- choose(plays, 6) * choose(total - plays, 7)
formatted_result <- format(result, scientific = TRUE, digits = 2)
cat("Total number of different reading schedules possible:", formatted_result, "\n")
## Total number of different reading schedules possible: 3.2e+04
sycamores<-5
cypress<-5
total_tree<-10
(tree10choose5<-choose(10,5)) #finding all outcomes
## [1] 252
cards <- 52
queen_lower <- 44
pay_qn_lower <- 4
if_not <- 16
expected_value <- round((pay_qn_lower * queen_lower / cards) - (if_not * ((cards - queen_lower) / cards)), 2)
expected_value
## [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.
games_played <- 833
expected_value_per_game <- 0.92
total_expected_value <- round(games_played * expected_value_per_game, 2)
total_expected_value
## [1] 766.36