For all students, what we want to do is we want to give you an understanding of the role computation can and cannot play in tackling technical problems.
对所有学生来讲,我们想做的就是,给你们关于计算在能否解决技术问题中,所扮演角色的,认识。
The real issue is to figure out how to build constructs out of this that tackle particular problems, but the fundamental basics of computation are just captured in that set of mechanisms.
坏消息是当然这不是真的,真正的问题是怎么来,构建解决特定的问题的这些结构,但是运算的最基本的东西,仅仅体现在机制集里。
I only give, I don't know, about 10% or 20% for getting the right number in a computation. I tell my graders, if the student demonstrates minimal acceptable proficiency that student has to get a passing score.
我只是给,我不知道,10%或者20%的随机概率得到合适的数字,我告诉我的学生们,如果有人想证明,最小可接受的熟练,就是学生们得到一个及格的分数。
And I'll also remind you, and we're going to see this in the next example, we talked about looking at the worst case behavior. In these cases there's no best case worst case, it's just doing one computation.
我还要提醒大家的就是,我们也会在下一个例子里发现者一点,我们谈到了要去考虑最坏的情况,在下面这些例子里,没有好情况坏情况之分,就只是一次运算。
So even within this framework of, given a description of a computation as a set of steps, in the idea that I could build a circuit to do it, let me suggest for you what would be a wonderful circuit to build.
所以即使需要在将计算描述,当成一系列步骤中的一步,这个框架之内,我也完全可以建立一个线路,来完成那个想法,让我为你们假设能建造起,一个多么棒的线路吧。
OK, in a few minutes we're going to start talking then about what is computation, how are we going to start building those tools, but that's what you should take away, that's what you're going to gain out of this course by the time you're done.
好啦,我们会花一点儿时间,谈谈什么是计算,我们如何去建造这些工具,但是这些是你应该,在离开这个课堂时,应该学会的事儿。
The body of that function looks exactly like the computation up above, except I'm simply using those in place of the specific message I had before.
方法体内部看起来,很像上面的计算过程,除了我用这些来替代了,原来的那些特殊信息。
And as long as that smaller computation reduces to another smaller computation, eventually I ought to get to the place where I'm down in that base case.
如果我不属于基础事件,那么我需要把它简化为更简单的计算,随着计算的不断简化,最终我能分解成基础事件。
At that point we're in the base case and we can unwrap this computation.
在这一步我们就是属于基础事件了,也就是说我们可以打开这个计算了。
Second thing we've got to worry about is, what's a basic step? All right, if I bury a whole lot of computation inside of something, I can say, wow, this program, you know, runs in one step. Unfortunately, that one step calls the Oracle at Delphi and gets an answer back. Maybe not quite what you want.
我们需要担心的第二件事情就是,什么该作为一个基本的步骤呢?,如果我把一大堆的计算过程放到里面,我可以说,噢,这个程序你知道的,一步就完成了,不幸的是,这一步可能要靠预言家才能得到答案,这可能跟你想要的结果不太相同吧。
What we're saying is, in order to do computation, we want to describe recipes, we want to describe this sequence of steps built on some primitives, and we want to describe the flow of control that goes through those sequence of steps as we carry on So the last thing we need before we can start talking about real programming is, we need to describe those recipes.
我们在说,为了做计算,我们想描述一个方法,想描述建立在,相同基本类型上的步骤序列,而且我们想描述经过我们设计的,步骤的序列的,控制流程,因此我们开始谈论真正的编程之前,的最后一件事是,我们需要描述一下那些方法。
What do I have here? I need the variable, ANS, ANS I need x, and I need ANS times ANS, ANS times ANS. Right. Those are the three things that are involved in this computation.
因此让我先用这个方法做吧,我这里需要什么呢?我需要变量,还需要x,然后将ANS乘以ANS,对,在这个计算中涉及到了三件事情。
Because in doing that, Python would then have a value that it could pass on into some other part of a computation, and if it wasn't what I wanted, I might be a long ways downstream in the computation before I actually hit some result that makes no sense.
因为如果这样做的话,Python会将,输入的值传递到下面的,一些运算中去,如果这个值的类型不是我想要的,我可能会在得到,一个毫无意义的结果之前,经历一个很长时间的,计算过程。
This was one of the very first recorded bugs in the history of computation.
在关于计算的历史上,有一个最早记录的bug,如果你们。
应用推荐