Question: C++ 13 Write a recursive function to implement the recursive algorithm of Exercise 14 (detemmining the number of ways to select a set of things
C++
13 Write a recursive function to implement the recursive algorithm of Exercise 14 (detemmining the number of ways to select a set of things from a given set of things). Also, write a program to test your function 14 Consider the following problem: How many ways can a committee of fowr people be selected from a group of 10 people? There are many other similar problems, where 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, where rand n are nonnegative integers and Suppose C(n, )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 fommula: n! ,m where the exclamation point denotes the factorial function. Moreover, C(, o) = C(n,1. It is also known that C,r)C(1, 1+( 1, ) a. Write a recursive algorithm to determine C(, r. Identify the base case(s) and the general case(s). Using your recursive algorithm, determine C(5, 3) and C(9, 4) b
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
