Skip to content
Official PYQ · 2016

GATE CS 2016 Set 1 Q28 — Sets, Relations and Functions

Explain with AI
A function f:N+→N+f: \Bbb{N^+} \rightarrow \Bbb{N^+} , defined on the set of positive integers N+\Bbb{N^+}, satisfies the following properties:

                    f(n)=f(n/2)f(n)=f(n/2)   if nn is even

                    f(n)=f(n+5)f(n)=f(n+5)  if nn is odd

Let R={i∣∃j:f(j)=i}R=\{ i \mid \exists{j} : f(j)=i \} be the set of distinct values that ff takes. The maximum possible size of RR is ___________.
View worked solution

Answer: 2

To find the maximum possible size of the range RR, we analyze the given properties of the function f:N+→N+f: \mathbb{N}^+ \rightarrow \mathbb{N}^+:

  1. Even rule: f(n)=f(n/2)f(n) = f(n/2) when nn is even. This implies that the value of f(n)f(n) is determined entirely by the odd part of nn. That is, if n=2a⋅mn = 2^a \cdot m where mm is odd, then f(n)=f(m)f(n) = f(m).
  2. Odd rule: f(n)=f(n+5)f(n) = f(n+5) when nn is odd. Since n+5n+5 is even, applying the even rule gives: f(n)=f(n+52)f(n) = f\left(\frac{n+5}{2}\right)

Let us trace this relation for odd integers nn:

  • For n=1n = 1: f(1)=f(1+52)=f(3)f(1) = f\left(\frac{1+5}{2}\right) = f(3). Thus, f(1)=f(3)f(1) = f(3).
  • For n=3n = 3: f(3)=f(1)f(3) = f(1).
  • For n=5n = 5: f(5)=f(5+52)=f(5)f(5) = f\left(\frac{5+5}{2}\right) = f(5).
  • For n=7n = 7: f(7)=f(6)=f(3)=f(1)f(7) = f(6) = f(3) = f(1).
  • For n=9n = 9: f(9)=f(7)=f(1)f(9) = f(7) = f(1).
  • For n=11n = 11: f(11)=f(8)=f(1)f(11) = f(8) = f(1).

By induction, we can classify all positive integers into two equivalence classes based on whether they are multiples of 55:

  • Not a multiple of 5: All such integers eventually map to f(1)f(1).
  • Multiple of 5: All such integers eventually map to f(5)f(5).

Thus, the range of ff can contain at most 22 distinct values: R={f(1),f(5)}R = \{f(1), f(5)\}. We can construct a valid function ff where f(1)≠f(5)f(1) \neq f(5) (for example, f(n)=2f(n) = 2 if 5∣n5 \mid n, and f(n)=1f(n) = 1 otherwise). Therefore, the maximum possible size of RR is 22.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Sets, Relations and Functions questions