The formula for a combination of n objects in groups of r is n!/(n-r)!. A...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The formula for a combination of n objects in groups of r is n!/(n-r)!. • A use for this formula would be to calculate how many ways five people can win a race where there is a 1st, 2nd and 3rd place. ● This is the same as saying how many ways can you order five objects in only three positions. Using the above formula we would set n=5 and r-3 and calculate 5!/(5-3)! which simplifies to 5*4*3 or 60 possible ways. Write a function factorial() which accepts an integer as input and returns the factorial of the input. Write a program which uses factorial() to calculate the number of combinations of n objects taken r at a time Sample output Enter the number of objects: 2 Enter the group size: 2 The number of combinations of 2 objects in groups of 2 is 1 Enter the number of objects: 3 Enter the group size: 2 The number of combinations of 5 objects in groups of 3 is 3 Enter the number of objects: 5 Enter the group size: 3 The number of combinations of 5 objects in groups of 3 is 60 The formula for a combination of n objects in groups of r is n!/(n-r)!. • A use for this formula would be to calculate how many ways five people can win a race where there is a 1st, 2nd and 3rd place. ● This is the same as saying how many ways can you order five objects in only three positions. Using the above formula we would set n=5 and r-3 and calculate 5!/(5-3)! which simplifies to 5*4*3 or 60 possible ways. Write a function factorial() which accepts an integer as input and returns the factorial of the input. Write a program which uses factorial() to calculate the number of combinations of n objects taken r at a time Sample output Enter the number of objects: 2 Enter the group size: 2 The number of combinations of 2 objects in groups of 2 is 1 Enter the number of objects: 3 Enter the group size: 2 The number of combinations of 5 objects in groups of 3 is 3 Enter the number of objects: 5 Enter the group size: 3 The number of combinations of 5 objects in groups of 3 is 60
Expert Answer:
Answer rating: 100% (QA)
Heres a Python program that calculates the number of combinations of n objects taken r at a time usi... View the full answer
Related Book For
Finite Mathematics and Its Applications
ISBN: 978-0134768632
12th edition
Authors: Larry J. Goldstein, David I. Schneider, Martha J. Siegel, Steven Hair
Posted Date:
Students also viewed these programming questions
-
The following data on power consumption in electric furnace heats (kW consumed per ton of melted product) resulted from a 24 factorial experiment with three replicates ("Studies on a 10-cwt Arc...
-
During the 2019 Masters Golf tournament Patrick Reed failed to repeat as champion. His scores relative to par in each round, on each hole are reported in the table. Develop and review appropriate...
-
1. A steam power plant with two boilers are connected to a steam turbine. Both boiler received a H20 at 5MPa and 190C. Both hot vapors will enter a mixing chamber before entering the turbine. Steam...
-
Warnerwoods Company uses a periodic inventory system. It entered into the following purchases and sales transactions for March. Date Activities Units Acquired at Cost Units Sold at Retail Mar. 1...
-
Find the relative maxima, relative minima, and points of inflection of the graph of y = x3 - 3x2 - 9x + 10
-
Wilmet College recently purchased new computing equipment for its library. The following information refers to the purchase and installation of this equipment: 1. The list price of the equipment was...
-
Create formulas for the following in an Excel worksheet: a. Add the values of 3 and 5 to one another. b. Subtract the value of 5 from 1 O and multiply the outcome by 7. c. Average the values 5, 6, 7,...
-
The chairperson of the department of management at Tech wants to forecast the number of students who will enroll in operations management next semester in order to determine how many sections to...
-
What is the relationship between organizational investment in employee development programs and the resultant levels of organizational commitment ?
-
Consider a scenario in which state colleges must actively recruit students. California Sci has $750,000 in assets available. Its Board of Regents has to consider several options. The board may decide...
-
Define a function called input_name () that has no parameters and returns the user's input name. It should prompt for and take keyboard input for the player's name. It should validate this input in a...
-
Ravisti Industrial Limited powers businesses worldwide by manufacturing and supplying industrial products. The major markets that the company deals with is from the USA. There is an IT department to...
-
Which type of stress occurs due to the day-to-day demands and pressures faced by every individual? Acute Chronic Episodic acute None of the above
-
A stressor leads the body to use its alarm reaction. True False
-
Stress is not contagious. True False
-
_________ focuses on slowing your mind down and clearing it of unimportant matter or things. Regular exercise Excessive alcohol Meditation None of the above
-
You need to purchase 1,000,000,000 JPY using USD to pay for an import transaction. Assume that you need to purchase the currency from a bank. Conduct research on the exchange rates quoted by...
-
President Lee Coone has asked you to continue planning for an integrated corporate NDAS network. Ultimately, this network will link all the offices with the Tampa head office and become the...
-
Determine whether the given matrix is an absorbing stochastic matrix. 1. 2. 3. 4. 1 0. 0.8 Lo .9 .3 .2 .2 Lo .3
-
Rework the furniture manufacturing problem, where everything is the same except that the profit per chair is changed to the given value. (See Table 1 for vertices.) 1. $150 2. $60
-
Determine the probability distribution for the given experiment. 1. Toss an unbiased coin twice, and count the number of heads. 2. A box contains seven slips of paper: one with a letter A printed on...
-
The equation of motion of a rocket, of mass \(m\), traveling vertically under a thrust \(F\) and air resistance or drag \(D\) is given by \[m \dot{u}=F-D-m g\] If \(m=1000 \mathrm{~kg}, F=50,000...
-
Use Rayleigh's method to solve Problem 2.26. Data From Problem 2.26:- A mass \(m\) is attached to a cord that is under a tension \(T\), as shown in Fig. 2.67. Assuming that \(T\) remains unchanged...
-
Find the natural frequency of the system shown in Fig. 2.54. Figure 2.54:- Rotating machine B Isolator (Helical springs) FIGURE 2.54 Isolated rotating machine. Foundation block
Study smarter with the SolutionInn App