Engineering
Engineering, 18.03.2020 02:58, jorgelive5870

The eventual goal of this assignment is to compute the total number of ways of forming a collection of committees from an academic department of n professors The first task is to write a function called committee to compute the number of ways of forming a single committee with r members from a collection of n people. This is the same as computing the number of ways of choosing r people out of n to sit at the first of two tables, and is therefore n! (r!*(n-r)!) by the reasoning given in the zyLab in section 6.18 on seating a large group at multiple tables. Make sure the function returns an integer, not a floating point number with a decimal point In addition to the fact that this must now be a function, there there are now some further enhancements First of all, there committee membership, so there are r n! need a chairperson If so, there are r choices for the a chaired committee. Another way of ways of of the possible the for selecting is the potential that the chairperson each forming such committee of might (r! (n-r)!) ways thinking how to form such a committee is to choose the chairperson first (there are n possible choices for that), and then for each possible chairperson n-r, this gives the same final formula n! (r-1)! (n-r)!) Your function definition must be of a form like def committee (people, members, chairperson where the parameter "people" is an integer giving the number of people to choose from (called "n" in the formulas above), the parameter "members" is an integer giving the number of members in the committee (called "r in the formulas above) and the parameter "chairperson" is a boolean variable which is True if a chairperson is required, and the formula in the third paragraph of this specification must be used, and False if the committee has no chairperson, and the formula in the second paragraph must be used. You must use exactly these names for the parameters, because your function will be be called by keyword arguments using these parameter names in some of the tests, instead of just relying on the parameter order. Write your function in a file named committee. py, and upload it to zyBooks for the first few tests, which will exercise as it as a module using programs already at zyBooks that import your committee function from it. The first test is with the following calls from committee import committee committee (10, 3, True committee (10, 3, alse committee (members 3, people 10, chairperson True) committee (chairperson False embers 3, people 10) committee (2, 2, True committee (3, 3, False and the six values returned should be 360, 120, 360, 120, 2, 1 respectively. Ifthey are not all correct, zyBooks will report True for the correct ones, and False for the incorrect ones. For now, you may submit an empty file for the file multiple committees. py which will be required for later steps

answer
Answers: 2

Other questions on the subject: Engineering

image
Engineering, 03.07.2019 14:10, bryneosburn
Line joining liquid phase with liquid and solid phase mixture is known as: a) liquidus b) solidus c) tie line d) none of the mentioned
Answers: 2
image
Engineering, 04.07.2019 12:10, Ryantimes2
On a average work day more than work place firs are reorted
Answers: 1
image
Engineering, 04.07.2019 18:10, ashleybaber4966
If a particle moves along a path such that r : (3 sin t) m and ? : 2t rad, where t is in seconds. what is the particle's acceleration in m/s in 4 seconds? a)- 16.43 b)- 16.29 c)- 15.21 d)- 13.79
Answers: 1
image
Engineering, 04.07.2019 18:10, skpdancer1605
Ariver flows from north to south at 8 km/h. a boat is to cross this river from west to east at a speed of 20 km/h (speed of the boat with respect to the earth/ground). at what angle (in degrees) must the boat be pointed upstream such that it will proceed directly across the river (hint: find the speed of the boat with respect to water/river)? a 288 b. 21.8 c. 326 d. 30.2
Answers: 3
Do you know the correct answer?
The eventual goal of this assignment is to compute the total number of ways of forming a collection...

Questions in other subjects: