GATE / CS ARCHIVE

GATE CSE 1991 / QUESTION 1(xiii)

Triples with sum divisible by three

Discrete Mathematics · Combinatorics & Counting · Full GATE CSE 1991 paper

GATE 1991, Q1(xiii) 2 marks · Other
Report issue

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