library(gtools)
\[ Step\ 1:\ \binom{5}{1} =\frac{5!}{(5-1)!1!} =\frac{120}{24} =5\ ways\ to\ get\ 1\ green\ jellybean \]
choose(5,1)
## [1] 5
\[ Step\ 2:\ \binom{7}{4} =\frac{7!}{(7-4)!4!} =\frac{5,040}{144} =35\ ways\ to\ get\ 4\ red\ jellybeans \]
choose(7,4)
## [1] 35
\[ Step\ 3:\ \binom{7}{5} =\frac{7!}{(7-5)!5!} =\frac{5,040}{240} =21\ ways\ to\ get\ 5\ red\ jellybeans \]
choose(7,5)
## [1] 21
\[ Answer:\ Total\ possibilities\ =\ \binom{5}{1} \times \binom{7}{4} +\binom{7}{5} =196\ ways \]
(choose(5,1) * choose(7,4)) + choose(7,5)
## [1] 196
\[ Step\ 1:\ \binom{13}{4} \times \binom{14}{1} =715\times 14=10,010\ ways\ to\ choose\ with\ at\ least\ 4\ representatives \]
choose(13,4)
## [1] 715
choose(14,1)
## [1] 14
choose(13,4) * choose(14,1)
## [1] 10010
\[ Step\ 2:\ \binom{13}{5} =6,227,020,800/4,838,400=1287\ ways\ to\ choose\ with\ 5\ representatives \]
## Possibilites with all 5 representative we have:
choose(13,5)
## [1] 1287
\[ Answer:\ Total\ possibilities\ =\ \binom{13}{4} \times \binom{14}{1} +\binom{13}{5} =11,297\ ways \]
(choose(13,4) * choose(14,1)) + choose(13,5)
## [1] 11297
\[ Coin\ tossed\ 5\ times,\ Outcomes=2^{5}=32 \]
2*2*2*2*2
## [1] 32
\[ 6\ sided\ die\ rolled\ 2\ times,\ outcomes=6^{2}=36 \]
6*6
## [1] 36
\[ Draw\ a\ group\ of\ 3\ cards\ from\ a\ deck\ of\ 52=\binom{53}{3} =\frac{53!}{(53-3)!3!} =22,100 \]
choose(52,3)
## [1] 22100
\[ Answwer:\ Add\ all\ outcomes\ togther=\ 22,168 \]
2^5 + 6^2 + choose(52,3)
## [1] 22168
\[ Answer:\ P\left( \frac{Hands\ w/\ a\ 3}{Total\ hands\ possible} \right) =\frac{\binom{51}{2} }{\binom{52}{3} } =\frac{1275}{22100} =0.0577 \]
(ways <- choose(52,3))
## [1] 22100
(rem_ways <- choose(51,2))
## [1] 1275
(format(round(rem_ways/ways, 4)))
## [1] "0.0577"
\[ Answer:\ \binom{31}{5} =\frac{31!}{(31-5)!5!} =169,911 \]
choose(31,5)
## [1] 169911
\[ Answer:\ \binom{31}{4} =\frac{31!}{(31-4)!4!} =31,465 \]
choose(31,4)
## [1] 31465
\[ Step\ 1:\ \binom{4}{3} =\frac{4!}{(4-3)!3!} =4\ ways\ for\ 3\ symphonies\ from\ Brahms \]
choose(4,3)
## [1] 4
\[ Step\ 2:\ \binom{104}{3} =\frac{104!}{(104-3)!3!} =182,104\ ways\ for\ 3\ symphonies\ from\ Haydn \]
choose(104,3)
## [1] 182104
\[ Step\ 3:\ \binom{17}{3} =\frac{17!}{(17-3)!3!} =680\ ways\ for\ 3\ symphonies\ from\ Mendelssohn \]
choose(17,3)
## [1] 680
\[ Anwer:\ \binom{4}{3} \binom{104}{3} \binom{17}{3}=4.9532e+08\ ways\ for\ 3\ symphonies\ from\ Brahms,\ Haydn\ and\ Mendelssohn. \]
formatC(choose(4,3) * choose(104,3) * choose(17,3),format="e")
## [1] "4.9532e+08"
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.
\[ Answer\ 1: Number\ of\ schedules\ where\ there\ are\ no\ more\ than\ 4\ non-fiction\ books\\=\ 2.5782e+06.\]
# Number of ways one non-fiction book is selected
one_nf <- choose(23,12)
# Number of ways two non-fiction book is selected
two_nf <- choose(22,11)
# Number of ways three non-fiction book is selected
three_nf <- choose(21,10)
# Number of ways three non-fiction book is selected
four_nf <- choose(20,9)
(formatC(one_nf+two_nf+three_nf+four_nf,format="e"))
## [1] "2.5782e+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.
\[ Answer\ 2:\ \binom{18}{7} =\frac{18!}{(18-7)!7!} =3.1824e+04 \]
formatC(choose(18,7),format = "e")
## [1] "3.1824e+04"
\[ Answer:\ Each\ tree\ has\ a\ \frac{1}{10} \ chance\ of\ being\ pick\ next\ to\ plant\ so\ there\ is\ a\ 5/10\ chance\\ that\ 5\ sycamores\ will\ be\ planted\ in\ a\ row\ and\ vice\ versa.\]
To be rewarded $4 you must not get a king or an ace. Since there are 4 kings and 4 aces you have a probability 8/52 that you will draw a king or an ace. That also means that we have a 44/52 chance that we will not draw an ace or a king
paste0("The expected Value is ",round((4* (44/52)) + (-16 * (8/52)),4))
## [1] "The expected Value is 0.9231"
odds <- (4* (44/52)) + (-16 * (8/52))
winnings <- round(833 * odds,2)
paste0("You would have ", winnings)
## [1] "You would have 768.92"