What I want this class to be is a class where at least sometimes, like on this homework assignment, I set up a model for you, set up the story for you, and then you have to actually figure out how do I set this up properly and how do I solve it out?
我希望这个课程是至少在某些时候,就像这次家庭作业,我为你们设定一个模型,设定故事情节,然后由你们自己实际操作,如何恰当地设计并解决它
And when I solve it for k2 boundary conditions, s2 I get s2.
在k2条件下我,得到解。
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.
所以我并没有施魔法,我已经告诉了你,一种快速解决背包问题的方法了,但是某些方面它的核心仍然是指数增长的。
So I have two solutions here; one, what would be sort of the obvious sort of hackish or solve it fast solution?
我这里有两个解决方案,一是有没有一个明显的,独创性的,快速地解决方案?
I'll get you to solve it out on a homework assignment, so you can actually prove that.
我让你们回去做一次作业,你们就都明白了
Normally, if I tell you 3x + 4y = 6, and 9x + 6y = 14, you know how to solve it.
一般来说,如果我给你两个方程 3x + 4y = 6,和 9x + 6y = 14,你们肯定会解
If I haven't solved the problem, let me solve it, and store the answer away for later reference.
让我解决它,然后保留答案以备下次调用。
That doesn't solve the problem we had before though Then I'm going to append it, and keep the last change for future use.
这样没有解决我们之前的问题,所以我要给它加上一个值,让上一次的变化能够用到未来的例子中。
And then they get really angry and say I am going to solve this if it is the last thing I do.
然后他们真的很愤怒,所我就要解决这个,如果这是我做的最后一个。
I actually do get worked up over these things because it drives me nuts because these are not hard problems to solve and yet consistently throughout society and your own laptops there are dozens of examples I'm sure of poorly designed software.
我确实对这些东西很生气,因为它令我发狂,因为这不是很难解决的难题,然而贯穿整个社会,在你自己的笔记本上,我确信有很多这样,设计地很挫的软件的例子。
There's a tendency for people to say, oh this problem's exponential, I can't solve it.
人们往往会说,哦这是个指数型的问题我没法解决它。
The power of linearity is F=k1+k2 if I come across f of x, y, z equals k1 plus k2, if it is a linear equation, I don't have to go and solve it all over again.
线性的威力是,一个方程,如果它是个线性方程,那么我就不用再去解他了。
So if you demonstrate something by writing an intelligent answer just by outlining it and saying, well, what I would do is I would equate the energy lambda and then solve for lambda, I can see that you know what is going on.
如果你想证明一些东西,通过写下一些很天才的答案,仅仅大致说一下,好的,我想做的是能量相等,然后解出,我能看到你知道怎么做。
Well, I solve 2 or 3 exponential problems before breakfast every day. You know things like, how to find my way to the bathroom is inherently exponential, but I manage to solve it anyway.
你要知道如何找到,我的浴室就是一个,固有的指数型问题,但是我还是能解决它。
I am going to solve it graphically and I am going to solve it analytically.
我将采用图解法,然后我将用分析法解决它。
I am going to show the equation, but I don't expect you to solve it.
我将给出这个方程式,但我不期望你可以得出解。
I'm going to let t of b be the number of steps it takes to solve the problem of size b.
我会设立一个t作为,计算指数为b的时候解决问题需要的步骤数。
Somebody who's not a math major, tell me how I solve out for the maybe the math majors can't do it actually, it's too simple.
谁不是数学专业的,告诉我们怎么解呀,数学专业的觉得它太简单而不屑去解
And I am not going to take the time to solve it because I think that is a waste of class time, but those are the three unknowns.
但我并不打算把解这几个方程,我觉得那会是浪费课堂时间,但那是三个未知式。
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.
如果我想要解决这个问题,这就是我要解决它的方式了,第一件我要做的事情就是要,输入一个浮点数作为三角形的底。
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的时候停止分解,那是一个非常简单的对比。
Good, so this is our key expression and I'm going to use this expression; I'm going to solve it for q1.
好了,这是个关键表达式,我们一会还要用到它的,我们用它来解出q1
I've got one test, I've got a subtraction, I've got a multiplication, that's three steps, plus whatever number of steps it takes to solve a problem of size b minus 1.
我进行了一次比较,一次减法,一次乘法,一共是三个步骤,再加上t的步骤数。
So the best response for Player 1, as a function of what Player 2 chooses, q2, is just equal to the q1 hat in this expression and if I solve that out carefully, I will no doubt make a mistake, but let's try it.
这个就是参与人1的最佳对策,它是参与人2策略q2的一个函数,它和之前的q1帽那个表达式是相等的,虽然我是很仔细地计算的,还是有可能算错的,我来验证一下
How would we go about, I mean I don't want to do it because I'll probably get it wrong, but if I wanted to solve out for this X and the Y, since this is a QR class, let's just talk about it a second.
我们怎么解呢,我的意思是我现在不会去计算,因为我可能会算错,但是如果你真的很想解出X和Y的值,介于这是一节需要快速反应的课,那我们花些时间来探讨一下吧
应用推荐