MIT计算机科学及编程导论.英文字幕 下载本文

[MIT计算机科学及编程导论.讲座视频].mit-6-00-f08-lec01-24

By sxj_702@126.com Cueb

The following content is provided under a CreativeCommons license.Your support will help MIT OpenCourseware continue tooffer high-quality educational resources for free.To make a donation, or view additional materials from hundreds of MIT courses,visit MIT OpenCourseware,at ocw.mit.edu .

PROFESSOR: Good morning.Try it again. Good morning. STUDENTS: Good morning. PROFESSOR: Thank you. This is ., also known as Introduction to Computer Science and Programming. My name is Eric Grimson, I have together

PROFESSOR John Guttag over here, we're going to be lecturing the course this term. I want to give you a heads up; you're getting some serious firepower this term. John was department head for ten years, felt like a century, and in course six, I'm the current department head in course six. John's been lecturing for thirty years, roughly. All right, I'm the young guy, I've only been lecturing for twenty-five years. You can tell, I have less grey hair than he does. What I'm trying to say to you is, we take this course really seriously. We hope you do as well. But we think it's really important for the department to help everybody learn about computation, and that's what this course is about. What I want to do today is three things: I'm going to start-- actually, I shouldn't say start, I'm going to do a little bit of administrivia, the kinds of things you need to know about how we're going to run the course. I want to talk about the goal of the course, what it is you'll be able to do at the end of this course when you get through it, and then I want to begin talking about the concepts and tools of computational thinking, which is what we're primarily going to focus on here. We're going to try and help you learn how to think like a computer scientist, and we're going to begin talking about that towards the end of this lecture and of course throughout the rest of the lectures that carry on. Right, let's start with the goals. I'm going to give you goals in two levels. The strategic goals are the following: we want to help prepare freshmen and sophomores who are interested in majoring in course six to get an easy entry into the department, especially for those students who don't have a lot of prior programming experience. If you're in that category, don't panic, you're going to get it. We're going to help you ramp in and you'll certainly be able to start the course six curriculum and do just fine and still finish on target. We don't expect everybody to be a course six major, contrary to popular opinion, so for those are you not in that category, the second thing we want to do is we want to help students who don't plan to major in course six to feel justifiably confident in their ability to write and read small pieces of code. 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. So that you will come away with a sense of what you can do, what you can't do, and what kinds of things you should use to tackle complex problems. And finally, we want to position all students so that you can easily, if you like, compete for things like your office and summer jobs.

Because you'll have an appropriate level of confidence and competence in your ability to do computational problem solving.

Those are the strategic goals. Now, this course is primarily aimed at students who have little or no prior programming experience. As a consequence, we believe that no

STUDENT here is under-qualified for this course: you're all MIT students, you're all qualified to be here. But we also hope that there aren't any students here who are over-qualified for this course. And what do I mean by that? If you've done a lot prior programming, this is probably not the best course for you, and if you're in that category, I would please encourage you to talk to John or I after class about what your goals are, what kind of experience you have, and how we might find you a course that better meets your goals. Second reason we don't want over-qualified students in the class, it sounds a little nasty, but the second reason is, an over-qualified student, somebody who's, I don't know, programmed for Google for the last five years, is going to have an easy time in this course, but we don't want such a

STUDENT accidentally intimidating the rest of you. We don't want you to feel inadequate when you're simply inexperienced. And so, it really is a course aimed at students with littleor no prior

programming experience.And again, if you're not in that category, talk to Johnor I after class, and we'll help you figure out whereyou might want to go.OK.Those are the top-level goals of the course.Let's talk sort of at a more tactical level, about what dowe want you to know in this course.What we want you to be able to do by the time youleave this course?So here are the skills that we would like you to acquire.Right, the first skill we want you to acquire, is we want youto be able to use the basic tools of computational thinkingto write small scale programs.I'm going to keep coming back to that idea, but I'm going tocall it computational thinking.And that's so you can write small pieces of code.And small is not derogatory here, by the way, it just saysthe size of things you're going to be able to do. Second skill we want you to have at the end of this course is the ability to use a vocabulary of computationaltools in order to be able to understand programswritten by others.So you're going to be able to write, you're goingto be able to read.This latter skill, by the way, is incredibly valuable.Because you won't want to do everything from scratchyourself, you want to be able to look at what is beingcreated by somebody else and understand what is inside ofthere, whether it works correctly and how youcan build on it.This is one of the few places where plagiarismis an OK thing.It's not bad to, if you like, learn from the skills of othersin order to create something you want to write.Although we'll come back to plagiarism as abad thing later on.Third thing we want you to do, is to understand thefundamental both capabilities and limitations ofcomputations, and the costs associated with them.And that latter statement sounds funny, you don't thinkof computations having limits, but they do.There're some things that cannot be computed.We want you to understand where those limits are.So you're going to be able to understandabilities and limits.And then, finally, the last tactical skill that you'regoing to get out of this course is you're going to have theability to map scientific problems into acomputational frame.So you're going to be able to take a description ofa problem and map it into something computational.Now if you think about it, boy, it sounds like grammar school.We're going to teach you to read, we're going to teach youto write, we're going to teach you to understand what you canand cannot do, and most importantly, we're going to tryand give you the start of an ability to take a descriptionof a problem from some other domain, and figure out how tomap it into that domain of computation so you can dothe reading and writing that you want to do.OK, in a few minutes we're going to start talking thenabout what is computation, how are we going to start buildingthose tools, but that's what you should take away, that'swhat you're going to gain out of this course by thetime you're done.Now, let me take a sidebar for about five minutes to talkabout course administration, the administrivia, things thatwe're going to do in the course, just so you knowwhat the rules are.Right, so, class is two hours of lecture a week.You obviously know where and you know when,because you're here.Tuesdays and Thursdays at :.One hour of recitation a week, on Fridays, and we'll come backin a second to how you're going to get set up for that.And nine hours a week of outside-the-class work.Those nine hours are going to be primarily working on problemsets, and all the problems sets are going to involveprogramming in Python, which is the language we're goingto be using this term.Now, one of the things you're going to see is the firstproblem sets are pretty easy.Actually, that's probably wrong, John, right?They're very easy.And we're going to ramp up.By the time you get to the end of the term, you're going to bedealing with some fairly complex things, so one of thethings you're going to see is, we're going to make heavy useof libraries, or code written by others.It'll allow you to tackle interesting problems I'll haveyou to write from scratch, but it does mean that this skillhere is going to be really valuable. You need to be able to read that code and understand it, as well as write your own.OK.Two quizzes.During the term, the dates have already been scheduled.John, I forgot to look them up, I think it's October nd andNovember th, it'll be on the course website.My point is, go check the course website, which bythe way is right there.If you have, if you know you have a conflict with one ofthose quiz dates now, please see John or I right away.We'll arrange something ahead of time.But if you-- The reason I'm saying that is, you know, youknow that you're getting married that day for example,we will excuse you from the quiz to get married.We'll expect you come right back to do the quiz by the way,but the-- Boy, tough crowd.All right.If you have a conflict, please let us know.Second thing is, if you have an MIT documented special need fortaking quizzes, please see John or I well in advance.At least two weeks before the quiz.Again, we'll arrange for this, but you need to give usenough warning so that we can deal with that.OK, the quizzes are

open book.This course is not about memory.It's not how well you can memorize facts: in fact, Ithink both John and I are a little sensitive to memorytests, given our age, right John?This is not about how you memorize things, it'sabout how you think.So they're open note, open book.It's really going to test your ability to think.The grades for the course will be assigned roughly, and I usethe word roughly because we reserve the right to move thesenumbers around a little bit, but basically in the followingpercentages: % of your grade comes from the problem sets,the other % come from the quizzes.And I should've said there's two quizzes and a final exam.I forgot, that final exam during final period.So the quiz percentages are %, %, and %.Which makes up the other %.OK.Other administrivia.Let me just look through my list here.First problem set, problem set zero, has already been posted.This is a really easy one.We intend it to be a really easy problem set.It's basically to get you to load up Python on your machineand make sure you understand how to interact with it.The first problem set will be posted shortly, it's alsopretty boring-- somewhat like my lectures but not John's--and that means, you know, we want you just to getgoing on things.Don't worry, we're going to make them more interestingas you go along.Nonetheless, I want to stress that none of these problemssets are intended to be lethal.We're not using them to weed you out, we're usingthem to help you learn.So if you run into a problem set that just,you don't get, all right?Seek help.Could be psychiatric help, could be a TA.I recommend the TA.My point being, please come and talk to somebody.The problems are set up so that, if you start down theright path, it should be pretty straight-forwardto work it through.If you start down a plausible but incorrect path, you cansometimes find yourself stuck in the weeds somewhere, and wewant to bring you back in.So part of the goal here is, this should not be a grueling,exhausting kind of task, it's really something that should behelping you learn the material.If you need help, ask John, myself, or the TAs.That's what we're here for.OK.We're going to run primarily a paperless subject, that'swhy the website is there. Please check it, that's where everything's going to be posted in terms of things you need to know.In particular, please go to it today, you will find a formthere that you need to fill out to register for, or sign upfor rather, a recitation.Recitations are on Friday.Right now, we have them scheduled at :, :,:, :, :, and :.We may drop one of the recitations, just dependingon course size, all right?So we reserve the right, unfortunately, to haveto move you around.My guess is that : is not going to be a tremendouslypopular time, but maybe you'll surprise me.Nonetheless, please go in and sign up.We will let you sign up for whichever recitationmakes sense for you.Again, we reserve the right to move people around if we haveto, just to balance load, but we want you to find somethingthat fits your schedule rather than ours.OK.Other things.There is no required text.If you feel exposed without a text book, you really have to have a textbook, you'll find one recommended-- actually I'm going to reuse that word, John, at least suggest it,on the course website.I don't think either of us are thrilled with the text, it'sthe best we've probably found for Python, it's OK.If you need it, it's there.But we're going to basically not rely on any specific text.Right.Related to that: attendance here is obviouslynot mandatory.You ain't in high school anymore.I think both of us would love to see your smiling faces, orat least your faces, even if you're not smilingat us every day.Point I want to make about this, though, is that we aregoing to cover a lot of material that is not in theassigned readings, and we do have assigned readingsassociated with each one of these lectures.If you choose not to show up today-- or sorry, you didchoose to show up today, if you choose not to show up in futuredays-- we'll understand, but please also understand that theTAs won't have a lot of patience with you if you'reasking a question about something that was eithercovered in the readings, or covered in the lecture and ispretty straight forward.All right?We expect you to behave responsibly andwe will as well.All right.I think the last thing I want to say is, we will not behanding out class notes.Now this sounds like a draconian measure;let me tell you why.Every study I know of, and I suspect every one John knows,about learning, stresses that students learn bestwhen they take notes.Ironically, even if they never look at them.OK.The process of writing is exercising both halves of yourbrain, and it's actually helping you learn, and sotaking notes is really valuable thing.Therefore we're not going to distribute notes.What we will distribute for most lectures is a handoutthat's mostly code examples that we're going to do.I don't happen to have one today because we're notgoing to do a lot of code.We will in future.Those notes are going to make no sense, I'm guessing, outsideof the lecture, all right?So

it's not just, you can swing by : and grab a copy and gooff and catch some more sleep.What we recommend is you use those notes to take your ownannotations to help you understand what's going on,but we're not going to provide class notes. We want you to take your own notes to help you, if you like, spur your own learning process.All right.And then finally, I want to stress that John, myself,all of the staff, our job is to help you learn.That's what we're here for.It's what we get excited about.If you're stuck, if you're struggling, if you'renot certain about something, please ask.We're not mind readers, we can't tell when you'restruggling, other than sort of seeing the expression on yourface, we need your help in identifying that.But all of the TAs, many of whom are sitting down in thefront row over here, are here to help, so come and ask.At the same time, remember that they're students too.And if you come and ask a question that you could haveeasily answered by doing the reading, coming to lecture, orusing Google, they're going to have less patience.But helping you understand things that really are aconceptual difficulty is what they're here for and whatwe're here for, so please come and talk to us.OK.That takes care of the administrivia preamble.John, things we add?

PROFESSOR GUTTAG: Two more quick things. This semester, your class is being videotaped for OpenCourseware. If any of you don't want your image recorded and posted on the web, you're supposed to sit in the back three rows.

PROFESSOR GRIMSON: Ah, thank you. I forgot.

PROFESSOR GUTTAG: --Because the camera may pan.I think you're all very good-looking and give MITa good image, so please, feel free to be filmed.

PROFESSOR GRIMSON: I'll turn around, so if you want to,you know, move to the back, I won't see who moves.Right.Great.Thank you, John.

PROFESSOR GUTTAG: So that, the other thing I want to mention is, recitations are also very important. We will be covering material in recitations that're not in the lectures, not in the reading, and we do expect you to attend recitations.

PROFESSOR GRIMSON: Great. Thanks, John.Any questions about the administrivia?I know it's boring, but we need to do it so you know whatthe ground rules are.Good.OK.Let's talk about computation.As I said, our strategic goal, our tactical goals, are tohelp you think like a computer scientist.Another way of saying it is, we want to give you the skill sothat you can make the computer do what you want it to do.And we hope that at the end of the class, every time you'reconfronted with some technical problem, one of your firstinstincts is going to be, "How do I write the piece of codethat's going to help me solve that?"So we want to help you think like a computer scientist.All right.And that, is an interesting statement.What does it mean, to think like a computer scientist?Well, let's see.The primary knowledge you're going to take away from thiscourse is this notion of computational problem solving,this ability to think in computational modes of thought.And unlike in a lot of introductory courses, as aconsequence, having the ability to memorize isnot going to help you.It's really learning those notions of the toolsthat you want to use.What in the world does it mean to say computationalmode of thought?It sounds like a hifalutin phrase you use when you'retrying to persuade a VC to fund you.Right.So to answer this, we really have to ask a differentquestion, a related question; so, what's computation?It's like a strange statement, right?What is computation?And part of the reason for putting it up is that I wantto, as much as possible, answer that question by separatingout the mechanism, which is the computer, fromcomputational thinking.Right.The artifact should not be what's driving this.It should be the notion of, "What does it meanto do computation?"Now, to answer that, I'm going to back up one more level.And I'm going to pose what sounds like a philosophyquestion, which is, "What is knowledge?" And you'll see inabout two minutes why I'm going to do this.But I'm going to suggest that I can divide knowledge intoat least two categories.OK, and what is knowledge?And the two categories I'm going to divide theminto are declarative and imperative knowledge.Right.What in the world is declarative knowledge?Think of it as statements of fact.It's assertions of truth.Boy, in this political season, that's a really dangerousphrase to use, right?But it's a statement of fact.I'll stay away from the political comments.Let me give you an example of this.Right.Here's a declarative statement.The square root of x is that y such that y squaredequals x, y's positive.You all know that.But what I want you to see here, is that'sa statement of fact.It's a definition.It's an axiom.It doesn't help you find square roots.If I say x