Chapter 15: Problem 16
Consider the following problem: How many ways can a committee of four people be selected from a group of 10 people? There are many other similar problems in which you are asked to find the number of ways to select a set of items from a given set of items. The general problem can be stated as follows: Find the number of ways \(r\) different things can be chosen from a set of \(n\) items, in which \(r\) and \(n\) are nonnegative integers and \(r \leq n .\) Suppose \(C(n, r)\) denotes the number of ways \(r\) different things can be chosen from a set of \(n\) items. Then, \(C(n, r)\) is given by the following formula: \(C(n, r)=\frac{n !}{r !(n-r) !}\) in which the exclamation point denotes the factorial function. Moreover, \(C(n, 0)=C(n, n)=1 .\) It is also known that \(C(n, r)=C(n-1, r-1)+C(n-1, r)\) a. Write a recursive algorithm to determine \(C(n, r)\). Identify the base case \((\mathrm{s})\) and the general case \((\mathrm{s})\) b. Using your recursive algorithm, determine \(C(5,3)\) and \(C(9,4)\)
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.