library(glue)

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?

glue('The amount of ways, 5 jellybeans 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))} ways.')
## The amount of ways, 5 jellybeans be withdrawn from the bag so that the number of green ones withdrawn will be less than 2 is 196 ways.

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?

glue('The amount of ways a subcommittee of 5 can be formed if at least 4 of the members must be representatives is {(choose(13,4)*choose(14,1) + choose(13,5))} ways.')
## The amount of ways a subcommittee of 5 can be formed if at least 4 of the members must be representatives is 11297 ways.

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?

glue('There are {(2^5*6^2*choose(52,3))} different outcomes that are possible.')
## There are 25459200 different outcomes that are possible.

A standard deck of cards contains 52 cards (26 of which are red and 26 of which are black) divided into 4 suits (clubs, spades, diamonds, and hearts), where there are 13 of each suit (ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, jack, queen, and king). Of these cards, 12 are considered face cards (4 kings, 4 queens, and 4 jacks) and 16 do not have numbers on them (4 aces, 4 kings, 4 queens, and 4 jacks).

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.

glue('The probability that at least one of the cards drawn is a 3 is {round((1-choose(48,3)/choose(52,3)),4)}.')
## The probability that at least one of the cards drawn is a 3 is 0.2174.

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?

glue('He can rent {choose(31,5)} combinations of 5 movies.')
## He can rent 169911 combinations of 5 movies.

How many different combinations of 5 movies can he rent if he wants at least one mystery?

glue('He can rent {choose(14,1)*choose(17,4) + choose(14,2)*choose(17,3) + choose(14,3)*choose(17,2) + choose(14,4)*choose(17,1) + choose(14,5)} combinations of 5 movies, if he wants at least one mystery.')
## He can rent 163723 combinations of 5 movies, if he wants at least one mystery.

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.

glue('There are {format((choose(4,3)*choose(104,3)*choose(17,3)), scientific = TRUE, digits=3)} different schedules possible.')
## There are 4.95e+08 different schedules possible.

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.

glue('There are {format(choose(24,13)-choose(5,5)*choose(19,8),scientific = TRUE, digits=3)} different reading schedules possible.')
## There are 2.42e+06 different reading schedules possible.

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.

glue('If he wants to include all 6 plays, there are {format((choose(6,6)*choose(18,7)),scientific = TRUE, digits=3)} reading schedules possible.')
## If he wants to include all 6 plays, there are 3.18e+04 reading schedules possible.

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.

glue('The 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 is {round((2/choose(10,5)),4)}.')
## The 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 is 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.) Find the expected value of the proposition. Round your answer to two decimal places. Losses must be expressed as negative values.

glue('The expected value of the proposition is ${round(4*(44/52)-16*(8/52), 2)}')
## The expected value of the proposition 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.

glue('If you played this game 833 times you would expect to win ${(round(4*(44/52)-16*(8/52), 2))*833}.')
## If you played this game 833 times you would expect to win $766.36.