Let x 0 , x 1 , x 2 , x 3 , … be positive integers satisfying the recursive relation,
x n + 1 > 2 × x n .
How many ways are there to pick x 0 through x 3 such that x 3 < 5 1 ?
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.
Relevant wiki: Recursive functions
Define the following function:
Then,
These were derived as follows...
The first equation follows trivially.
The second one I got by looking at the minimum value possible for x n .
And so the general expression for these minima is:
x n , m i n = 2 n + 1 − 1
So anything less than these minima must be 0 .
So,
N n ( i ) = 0 if i < 2 n + 1 − 1
Finally, the third equation I got by looking at how many ways you could pick x 0 to x n for x n < i + 1 . This will be equal to the number of ways that they can be picked for x n < i which is given by N n ( i − 1 ) plus the number of "new" combinations you can now make with the new maximum x n , which is given by N n − 1 ( ⌊ 2 i − 1 ⌋ ) . The floor function was needed only to differentiate between even and odd numbers.
So, N n ( i ) = N n ( i − 1 ) + N n − 1 ( ⌊ 2 i − 1 ⌋ ) otherwise
Solving, you find:
N 3 ( 5 0 ) = 2 1 7 0
Or if you prefer the compute intensive, brute force, way (in perl):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
Output:
2 1 7 0
would there have been a way to do this without a computer?
Yes, the first way... :)
How did you get these two lines?
- N n ( i ) = 0 if i < 2 n + 1 − 1
- N n ( i ) = N n ( i − 1 ) + N n − 1 ( ⌊ 2 i − 1 ⌋ ) otherwise
Log in to reply
Lets see... The first one I got by looking at the minimum value possible for x n .
And so the general expression for these minima is:
x n , m i n = 2 n + 1 − 1
So anything less than these minima must be 0 .
So,
N n ( i ) = 0 if i < 2 n + 1 − 1
The second one I got by looking at how many ways you could pick x 0 to x n for x n < i + 1 . This will be equal to the number of ways that they can be picked for x n < i which is given by N n ( i − 1 ) plus the number of "new" combinations you can now make with the new maximum x n , which is given by N n − 1 ( ⌊ 2 i − 1 ⌋ ) . The floor function was needed only to differentiate between even and odd numbers.
So, N n ( i ) = N n ( i − 1 ) + N n − 1 ( ⌊ 2 i − 1 ⌋ )
I have updated the solution accordingly. Is it clear?
Problem Loading...
Note Loading...
Set Loading...
Since we must have x 0 ≤ 5 , x 1 ≤ 1 1 , x 2 ≤ 2 4 and x 3 ≤ 5 0 , the number of ways is a = 1 ∑ 5 ( b = 2 a + 1 ∑ 1 1 ( c = 2 b + 1 ∑ 2 4 ( d = 2 c + 1 ∑ 5 0 1 ) ) ) = 2 1 7 0 This can either be computed by brute force/computer or by using the formulae for ∑ r = 1 n r , ∑ r = 1 n r 2 and ∑ r = 1 n r 3 .