GATE Computer ScienceVery hardGATE CS (PYQ pattern)

What is the largest size of a subset S of {1, 2, …, 40} such that 7 ∈ S and no element of S divides another element of S?

  1. A. 20
  2. B. 18
  3. C. 17
  4. D. 19

Correct answer: B. 18

Split {1,…,40} into 20 chains m, 2m, 4m, … by odd part m. Since 7 ∈ S, 7's chain {7, 14, 28} is used by 7, and the chains {21} and {35} are useless (7 divides 21 and 35). So |S| ≤ 20 − 2 = 18, and S = {7} ∪ ({21,…,40} ∖ {21, 28, 35}) attains 18.

More Discrete Mathematics questions

Exams that ask this topic