Double Trouble

Let x 0 , x 1 , x 2 , x 3 , x_0, x_1, x_2, x_3, \ldots be positive integers satisfying the recursive relation,

x n + 1 > 2 × x n . x_{n+1} > 2 \times x_n .

How many ways are there to pick x 0 x_0 through x 3 x_3 such that x 3 < 51 x_3 < 51 ?


The answer is 2170.

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.

2 solutions

Mark Hennings
Sep 30, 2016

Since we must have x 0 5 x_0 \le 5 , x 1 11 x_1 \le 11 , x 2 24 x_2 \le 24 and x 3 50 x_3 \le 50 , the number of ways is a = 1 5 ( b = 2 a + 1 11 ( c = 2 b + 1 24 ( d = 2 c + 1 50 1 ) ) ) = 2170 \sum_{a=1}^5\left(\sum_{b=2a+1}^{11}\left(\sum_{c=2b+1}^{24} \left(\sum_{d=2c+1}^{50} 1 \right)\right)\right) \; = \; 2170 This can either be computed by brute force/computer or by using the formulae for r = 1 n r \sum_{r=1}^n r , r = 1 n r 2 \sum_{r=1}^n r^2 and r = 1 n r 3 \sum_{r=1}^n r^3 .

Geoff Pilling
Jul 11, 2016

Relevant wiki: Recursive functions

Define the following function:

  • N n ( i ) = N_n(i) = The number of ways you can pick x 0 x_0 to x n x_n such that x n < i + 1 x_n < i+1

Then,

  • N 0 ( i ) = i N_0(i) = i
  • N n ( i ) = 0 N_n(i) = 0 if i < 2 n + 1 1 i < 2^{n+1} - 1
  • N n ( i ) = N n ( i 1 ) + N n 1 ( i 1 2 ) N_n(i) = N_n(i-1) + N_{n-1}({\lfloor{\frac{i-1}{2}}\rfloor}) otherwise

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 x_n .

  • The minimum x 0 x_0 is clearly 1 1 .
  • The minimum x 1 x_1 is 2 × x 0 + 1 = 3 2 \times x_0 + 1 = 3 .
  • The minimum x 2 x_2 is 2 × x 1 + 1 = 7 2 \times x_1 + 1 = 7 .

And so the general expression for these minima is:

x n , m i n = 2 n + 1 1 x_{n,min} = 2^{n+1} - 1

So anything less than these minima must be 0 0 .

So,

N n ( i ) = 0 N_n(i) = 0 if i < 2 n + 1 1 i < 2^{n+1} - 1

Finally, the third equation I got by looking at how many ways you could pick x 0 x_0 to x n x_n for x n < i + 1 x_n < i + 1 . This will be equal to the number of ways that they can be picked for x n < i x_n < i which is given by N n ( i 1 ) N_n(i-1) plus the number of "new" combinations you can now make with the new maximum x n x_n , which is given by N n 1 ( i 1 2 ) N_{n-1}({\lfloor{\frac{i-1}{2}}\rfloor}) . The floor function was needed only to differentiate between even and odd numbers.

So, N n ( i ) = N n ( i 1 ) + N n 1 ( i 1 2 ) N_n(i) = N_n(i-1) + N_{n-1}({\lfloor{\frac{i-1}{2}}\rfloor}) otherwise


Solving, you find:

N 3 ( 50 ) = 2170 N_3(50) = \boxed{2170}

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
$n = 0;

for $a (1..50) {
        for $b (1..50) {
                for $c (1..50) {
                        for $d (1..50) {
                                if  ($b > 2 * $a && $c > 2 * $b && $d > 2 * $c) {
                                        $n ++
                                }
                        }
                }
        }
}

print "$n\n";

Output:

2170 \boxed{2170}

would there have been a way to do this without a computer?

Willia Chang - 4 years, 11 months ago

Yes, the first way... :)

Geoff Pilling - 4 years, 11 months ago

Log in to reply

ah...ic. thanks!!!!

Willia Chang - 4 years, 11 months ago

How did you get these two lines?

  • N n ( i ) = 0 N_n(i) = 0 if i < 2 n + 1 1 i < 2^{n+1} - 1
  • N n ( i ) = N n ( i 1 ) + N n 1 ( i 1 2 ) N_n(i) = N_n(i-1) + N_{n-1}({\lfloor{\frac{i-1}{2}}\rfloor}) otherwise

Pi Han Goh - 4 years, 11 months ago

Log in to reply

Lets see... The first one I got by looking at the minimum value possible for x n x_n .

  • The minimum x 0 x_0 is clearly 1 1 .
  • The minimum x 1 x_1 is 2 × x 0 + 1 = 3 2 \times x_0 + 1 = 3 .
  • The minimum x 2 x_2 is 2 × x 1 + 1 = 7 2 \times x_1 + 1 = 7 .

And so the general expression for these minima is:

x n , m i n = 2 n + 1 1 x_{n,min} = 2^{n+1} - 1

So anything less than these minima must be 0 0 .

So,

N n ( i ) = 0 N_n(i) = 0 if i < 2 n + 1 1 i < 2^{n+1} - 1

The second one I got by looking at how many ways you could pick x 0 x_0 to x n x_n for x n < i + 1 x_n < i + 1 . This will be equal to the number of ways that they can be picked for x n < i x_n < i which is given by N n ( i 1 ) N_n(i-1) plus the number of "new" combinations you can now make with the new maximum x n x_n , which is given by N n 1 ( i 1 2 ) N_{n-1}({\lfloor{\frac{i-1}{2}}\rfloor}) . The floor function was needed only to differentiate between even and odd numbers.

So, N n ( i ) = N n ( i 1 ) + N n 1 ( i 1 2 ) N_n(i) = N_n(i-1) + N_{n-1}({\lfloor{\frac{i-1}{2}}\rfloor})

I have updated the solution accordingly. Is it clear?

Geoff Pilling - 4 years, 11 months ago

Log in to reply

Yes. Thank you!

Pi Han Goh - 4 years, 11 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...