• edited by
36,716 views
141 141 votes
A function $f: \Bbb{N^+} \rightarrow \Bbb{N^+}$ , defined on the set of positive integers $\Bbb{N^+}$, satisfies the following properties:

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

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

Let $R=\{ i \mid \exists{j} : f(j)=i \}$ be the set of distinct values that $f$ takes. The maximum possible size of $R$ is ___________.

11 Answers

Best answer
258 258 votes
Let us assume: $f(1) = x.$

Then, $f(2) = f(2/2) = f(1) = x$
$ f(3) = f(3+5) = f(8) = f(8/2) = f(4/2) = f(2/1) = f(1) = x.$

Similarly, $f(4) = x$
$f(5) = f(5+5) = f(10/2) = f(5) = y.$

So, it will have two values. All multiples of $5$ will have value $y$ and others will have value $x.$
• selected by
2 flags:
✌ Edit necessary (Hazard “it should be f(2/2) = 1 and not f(2/1) = 1”)
✌ Edit necessary (oogway69 “f(2/2) = f(1)”)
53 53 votes

Answer is 2
Its Saying we have 2 domains
N+ → N+

  1. So F(1) = F(6) = F(3) = F(8) = F(4) = F(2) = F(1)....It Repeats...  Now F(7) = F(12) = F(6)...Again repeats both above are same...Since F(6) matches in both so same both belongs to same value.We are not getting F(5) above
  2. Now F(5) = F(10) = F(5)..Repeats ...We can see we have different value for multiples of 5 and other natural numbers.
• edited by
34 34 votes

$\text{let we have f(1) = x. Then, f(2) = f(2/2) = f(1) = x}$

$\text{f(3) = f(3+5) = f(8) = f(8/2) = f(4/2) = f(2/1) = f(1) = x }$
$\text{f(5) = f(5+5) = f(10/2) = f(5) = y. }$

$\text{All  $N^+$ except multiples of 5 are mapped to x and multiples}$ 

$\text{of 5 are mapped to y so ,$\mathbf{Answer\space is\space 2}$}$

 

 

• edited by
19 19 votes

http://math.stackexchange.com/questions/2118739/finding-recursive-function-range/2118749

We will use strong Induction Hypothesis to proof this.

Suppose that $f(1) = a$ and $f(5) = b$. It is clear that $$f(5n) = b$$ for all $n$. We'll prove by induction that for all $n \ne 5k$, $f(n) = a$.
First note that
$$f(2) = f(\frac{2}{2}) = f(1) = a,$$
$$f(3) = f(3+5) = f(8) = f(4) = f(2) = a,$$
$$f(4) = f(2) = a.$$
Now suppose $n = 5k + r$, where $0 \lt r \lt 5$, and for all $k\lt n$, $n$ is not divisible by $5$ bcoz $r \neq 0$
Note that if  $n$ is not divisible by $5$ then $n-5$ is also not divisible by $5$. Because $n-5 = 5(k-1) + r$, again $r \neq 0$.
And also Note that $\frac{n}{2}$ is not divisible by $5$, bcoz if it were divisible by $5$, this will make $n$ divisible by $5$. 

Base case:  $f(1)=f(2)=f(3)=f(4)=a$ [already solved for base cases above]
Incuctive step: Now suppose $n = 5k + r$, where $0 \lt r \lt 5$, and for all $m\lt n$ which are not divisible by $5$, $f(m) = a$.
($m$ already covers $n-5$ and $\frac{n}{2}$)
If $n$ is odd, $f(n) = f(n-5)$, and by induction hypothesis, $f(n-5) = a$, so we get $$f(n) = a.$$
If $n$ is even,  $f(n) = f(n/2)$, and by induction hypothesis, $f(n/2) = a$, so we get $$f(n) = a.$$

• edited by
16 16 votes
Answer 2..

for multiples of 5.. f(5)=f(10)...
and one for rest of the numbers in N.
7 7 votes

Let's start with the smallest number. (You can begin at any number)

$f(1) = f(6) = f(3) = f(8) = f(4) = f(2) = \color{red}{f(1)}... $

$f(2)=\color{red}{f(1)}$

$f(3)=\color{red}{f(1)}$

$f(4)=\color{red}{f(1)}$

$f(5) = f(10) = \color{blue}{f(5)}... $

$f(6)=\color{red}{f(1)}$

$f(7) = f(12) = f(6) =\color{red}{f(1)}$

$f(8)=\color{red}{f(1)}$

$f(9) = f(14) = f(7)=\color{red}{f(1)}$

$f(10)=\color{blue}{f(5)}$

$f(11) = f(16) = f(8)=\color{red}{f(1)}$

... so on.

 

We observe that all the multiples of 5 will have the value of $f(5)$ and every other number will converge to $f(1)$ ultimately.

Let's assume $f(1) = i_1$ and $f(5) = i_2$

$R=\{i∣∃j:f(j)=i\} $

Hence, there are 2 such $i$'s.

Answer:
Position:
Show:

Related questions

91 91 votes
10 answers 10 answers
39.0k
39.0k views
Sandeep Singh asked Feb 12, 2016
38,955 views
Consider the weighted undirected graph with $4$ vertices, where the weight of edge $\{i,j\}$ is given by the entry $W_{ij}$ in the matrix $W$. W=$\begin{bmatrix} 0&2 &8 &...
117 117 votes
22 answers 22 answers
56.5k
56.5k views
Sandeep Singh asked Feb 12, 2016
56,530 views
Let $G$ be a complete undirected graph on $4$ vertices, having $6$ edges with weights being $1, 2, 3, 4, 5,$ and $6$. The maximum possible weight that a minimum weight s...
139 139 votes
24 answers 24 answers
68.1k
68.1k views
Sandeep Singh asked Feb 12, 2016
68,100 views
For a host machine that uses the token bucket algorithm for congestion control, the token bucket has a capacity of $1$ $\text{megabyte}$ and the maximum output rate is $2...
67 67 votes
6 answers 6 answers
32.3k
32.3k views
Sandeep Singh asked Feb 12, 2016
32,339 views
Cylinder a disk queue with requests for $I/O$ to blocks on cylinders $47, 38, 121, 191, 87, 11, 92, 10.$ The C-LOOK scheduling algorithm is used. The head is initially at...