Suppose f is a function from the positive integers to the positive integers that satisfies
f ( n ) = { n − 6 0 0 , f ( f ( n + 8 0 0 ) ) , for n > 2 0 1 3 , for n ≤ 2 0 1 3 .
How many fixed points does f have?
Details and assumptions
A fixed point of a function f is a value x which satisfies f ( x ) = x .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
It's important to understand how the recursion in the function works and what the condition is for exiting. The function will only end when 2 values are generated in succession that are greater than 2013.
The general process of the function is something like:
f ( n ) 1 → f ( n 1 ) → f ( n 2 ) → ⋮ f ( n i − 1 ) → f ( n i + 1 ) → f ( n i + 2 ) → f ( n i + 3 ) → ⋮ f ( n k − 3 ) → f ( n k − 2 ) → f ( n k − 1 ) → f ( n ) = n k n 1 > 2 0 1 3 ? n 1 > 2 0 1 3 ? n 2 > 2 0 1 3 ? n i − 1 > 2 0 1 3 ? n i + 1 > 2 0 1 3 ? n i + 2 > 2 0 1 3 ? n i + 3 > 2 0 1 3 ? n k − 3 > 2 0 1 3 ? n k − 2 > 2 0 1 3 ? n k − 1 > 2 0 1 3 ? False → False → False → False → True → False → True → False → True → True → n 1 = n 1 + 8 0 0 ⇒ n 2 = n 1 + 8 0 0 ⇒ n 3 = n 2 + 8 0 0 ⇒ n i + 1 = n i + 1 + 8 0 0 ⇒ n i + 2 = n i + 1 − 6 0 0 ⇒ n i + 3 = n i + 2 + 8 0 0 ⇒ n i + 4 = n i + 3 − 6 0 0 ⇒ n k − 2 = n k − 3 + 8 0 0 ⇒ n k − 1 = n k − 2 − 6 0 0 ⇒ n k − 1 = n k − 1 − 6 0 0 ⇒
Notice, that the set of values for n that could possibly satisfy f(n) = n have to be n > 1413 . That is because the last step ( n - 600 ) is only done if n > 2013 . The smallest value that n can be at that point is 2014 , and 2014 - 600 = 1414 . So no value of n < 1414 could satisfy the problem.
After making some observations, we can come up with an a set of operations that n will go through.
n + 8 0 0 − 6 0 0 + 8 0 0 − 6 0 0 + ⋯ + 8 0 0 − 6 0 0 − 6 0 0 = n k Note: +800 does not repeat because only values n < 1214 repeat the inital step.
Notice, that the operations alternate between + 800 and - 600 , up till the last operation. We can simplify this to :
n + 8 0 0 x − 6 0 0 x − 6 0 0 = n k ⇒ n + 2 0 0 x − 6 0 0 = n k where x is how many times the pattern is repeated
Solving for x will let us know how many times that pattern repeats for the set of values that satisfy f(n) = n .
n + 8 0 0 x − 6 0 0 x − 6 0 0 = n k ⇒ 2 0 0 x = 6 0 0 ⇒ x = 3 Note: we can cancel n and n k since we are assuming that n = n k
If we look at the step before the last, we can make the following statements.
n + 2 0 0 x = n k − 1 a n d n k − 1 > 2 0 1 3 n + 2 0 0 ⋅ 3 = n k − 1 ⇒ n + 6 0 0 = n k − 1 ∴ n + 6 0 0 > 2 0 1 3 ⇒ n > 1 4 1 3
We now have our lower limit for the set of values that satisfy f(n) = n . We know that all these values must repeat the middle pattern 3 times. If they do not, they will not satisfy the condition.
To find the upper limit we will find the numbers that repeat the pattern 2 times. We do this because the numbers that repeat the pattern only 2 times are larger, and the point at which this transition happens will be our upper limit.
n + 2 0 0 x = n k − 1 a n d n k − 1 > 2 0 1 3 n + 2 0 0 ⋅ 2 = n k − 1 ⇒ n + 4 0 0 = n k − 1 ∴ n + 4 0 0 > 2 0 1 3 ⇒ n > 1 6 1 3
So the range of values for n that satisfy f(n) = n is:
( 1 4 1 3 , 1 6 1 3 ) 1 6 1 3 − 1 4 1 3 = 2 0 0
My solution was getting too long so shorten it to include my process, but that doesnt give all the details to how I came to my conclusion. Below is my reasoning behind some of the things I did.
Method for finding the pattern of operations:
The function can be broken into 3 stages. Depending on what the initial value for n is, some of the stages may be skipped. We can find the point when this happens by observing the behavior of the function.
When n > 1213 , the 1st stage is skipped. This is because the 1st condition of the function will only be met after the inital check if n + 800 > 2013 . We can do a test to verify this by plugging in 2013 and 2014 and observing the behavior.
When n > 1813 , the 1st and 2nd stage are skipped. We can deduce this in a similar manner that we did for the first stage, that is when n + 800 - 600 > 2013 .
Notice, that the set of values for n that could possibly satisfy f(n) = n have to be n > 1413 . That is because the last step ( n - 600 ) is only done if n > 2013 . The smallest value that n can be at that point is 2014 , and 2014 - 600 = 1414 . So no value of n < 1414 could satisfy the problem.
Doing a similar test, we can see that the set of values of n that could satisfy f(n) = n have to be n < 1814. That is because values > 1813 skip the 1st and 2nd stage. So the operations that will be performed on those values are: + 800 , - 600 , and - 600 . These operations could never return the initial value.
Now we have been able to reduce the range of the possible values to 1413 < n < 1814 . But more importantly, we have deduced the stages that the set of values will go through, which prove key in solving the problem.
We now know the set of values of n that could satisfy f(n) = n skip the first stage, since the range is greater than 1213, but do go through the 2nd and 3rd stage since the range is less than 1814. From this we come up with the pattern for the operations that will be perform on n :
n + 8 0 0 − 6 0 0 + 8 0 0 − 6 0 0 + ⋯ + 8 0 0 − 6 0 0 − 6 0 0 = n k
First, we can rewrite the given equation, we have :
f(n) = \left\{ \begin{array}{l} n - 600\\ f(f(n + 800) \end{array} \right.\begin{array}{*{20}{c}} {n > 2013}\\ {n \le 2013} \end{array} = \left\{ \begin{array}{l} n - 600\\ f(n + 200) \end{array} \right.\begin{array}{*{20}{c}} {n > 2013}\\ {n \le 2013} \end{array}
The way we can interpret this is that for every number smaller or equal to 2013, we have to add 200 to it then plug it in the function again to see if it's greater to 2013 or smaller or equal. Depending on the result we subtract 600 (if it's greater then 2013) or add 200 and try again. We observe that for any integer between 14 and 213, the function gives 1414 up to 1613. I am not used to this kind of algebra so I do not know the exact term, but I would call this function periodical, the period would be from 14 to 213, the other would be 214 to 413, etc. In general, it starts from
1 4 + 2 0 0 n
and it ends at
2 1 3 + 2 0 0 n
Now we must find the numbers where f(n)=n. Let's see if f(1414)=1414. We must add 3 times 200 to get over the 2013 limit, Then we substract 600 to get again the same number. If we try with smaller numbers like 1413, we obtain 1613 which is 199 more then 1414. If we try with 1613, we obtain f(1613)=1613. With f(1614), we have 1414 which is the start of another period. The only possible answer are all the numbers between from 1414 to 1613. We have 200 fixed point.
For n less than 1214 one can not rewrite the first expression as you did in your first sentence.
Log in to reply
Ohh, thanks for pointing that out.My solution is indeed incorrect. Luckily it doesn't affect the solution. In that case would it be more appropriate to write down the function like this? f(n) = \left\{ \begin{array}{l} n - 600\\ f(n + 200)\\ f(f(n + 800)) \end{array} \right.\begin{array}{*{20}{c}} {n > 2013}\\ {1214 \le n \le 2013}\\ {n < 1214} \end{array}
Then we would say that the period for the second function is ruled by 1214+200n and 1413+200n. We obtain the same result as the answer for the problem, the only thing to add is that the new equation does not ever give a fixed point. (Proof needed).
Log in to reply
It cannot give a fixed point since f ( n ) can only terminate at values ≥ 1 4 1 4 , so we must only check 1 4 1 4 ≤ x ≤ 2 0 1 2 .
Ohh, thanks for pointing that out.My solution is indeed incorrect.
Actually, it so happens that your first expression is correct, even if the thought process that led to it was incorrect.
Lets take and example, and define 1 6 1 3 .
f ( 1 6 1 3 ) = f ( f ( 2 4 1 3 ) ) = f ( 1 8 1 3 ) = f ( f ( 2 6 1 3 ) ) = f ( 2 0 1 3 ) = f ( f ( 2 8 1 3 ) ) = f ( 2 2 1 3 ) = 1 6 1 3 .
So we note that for n in the function f ( n ) , there's a pattern of + 2 0 0 . But remember that when n > 2 0 1 3 , then f ( n ) = n − 6 0 0 . Since with f ( 2 0 1 3 ) we will always reach f ( 2 2 1 3 ) , then the smaller possible value is f ( 2 0 1 4 ) = 1 4 1 4 .
Now we want to find which is the highest value, but we know we are talking about integers, and the higher case smaller than f ( 2 0 1 4 ) is f ( 2 0 1 3 ) = f ( 2 2 1 3 ) = 1 6 1 3 . Hence, the highest possible value is 1 6 1 3 , and we know that from 1 4 1 4 to 1 6 1 3 there are 2 0 0 values, so the answer is 2 0 0 .
But there's still a question: Why can't we do better than 2 0 0 fixed points? Because if you start from any n , the final value of f ( n ) will always be from 1 4 1 4 to 1 6 1 3 inclusive (unless you take n ≥ 2 2 1 3 , but clearly, that will not take us to anywhere).
PD: Can anyone teach me how to square my final answer (the code)?
You can use \boxed{answer}, as in 2 0 0 .
what do you mean square? like ^2?
Log in to reply
I mean like enclosing the solution in a box.
Log in to reply
If you look at the formatting guide it gives you a basic list of things you can do with markdown and latex.
I think you mean like a code block?
- Solution Start
.
.
.
- End Solution
You just start a new paragraph with each line spaced 4 spaces from the edge. But I tried putting some latex code and it didn't work inside code blocks.
If you want to keep your latex code from going off the edge you can just do a line break inside the code with _\\ _ . That will put the rest of the code after it on the next line.
when n=1, f(801), f(1601),f(1801),f(2001), f(2201) is equal to 1601 when n=2, f(802), f(1602), f(1802), f(2002), f(2202) is equal to 1602
f(n)=n for numbers from 1601 to 1800 after which it will repeat.
Total fixed points = 1800-1601+1=200
Let's pick a number n and see run with it, seeing if we can get it back to n. Note that if we ever end iterating functions, our input will be >2013. So n<=2013 to begin. Also, n>2013-600 or we will never return to the number by subtracting 600. Ok. f(n)=> f(f(n+800))=>f(n+200); we don't want it to end yet so say n+200<=2013. Then this goes to f(f(n+1000))=>f(n+400). By same reasoning this goes to f(f(n+1200))=>f(n+600). Aha! Now let n+600>2013 and f(n+600)=n. So we know that n+600>2013 and n+400<=2013. There are 200 integers that are in this range.
A decrease is equivalent to 600 ... and an Increase equivalent to 800 in order to have f(x) = x ... we need 3 increases and 4 decreases
few points to note: 1. Initial decrease would resolve a value .... So we should have an increase initially 2. 1 increase followed by 2 decreases will also resolve a value ... So that should be the last step
Keeping this is mind ... we need the order of Increase/ Decrease as follows: ID ID IDD (3 increases 4 decreases)
now if the last 2 has to be decreases, the last decrease has to be over a minimum of 2014 ... which will give the final value as 1414 ... this will be the minimum value
Also, after the 2nd increase there should not be two simultaneous decreases ... which is the case if the 2nd increase leads to 2614 ... 2614 decreased to 2014 ... decreased to 1414 ... If the 2nd increase is to 2614, we should have started with 1614 .... (2 increases = + 1600 ... 1 decrease = - 600 ... net change +1000)
hence the range of values acceptable is:
1414 <= x < 1614 .... hence 200 values
Conjecturing a pattern out the blue:
Case 1: We assume that there are fixed points for n>2013 but since the function indicates that f(n) = n - 600, there wouldn't be any fixed points or values of n that will satisfy f(n) = n.
Case 2: We'll plug in some values, especially when n is less than or equal to 2013 and we will try to make a conjecture out of it.
Plug 1: Let n = 2013, 2012, 2011 This will yield f(2013) = f(f(2813)) = f(2213) = 1613 f(2012) = f(f(2812)) = f(2212) = 1612 f(2011) = f(f(2811)) = f(2211) = 1611
Plug 2: We will try to think a value wherein we don't have to use the function too much or use the function simply. This is when f(n + 800) = 2014, the first value where the function satisfies the function f(n) = n - 600. If we continue to use the function where f(n) = f(f(n+800)), the independent variable n simply increases by 200 constantly. So the number is n + 200 = 2014, n = 1814. So we will plug n = 1816, 1815, 1814. f(1816) = f(f(2616)) = f(2016) = 1416 f(1815) = f(f(2615)) = f(2015) = 1415 f(1814) = f(f(2614)) = f(2014) = 1414 And here we go...
Plug 3: Now let's try to plug in a value wherein we have to use the function more than once. Plug n = 1813, 1812, 1811 f(1813) = f(f(2613) = f(2013) = f(f(2813) = f(2213) = 1613. f(1812) = f(f(2612) = f(2012) = f(f(2812) = f(2212) = 1612. f(1811) = f(f(2611) = f(2011) = f(f(2811) = f(2211) = 1611. Now observe that the values 1613, 1612, and 1611 repeats again, therefore, we can conjecture that the values when n is less than or equal to 2013 will range from 1613 - 1414.
To find the fixed points, we have to repeat the sequence with their values respectively: n f(n) 2013 - 1814 1613 - 1414 1813 - 1614 1613 - 1414 1613 - 1414 1613 - 1414 1413 - 1214 1613 - 1414 ... and so on...
Observe also that the function and the value chosen have the same last two-digit numbers. Conclusion: There are 1613 - 1414 + 1 = 200 fixed points.
a solution in javascript
function f(n) {
if (n > 2013) {
return n - 600;
} else {
return f(f(n+800));
}
}
fixedPoints = 0;
n=1;
tries=999999;
while (tries >0) {
r = f(n);
if (r == n) {
fixedPoints++;
document.write(fixedPoints + "<br>");
}
tries--;
n++;
}
document.write("found " + fixedPoints);
Log in to reply
Good solution, and definitely less work doing it this way. But I still find it more rewarding when I can come up with a solution mathematically. However, I still need to get my programming fix once in a while. If interested you can look into talentbuddy.co if you ever want to handle some problems specifically designed to be worked by programming. :)
Problem Loading...
Note Loading...
Set Loading...
While the following solutions are correct, they were all extremely long and failed to express the essence of the problem. The key to this problem is understand how the function works, in order to interpret it.
When n ≤ 2 0 1 3 and n + 8 0 0 > 2 0 1 3 , then we get that f ( n ) = f ( f ( n + 8 0 0 ) ) = f ( n + 2 0 0 ) . As such, for i = 1 to 200, we have
f ( 1 2 1 3 + i ) = f ( 1 4 1 3 + i ) = f ( 1 6 1 3 + i ) = f ( 1 8 1 3 + i ) = f ( 2 0 1 3 + i ) = 1 4 1 3 + i .
This gives us 200 fixed points, of the form n = 1 4 1 3 + i .
For n > 2 0 1 3 , since f ( n ) = n − 6 0 0 , there are no fixed points. For n < 1 2 1 3 , we see that f ( n ) ≥ 1 4 1 4 , hence there are no fixed points either.
Thus, in total, there are 200 fixed points.