subject
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

ansver
Answers: 2

Another question on Engineering

question
Engineering, 03.07.2019 15:10
Heat is added to a piston-cylinder device filled with 2 kg of air to raise its temperature 400 c from an initial temperature of t1 27 cand pressure of pi 1 mpa. the process is isobaric process. find a)-the final pressure p2 b)-the heat transfer to the air.
Answers: 1
question
Engineering, 04.07.2019 16:10
An electrical motor raises a 50kg load at a construct velencity .calculate the power of the motor, if it takes 40sec to raise the load through a height of 24m(take g =9.8n/g)
Answers: 2
question
Engineering, 04.07.2019 18:10
Afluid flows with a velocity field given by v=(x/t)i.. determine the local and convective accelerations when x=3 and t=1.
Answers: 2
question
Engineering, 04.07.2019 18:10
Thermal stresses are developed in a metal when its a) initial temperature is changed b) final temperature is changed c) density is changed d) thermal deformation is prevented e) expansion is prevented f) contraction is prevented
Answers: 2
You know the right answer?
The eventual goal of this assignment is to compute the total number of ways of forming a collection...
Questions
question
Mathematics, 02.12.2020 22:20
Questions on the website: 13722362