Question

Question 5 5. Write python code for the given for the problem: Ex: Working group has...

Question 5
5. Write python code for the given for the problem:
Ex: Working group has 8 members. Three will be assigned to lead the group (no difference in leadership
positions). If there are 3 women and 5 men in the group, what is the probability of exactly 1 woman
being assigned to the leadership (if assigned randomly)?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Python code:

import math
def ncr(n,r):
    f=math.factorial
    return f(n)/f(r)/f(n-r)

print("We have to choose 3 leaders out of which exactly one woman")
print("Given 3 women and 5 men in the group")
m=ncr(5,2)*ncr(3,1)
print("Number of ways such that exactly one women and 2 men as Leaders is :",m)
n=ncr(8,3)
print("Total Number of ways such that exactly 3 members as Leaders out of 9 is :",n)
print("Probability is ",m/n)

Execution screenshot:

main.py 1 import nath 2- def ncr(n,r) f-nath.factorial return f(n)/f(r)/f(n-r) 4 6 print(We have to choose 3 leaders out of

Add a comment
Know the answer?
Add Answer to:
Question 5 5. Write python code for the given for the problem: Ex: Working group has...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • The table below describes the smoking habits of a group of asthma sufferers. Use this table...

    The table below describes the smoking habits of a group of asthma sufferers. Use this table to answer questions 7-9. Nonsmoker Light Smoker Heavy Smoker Total Men 75 65 470 Women 315 87 485 Total 645 158 152 7) If one of the subjects is randomly selected, find the probability that he/she is a light smoker or a woman. 330 83 955 8) If 3 of the subjects are randomly selected, find the probability that they are all men. (5)...

  • can someone please answer this Python code? Problem 5 and write code that would find the...

    can someone please answer this Python code? Problem 5 and write code that would find the union, intersection, and Read the documentation for sets difference of the sets below. A = { 'George', 'Jim', 'John', 'Blake', 'Kevin', 'Michael'} B = {'George', 'Katie', 'Kevin', 'Michelle', 'Ryan'} Previous Next →

  • Python working code P) Problem 5 A truth table on three variables p, q, r has...

    Python working code P) Problem 5 A truth table on three variables p, q, r has 23 assignments (ti, t2, t3) where ty, t2, t3 e {T,ㅘ. Show that the following statements are equivalent by constructing the truth tables of each statement and showing that the resulting truth values are the same.

  • Calculate P(rolling any 6's) .Calculate P(not rolling any 6s) Answer: Answer: Question 3 Team Selection A...

    Calculate P(rolling any 6's) .Calculate P(not rolling any 6s) Answer: Answer: Question 3 Team Selection A large nonprofit corporation wishes to form an executive leadership team from a group of 7 male executives and 9 female executives. The team will have 7 members. If the team members are selected randomly, find the probability of each team described below. a) Selecting 2 men and 5 women b) Selecting only Men c) Selecting 4 men and 3 womern Answer: Answer: Answer:

  • please answer question number 10 10. (Ch. 7) Sixty men out of 1,000 and three women...

    please answer question number 10 10. (Ch. 7) Sixty men out of 1,000 and three women out of 1,000 are color blind. A person is picked at random from a group containing 10 men and 10 women. (a) What is the probability that the person is color blind? (b) What is the probability that the person is a men if the chosen person is color blind? (c) Are gender and being color blind independent? 11. (Ch. 7) Suppose that two...

  • Week#5: Question 1: A team of 10 members, 3 are men and 7 are women. A...

    Week#5: Question 1: A team of 10 members, 3 are men and 7 are women. A committee of 4 people will be chosen randomly. What is the probability that the committee will have atleast two men on it? Question 2: In this experiment, you flip a fair coin four times. Make a tree diagram of this experiment. What is the probability that out of four coin tosses, you get exactly two heads in a row?

  • Question 23: Write a python code to sort the given set of numbers in ascending order....

    Question 23: Write a python code to sort the given set of numbers in ascending order. You must not use any built-in functions of python

  • Python 3 Problem: Write a single line of code that gets the second, third and forth...

    Python 3 Problem: Write a single line of code that gets the second, third and forth elements of a list L and assigns this list to the variable X For example, given the list L= [5,6,7,8,9] the code would cause X to equal [6,7,8]. That same code would, given the list L= ['one','two','three','four','five'] would cause X to equal [ 'two','three','four' ].

  • i really need help with my math 121 question # number 3 and 10 problems if...

    i really need help with my math 121 question # number 3 and 10 problems if possible here is the upload photos work in each question) out the questionmaire fa) How many different samples of five people are possible? b How many of them would eomsist of eactly two wom en and three mmen e How many of thes would con sist of exactly five women? ld) How many of them would consint of exactly Sour men? (e) How many...

  • Problem 1 A dance class consists of 22 students, of which 10 are women and 12...

    Problem 1 A dance class consists of 22 students, of which 10 are women and 12 are men. if 5 men and 5 women are to be chosen and then paired off, how many results are possible? Problem 2 A student is to answer 7 out of 10 questions in an examination. How many choices has she? How many if she must answer at least 3 of the first 5 questions? Problem 3 Prove that P(EnFc)-P(E)-P(EnF) Indicate the difference between...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT