简单地说,我们有兔子在这个地方自由地四处游荡。
Simply put, we have rabbits wandering freely around the place.
这些角色称为“个人向导”,有称为Rover的小狗(也是缺省向导),有名叫French的猫,有兔子,有叫sullen的老鼠,有怪物,甚至莎士比亚本人,还有更多。
The characters were called "personal guides," and included a dog named Rover (the default guide), a French cat, a rabbit, a turtle, a sullen rat, a gargoyle, William Shakespeare himself, and others.
这片森林有许多兔子。
And so he said, if you start off with a male and a female, at the end of one month they have an offspring. Let's assume they have two offspring. At the end of the next month let's assume those offspring have offspring. Again a male and female.
在13世纪的时候想要计算兔子的数量,就是一个月大的兔子,再过一个月就可以进行交配,所以它说如果你一开始有一公一母两只兔子,在一个月末它们就可以生小兔子,让我们假设它们生了两只小兔子。
The question was how many rabbits do you have at the end of a year? At the end of two years? At the end of more than that number of years, and so. We can do this with the following level definition. We're going to let pairs of 0, the number of pairs at month 0, actually it would not be it would be 1.
在下一个月末的时候让我们假设,这2只小兔子也有了后代,同样是一公一母,问题是一年后你会有多少只小兔子?,两年后呢?更多年后呢?,我们可以用接下来的等级说明来解释,在第0个月有0对兔子。
Notice if I'm going to have two different sub problems I need to have two base cases here to catch this. And if I only had one it would error out. And as a consequence, I can go off and ask about rabbits. Let's see.
我需要定义两个基础事件来处理它,如果我只有一个基础事件的话就会产生错误,这样我就能够知道到底有多少只兔子了,让我们来看看,在第12个月末,没那么简单,在第二年末兔子就很多了。
应用推荐