GATE / CS ARCHIVE

SIMILAR QUESTIONS / DISCRETE MATHEMATICS

Shift lower bounds and count compositions using stars and bars

6 questions solved the same way, newest first. Back to Discrete Mathematics

2 marks · NAT
Report issue

Recurrences & Generating Functions

Question 26, GATE 2016: Find the coefficient of x^12 in (x^3+x^4+x^5+x^6+...)^3.
Tap to enlarge
Answer & solution

Official answer: 10.0 : 10.0

Our answer: 10

Factor the series as x³/(1−x). Its cube is x⁹(1−x)−3, so the coefficient of x¹² equals that of x³ in(1−x)−3, namely C(5, 2)=10. Equivalently distribute three excess units across three exponents, each originally at least 3.

Each of the three factors contributes one exponent at least 3. Write those exponents as 3+i,3+j,3+k with i,j,k≥0. To total 12, their excesses must satisfy i+j+k=3. Stars-and-bars counts C(3+3−1,3−1)=10 solutions. The three factors are distinguishable, so choices such as(3,4,5) and(4,3,5) contribute separately; counting unordered partitions would undercount the coefficient.

Original paper, page 12 · 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

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