# For the draw that contains 1 greenjelly beans we can have 5 choose 1 where 5 jelly beans can have 1 position
choose(5,1)
## [1] 5
# For other spots must be filled with red jellybeans for the remaining for 4 spots so:
choose(7,4)
## [1] 35
# For the draw that contains no green jelly beans we only have red jelly beans we can do 7 red jelly beans choose 5 spots:
choose(7,5)
## [1] 21
# Combining the possibilites we have in total:
paste0("The possibilities of 5 jellybeans to be withdrawn from the bag so that the number of green ones withdrawn will be less than 2 is: ",(choose(5,1) * choose(7,4)) + choose(7,5))
## [1] "The possibilities of 5 jellybeans to be withdrawn from the bag so that the number of green ones withdrawn will be less than 2 is: 196"
# Possibilites of 4 representatives and one senator we have:
choose(13,4) * choose(14,1)
## [1] 10010
# Possibilites with all 5 representative we have:
choose(13,5)
## [1] 1287
# Total possiblites:
paste0("Total possibilities are: ",(choose(13,4) * choose(14,1)) + choose(13,5))
## [1] "Total possibilities are: 11297"
# A coin is tossed 5 times and the only possiblites are Heads and Tails which are 2 possiblites:
2^5
## [1] 32
# A standard six-sided die has 6 possibilities 1 to 6 and rolled 2 times:
6^2
## [1] 36
# A group of three cards drawn from a standard deck of 52 cards without replacement is 52 on first card drawn, 51 on second card drawn, and 50 on third card drawn:
52*51*50
## [1] 132600
# With all 3 how many different outcomes are possible?
paste0("Total of different outcomes possible is: ",(2^5)*(6^2)*(52*51*50))
## [1] "Total of different outcomes possible is: 152755200"
# Probablity atleast one of the card is a 3 means P(x > 1) =
# We have 4 cards that are a 3
# One of the card is a 3
choose(4,1) * choose(48,2)
## [1] 4512
# Two of the card is a 3
choose(4,2) * choose(48,1)
## [1] 288
# Tree of the cards is a 3
choose(4,3) * choose(48, 0)
## [1] 4
# 3 cards drawn from a deck without replacement is 52 choose 3 so
choose(52,3)
## [1] 22100
# Adding all the cards over the total cards drawn from the deck is:
Total_Prob = (4512+288+4)/choose(52,3)
paste0("The probability that at least one of the cards drawn is a 3 is: ",round(Total_Prob,4))
## [1] "The probability that at least one of the cards drawn is a 3 is: 0.2174"
Step 1. How many different combinations of 5 movies can he rent?
# He has picked 17+14 31 movies to choose for 5 so 31 choose 5
paste0("The total number of different combinations of 5 movies he can rent is: ",choose(31,5))
## [1] "The total number of different combinations of 5 movies he can rent is: 169911"
Step 2. How many different combinations of 5 movies can he rent if he wants at least one mystery?
# Combinations with one mystery and 4 docs
oNe <- choose(14,1) * choose(17,4)
# Combinations with two mystery and 3 docs:
two <- choose(14,2) * choose(17,3)
# Combinations with three mystery and 2 docs:
three <- choose(14,3) * choose(17,2)
# Combinations with 4 mystery and 1 doc:
four <- choose(14,4) * choose(17,1)
# Combinations with all 5 movies being mysteries
five <- choose(14,5)
# All of the total is:
paste0("The total number of different combinations of 5 movies he rent is at least one mystery is: ",oNe + two + three + four + five)
## [1] "The total number of different combinations of 5 movies he rent is at least one mystery is: 163723"
# 4 Brahms For 3
choose(4,3)
## [1] 4
# 104 Haydn for 3
choose(104,3)
## [1] 182104
# 17 Mendelssohn for 3
choose(17,3)
## [1] 680
# Setting up a schedule of the 9 symphonies
# Scientific notation rounding to the hundredths place
paste0("The total number of different schedule that are possible is: ",formatC(factorial(9) * choose(4,3)*choose(104,3)*choose(17,3), format = 'e', digits=3))
## [1] "The total number of different schedule that are possible is: 1.797e+14"
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 books are 6+6+7+5 which is 23 books
# No more than 4 means we can only have 4 or less nonfiction books
# 23 - 5 = 19
# Combinations with 1 non-fic and 19 others books then:
# with 0 non-fic
zero <- choose(5,0) * choose(19,13)
# with 1 non-fic
one <- choose(5,1) * choose(19,12)
# With 2 non-fic
two <- choose(5,2) * choose(19,11)
# With 3 non-fic
three <- choose(5,3) * choose(19,10)
# With 4 non-fic
four <- choose(5,4) * choose(19,9)
paste0("Different reading schedules that are possible with no more than 4 nonfictions books: ",formatC(factorial(13) * zero+one+two+three+four,format="e", digits=3))
## [1] "Different reading schedules that are possible with no more than 4 nonfictions books: 1.690e+14"
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.
paste0("Different reading schedules that are possible if he wants to include all 6 plays: ",formatC(factorial(13) * choose(6,6) * choose(6+7+5,7),format="e", digits=3))
## [1] "Different reading schedules that are possible if he wants to include all 6 plays: 1.982e+14"
paste0("Probability that Zane randomly plants the trees so that all 5 sycamores are next to each other and all 5 cypress trees are next to each other: ",round((2/choose(10,5)),4))
## [1] "Probability that Zane randomly plants the trees so that all 5 sycamores are next to each other and all 5 cypress trees are next to each other: 0.0079"
Step 1. Find the expected value of the proposition. Round your answer to two decimal places. Losses must be expressed as negative values.
# 1 - 8/52 = 44/52
# To lose 16 we must have 8/52
paste0("The expected value of the proposition is: ",round((4* (44/52)) + (-16 * (8/52)),2))
## [1] "The expected value of the proposition is: 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.
paste0("I would expect to win: ",(833 * (round((4* (44/52)) + (-16 * (8/52)),2))))
## [1] "I would expect to win: 766.36"