The jumps of the bunny

A one year old bunny is sitting on the number 0 in the number line. His father, Bugs Bunny, is waiting for him on the number 10.

The bunny has to reach his father. At each minute, he can:

  • Move one step forward;
  • Move two steps forward;
  • Stay still;
  • Move one step backward;
  • Move two steps backward.

There are N N possible ways the bunny can be on the number 10 after 10 minutes. Find the last three digits of N N .

Details and assumptions

  • The bunny is allowed to hop beyond 10, and then come back.

  • There are no restrictions on the bunny entering the negative numbers. The bunny can go as much backwards as he wants.

  • Order does matter. For example, the steps { 0000022222 } \{0000022222\} and { 2020202020 } \{2020202020\} are considered distinct.


The answer is 403.

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.

3 solutions

Joel Tan
Dec 21, 2013

The generating function is ( x 2 + x + 1 + 1 x + 1 x 2 ) 10 (x^{2}+x+1+\frac{1}{x}+\frac{1}{x^{2}})^{10} The coefficient of x 10 x^{10} when expanded is 72403. Thus there are 72403 ways and the last three digits are 403.

How do you expand this :P

Michael Tang - 7 years, 5 months ago

Log in to reply

You could use WolframAlpha but Sreejato showed me a method which involved multiplying the argument in the parentheses by x 2 x^2 and then finding the coefficient of x 30 x^{30} .

Also, how did you solve it? :P

Ahaan Rungta - 7 years, 5 months ago

After multiplying by x^2, change it into (x^5-1)^10 * (x-1)^(-10), then use binomial expansion, the coefficient of x^30 term = (10 choose 0)(-10 choose 30) + (10 choose 1)(-10 choose 25) + (10 choose 2)(-10 choose 20) + (10 choose 3)(-10 choose 15) + (10 choose 4)(-10 choose 10) + (10 choose 5)(-10 choose 5) + (10 choose 6)(-10 choose 0). And of course (-n choose m)=(n+m-1 choose m) for n,m=nonnegative integers.

Maya Maya - 7 years, 5 months ago

Log in to reply

excellent method however i thin what you mean is(10 choose 0)(-10 choose 30) - (10 choose 1)(-10 choose 25) + (10 choose 2)(-10 choose 20) - (10 choose 3)(-10 choose 15) + (10 choose 4)(-10 choose 10) - (10 choose 5)(-10 choose 5) + (10 choose 6)(-10 choose 0) because x^5 -1 will give negative coefficients for odd powers of x

Adit Mohan - 7 years, 5 months ago

also notice that coefficient of x^10 = coefficient of x^30 so simply we have.
(-10 choose 0)(-10 choose 10)-(10 choose 1)(-10 choose 5)+(10 choose 2)(-10 choose 0)

Adit Mohan - 7 years, 5 months ago

Note that the exponents are 2, 1, 0, -1, and -2 which correspond to the number of moves he has moved towards his father. (Negative means backwards). The whole expression raised to the 10th power represents the 10 minutes. Thus the coefficient of x^10 will be the number of ways. If you would like to know more about generating functions this is a good site

www.mathdb.org/notes download/elementary/algebra/ae A11.pdf

(That was the article that introduced me to this concept)

Joel Tan - 7 years, 5 months ago

Log in to reply

i want to know what do you mean by x,what is the value of x,and how can i get 72403

Fahad Arman - 7 years, 5 months ago

Log in to reply

x is not really meaningful here, it's just a tool to keep the exponents (total distance) and coefficients (combinations of steps that get that distance) meaningful. You could divide the whole thing x 10 x^{10} because 10 is the distance you're looking for and then find the constant term. In other problems, the variables can take on meaning, though.

Chris Maitland - 2 years, 11 months ago

This question went over my head!!!! it didn't even dare to pass through it :p.....................i wonder why? by the way the this solution even went over my head.... i again wonder why? :(

Hibah Naveed - 7 years, 5 months ago

Log in to reply

Generating functions are totally worth learning if you enjoy combinatorics

Chris Maitland - 2 years, 11 months ago

Haha me too; I just entered the function (1+x+x^2+x^3+x^4)^10, and I found the coefficient of x^30

Sam Thompson - 7 years, 5 months ago

Log in to reply

I UNDERSTAND THIS BUT HOW TO FIND COEFFI. OF X^30

Raj Gupta - 7 years, 5 months ago

woowww.... :p i tried it with permutations... it's binomial problem!! ;) i'll try it again.... it's a great problem..! :)

Saloni Sharma - 7 years, 5 months ago

great! I did the same thing too. But how do you expand this by hand?

Agnishom Chattopadhyay - 7 years, 3 months ago

Nice solution! BTW Good luck for SMO Open!

Tan Wee Kean - 6 years, 9 months ago
Priyanka Banerjee
Dec 21, 2013

We have to find the number of solutions of summation of a series of 10 variables which can take values from -2 till +2 and count the cases when the answer is 10...

Force Brute is always an option ::

import java.io.*;

public class TheJumpsOfTheBunny

{

public static void main(String args[])

{

    int q=0,w=0,e=0,r=0,t=0,y=0,u=0,i=0,o=0,p=0,sum=0;

    for(q=-2;q<3;q++)

    {

        for(w=-2;w<3;w++)

    {

        for(e=-2;e<3;e++)

    {

        for(r=-2;r<3;r++)

    {

        for(t=-2;t<3;t++)

    {

        for(y=-2;y<3;y++)

    {

        for(u=-2;u<3;u++)

    {

        for(i=-2;i<3;i++)

    {

        for(o=-2;o<3;o++)

    {

        for(p=-2;p<3;p++)

    {

        if((q+w+e+r+t+y+u+i+o+p)==10)

            sum++;

    }

    }

    }

    }

    }

    }

    }

    }

    }

    }

    System.out.print(sum);

}

}

OUTPUT:: 72403

That's called cheating!

Sreejato Bhattacharya - 7 years, 5 months ago

Log in to reply

can you get me a detailed solution ?

Chirayata Bhatttachharyya - 7 years, 5 months ago

Log in to reply

Read the other solution for deriving the generating function, and Maya Maya's comment for computing the coefficient of x 10 x^{10} .

Sreejato Bhattacharya - 7 years, 5 months ago

We can also use dynamic programming method. a[i][j] = a[i-1][j-2] + a[i-1][j-1] + a[i-1][j] + a[i-1][j+1] + a[i-1][j+2], where a[i][j] - the number of ways be on number j after i minutes.

Alex Alex - 7 years, 5 months ago

Log in to reply

.... Plus the obvious boundary conditions a [ 1 ] [ j ] = 1 , j = 8 , 9 , 10 , 11 , 12 a[1][j]=1, \forall j=8,9,10,11,12 and zero otherwise.

Abhishek Sinha - 7 years, 3 months ago

Above attempt is called brute force attempt. In this attempt ,this problem has a complexity of 5^10... that's a huge one.

Debonil Ghosh - 7 years, 5 months ago

This is not a computer science problem.

Nicholas Tomlin - 7 years, 5 months ago

hey priyanka! u used programming skills very well..thumbs up!

Suyog Gadhave - 7 years, 5 months ago

without using programming can we solve this another way, do you have any idea about this, please if you able,send it my email. [email protected]

Fahad Arman - 7 years, 5 months ago
Michael Nasti
Feb 23, 2017

We seek the number of solutions to the equation x 1 + x 2 + x 3 + . . . + x 10 = 10 x_1+x_2+x_3+...+x_{10} = 10 where each x i { 2 , 1 , 0 , 1 , 2 } x_i \in \{-2,-1,0,1,2\} , or equivalently the number of solutions to x 1 + x 2 + x 3 + . . . + x 10 = 30 x_1+x_2+x_3+...+x_{10} = 30 where each x i { 0 , 1 , 2 , 3 , 4 } x_i \in \{0,1,2,3,4\} . (You can picture the original problem as the bunny moving 0 to 4 steps forward and always 2 steps back each minute. Ignoring the 2 steps back each time, it would end up at the number 30 instead of 10)

This is then a routine inclusion-exclusion problem. Using " stars and bars ," the number of solutions to x 1 + x 2 + x 3 + . . . + x 10 = 30 x_1+x_2+x_3+...+x_{10} = 30 where each x i { 0 , 1 , 2 , 3 , 4 , 5 , . . . } x_i \in \{0,1,2,3,4,5,...\} is ( 39 9 ) \binom{39}{9} .

If x 1 { 5 , 6 , 7 , . . . } x_1 \in \{5,6,7,...\} we can define x 1 = x 1 5 { 0 , 1 , 2 , . . . } x_1' = x_1-5 \in \{0,1,2,...\} and the equation becomes x 1 + x 2 + x 3 + . . . + x 10 = 25 x_1'+x_2+x_3+...+x_{10} = 25 , which has ( 34 9 ) \binom{34}{9} nonnegative integer solutions.

This is true for each of the ( 10 1 ) \binom{10}{1} x i x_i s. Thus there are ( 10 1 ) ( 34 9 ) \binom{10}{1}\binom{34}{9} solutions with one of the x i x_i s above 4 4 that we should subtract.

However by inclusion-exclusion, we must then add back the ( 10 2 ) ( 29 9 ) \binom{10}{2}\binom{29}{9} where two of the x i x_i s are above 4 4 , and subtract the ( 10 3 ) ( 24 9 ) \binom{10}{3}\binom{24}{9} where three of the x i x_i s are above 4 4 , and so on, yielding:

( 39 9 ) ( 10 1 ) ( 34 9 ) + ( 10 2 ) ( 29 9 ) ( 10 3 ) ( 24 9 ) + ( 10 4 ) ( 19 9 ) ( 10 5 ) ( 14 9 ) + ( 10 6 ) ( 9 9 ) = 72403 \binom{39}{9}-\binom{10}{1}\binom{34}{9}+\binom{10}{2}\binom{29}{9}-\binom{10}{3}\binom{24}{9}+\binom{10}{4}\binom{19}{9}\\ \ -\binom{10}{5}\binom{14}{9}+\binom{10}{6}\binom{9}{9} = 72403

Good Show ! Jolly Good Show !

Vijay Simha - 1 year, 8 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...