Rabbit Puzzle

pradeep_agrawal

pradeep_agrawal

@pradeep-agrawal-rhdX5z Oct 27, 2024
There is a closed room where we left a rabbit. That rabbit has a unique property. It starts giving birth after 2nd month of its own birth (start of third month), and after that it gives birth in every month. It delivers a single rabbit in each time. And these descendant rabbits inherit the same property.

Let's assume that the room is large enough to hold infinite number of rabbits, and there is enough food, water etc. in the room for infinite number of rabbits. How many rabbits will be there in the room after n months?

-Pradeep

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • shalini_goel14

    shalini_goel14

    @shalini-goel14-ASmC2J Jul 2, 2009

    Sorry , it will be sum of following series

    (n-1) + (n-1)(n-2) +(n-1)(n-2)(n-3)+... [(n-1)(n-2)..{n-(n-1)}]
  • pradeep_agrawal

    pradeep_agrawal

    @pradeep-agrawal-rhdX5z Jul 2, 2009

    I edited the post to make question more clear.

    -Pradeep
  • Anil Jain

    Anil Jain

    @CrazyBoy Jul 2, 2009

    shalini_goel14
    Sorry , it will be sum of following series

    (n-1) + (n-1)(n-2) +(n-1)(n-2)(n-3)+... [(n-1)(n-2)..{n-(n-1)}]
    I have not calculated till now... but certainly this is not the asnwer..

    Consider n= 1
    As per your expression, value would be 0

    However 1 rabit should be the value....

    -CB
  • shalini_goel14

    shalini_goel14

    @shalini-goel14-ASmC2J Jul 2, 2009

    crazyboy
    I have not calculated till now... but certainly this is not the asnwer..

    Consider n= 1
    As per your expression, value would be 0

    However 1 rabit should be the value....

    -CB
    No each rabbit can give birth only in second month so for 1 month[i.e n=1] there will be 0 rabbit.

    PS: Correct me if wrong.
  • pradeep_agrawal

    pradeep_agrawal

    @pradeep-agrawal-rhdX5z Jul 2, 2009

    shalini_goel14
    No each rabbit can give birth only in second month so for 1 month[i.e n=1] there will be 0 rabbit.

    PS: Correct me if wrong.
    Yep, you are wrong here. Even in the first month we have 1 rabbit (the unique rabbit who starts the chain) 😀

    And a rabbit can give birth after second month (i.e., start of third month). This is the clarification i have done by editing the puzzle.

    -Pradeep
  • shalini_goel14

    shalini_goel14

    @shalini-goel14-ASmC2J Jul 2, 2009

    pradeep_agrawal
    Yep, you are wrong here. Even in the first month we have 1 rabbit (the unique rabbit who starts the chain) 😀

    And a rabbit can give birth after second month (i.e., start of third month). This is the clarification i have done by editing the puzzle.

    -Pradeep
    Ok, I got it , it is wrong. Will post later the correct answer. 😀

    Bye ! Keep on trying 😉

    PS: "Hurry makes curry" -how true 😡
  • RajdeepCE

    RajdeepCE

    @rajdeepce-7UdrG8 Jul 2, 2009

    After n days the number of rabits will be n[sup]th[/sup] fibonacci number. Here is explanation,
    1st month = 1 rabit,
    2nd month = 1 rabit,(1st rabit cant give birth now)
    3rd month = 2 rabit,(1st rabit starts giving birth)
    4th month = 3 rabit,(1st rabit gives birth to another)
    5th month = 5 rabit,(both rabit start giving birth)
    So the answer will be nth element of fibonacci series.
  • Anil Jain

    Anil Jain

    @CrazyBoy Jul 2, 2009

    And what would be n^th element ?? Thats what he is looking for.. 😀
  • RajdeepCE

    RajdeepCE

    @rajdeepce-7UdrG8 Jul 2, 2009

    I mentioned that in my posts first and last line. And again after n months the number of rabits will be the n[sup]th[/sup] fibonacci number. And the equation of fibonacci series is,
    f(n)=f(n-1)+f(n-2), n=2,3,4,... & f(n-1)=f(n-2)=1.
  • pradeep_agrawal

    pradeep_agrawal

    @pradeep-agrawal-rhdX5z Jul 3, 2009

    RajdeepCE
    So the answer will be nth element of fibonacci series.
    Yes that the correct answer that the number of rabbits on nth day will be the nth element of the fibonacci series.

    RajdeepCE
    And the equation of fibonacci series is,
    f(n)=f(n-1)+f(n-2), n=2,3,4,... & f(n-1)=f(n-2)=1.
    I feel you mean to say "f(1)=f(2)=1" instead of "f(n-1)=f(n-2)=1".

    My next query, is there any simple equation through which i can directly calculate the number of rabbits on nth day (i.e., nth element of fibonacci series) instead of going by formula

    f(n)=f(n-1)+f(n-2), f(1)=f(2)=1.

    -Pradeep
  • silverscorpion

    silverscorpion

    @silverscorpion-iJKtdQ Jul 4, 2009

    Ok. That's easy.

    The formula for the N[sup]th[/sup] fibonacci number is,

    {[(1+sqrt(5))/2][sup]n[/sup] - [(1-sqrt(5))/2][sup]n[/sup]} / sqrt(5)
    ie.,

    (1+sqrt(5))/2 is nothing but the golden ratio, 1.68. We can call it phi.
    So, Nth fibonacci number is,


    {phi[sup]n[/sup] - 1/phi[sup]n[/sup]} / sqrt(5);
    Am I correct??
  • pradeep_agrawal

    pradeep_agrawal

    @pradeep-agrawal-rhdX5z Jul 4, 2009

    silverscorpion, not sure how you derived the formula. I tried with different value of n and i am not getting correct answers, e.g.,

    For n = 1, answer = 0.485
    For n = 2, answer = 1.103
    For n = 3, answer = 2.026
    For n = 4, answer = 3.506
    For n = 5, answer = 5.951
    For n = 6, answer = 10.034

    I am even not sure if a equation for fibonacci series exist.

    -Pradeep
  • silverscorpion

    silverscorpion

    @silverscorpion-iJKtdQ Jul 5, 2009

    Well, this formula exists and is quite right too. The thing is, you have to round off the answers.
    And sorry, I gave the value of phi to be 1.68. It's actually, 1.618.

    And another thing I forgot to mention is that, the power should actually be n+1. ie, for getting nth fibonacci number, we have to use phi[sup]n+1[/sup].

    So, let's calculate.

    For 1, we have

    (phi[sup]2[/sup] - 1/phi[sup]2[/sup]) / sqrt(5)
    = (1.618[sup]2[/sup] - 0.618[sup]2[/sup]) / sqrt(5) = 1.0

    For 2, we have

    (phi[sup]3[/sup] - 1/phi[sup]3[/sup]) / sqrt(5)
    = (1.618[sup]3[/sup] - 0.618[sup]3[/sup]) / sqrt(5) = 2.0

    Try it for other numbers too. It will work. Let me know if you got it!! 😀😀
  • pradeep_agrawal

    pradeep_agrawal

    @pradeep-agrawal-rhdX5z Jul 5, 2009

    That's cool silverscorpion, this works 😀

    -Pradeep
  • silverscorpion

    silverscorpion

    @silverscorpion-iJKtdQ Jul 5, 2009

    I said it would!!

    Happy?? 😀😀
  • mech_guy

    mech_guy

    @mech-guy-TMwuj2 Jul 5, 2009

    Hi,

    Fibonacci series sum was cool indeed. I got it other way round and my answer is:-
    if n >= 3 Total no. of rabbits = 2 + [(n-2)*(n-3)/2]
    if n = 1 Total no. of rabbits = 1
    if n = 2 Total no. of rabbits = 2
    I made following sequence :-

    Months:- 1__2__3__4__5__6__7__8__9 ..............
    Rabbits:- _1__1__1__1__1__1__1__1__1
    __________________1__1__1__1__1__1
    _____________________1__1__1__1__1
    ________________________1__1__1__1
    ___________________________1__1__1
    ______________________________1__1
    _________________________________1
    ----------------------------------------
    Total rabbits after n months:- 1 + 1 + (1 +2 + 3 + 4 + 5 + 6 + 7 + ....(n-2) terms)
    = 2 + SIGMA(n on (n-2) terms)
    = 2 + [(n-2)*(n-3)/2] => assuming n>=3 else total = 1 for n = 1 and total = 2 for n = 2

    Thanks

    PS: my first post, didnt knw how to properly type, so using lots of underscores, hope its comprehendible.
  • pradeep_agrawal

    pradeep_agrawal

    @pradeep-agrawal-rhdX5z Jul 5, 2009

    That was also a good try mech_guy. But the formula that you have given works correctly till n = 6. When we have n = 7:

    Total no. of rabbits = 2 + [(7-2)*(7-3)/2]
    = 2 + [5*4/2]
    = 2 + 10
    = 12

    But the actual answer is for n = 7 should be 13.

    - Pradeep
  • mech_guy

    mech_guy

    @mech-guy-TMwuj2 Jul 5, 2009

    Hi Pradeep,

    Formula for SIGMA (1 + 2 + 3....+ n) should be = n*(n+1)/2 while i did calculation for n*(n-1)/2 and that is why got wrong Total.

    So total should be 2 + [(n-2)*(n-1)/2]

    For n = 7, total number of rabbits after 7 months = 17 (how 13?)

    Regards
  • silverscorpion

    silverscorpion

    @silverscorpion-iJKtdQ Jul 5, 2009

    This is not correct. Using this formula, you get the series,

    1, 2, 3, 5, 8, 12, 17, 23, 30,...

    This is not fibonacci series.
  • mech_guy

    mech_guy

    @mech-guy-TMwuj2 Jul 5, 2009

    Hi SilverScorpion,

    Agreed its not a Fibonacci series.
    And yes my solution is wrong, i messed it up after 6 month onwards. It was a bad try.

    Regards
  • silverscorpion

    silverscorpion

    @silverscorpion-iJKtdQ Jul 6, 2009

    mech_guy
    Hi SilverScorpion,

    Agreed its not a Fibonacci series.
    And yes my solution is wrong, i messed it up after 6 month onwards. It was a bad try.

    Regards

    You tried!! That is great in itself!!

    And now you know the answer! So, enjoy!😁