Question
A function , defined on the set of positive integers , satisfies the following properties:
Let be the set of distinct values that takes. The maximum possible size of is _____.
Official answer and solution
- Official answer
- 2
- From
- Official GATE 2016 answer key
Solution
Analyze the modular dynamics of and to partition positive integers into equivalence classes.
The function satisfies:
- if is even
- if is odd
Notice that if is odd, is even, so .
Let us trace the operations on positive integers modulo 5:
- If is a multiple of 5 ():
- For : (forms a self-loop).
- For any : repeatedly applying when even and when odd preserves divisibility by 5 because adding 5 preserves multiples of 5, and dividing an even multiple of 5 by 2 yields another multiple of 5.
All multiples of 5 eventually reduce to the attractor 5.
Now consider integers NOT divisible by 5 ():
- Adding 5 preserves .
- Dividing an even number by 2 multiplies by , which never maps a non-zero residue to zero.
Thus, no number not divisible by 5 can ever transition to a multiple of 5.
Trace values not divisible by 5:
- :
- :
- :
- :
Every integer coprime to 5 is reachable from and reduces to the cycle .
Therefore, the set of positive integers is partitioned into exactly two disjoint connected components under the relations:
- The set of integers not divisible by 5 (all mapped to )
- The set of integers divisible by 5 (all mapped to )
Since there are only 2 equivalence classes, can take at most 2 distinct values. Hence, the maximum possible size of is 2.
2
Assuming can produce an infinite range of values, missing that the collatz-like operations collapse all inputs into two closed cycles modulo 5.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2016 Computer Science and Information Technology (CS) Session 1
- Question
- 38 of 65, printed as CS Q.28
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.