Question
The formula for computing the number of ways of choosing r different things from a set of n things (the number of r-combinations) is the
The formula for computing the number of ways of choosing r different things from a set of n things (the number of r-combinations) is the following: C(n, r) = n! r! (n r)! In this formula, the factorial function is represented by an exclamation point (!) and defined as the product: n! = n (n 1) (n 2) ... 1 Discover a recursive version of the C(n, r) formula and write a recursive method that computes the values of the formula. The name of the method should be combinations . For this method write a program that would test it. The program should prompt the user to enter value(s) of parameter(s) and execute the method.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started