But don't worry about it, it's not, I'm just using it because it's a simpler example than the one I really want to get to, which is knapsack.
但是别担心,我讲这些是因为它比我,真正想讲的问题简单一些,我想讲的是背包问题。
But practice this, because it's something that's such an easy way to ask such a variety of questions.
但是你仍然需要好好练习,因为这个简单的用法能够提出各种各样的问题。
And I want to talk briefly about each of these three parts of language before looking at some other issues.
在探讨一些其他问题之前,我想简单的讲一下语言的这三个成分
It's a simple problem, but I just want to do it so you get used to working with vectors.
这是个简单的问题,但我还是想做一下好让你们习惯矢量运算
The problem is as simple as the fact that millions of people who are unable to move or to communicate.
问题很简单,数以百万的人们无法行动,或者与人交流。
These are stupid questions, because once you understand what they're asking, the answer is just built in. It follows trivially.
这是些很愚蠢的问题,因为一旦你明白了他们的问题,答案就在其中,一切简单明了
And so I would ask you to think about a couple of simple questions as you move through this book, and as you think about what I have to say about it.
所以,我想让大家在继续读这本书时,想出一些简单的问题,并且想想我会对此说些什么。
We call that a base case. It's basically the simplest possible solution to the problem.
我们说这是一个基础案例,这是这个问题最简单的解决方案。
Now, I want to say one other quick thing before we get to the substance.
现在,我想简单提一点别的东西,然后我们再继续讲这个问题
He says, oh it's a very simple question; it's not difficult to answer.
他答道,这问题太简单了,一点儿都不难回答
> David: Good question and short answer: no.
>,大卫:好问题,简单回答:不行。
So let's start by asking a simple question.
就让我们以问个简单的问题开始。
That was Cartesian space. When I plot r as a distance out from the nucleus that is sort of our simple-minded planetary model. Now let's look at energy.
笛卡尔坐标系,当我用r表示,离原子核的距离时,那只是我们头脑中简单的,类似行星的模型,现在我们看一下能量问题。
I mean that, that's an endemic problem. But, you know, I mean the rules are actually pretty simple.
那是一个地域性的问题。但是,这其实是非常简单的规则。
So, I know this is a simple example and I can see everyone pretty much got it right, and probably those that didn't actually made some sort of clicker error is my guess.
分别是质子和电子,我知道这是个很简单的问题,你们大部分人都做对了,我猜那些没做对的大概是因为点错了。
If you stop and think of it as a grammatical question, you say to yourself, "Gee, that's a very good question, isn't it, because, of course, the easiest thing in the world is to tell the dancer from the dance.
如果你停下来,把它当成一个语法型问句,你对自己说,“哈,那是个很好的问题,不是吗“,因为,当然,世界上最简单的事,就是将舞者和舞蹈分开。
And this is in an isolated, in an adiabatic container.
这应该是个很简单的问题,桨轮处在一个与外界隔离额绝热环境中。
We'll devote a whole class to that down the road just a bit.
我们会用一整节课来简单讨论这个问题
Great question. It was easy and fun in the beginning,
好问题。一开始很简单,有意思,
And so, it's not an easy, clear-cut question.
所以,这不是一个简单的非黑即白的问题。
There are different ways of playing the game, and some of us find great pride in finding the most simple way to understand something.
条条大路通罗马,当找到简单的方法来理解问题时,我们会很有成就感
So things that are good candidates for divide And conquer are problems where it's easy to figure out how to divide down, and the combination is of little complexity.
因为适合用分治算法解决的问题,最好是能够简单的将问题进行分解,并且合并的过程不是非常的复杂,只要比线性方案要小。
I'm going to start with the simplest example and slowly add on bells and whistles and make it more and more complicated.
我会从最简单的例子开始,逐渐增加难度,让问题越来越复杂
But finally, Reiner says, well, thank you for visiting us, it's all very wonderful, but you know our audience would really like to know; it seems like a simple question but it's awfully hard to understand, but how can a great, big, enormous, heavy thing like this airplane get off the ground?
但最后 雷纳说到,谢谢你的来访,太棒了,但你知道吗,我们的观众非常想知道,这问题貌似简单,但却很难让人明白,问题是,像这么一个巨大且沉重的飞机,是如何飞起来的呢
So honestly, one of the best strategies in this course and in programming in general is-- generally speaking design, but it's these little tricks of the trade that will honestly make things much more fun, much more easier, and really allow you to focus on the juicy parts of the problem and not little tiny bugs that you may have started tripping over already.
说实在的,这堂课在编程方面最棒的策略之一,简而言之,就是--设计,但这只是一些让事情更简单,更容易的小技巧,让你专注于问题的核心关键,而不是一些可能让你绊倒的,这样或那样的小错误。
This is the easiest question all day, what is the bond angle between all of these?
这个问题很简单,键角是多少?
Well, it's, you sort of know how you'd do it if this was grammar school right?
你怎么解决这个问题呢?,很简单?
And I think this is best illustrated by giving you a simple little piece of code.
我认为给你看一段简单的代码,可以很好的说明这个问题。
There are other problems that are much more naturally thought of in a recursive fashion.
有一些问题不递归,也可以很简单的解决。
That's certainly one way to do it, but for computers that's not necessarily the easiest way. So another way of solving it is to do something we already saw last time, which is basically, why not simply enumerate all possible examples and check them?
将一个等式代入另一个等式,这当然是一种办法,但是对电脑来说这绝对不是一件简单的事,所以解决这个问题的办法,正如我们上一次看过的,非常基本?
应用推荐