Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
We don't bite newbies here... much
 
PerlMonks  

Re^3: Rabbits

by zejames (Hermit)
on Nov 29, 2004 at 09:14 UTC ( [id://410928]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re^2: Rabbits
in thread Rabbits

Let's assume that each couple of rabbits give birth to two baby rabbits.

Let's count the number of couple of rabbits. At the beginning, we've 1 couple of young rabbit

F_1 = 1

Next year, they'll be adult rabbits, but won't have children yet :

F_2 = 1

On the third year, they'll a two baby rabbits, that is one couple

F_3 = 2

On the forth year, the first parent will have two baby rabbits again, but young rabbits won't be old enough to do so

F_3 = 2 + 1 = 3

On the fifth year, we've got two couples that can have little rabbits and one that cannot :

F_3 = 3 + 2 = 5

and so on... Each year, the number of couple is :

  • the number of rabbits that lived the year before, that is F_{n-1}
  • plus the number of rabbits that were born that year, that is the number of couple old enough to proceate, that is F_{n-2}

To conclude :

F_n = F_{n-1} - F{n-2}

Funny, isn't it ? Ok, that is not very realistic and very accurante, but who cares ? ;)


--
zejames

Replies are listed 'Best First'.
Re^4: Rabbits
by CloneArmyCommander (Friar) on Nov 29, 2004 at 14:28 UTC
    That's one way of putting it :). I find it fun to play around with sequences and series, and perl is just an easy language to model them with. Thanks for the clear picture and explanation :), I understood the idea, but it is difficult for me to explain.
Re^4: Rabbits
by Jasper (Chaplain) on Nov 30, 2004 at 07:20 UTC
    Well, that's that clarified. The monthly thing was misleading me :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://410928]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.