# 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
#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
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
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
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
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)
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)
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
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