Question-1: 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?

Ans-1:

# way_1 = C(7,5) # withdrawal of 5 red jellybeans from 7 red jellybeans
# way_2 = C(7,4)*C(5,1) # withdrawal of 4 red jellybeans from 7 red jellybeans and withdrawal of 1 green jellybeans from 5 green jellybeans
# total_ways_of_withdrawal_5_jellybeans_where_number_of_green_jellybeans_will_be_less_than_2= way_1+way_2

total_ways_of_withdrawal_5_jellybeans_where_number_of_green_jellybeans_will_be_less_than_2=(factorial(7)/(factorial(5)*factorial(7-5)))+ (factorial(7)/(factorial(4)*factorial(7-4)))*(factorial(5)/(factorial(1)*factorial(5-1))) 
total_ways_of_withdrawal_5_jellybeans_where_number_of_green_jellybeans_will_be_less_than_2
## [1] 196

Therefore, the total number of ways of withdrawing 5 jellybeans where the number of green jellybeans withdrawal will be less than 2 is 196

Question-2: 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?

Ans-2:

#total_ways_subcommittee_can_be_formed=C(13,4)*C(14,1)+C(13,5)
total_ways=(factorial(13)/(factorial(4)*factorial(13-4)))*(factorial(14)/(factorial(1)*factorial(14-1)))+(factorial(13)/(factorial(5)*factorial(13-5)))
total_ways
## [1] 11297

Therefore, the total number of ways a sub-committee can be formed where at least 4 of the members must be representatives is 11,297

Question-3: If a coin is tossed 5 times, and then a standard six-sided die is rolled 2 times, and finallya group of three cards are drawn from a standard deck of 52 cards without replacement, how many different outcomes are possible?

Ans-3:

total_outcomes_from_coin_toss_five_times = 2^5
total_outcomes_from_rolling_die_2_times = 6^2
total_outcomes_for_drawing_3_cards_from_52_cards=factorial(52)/(factorial(3)*factorial(52-3))
total_outcomes_for_three_different_events= 2^5*6^2*(factorial(52)/(factorial(3)*factorial(52-3)))
total_outcomes_for_three_different_events
## [1] 25459200

Therefore, the number of total possible outcomes is 25,459,200

Question-4: 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.

Ans-4:

A=probability_of_not_getting_3_at_first_withdrawl_without_replacement=48/52
B=probability_of_not_getting_3_at_second_withdrawl_without_replacement=47/51
C=probability_of_not_getting_3_at_third_withdrawl_without_replacement=46/50
D=probability_of_not_getting_3_at_all_three_times_without_replacement=A*B*C
probability_of_drawing_at_least_one_3_without_replacement=1-D
round(probability_of_drawing_at_least_one_3_without_replacement,4)
## [1] 0.2174

Therefore, the probability that at least one of the cards drawn is a 3 is 0.2174

Question-5: 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? Step 2. How many different combinations of 5 movies can he rent if he wants at least one mystery?

Ans-5:

step_1=different_combinations_of_5_movies_can_be_rent=factorial(31)/(factorial(5)*factorial(31-5)) # C(31,5)
step_1
## [1] 169911
intermediate_step=combinations_where_mystery_movies_absent=factorial(17)/(factorial(5)*factorial(17-5)) # C(17,5)
step_2=different_combinations_of_5_movies_where_at_least_one_mystery_movie_present=step_1 - intermediate_step # C(31,5)-C(17,5)
step_2
## [1] 163723

Therefore, the total combinations of 5 movies Lorenzo can rent is 169911. Also,the number of combinations of 5 movies he can rent where at least one mystery movie will be present is 163723

Question-6: 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.

Ans-6:

X=ways_to_choose_3_Brahms = factorial(4)/(factorial(3)*factorial(4-3)) # C(4,3)
Y=ways_to_choose_3_Haydn = factorial(104)/(factorial(3)*factorial(104-3)) # C(104,3)
Z=ways_to_choose_3_Mendelssohn = factorial(17)/(factorial(3)*factorial(17-3)) # C(17,3)
total=number_of_different_schedule_where_equal_number_symphonies_present= X*Y*Z
format(total, scientific = TRUE,digits=3)
## [1] "4.95e+08"

Therefore, the number of different schedules is 4.95e+08 (or 4.95 x 10^8)

Question-7: 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. 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.

Ans-7:

A=ways_to_choose_13_books_from_all_24_books= factorial(24)/(factorial(13)*factorial(24-13)) # C(24,13)
B=ways_to_choose_13_books_where_all_5_nonfiction_books_included=factorial(5)/(factorial(5)*factorial(5-5))*factorial(19)/(factorial(8)*factorial(19-8)) # C(5,5)*C(19,8)
C=ways_to_choose_schedules_of_13_books_where_no_more_than_4_nonfiction_books_included = A-B
format(C,scientific = TRUE,digits = 3)
## [1] "2.42e+06"
D=ways_to_choose_13_books_where_all_6_plays_included=factorial(6)/(factorial(6)*factorial(6-6))*factorial(18)/(factorial(7)*factorial(18-7)) # C(6,6)*C(18,7)
format(D,scientific = TRUE,digits = 3)
## [1] "3.18e+04"

Therefore, the number of possible reading schedules that include no more than 4 nonfiction books is 2.42e+06 (or 2.42 x 10^6) and the number of reading schedules that include all 6 plays is 3.18e+4 (or 3.18 x 10^4)

Question-8: 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.

Ans-8:

desird_outcome=factorial(2)*factorial(5)*factorial(5) # considering arrangement of 5 sycamores as one group and 5 cypress as another group
total_outcome=factorial(10) # considering arrangement of for total 10 plants
probability=desird_outcome/total_outcome
round(probability,4)
## [1] 0.0079

Therefore, the probability of randomly planting the trees where all 5 sycamores are next to each other and all 5 cypress trees are also next to each other is 0.0079

Question-9: 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.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.

Ans-9:

expected_value_of_proposition=(4*44/52)+(-16*8/52) # there are 44 cards are queen or lower out of 52 cards 
round(expected_value_of_proposition,2)
## [1] 0.92
expected_winning=round(expected_value_of_proposition*833,2)
expected_winning
## [1] 768.92

Therefore, the expected value of the proposition is $0.92 and the expected winning value is $768.92