GATE / CS ARCHIVE

SUBJECT COLLECTION

Discrete Mathematics · Combinatorics & Counting

34 questions, newest first

GATE CSE has asked 34 questions on Combinatorics & Counting (Discrete Mathematics) from 1991 to 2026, in 22 of the 46 papers; the most recent is in GATE CSE 2026 Set 1. In the last five years it carried 0.6 marks per 100-mark paper on average, against 0.7 since 2003. Since 2014 the questions have been 6 NAT and 2 MCQ. 5 groups of questions here are solved the same way; “One per method” keeps the newest of each.

Browse topics
1 mark · MCQ
Report issue

Counting binary parity matrices

Combinatorics & Counting

Question 12, GATE 2026: Count 4-by-4 matrices with entries 0 or 1 in which every row and every column has an even number of ones. The offered counts include 512, 1025, 1023 and 255.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Our answer: 512; option A

Givens and goal

Count 4-by-4 matrices with entries 0 or 1 in which every row and every column has an even number of ones. The offered counts include 512, 1025, 1023 and 255.

Approach

Choose an independent block freely and show that parity determines every remaining entry uniquely.

Step-by-step solution

1. Select the nine entries a_ij with 1≤i,j≤3 arbitrarily. Each is a binary choice, so there are 29 possibilities at this stage.
2. For each of the first three rows, choose ai4 as the sum of its first three entries modulo 2. If that sum is odd, append 1; if even, append 0. This forces even row parity.
3. For each of the first three columns, choose a_4j similarly from its first three entries. This forces even column parity.
4. Let p be the parity of the original 3-by-3 block. The parity of the three new bottom-row entries is p, and the parity of the three new last-column entries is also p: both count the same nine original entries. Setting a44=p therefore makes both the last row and last column even simultaneously.
5. Every initial block has exactly one completion, and different initial blocks yield different matrices. Thus the required count is 29=512, option A.

Why not 28? Although eight parity conditions are written, one is redundant: the total parity obtained by summing row parities equals that obtained by summing column parities. There are seven independent constraints on sixteen bits, leaving nine free bits.

Original paper, page 10 · Answer key

1 mark · NAT
Report issue

Counting ternary words with adjacent repeats

Combinatorics & Counting

Question 30, GATE 2025: Over alphabet {a,b,c}, count the length-five strings containing at least one adjacent equal pair aa, bb or cc.
Tap to enlarge
Answer & solution

Official answer: 195

Approach: Count the complement, because counting each repeated-pair position directly would count some strings multiple times.
There are three choices independently at each of five positions, so there are 35=243 strings in total. A string with no equal adjacent symbols has 3 choices for its first symbol. At each of its remaining four positions, the immediately previous symbol is forbidden and the other two are allowed. This gives 3×24=48 strings without adjacent repeats.
Every string either has an adjacent equal pair or has none, and these categories are disjoint. Subtracting the latter from the total gives 243−48=195.
For example aaaaa has four repeated-adjacency positions, but it must count as just one string. Complement counting handles such overlaps automatically. The condition is “at least one”, so strings with two, three or four equal adjacent pairs all remain included in 195.

Original paper, page 30 · Answer key

2 marks · MCQ
Report issue

Combinatorics & Counting

Question 48, GATE 2023: Let U={1,...,n}, n>1000, and disjoint A,B⊆U each have size k>0. Count permutations in which every A-element precedes every B-element or every B-element precedes every A-element; other elements may appear anywhere.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

Choose the 2k positions occupied by A∪B in binomial(n, 2k) ways. For A before B, the first k chosen positions receive A in k! orders and the last k receive B in k! orders. The remaining elements occupy other positions in(n−2k)! orders. The reversed block order contributes an equal, disjoint count because k>0. Total 2 binomial(n, 2k)(k!)²(n−2k)!, option D. Existence of the disjoint sets implicitly guarantees 2k≤n.

Teaching detail. A and B need not occupy consecutive positions in the full permutation: unrelated U-elements may be interspersed. After choosing their 2k positions, requiring A before B completely determines which k positions are reserved for each set but leaves internal order free. As an alternative check, all binomial(2k,k) patterns of A/B labels among those positions are equally likely, and exactly two are favorable. Multiplying n! by 2/binomial(2k,k) gives the same expression. When k=1 every permutation qualifies, and the formula correctly reduces to n!.

Original paper, page 51 · Answer key

1 mark · NAT
Report issue

Combinatorics & Counting

Question 32, GATE 2022: How many distributions of six identical balls into three identical bins exist, allowing empty bins?
Tap to enlarge
Answer & solution

Official answer: 7

Because both balls and bins are identical, count unordered partitions of 6 into at most three parts. In nonincreasing order they are (6, 0, 0),(5, 1, 0),(4, 2, 0),(4, 1, 1),(3, 3, 0),(3, 2, 1),(2, 2, 2). Therefore 7 distributions, allowing empty bins as stated by the ordinary distribution model.

Sort occupancies a≥b≥c≥0 so each distribution is counted once. For c=0, b ranges 0…3 giving four cases; for c=1, b=1 or 2 gives two; for c=2, only a=b=c=2 gives one. Hence 4+2+1=7. Stars-and-bars would count labeled bins and overcount here.

Original paper, page 22 · Answer key

1 mark · NAT
Report issue

Combinatorics & Counting

Question 19, GATE 2021: Assign six distinct jobs of distinct difficulty to three distinct computers of distinct speeds. The fastest must get the toughest job, the slowest the easiest, and each computer must receive at least one job. How many assignments are possible?
Tap to enlarge
Answer & solution

Official answer: 65

Fix the toughest job on the fastest computer and the easiest on the slowest. Each of the four remaining distinct jobs has 3 destination choices, giving 3⁴. Subtract assignments that leave the middle-speed computer empty: all four then go to the other two computers, giving 2⁴. Thus3⁴−2⁴=81−16=65.

The extreme jobs are fixed, leaving four labeled jobs, not four indistinguishable units. The fastest and slowest computers are already nonempty, so only the middle computer requires an inclusion-exclusion correction. For a second count, assign exactly k of the four remaining jobs to the middle computer: Σ_(k=1)4 binom(4,k)24−k=32+24+8+1=65.

Original paper, page 20 · Answer key

2 marks · NAT
Report issue

Combinatorics & Counting

Question 50, GATE 2021: S has ten elements. Count ordered pairs (A,B) with A⊆B⊆S. Equality is permitted.
Tap to enlarge
Answer & solution

Official answer: 59049

For each of the 10 elements choose exactly one of three states: outside B, in B but not A, or in A (and therefore in B). Choices are independent, giving 310=59049 ordered pairs. The source symbol is subset-or-equal, so A=B is included.

A second derivation sums by |B|: for each k choose B in binomial(10,k) ways, then any of its 2k subsets A. Thus Σ binomial(10,k)2k=(1+2)10. Counting 410 would allow the forbidden state “in A but outside B”; subtracting equality would answer the strict-subset variant rather than this question.

Original paper, page 86 · Answer key

2 marks · NAT
Report issue

Combinatorics & Counting

Question 42, GATE 2020: How many distinct permutations of LILAC place no character in any of its original positions, treating the two Ls as indistinguishable?
Tap to enlarge
Answer & solution

Official answer: 12

Worked explanation

Number positions 1…5 with original symbols L,I,L,A,C. Neither L may occupy 1 or 3, so choose their two positions from {2,4,5} in C(3,2)=3 ways. After that, remaining positions are 1,3 and one r in {2,4,5}. At positions 1 and 3 any of I,A,C is allowed because the original symbol there was L. The only forbidden placement is the symbol originally at r returning to r. There are 3!=6 arrangements of I,A,C, and fixing that forbidden symbol leaves 2!=2 bad arrangements. Therefore each L choice yields 4 valid arrangements, total 12. Treating the Ls as labeled would double-count; using !5 blindly also misses their shared exclusion from both original L slots.

Derivation and answer

The two indistinguishable Ls must occupy two of positions 2, 4, 5, giving three choices. The one unoccupied position among those three is the original location of one of I, A, C. Place I, A, C in that position and positions 1, 3: of the 6 permutations, exactly 2 put that particular character back in its original position. Thus each L placement permits 4 arrangements, totaling 3*4=12. Direct enumeration of the 60 distinct permutations also yields 12.

Original paper, page 13 · Answer key

1 mark · NAT
Report issue

Combinatorics & Counting

Question 25, GATE 2015: How many four-digit numbers can be made using only digits {1,2,3}, with digits in nondecreasing order from left to right? Repetition is permitted.
Tap to enlarge
Answer & solution

Official answer: 15

1. For example, counts (2,1,1) give exactly 1123, not its other permutations, because sorting is required. Distributing four identical positions among three digit counts is the weak-composition count (4+3−1 choose 3−1).

2. A nondecreasing four-digit sequence is determined by counts c1, c2, c3≥0 summing to 4. Stars and bars gives C(6, 2)=15, with one sorted sequence for every count triple.

Original paper, page 61 · Answer key

2 marks · MCQ
Report issue

Length-five strings with no consecutive zeros

Combinatorics & Counting

Question 79, GATE 2008: Let xₙ count binary strings of length n containing no consecutive zeros. What is x₅?

(A) 5
(B) 7
(C) 8
(D) 16
Question 79, GATE 2008: Let xₙ count binary strings of length n containing no consecutive zeros. What is x₅?

(A) 5
(B) 7
(C) 8
(D) 16
Question 79, GATE 2008: Let xₙ count binary strings of length n containing no consecutive zeros. What is x₅?

(A) 5
(B) 7
(C) 8
(D) 16
Tap to enlarge
Your answer
Answer & solution

Answer: 13; no listed option (no official key was published)

1. The initial counts are x0=1 for the empty string and x1=2 for 0 and 1. The recurrence from Q78 gives x2=3, x3=5, x4=8 and x5=13.
2. Independently, count by the number of nonadjacent zeros: binomial(6,0)+binomial(5,1)+binomial(4,2)+binomial(3,3)=1+5+6+1=13. The scan lists 5,7,8,16; none is correct.
3. Do not use Fibonacci seeds 1,1, which count the wrong objects.

Original paper, page 17

2 marks · MCQ
Report issue

Monotone lattice paths to ten ten

Combinatorics & Counting

Question 84, GATE 2007: A robot starts at (0,0). Each move increases either its x-coordinate or y-coordinate by one, so from (i,j) it can move to (i+1,j) or (i,j+1). How many paths reach (10,10)? C(n,k) denotes a binomial coefficient.
Options:
(A) C(20,10)
(B) 2^20
(C) 2^10
(D) None of these
Question 84, GATE 2007: A robot starts at (0,0). Each move increases either its x-coordinate or y-coordinate by one, so from (i,j) it can move to (i+1,j) or (i,j+1). How many paths reach (10,10)? C(n,k) denotes a binomial coefficient.
Options:
(A) C(20,10)
(B) 2^20
(C) 2^10
(D) None of these
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. Every valid path contains exactly ten right moves and ten up moves. Specify which ten of the twenty move positions are right moves; the rest are then fixed.

2. Derivation and interpretation. A path from (0,0) to (10,10) requires exactly ten right and ten up moves. Choose the positions of the ten right moves among the twenty total moves. The count is C(20,10)=184756, option A.

Original paper, page 21

2 marks · MCQ
Report issue

Monotone paths avoiding a forbidden edge

Combinatorics & Counting

Question 85, GATE 2007: A robot moves one unit right or up at each step, starting at (0,0) and ending at (10,10). It may not traverse the edge (4,4)→(5,4). How many paths remain? C(n,k) denotes a binomial coefficient.
Options:
(A) 2^9
(B) 2^19
(C) C(8,4)×C(11,5)
(D) C(20,10)−C(8,4)×C(11,5)
Question 85, GATE 2007: A robot moves one unit right or up at each step, starting at (0,0) and ending at (10,10). It may not traverse the edge (4,4)→(5,4). How many paths remain? C(n,k) denotes a binomial coefficient.
Options:
(A) 2^9
(B) 2^19
(C) C(8,4)×C(11,5)
(D) C(20,10)−C(8,4)×C(11,5)
Question 85, GATE 2007: A robot moves one unit right or up at each step, starting at (0,0) and ending at (10,10). It may not traverse the edge (4,4)→(5,4). How many paths remain? C(n,k) denotes a binomial coefficient.
Options:
(A) 2^9
(B) 2^19
(C) C(8,4)×C(11,5)
(D) C(20,10)−C(8,4)×C(11,5)
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. Approach. Count forbidden paths by splitting at the forbidden edge. Choose a path to (4,4), traverse the single forbidden step, then choose a path from (5,4) to the destination. Subtract this product from all paths.

2. Derivation and interpretation. Subtract paths using the forbidden edge (4,4)->(5,4) from all C(20,10) paths. A path using that edge has C(8,4) choices to reach (4,4), then the fixed forbidden step, then C(11,5) choices for five right and six up moves from (5,4) to (10,10). Thus the permitted count is C(20,10)-C(8,4)*C(11,5)=184756-70*462=152416, option D.

Original paper, page 21

2 marks · MCQ
Report issue

Equal minima under a random permutation

Combinatorics & Counting

Question 24, GATE 2006: Let N={1,…,n} and A,B⊆N. How many permutations π of N satisfy min(π(A))=min(π(B)), where π(S)={π(s):s∈S}? The minimum requires nonempty A and B, although the reproduction says arbitrary subsets.
Options:
(A) (n−|A∪B|)|A||B|
(B) (|A|²+|B|²)n²
(C) n!·|A∩B|/|A∪B|
(D) |A∩B|²/C(n,|A∪B|)
Tap to enlarge
Your answer
Answer & solution

Answer: C for nonempty A and B (no official key was published)

1. The minima of π(A) and π(B) agree exactly when the smallest image among A∪B belongs to A∩B. By symmetry every member of A∪B is equally likely to have that image, so the fraction is |A∩B|/|A∪B|.

2. Multiply by n! to get C. The statement allows arbitrary subsets, but min of an empty set is undefined; nonempty A,B are required for this calculation.

3. If they are disjoint and nonempty the answer is 0.

4. Teaching check: Only the relative order of images of A∪B matters. If its earliest image comes from an element outside the intersection, one subset has a strictly earlier minimum than the other. Uniform permutations make each union element equally likely to be earliest, giving the intersection-to-union ratio.

Original paper, page 3

2 marks · MCQ
Report issue

Pigeonhole principle on residue pairs

Combinatorics & Counting

Question 44, GATE 2005: Minimum ordered pairs of nonnegative “numbers” guaranteeing two(a, b),(c, d) with a≡c mod 3 and b≡d mod 5? A4; B6; C16; D24. Explain necessary integer-domain convention.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Under the intended nonnegative-INTEGER interpretation, (a mod 3, b mod 5) has 3×5=15 classes. Sixteen pairs force a repeated class, while the fifteen representatives (i, j), 0≤i<3 and 0≤j<5, do not. Thus 16 (C). The paper say numbers rather than integers; arbitrary real numbers do not give fifteen residue classes, so the integer domain assumption is necessary.

Integer residues split the first coordinate into 3 classes and the second into 5, yielding 15 joint classes. Choosing 16 pairs forces a repeated class by pigeonhole; taking one representative from each class shows 15 is insufficient. This establishes exact minimality, not merely a sufficient bound. For arbitrary real numbers, residues are not limited to those 15 possibilities, so the source’s loose word “numbers” must be interpreted as integers.

Original paper, page 5

1 mark · MCQ
Report issue

Counting symmetric binary matrices

Combinatorics & Counting

Question 26, GATE 2004: How many n×n symmetric matrices have every entry either 0 or 1? Option C follows GFG; GateForum has malformed parentheses around its exponent.
Options:
(A) 2^n
(B) 2^(n²)
(C) 2^((n²+n)/2)
(D) 2^((n²−n)/2)
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Choose the n diagonal bits and the n(n−1)/2 bits above the diagonal freely; symmetry then determines the lower triangle. There are n(n+1)/2 independent bits and therefore 2^((n²+n)/2) matrices, C.

2. This is a finite counting problem.

3. Teaching check: For n=2, the matrix is [[a,b],[b,c]], with three independent bits and eight possibilities. This small case distinguishes 2^((n²+n)/2) from formulas that omit diagonal freedom or count the mirrored off-diagonal bits twice.

Original paper, page 4

2 marks · MCQ
Report issue

Count unordered colour pairs with repetition

Combinatorics & Counting

Question 75, GATE 2004: Each of 26 English letters is printed twice in a colouring book. Colour each of the 52 prints using k colours so the unordered pair of colours for each letter differs from that for every other letter. Both copies of a letter may have the same colour. What is the minimum k?
Options:
(A) 9
(B) 8
(C) 7
(D) 6
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. A letter receives an unordered pair of colours, allowing the same colour twice. There are binomial(k,2)+k=k(k+1)/2 possible pairs.

2. Distinguishing 26 letters requires k(k+1)/2≥26. Six colours give only 21 pairs, while seven give 28, so the minimum is 7, option C.

3. Teaching check: Count colour pairs with repetition and without order. Distinct-colour pairs contribute k(k−1)/2 and equal-colour pairs contribute k. Ordered pairs would give k² and underestimate the required number of colours for the problem’s pair interpretation.

Original paper, page 11

1 mark · MCQ
Report issue

Splitting a sorted sequence before merging

Combinatorics & Counting

Question 4, GATE 2003: A contains eight distinct integers sorted in increasing order. How many ordered pairs of increasing sequences (B,C), with five elements in B and three in C, merge to A? A. 2; B. 30; C. 56; D. 256.
Question 4, GATE 2003: A contains eight distinct integers sorted in increasing order. How many ordered pairs of increasing sequences (B,C), with five elements in B and three in C, merge to A? A. 2; B. 30; C. 56; D. 256.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. There is no additional permutation factor: once B’s five members are selected, sorting fixes their order, and the remaining three fix C. Compute 8!/(5!3!)=(8·7·6)/(3·2·1)=56. Choosing C first gives the same count binomial(8,3).

2. Choose which 5 of the 8 distinct elements belong to B; the other 3 belong to C. Their increasing orders are then forced, and merging reconstructs A. Hence binomial(8,5)=56 pairs, C.

Original paper, page 1

1 mark · MCQ
Report issue

Attendance with a spouse constraint

Combinatorics & Counting

Question 5, GATE 2003: There are n invited couples. A husband can attend only with his wife, but a wife can attend without her husband. How many different gatherings are possible? A. binomial(2n,n)·2^n; B. 3^n; C. (2n)!/2^n; D. binomial(2n,n).
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. The unconstrained four possibilities for a couple are neither, husband only, wife only, and both. Delete just husband only, leaving three. Multiplication across n distinguishable couples gives 3·3·…·3; the empty gathering is one of these assignments.

2. For each couple the allowed attendance choices are neither person, wife only, or both. These three independent choices give 3n gatherings, B, including the empty gathering. Husband-only attendance is excluded.

Original paper, page 1

2 marks · MCQ
Report issue

Balls with a lower bound per bag

Combinatorics & Counting

Question 34, GATE 2003: Distribute m identical balls among n distinct bags, each containing at least k balls, where k≥1 and m≥kn. How many distributions exist? A. binomial(m−k,n−1); B. binomial(m−kn+n−1,n−1); C. binomial(m−1,n−k); D. binomial(m−kn+n+k−2,n−k). The kn terms in the blurred GFG options are read using the cleaner alternate reproduction.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Write the bag counts as xᵢ=k+yᵢ. Then every yᵢ≥0 and their sum is M=m−kn. Encoding M identical stars and n−1 separators gives M+n−1 positions, of which n−1 are separators. If m=kn the formula becomes binomial(n−1,n−1)=1, as required.

2. Put k balls into each of the n distinct bags first. There remain m−kn identical balls to distribute freely. Stars and bars gives binomial(m−kn+n−1,n−1), B, for m≥kn.

Original paper, page 4

Descriptive
Report issue

Ordered sums of two positive integers

Combinatorics & Counting

Question 13(a), GATE 2002: Original13(a): For integer n≥2, count ordered expressions of n as a sum of two positive integers, not necessarily distinct. For n = 3, 1+2 and 2+1 are different expressions. Give only the answer without explanation.
Question 13(a), GATE 2002: Original13(a): For integer n≥2, count ordered expressions of n as a sum of two positive integers, not necessarily distinct. For n = 3, 1+2 and 2+1 are different expressions. Give only the answer without explanation.
Question 13(a), GATE 2002: Original13(a): For integer n≥2, count ordered expressions of n as a sum of two positive integers, not necessarily distinct. For n = 3, 1+2 and 2+1 are different expressions. Give only the answer without explanation.
Tap to enlarge
Answer & solution

Answer: n−1 (no official key was published)

There are n−1 ordered pairs: choose the first summand from 1 through n−1, after which the second is n minus that choice. Equivalently, choose one of the n−1 gaps between n unit objects as a separator. The example counts 1+2 and 2+1 separately, so these are ordered compositions, not unordered partitions.

Original paper, page 8

Descriptive
Report issue

Ordered sums of three positive integers

Combinatorics & Counting

Question 13(b), GATE 2002: Original13(b): For integer n≥3, count ordered expressions of n as a sum of three positive integers, allowing repeats. For n=4 the three expressions are 1+1+2, 1+2+1, 2+1+1. Give only the answer without explanation.
Question 13(b), GATE 2002: Original13(b): For integer n≥3, count ordered expressions of n as a sum of three positive integers, allowing repeats. For n=4 the three expressions are 1+1+2, 1+2+1, 2+1+1. Give only the answer without explanation.
Tap to enlarge
Answer & solution

Answer: C(n−1,2) = (n−1)(n−2)/2 (no official key was published)

Place two separators in distinct gaps among n unit objects. There are n−1 gaps, and choosing two gives C(n−1,2)=(n−1)(n−2)/2 ordered positive triples. For n=4 these are (1,1,2), (1,2,1), and (2,1,1).

Original paper, page 8

Descriptive
Report issue

Ordered positive compositions into k parts

Combinatorics & Counting

Question 13(c), GATE 2002: Original13(c): For n≥k≥1, count ordered expressions of n as a sum of k positive integers, allowing repeated summands. Give only the answer without explanation.
Question 13(c), GATE 2002: Original13(c): For n≥k≥1, count ordered expressions of n as a sum of k positive integers, allowing repeated summands. Give only the answer without explanation.
Tap to enlarge
Answer & solution

Answer: C(n−1,k−1) (no official key was published)

For n≥k≥1, separate a row of n unit objects into k nonempty consecutive groups by choosing k−1 of its n−1 internal gaps. Group lengths give an ordered k-tuple of positive integers summing to n, and every such tuple yields exactly one separator choice. Therefore the count is C(n−1,k−1). This also gives one composition when n=k or k=1.

Original paper, page 8

2 marks · MCQ
Report issue

Four-digit even numbers with distinct digits

Combinatorics & Counting

Question 2.1, GATE 2001: Count four-digit even decimal numbers whose four digits are distinct. Options are 2240,2296,2620,4536.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Step 1: Separate the final digit 0 from the other even digits. If the last digit is 0, the first digit has 9 choices and the middle positions have 8 and 7, giving 9·8·7=504.

Step 2: If the last digit is one of 2,4,6,8, there are 4 choices. The first digit can be any nonzero digit except that last digit:8 choices. The middle positions then have 8 and 7 choices, including zero if unused. This gives 4·8·8·7=1792.

Total 504+1792=2296, B. Counting all even last digits uniformly would mishandle leading zero.

Original paper, page 4

1 mark · MCQ
Report issue

Guaranteeing three cards of one suit

Combinatorics & Counting

Question 1.1, GATE 2000: How many cards must be dealt from any shuffled standard 52-card deck to guarantee three of one suit? Options: 3,8,9,12.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Step 1: To avoid three of a suit, take at most two from each of the four suits. This allows 4·2=8 cards, so eight do not guarantee the required triple.

Step 2: A ninth card must belong to one of those four suits and raises its count to at least three. This is the pigeonhole principle.

Conclusion: Nine is sufficient and the eight-card construction proves minimality, so C.

Original paper, page 1

1 mark · MCQ
Report issue

Sum of a difference array

Combinatorics & Counting

Question 1.2, GATE 2000: For 1≤i,j≤n, define v[i,j]=i−j. Find the sum of all n² entries. Options include 0,n−1,n²−3n+2,n²(n+1)/2.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Step 1: Pair entry(i,j) with entry(j,i). Their values i−j and j−i add to zero; diagonal entries are themselves zero.

Step 2: Equivalently, the double sum is n·sum_i i−n·sum_j j, whose terms cancel exactly.

Thus the total is zero for every positive n, option A. Counting only the positive triangular half would omit the equal negative half.

Original paper, page 1

Descriptive
Report issue

Size-four multisets with a double

Combinatorics & Counting

Question 5(a), GATE 2000: A multiset is unordered; repetitions are allowed, and its size counts repetitions. Elements are chosen from n distinct types.

Task: Count size-four multisets in which at least one element occurs exactly twice.
Question 5(a), GATE 2000: A multiset is unordered; repetitions are allowed, and its size counts repetitions. Elements are chosen from n distinct types.

Task: Count size-four multisets in which at least one element occurs exactly twice.
Tap to enlarge
Shared context

A multiset is unordered; repetitions are allowed, and its size counts repetitions. Elements are chosen from n distinct types.

Answer & solution

Answer: n·C(n−1,2)+C(n,2)=n(n−1)²/2. (no official key was published)

1. The only multiplicity partitions of 4 containing a part equal to 2 are 2+1+1 and 2+2. The patterns 4, 3+1 and 1+1+1+1 do not qualify.

2. For 2+1+1 choose the repeated type in n ways and the two distinct singleton types in C(n−1,2) ways. The singleton order is irrelevant.

3. For 2+2 choose the two doubled types as an unordered pair: C(n,2). Do not designate one as the repeated type, which would double-count this case.

4. Add the disjoint cases to obtain n(n−1)(n−2)/2+n(n−1)/2=n(n−1)²/2. This is zero for n=1 and equals one for n=2, as direct enumeration confirms.

Original paper, page 7

1 mark · MCQ
Report issue

Separated ones in binary strings

Combinatorics & Counting

Question 1.3, GATE 1999: Count strings containing n zeros and k ones with no adjacent ones. The listed binomial choice A is C(n+1,k).
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

First place the n zeros in their fixed order. They create n+1 gaps: before the first zero, between consecutive zeros, and after the last zero. A valid string uses at most one 1 in each gap, otherwise two ones would be adjacent. Choose exactly k of those gaps, giving C(n+1,k). Conversely every such choice creates one valid string, so this is a bijection rather than merely an upper bound. When k>n+1 the count is zero.

Original paper, page 1

2 marks · MSQ
Report issue

Dividing indistinguishable flowers

Combinatorics & Counting

Question 2.2, GATE 1999: Two distinct girls divide 10 roses,15 sunflowers and 14 daffodils. Count allocations among 1638,2100,2640,none.
Tap to enlarge
Select all that apply
Answer & solution

Answer: C (no official key was published)

The first girl may receive any number of roses from 0 through 10, giving 11 choices; the second receives the remainder. Independently there are 16 sunflower choices and 15 daffodil choices. By the product rule there are 11·16·15=2640 allocations, C. Flowers of the same type are treated as indistinguishable, and empty shares of a type are allowed. Counting subsets of individually labelled flowers would solve a different problem. Under the latter wording the count is 11·16·16=2816, giving D instead. The the paper-derived C is not claimed as an official answer.

Original paper, page 3

1 mark · MCQ
Report issue

Counting all functions

Combinatorics & Counting

Question 1.8, GATE 1998: Count functions from an m-element domain to an n-element codomain among m+n, m^n, n^m, mn.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Each of the m domain elements independently chooses one of n images. Multiplying n choices m times yields nm. Different domain elements may share an image because injectivity is not required. Thus C, not mn, which would count functions in the reverse direction. With an empty domain there is one empty function; the usual counting formula is interpreted accordingly.

Original paper, page 1

2 marks · MCQ
Report issue

Three-language inclusion-exclusion

Combinatorics & Counting

Question 2.4, GATE 1998: In a room of 28, English 18, Hindi 15, Kannada 22; overlaps English–Hindi=9, Hindi–Kannada=11, Kannada–English=13. How many speak all three? Options 9, 8, 7, 6.
Tap to enlarge
Your answer
Answer & solution

Answer: D: 6 if everyone speaks at least one; literal data allow 5 or 6 (no official key was published)

Let t be the triple overlap. Inclusion–exclusion gives union size 18+15+22−9−11−13+t=22+t. If all 28 people belong to at least one language group, t=6, option D. But that premise is not explicit. Nonnegative Hindi-only count gives 15−9−11+t=t−5≥0, while union≤28 gives t≤6. Thus integer t may be 5 or 6; t=5 leaves one person speaking none and has nonnegative counts in all seven regions. The textbook result 6 therefore relies on coverage, not solely on the stated headcount.

Original paper, page 4

Descriptive
Report issue

Count positive divisors

Combinatorics & Counting

Question 7(a), GATE 1995: Determine the number of divisors of 600.
Tap to enlarge
Answer & solution

Answer: 24 positive divisors; 48 if signed integer divisors are requested. (no official key was published)

Prime-factorize 600=6×100=2³×3¹×5². Every positive divisor has a unique form 2ᵃ3ᵇ5ᶜ where a∈{0,1,2,3}, b∈{0,1} and c∈{0,1,2}. There are four choices for a, two for b and three for c. The choices are independent, so the multiplication principle gives 4×2×3=24.

The factorization also explains why adding these counts would be wrong: one divisor is determined by choosing all three exponents together. Both 1 (all exponents zero) and 600 (all exponents maximal) are included. In standard elementary-number-theory exam usage “number of divisors” counts positive divisors. If the question instead meant all nonzero integer divisors, every positive divisor has a distinct negative partner, giving 48.

Original paper, page 6

5 marks · Descriptive
Report issue

Food-preference counts and missing union information

Combinatorics & Counting

Question 17, GATE 1993: Among 21 persons, 9 eat vegetables, 10 fish, 7 eggs, and 5 all three. How many eat at least two of the three? The statement does not say that every person eats one of them.
Tap to enlarge
Answer & solution

Answer: Underdetermined: at least-two may be any integer 5–10. Requiring all 21 to eat one dish is inconsistent. (no official key was published)

Let x1,x2,x3 count persons eating exactly one, exactly two, and exactly three dishes. Here x3=5. Counting memberships across the three sets yields x1+2x2+3*5=9+10+7=26, hence x1+2x2=11. Let x0 count persons eating none. The group total gives x0+x1+x2+5=21. Eliminating x1 shows x0=5+x2. Thus the requested count x2+x3=x2+5 is not fixed by the given data; equivalently it equals x0. The union size is 16−x2.

The individual set totals do impose bounds. After removing the five triple-eaters, the residual vegetable, fish, and egg memberships are respectively 4,5,2. If a,b,c count exactly vegetable/fish, vegetable/egg, fish/egg, then a+b<=4, a+c<=5, b+c<=2. Their sum x2 is nonnegative and 2x2<=4+5+2=11, so x2<=5. Both extremes are feasible. For x2=0, take only-vegetable=4, only-fish=5, only-eggs=2, all-three=5, none=5: all totals match and at least-two=5. For x2=5, take exactly-VF=3, exactly-VE=1, exactly-FE=1, only-fish=1, all-three=5, none=10, with other single-only counts zero. This again matches all totals, but at least-two=10. Intermediate x2 values are feasible too (for x2<=4 use only VF pairs, and use the preceding construction for 5). Therefore the possible answer is any integer from 5 through 10, not a unique number.

Do not assume all 21 eat at least one. With union=21, inclusion-exclusion gives sum of pairwise intersection sizes=26+5−21=10. But the five triple-eaters alone contribute 15 to that sum, a contradiction. Equivalently x0=0 would require x2=−5. Consequently adding that common implicit assumption does not rescue a unique answer; it makes the data inconsistent. No official correction or key is verified.

Original paper, page 12

2 marks · Other
Report issue

Triples with sum divisible by three

Combinatorics & Counting

Question 1(xiii), GATE 1991: Count ordered integer triples (i, j, k) with 1≤i, j, k≤300 and i+j+k divisible by 3.
Question 1(xiii), GATE 1991: Count ordered integer triples (i, j, k) with 1≤i, j, k≤300 and i+j+k divisible by 3.
Tap to enlarge
Answer & solution

Answer: 9, 000, 000 (no official key was published)

The interval 1, …, 300 contains exactly 100 representatives of each residue modulo 3. For each ordered pair (i, j), the required residue of k is uniquely −i−j modulo 3, and precisely 100 values of k realize it. There are 300² ordered pairs, so the total is 300²×100=9, 000, 000. Repetitions and different orderings are permitted because these are triples, not three-element subsets. Equivalently, exactly one third of the 300³ triples have residue sum zero. Both bounds are inclusive.

Original paper, page 2

2 marks · Other
Report issue

Matching combinatorial counts

Combinatorics & Counting

Question 2(iv), GATE 1991: Match A binary trees with n nodes; B length 2n binary strings with n zeros; C even permutations of n objects; D length 6n palindromes with exactly 2n zeros. Choices P=n!/2, Q=C(3n, n), R=C(2n, n), S=C(2n, n)/(n+1).
Question 2(iv), GATE 1991: Match A binary trees with n nodes; B length 2n binary strings with n zeros; C even permutations of n objects; D length 6n palindromes with exactly 2n zeros. Choices P=n!/2, Q=C(3n, n), R=C(2n, n), S=C(2n, n)/(n+1).
Tap to enlarge
Answer & solution

Answer: A–S; B–R; C–P; D–Q under ordered binary-tree and n≥2 conventions (no official key was published)

Ordered binary trees with n nodes satisfy the Catalan recurrence from choosing left and right subtree sizes; its solution is C(2n, n)/(n+1). For B, choose the n zero positions among 2n positions. For C, composing with a fixed transposition pairs even and odd permutations, so each class has n!/2 members when n≥2. An even-length palindrome is determined by its first half. Exactly 2n zeros in length 6n requires n zeros among the first 3n positions, giving C(3n, n). Unordered-tree counting and n=0 or 1 permutation cases require separate conventions.

Original paper, page 2

5 marks · Descriptive
Report issue

Balanced binary prefixes and Catalan numbers

Combinatorics & Counting

Question 16(a), GATE 1991: How many length-2n binary strings have n zeros and n ones and every prefix contains at least as many zeros as ones?
Tap to enlarge
Answer & solution

Answer: C_n = binom(2n,n) − binom(2n,n−1) = binom(2n,n)/(n+1). (no official key was published)

Interpret a zero as a +1 step and a one as a −1 step. A balanced string gives a walk from height 0 to height 0 in 2n steps. The prefix restriction asks that the height never become negative. There are binom(2n,n) balanced strings before imposing the restriction.

Count the bad strings by reflection. A bad walk has a first step reaching height −1. Swap zeros and ones in the segment from the beginning through that first visit. Originally that segment has one more one than zero; after the swap it has one more zero than one. Consequently the transformed entire string has n+1 zeros and n−1 ones and ends at height +2.

Conversely, any string with n+1 zeros and n−1 ones must first reach height +1. Reflect its prefix through that first visit. The resulting balanced walk first reaches −1 there, so it is bad. These two operations invert each other, establishing a bijection. The number of bad strings is therefore binom(2n,n−1), choosing the positions of its n−1 ones after reflection.

Subtracting gives binom(2n,n)−binom(2n,n−1). Since binom(2n,n−1)=n·binom(2n,n)/(n+1), the result is Cn=binom(2n,n)/(n+1), the nth Catalan number. For n=0, the empty string contributes one; for n=2, the valid strings are 0011 and 0101, agreeing with C2=2.

Original paper, page 8