The C program to find permutation and combination solves 4 different types of problems. The permutation problems are arrangement problems and the combination problems are selection problems.
You will more details about each type of problem in the problem definition section.
The list of problems is given below
- R-permutation of a set of N distinct objects where 1 < R < N.
- R-permutation of a set of N distinct objects with repetition allowed.
- Permutation of N objects where N is not distinct and contains indistinguishable objects of different types – n1 types, n2 types, … , nk types.
- R-combination of a set of N distinct objects where 1 < R < N.
- R-combination of a set of N distinct objects with repetition allowed.
You must be familiar with following concepts before learning from this examples.
Problem Definition: R-permutation of N distinct objects
A permutation is the number of arrangement of N distinct objects taken R at a time. Suppose we have N people sitting in a row of chairs, how many ways to change the sitting arrangement taken R people at a time.
For example, suppose we have 3 men sitting on 3 chairs; let’s call them A, B and C. The number of arrangement of 2 men out of 3 i.e., N =3, R = 2 is given below.
AB AC BC BA CA CB
In the above example, the order of the arrangement matters and each of these different orders is counted