And when you have an optimal substructure and the local solutions overlap, that's when you can bring dynamic programming to bear.
当你得到一个最优子结构,但局部解决方案有重跌时,你就可以引入动态编程,来解决这个问题了。
Well, this is a problem that we have solved and will solve in the weeks to come. See you Monday.
嗯,这是我们解决了的一个问题,并且将在接下来几周来解决这个问题,下周一再见。
We've had a great deal to do with it, but of course we still haven't the slightest idea what it is.
我们花了很大的功夫来接解决这个问题,但我们仍然一点都不知道语言是什么。
It's an example of a very common tool that's going to be really useful to us, not just for doing search, but for doing a whole range of problems. That is, in essence, the template the describes a log style algorithm.
不仅仅是做搜索,还可以解决一整类问题,本质上,这个模板就描述了,对数形的算法,我们一会再回来。
And although some psychologists and philosophers think they've solved it, most of us are a lot more skeptical.
尽管一些心理学家和哲学家认为,他们已经解决了这个问题,但大多数仍持有怀疑的态度
All right,so that's the best way for the personality theory to get revised to deal with this problem.
好了,这就是人格理论调整后,解决这个问题最好的答案。
Define the path. Get all of these really clear, and you've basically solved the problem.
把所有这些搞清楚,你就基本上解决这个问题了。
We'll see why they have to separate that in a minute, but they do that these lipid bi-layers solve that problem for them and they're self-assembled structures from these molecules called phospholipids.
我们马上会讲到为什么要把它们隔离开,脂质双层膜解决了这个问题,而这些自主装结构,就是由磷脂分子组成的
All right. So you solve the problem and then, lo and behold, it turns out that: It is my friend Bumpy. Bumpy gives me a push.
好了,你们解决这个问题,然后,你瞧,结果竟是:,这是我的朋友,颠簸,颠簸推了我一把。
So if I were to solve this problem, here's the way I would do it. I would say, first thing I want to do, is I want to input a value for the base as a float.
如果我想要解决这个问题,这就是我要解决它的方式了,第一件我要做的事情就是要,输入一个浮点数作为三角形的底。
And then remember how you solve this 'cause otherwise completely useless exercise.
记住我是怎么解决这个问题的,否则就是一次,无意义的演练了,对吧。
So no harm is done, once we've clarified the question that we're trying to ask, if we summarize that question in a bit of a jargon or slogan.
其实没什么的,一但我们证实了我们,试图想要解决的问题,如果把这个问题用术语或行话简化
OK. At this point, if we stop, you'll think all algorithms are linear. This is really boring.
可能我们就认为所有的解决这个问题的,算法都是线性增长的了,真很没意思,但是他们真不是对不对?
You say, "Yeah, here's a math problem I haven't solved before, but so what? I've just done so much math, " it holds no appeal to me before."
你会说“是的,我没解决过这个数学问题,那又怎样?我研究了太久的数学,我对它失去了兴感“
One reason it's been harder to identify stem cells is that they're so rare; the other reason is that it's hard to identify the characteristics of them and it's taken many years to work this out.
干细胞难以识别的原因之一是,这些细胞很少,另一个原因就是,干细胞的特征性蛋白难以识别,我们花了好多年去解决这个问题
So now we're left with a problem that's but 500 pages large and so what might a human do now to find Mike even more closely?
现在我们只用翻500页就能解决问题了,接下来,怎么做才能离Mike这个名字更近一步?
So how would we go about solving this problem if I told you not only was there a maximum weight, but there was a maximum volume. Well, we want to go back and attack it exactly the way we attacked it the first time, which was write some mathematical formulas.
有些时候两个都重要,所以如果我告诉你这里不仅有,最大重量还有最大容量,我们应该怎么解决这个问题呢?,好了,我们想回过来然后,和第一次一样看看这个问题。
That gets us to the smart thief. Why is this thief smart? Because she took 600. And she learned 600 that in fact there is a good way to solve this problem. And that's what we're going to talk about next. And that's something called dynamic programming.
现在我们要当聪明的贼,这个贼为什么聪明呢?,因为它选择了,它知道这事实上是解决这个问题的好方法,这就是我们接下来要讲的,也就是动态编程。
Well, realize one of the themes in this course and really one of the themes in programming and solving any problem with a machine is going to be really to just take small bites one at a time out of these problems until the end result ultimately is that you've actually bitten off a fairly large fairly interesting problem and in the aggregate, you've actually implemented something pretty sophisticated.
好吧,让我们先想一下这件事带给我们的主题,编程和解决问题的思想,一台机器最开始只会一步一个脚印,沿着要解决的问题向前迈进,直到最终的结果出来,最后你会发现,你已经解决了一个相当大,相当有趣的问题,而这个问题在最初看起来确是相当复杂的。
There is this include which allows me to include code, source code so to speak that other people wrote so I don't have to figure out for myself how to print things to the screen.
这个“include“可以让我加进一些代码来,比方说其他人写的源码,这样我就不用自己解决,如何在屏幕上输出了,别人已经为我解决这个问题。
应用推荐