Question
The number of 4 digit numbers having their digits in non-decreasing order (from left to right) constructed by using the digits belonging to the set is _____.
Official answer and solution
- Official answer
- 15
- From
- Official GATE 2015 answer key
Solution
Map non-decreasing digit sequences to combinations with repetition (multisets).
We need to form 4-digit numbers where each and .
Because the digits must be in non-decreasing order from left to right, once any multiset of 4 digits is chosen from , there is exactly one way to arrange them in non-decreasing order.
Thus, the number of such 4-digit numbers equals the number of ways to choose 4 elements from a set of 3 distinct elements with replacement (combinations with repetition).
Using the stars and bars formula with and :
Direct enumeration verifies the result:
- All digits identical: (3 numbers)
- Three of one digit, one of another: (6 numbers)
- Two of one digit, two of another: (3 numbers)
- Two of one digit, one each of other two: (3 numbers)
Total .
15
Using permutations instead of combinations, forgetting that the non-decreasing ordering constraint fixes the sequence uniquely.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2015 Computer Science and Information Technology (CS) Session 3
- Question
- 15 of 65, printed as CS Q.5
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.