A function f : Z → Z , has the following conditions
f ( n ) = 2 f ( n − 1 ) + 2 f ( 2 n ) , if n is even
f ( n ) = 2 f ( n ) + 2 f ( 2 n − 1 ) , if n is odd
If f ( 1 ) = 2 , find f ( 3 ) f ( 4 ) f ( 1 0 ) f ( 1 2 ) f ( 1 8 ) f ( 5 2 ) f ( 6 0 ) f ( 5 0 2 ) f ( 2 0 1 1 ) f ( 2 0 1 2 ) f ( 2 0 1 3 ) f ( 2 0 1 4 )
This problem is part of the Figure-It-Out Function! series
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Plugging the simple cases: one can conjecture that f(n) = n + 1.
We use induction to prove this:
Base cases: n = 0, f(0) = 0 + 1 = 1 as plugged. n = 1, f(1) = 1 + 1 = 2 as given.
Assume f(n) = n + 1 for any n.
If n + 1 is even (implies that n is odd):
f(n + 1) = [f(n) + 2f([n + 1]/2)]/2
From f(n):
f(n) = 2 f([n-1]/2) as plugged from the given.
This implies:
f(n+1) = f([n - 1]/2) + f([n + 1]/2)
And if n + 1 is odd:
Plugging from the given gives f(n + 1) = 2 f(n/2).
Equating both f(n + 1) = f(n + 1) especially when n is part of integer set.
f([n - 1]/2) + f([n + 1]/2) = 2 f(n/2).
This is where we use Jensen's Inequality. Since f''(n) = 0, this is the equality case of Jensen. Hence, the induction is proved.
The first step is to realise that the odd part is a rather elaborate way of writing that f ( n ) = 2 f ( 2 n − 1 ) . After calculating the image of the first few numbers, we start to suspect that this is a rather complicated way of describing the function f ( n ) = n + 1 , which one can indeed show it is. As a result the given quotient equals 4 ⋅ 5 ⋅ 1 1 ⋅ 1 3 ⋅ 1 9 ⋅ 5 3 ⋅ 6 1 ⋅ 5 0 3 2 0 1 2 ⋅ 2 0 1 3 ⋅ 2 0 1 4 ⋅ 2 0 1 5 , where all factors in the denominator are chosen nicely and cansel out good part of the numerator. All that's left in the end is 2 ⋅ 3 ⋅ 3 1 = 1 8 6 .
Java:
public class brilliant{
public static void main(String args[]){
double f[] = new double[2015];
f[1] = 2;
for(int i=2;i<2015;i++){
if(i%2==0) f[i]=(f[i-1]+2*f[i/2])/2;
else f[i] = 2*f[i/2];
}
System.out.println(f[2011]*f[2012]*f[2013]*f[2014]/f[3]/f[4]/f[10]/f[12]/f[18]/f[52]/f[60]/f[502]);
}
}
Very simple question, just put up the values: f(0)=1 f(1)=2 f(2)=3
Hence, f(n)=n+1
How do you know those values?
Log in to reply
We are given that f(1)=2 and all other values can be find out from given conditions for f(n) and hence, series will be obtained
Problem Loading...
Note Loading...
Set Loading...
We have the second formula as for any odd:- f ( n ) = 2 f ( n ) + 2 f ( 2 n − 1 ) Put n = 2 t + 1 , so that above formula is true for any natural t . 2 f ( 2 t + 1 ) = f ( 2 t + 1 ) + 2 f ( t ) f ( 2 t + 1 ) = 2 f ( t ) Similarly put n = 2 t in the first formula and we get:- 2 f ( 2 t ) = f ( 2 t − 1 ) + 2 f ( t ) From previous eqation:- 2 f ( 2 t ) = f ( 2 t − 1 ) + f ( 2 t + 1 ) Hence we see that terms of f ( n ) are in A P . Also we can see that f ( 3 ) = 2 f ( 1 ) = 4 From the definition of AP f ( n ) = f ( 1 ) + ( n − 1 ) d f ( 3 ) = f ( 1 ) + 2 d 4 = 2 + 2 d d = 1 Hence f ( n ) = 2 + n − 1 f ( n ) = n + 1