• S
    SwaseekhGATE Preparation
General
  • Dashboard
  • Syllabus
  • Questions
  • Aptitude
  • Mock Tests
  • TCS NQT 2026
Account
  • Pricing
  • Contact
  1. GATE CS
  2. PYQs
  3. Discrete Mathematics

A function f : N^+ -> N^+, defined on the set of positive integers N^+, satisfies the following properties: f(n) = f(n/2) if n is even f(n) = f(3n+5) if n is odd Let R = {r | r = f(n) for some n in N^+} be the set of distinct values that f takes. The maximum possible size of R is ___________.

GATE 2016 · Discrete Mathematics · Functions · medium

Answer: 2

  1. Trace the cycle from n=1: n=1 (odd): f(1)=f(3*1+5)=f(8). n=8 (even): f(8)=f(4). n=4 (even): f(4)=f(2). n=2 (even): f(2)=f(1). Cycle: {1,2,4,8}. All share the same f-value, call it a.
  2. Trace the chain from n=3: n=3 (odd): f(3)=f(14). n=14 (even): f(14)=f(7). n=7 (odd): f(7)=f(26). n=26 (even): f(26)=f(13). n=13 (odd): f(13)=f(44). n=44->22->11->38->19->62->31->98->49->152->76->38... eventually merges. Checking: does chain from 3 ever reach {1,2,4,8}? Tracing shows it does not enter {1,2,4,8}, so these form a separate chain that can take a distinct value b.
  3. Conclude maximum |R|: There are exactly 2 independent component groups. Maximum |R| = 2.