And the first thing you do is ask is it an instance of some problem that other people have already solved?
而且你以前从没碰过这个问题,你首先要做的一件事就是问问自己,这是不是一个别人已经解决了的问题?
because then you can solve new problems on midterms and what not if you understand the conceptual part.
因为这样你可以解决中期的新的问题,如果你不理解的话,就不好说了。
In addition to many lectures, we have the working groups pleased to do both experiments and to do problem-solving exercises.
我们不仅有讲座,还有不同的小组,他们将做实验,和解决问题的练习。
It literally halves the amount of time it takes to solve that problem but we can actually do better.
它能把解决问题时间的缩短一半,但其实我们能做的更好。
So I haven't done magic, I've given you a really fast way to solve a knapsack problem, but it's still exponential deep down in its heart, in something.
所以我并没有施魔法,我已经告诉了你,一种快速解决背包问题的方法了,但是某些方面它的核心仍然是指数增长的。
What does this mean? Linearity of solutions, the elegant way of saying it is superposition holds.
这是什么意思,方程的线性关系,是解决问题的十分漂亮的方法。
But if you can accept the purity of the statement I just made, it is at the root of the thing you have a solution.
但如果你能够遵从原教旨主义的方式,那么这就是你解决此问题的根本
So there are formal questions that we will take up time and again.
人们又怎么对待那些资源,这些是我们需要花时间,解决的正式问题。
So that's the topic that I'd like to address today.
这就是我今天要解决的问题。
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.
其实没什么的,一但我们证实了我们,试图想要解决的问题,如果把这个问题用术语或行话简化
These are the problems of insurance that we have to deal with.
这些都是我们要解决的问题
Then, here is what we actually do.
然后,这就是我们真正要解决的问题
So we've got a chord progression.
现在我们把和弦进行的问题解决了。
Although that might cause concern for some people, forcing people to vote is definitely not the answer.
也许这会让一些人担忧,但是强迫人们去投票绝对不是解决问题的方法。
and how using your knowledge of math can help you solve something in biology.
如何用数学方面的知识解决生物方面的问题。
Well, this is a problem that we have solved and will solve in the weeks to come. See you Monday.
嗯,这是我们解决了的一个问题,并且将在接下来几周来解决这个问题,下周一再见。
And so with this example here, I thought I'd propose that we consider exactly how you'd go about tackling something like this.
有了这个例子,我想我们可以,考虑一下应该如何下手,解决这样的问题。
Because you'll have an appropriate level of confidence and competence in your ability to do computational problem solving.
因为你们在自己的能力范围内,拥有应对解决计算问题的,正当水平的自信心和竞争力。
What we really want to worry about is, as the size of the problem gets larger, how does this thing grow? How does the cost go up?
随着问题规模的变大,解决问题花费的代价是怎么增长的,因此我们将会主要地讲讲?
What is the class of algorithm that's- that probably applies to this, and how do I pull something out of that, if you like, a briefcase of possible algorithms to solve?
以及哪种算法-,可能可以应用到这类问题上,问题本身又能提取出什么东西来,以及可能解决问题的一系列方法的简介?
OK. At this point, if we stop, you'll think all algorithms are linear. This is really boring.
可能我们就认为所有的解决这个问题的,算法都是线性增长的了,真很没意思,但是他们真不是对不对?
All right, this is what's called a recurrence relation, there are actually cool ways to solve them. We can kind of eyeball it.
好,这就是所谓的递归关系,也就是解决问题的相当好的办法,我们可以来看看。
Right, so the things we want you to take away from this are, get into the habit of using pseudo code when you sit down to start a problem, write out what are the steps.
好,这儿我想大家明白的就是,养成解决问题时先写伪代码的好习惯,把步骤都写出来,我想要告诉你们的是一个好的程序员。
If I want to try and decide how to tackle a problem in an iterative matter, here the steps I'm going to go through. First thing I'm going to do, is I'm going to choose a variable that's going to count.
但是这就是我对它的观点,如果我试着去以迭代的方式,解决一个问题的话,下面是我应该采取的步骤,第一件要做的事情。
There, they're just storing a database of previously solved problems.
好了,它就是一个存储之前,解决过的问题的数据库。
The second question I want to ask is what's the base case? When do I get down to a problem that's small enough that it's basically trivial to solve? Here it was lists of size one. I could have stopped at lists of size two right. That's an easy comparison.
第二个问题是什么是基础条件?,我要将问题分解到何时才使得问题,小到可以解决的基本问题?,这里是当列表的长度为1有时候,我也可以在长度为2的时候停止分解,那是一个非常简单的对比。
You can take a problem that might be relatively intuitive to solve but when you scale this thing up as is increasingly the case in the web, in large data systems, and so forth, you actually have to now think smart, you actually have to think efficiently and you have to solve this problem effectively.
你可以把一个问题用比较直观的方法解决,但如果你把此类问题的数量增大,正如越来越多的互联网,和大规模数据系统中出现的问题等等,你应该考虑怎样才能更简便,怎样才能更高效,你应该用行之有效的方法处理问题。
Optimal sub structure.
简单一点的子问题的最优方案来解决问题。
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.
好吧,让我们先想一下这件事带给我们的主题,编程和解决问题的思想,一台机器最开始只会一步一个脚印,沿着要解决的问题向前迈进,直到最终的结果出来,最后你会发现,你已经解决了一个相当大,相当有趣的问题,而这个问题在最初看起来确是相当复杂的。
应用推荐