ProgrammingMethodology-Lecture27.pdf

(45 KB) Pobierz
Programming Methodology-Lecture27
Instructor (Mehran Sahami): So welcome back. Wow. That’s a little loud. To our last
week of cs106a. Of course, it is another fun filled exciting day despite it being our last
week. We’re getting down to the end. We have class today, there’s class on Wednesday,
there’s no class on Friday. So next time will be our last day. But a few announcements.
There’s actually just a load of announcements because we’re so close to the end of the
quarter. First announcement, there’s one handout, which is your section handout for this
week. There are still sections this week, so despite the fact that we don’t have class on
Friday, still go to your sections this week.
There’s a couple problems on the section handout, as well as the sectional will just be a
general review for the final exam in case you have any questions. That’s a good place to
ask them. Also it would be a good place if you want to ask some questions say, about
[inaudible] for example, the last assignment. Just wondering, how many have started
assignment number seven? Wow, good to see. Anyone done with assignment number
seven? A couple of folks. That’s good to know. I might talk to you afterwards as to how
much time it actually took you, but hopefully, it wasn’t too painful. The graphics contest
was due last Friday. The winners will be announced in next class, so Ben and I actually
took a first pass already over all the contest entries. There was actually some very
impressive entries in the contest. Things you were just kind of jaw dropping, like, go and
show them to other faculty in the department because they’re just that cool. But this
afternoon we are having our staff meeting with all the section leaders and they will
actually be the ones voting and deciding on the winners in each category. So we’ll give
them the short list and they’ll make the final determination, and then on Wednesday, I’ll
announce it to and I’ll check with the winners of the contest to see if they’re okay
demo'ing it. But if they’re okay demo’ing it, then I’ll show you the winning contest
entries as well, plus on Wednesday we’ll have the random drawing to give away the last
sort of grand prize. But if you didn’t happen to win, just for entering you still get an entry
into the grand prize or you could just get a free 100 percent on any assignment in the
class including the final exam. So assignment number seven, we just talked a little bit
about. Since it’s due the last day of the quarter on Friday, but we don’t have class that
day, it’s just electronic submission. So if you’re wondering about what do I do with the
hard copy, you don’t need to do anything with the hard copy. We just need electronic
submissions.
For the other assignments in this class, we requested that you turn in a hard copy because
when you did interactive grading or if you’re a section leader to write comments on, we
actually had something that they could mark up. For assignment number seven, because
it’s due the last day of the quarter, there will be no interactive grading for the last
assignment so the down side is there’s no interactive grading for it, the plus side of that is
that you don’t need to turn in a hard copy because we can just take a look at your online
submission to figure out functionality and other kinds of things. And just as a reminder,
even though it wasn’t clear that was on the handout, like, right on the front the last couple
days, no late days on assignment number seven. Just in case you’re wondering. So final
exam, it’s time to start thinking about the final exam. Finals are next week. You probably
know that, but just in case you didn’t, the final exam is just like the mid-term. It’s open
book and open notes, so you can bring in your text book for the class. Feel free to bring
in all print outs of all your programs, all the notes you’ve taken in the class, all your
handouts. That stuffs all open, but just like the mid-term, it is a closed computer exam. So
if you have a laptop or a PDA or whatever, you can’t use that during the exam. Same
rules basically applies to the mid-term. And we’ll talk a little bit more about the final
when we actually do review for it next class.
The regular final is scheduled for Thursday of finals week. That’s December 13th, 12:15
to 3:15 P.M. in Kresge Auditorium, which is the same place we had the mid-term. One of
the only rooms large enough to actually accommodate us, and the alternate has been
scheduled. So alternate final is December 12th, that’s Wednesday of finals week, 3:30 -
6:30 in the afternoon, also in Kresge Aud. So this time seemed like a relatively unpopular
time for other final exams. And you’re free to take either one. So you don’t need to send
me an email saying you have a conflict with the regular exam or whatever. If you just
want to get done with your finals earlier and you want to take the alternate exam, you’re
just welcome to take the alternate exam. But only take one exam. So you can pick one,
and just one. That’s just life in the city. Okay. And if you’re an SEPD student, I
announced this last time, but I’ll announce it again. I’ve already gotten email from one of
you, which is a good thing. To email me by 5:00 P.M. December 5th, that’s Wednesday
if you’re planning on taking the exam at your site. If you’re gonna come in for the exam,
you don’t need to email me. You can, feel free to email and say, “Hey, man, I’m gonna
come into campus and take the exam.” And you’re welcome to take it at either one of
these times as well as if you’re out in SITN. But if you plan on taking it at your site, send
me an email. Also, let me know the name and email address of your site administrator so
I can send the site administrator your exam to administer to you. So that was just a load
of announcements.
Any questions about anything before we delve into our next great topic? All right. You’re
feeling okay. Good. So a lot of today’s class is actually about life after this class because
we’re getting pretty close to the end of this class. So one of the things I want you to just
kind of know about and so you can think about it, are what are some of the options that
are available to you afterwards. Whether or not you’re just thinking about declaring a
major or if you’ve already declared a major or you just want to get sort of a lay of the
land of what’s this whole computer science thing all about. Because probably the biggest
thing I would stress, despite the fact that you just spent the last nine weeks programming,
is computer science is not computer programming. Okay? A lot of time the two get
equated, but if it was called computer programming, this class wouldn’t be called
programming methodology, we’d just call it something like programs that work, right,
and we wouldn’t worry about style and all this other stuff, and good software engineering
principles, and at the same time, computer science wouldn’t be called computer science,
it would called something like programming. Right? And it’s, like, “Oh, what did you
major in?” “Oh, I majored in programming,” and that’s like, when you say, “Oh, I’m
sorry. I think you can get shots for that kind of thing now.” Because it’s not just about
programming. There is programming in computer science, but there’s actually a science
to the field and there’s a lot of things that go on outside of programming and that’s what
it’s important to, in some sense, appreciate. So if we think about life after this class, let’s
first kind of deal with some of the short-term logistical kinds of things. Like, you just
took this class; you might think, well, there’s probably a couple things you think. You
think, “Hey, Miron, that was kind of interesting, I might consider taking 106b.” You
might consider, “Hey, Miron, that was interesting, I might actually considering minoring
or majoring in computer science.” And you might say, “Hey, Miron, that was interesting,
in the same way, for example, that dropping a brick on my head is interesting, and I’m
gonna run screaming.”
And if you’re thinking the third option, I apologize, because that was not the point of this
class, but here’s a few things that you can potentially think about, even if you’re in the
third option and definitely some things to think about for the first two options. And I
guess there was also that option of the, “Oh, I got the general education requirements out
of the way and now I will go on figuring out what to do with the rest of my life,” and if
that’s the case, you should pay attention as well. So what happens after 106a? So here’s
cs106a, this is where we’re all sort of happy, and we’re scrappy and we’re making social
networks, and life after this kind of, you know, your next immediate step is actually
pretty clear. There’s a class cs106b, that’s called Programming Abstractions, which is the
next class to take. And that class is on a language called C++, so you’ll learn a whole
new language, although, you’ll realize when you actually CC++, that a whole bunch of
things in it are just the same as Java. Whole notions of parameter passing and methods,
and decomposition and objects, all those same things exist in here. Okay. But you also
will get with this class called Programming Abstractions because, so far, what we’ve
done is used a lot of extractions. There you get into a whole bunch of tradeoffs with how
you can make things run more quickly versus perhaps using more memory versus
different kinds of programming techniques that actually come up. There’s also some
really cool ideas that come up in here, which are just sort of mind blowing ideas, which is
the notion – for example, one of them is called recursion, which is so far we have
methods and methods call other methods and they call other methods. What if a method
called itself? That’s kind of weird, Miron. Why would a method call itself? Because some
functions are defined in terms of themselves. Right?
If you kind of think about the factorial function – anyone remember this function? The
“N” function. Right? This is N factorial. And all this really is – sorry if I just shattered
your ear drums, is N times N minus 1 times N minus 2 times….times 1. You just multiply
everything together. That’s where [inaudible] all about. You can define a function in
terms of itself. And it turns out, yeah, a factorial, that’s kind of a simple way to
understand it. It turns out that this is a hugely powerful concept that allows you to do all
kinds of things, and this is kind of another cool thing you get in cs106b. Okay. Now, you
might say, “Okay, Miron, that’s still sounding like programming to me, even though I’m
learning these cool concepts, isn’t that just a programming class,” and in some sense,
yeah, this is a programming class. There’s other options that are also available to you
now that kind of fall into the category of being part of the CS major or the CS minor. A
set of classes called cs103. And cs103 come in a different couple different flavors, like,
vanilla, grape and pork – no, they come in those in a, b sequence and there’s [inaudible] –
I can’t think of anything in the world that would come in those three flavors.
And this is really a class that in some sense is about discrete math. And you might say,
“Oh, gee, Miron, besides your class, I’m taking calculus and that’s about as much fun as
sliding down a 50 foot razor blade. Why would I want to do that again? Not on the sharp
side, right, just imagine the other side, like, the flat side of the razor blade and it’s been
made slick and it’s like a big slide. It’s fun. Wait until all my friends in the math
department see that. Anyway, why would I care about this discrete math thing? Well, first
of all, this is an operative word here, which means this little symbol that you have grown
to know and love, our friend the integral, just nod around, right, this is all discrete, this is,
like, “Hey, you know what, what we want to think about our some things that are useful
to us in a computer science context,” and computers at the end of day are digital objects.
Right. They have ones and zeros, which means there’s a whole bunch of things, like, sets
for example and logic that come up in these things. But there’s also interesting ideas that
come up in here, like, computability. In these classes, you get exposed to some things like
some of the biggest open problems in computer science.
Now, there isn’t time to go into what some of the biggest open problems in computer
science are, but there’s a problem called the P = NP problem. Right. And this is a big
question mark. Basically, we just don’t know if these two things, one of them named P
and the other one named NP are equal to each other or not. And you’ll find out what
those are in the class and you might say, “Okay, Miron, why do I care about that?”
Because it turns out this little problem here, has a $1 million prize associated with it. And
it’s simple enough to explain that after having had 106a when you take these next two
classes you’ll actually get exposed to this problem It’s one of things that’s, like, a minute
to understand, a lifetime to master. And no one’s mastered it yet. But in some sense, this
is also a problem that’s only about 35 years old. Maybe just slightly older than 35 years
old. So it’s not like this problem that’s existed for, like, hundreds of thousands of years
and, you know, cave people were writing does P = NP on stone tablets. This problem
actually came to the floor and people realized it was an important problem in the 70s,
which means it’s possible that it’ll be solved in your lifetime, and it’s possible that you
may be the one, presumably, solving it in your lifetime because it would be difficult to
solve it if it wasn’t in your lifetime.
So even if programming, by itself, doesn’t necessarily turn you on, but you think, you
know, programming is interesting, is there also some deeper science or some
mathematics because for a lot of people, they didn’t necessarily get exposed to computer
science earlier on, but they did get exposed to mathematics, this might be the kind of
thing that really turns you on. Now, you might say, “Okay, Miron, math doesn’t
necessarily turn me on, programming turns me on.” Besides that 106 class, what other
options are there? There’s two other classes, cs107 and 108. And these classes, basically,
look at building, in some sense, larger scale systems, so this involves object oriented
systems and in some sense, building larger applications. So you build some things here
which are outside the scope of a one or two-week project, like, you might spend four
weeks on a large project in this class by the end and actually build a fairly substantial
application, and 107 looks at a whole bunch of issues, that in some sense, we like to think
of as lower level kinds of issues, but it involves a lot of programming and it gets into the
nuts and bolts as to how does the software sit on top of the hardware of your machine and
how do these things interact and getting into understanding memory better and whole
bunch of other things.
And if you think about this set of class, like 106a, b, 103a, b and 107, 108, if you were to
take that set of classes and add to it 2cs electives, that’s the minor. Okay. So the minor is
basically these six core classes. You need to take math up to math51 I should say as a
little side note. Just in case you’re wondering. That’s just something, that, you know,
we’re not responsible for that, it’s just kind of required. And then two cs electives beyond
this kind of stuff and then you’re getting a minor. Okay. So if you want to kick it up a
notch beyond a minor and think about the major – actually, I’ll just leave this up. Two cs
electives, you sort of add that all together and it equals the cs minor, which is kind of fun.
Okay. Now, if you want to think about besides just a cs minor, potentially, actually
majoring in cs, you might want to think about, “Okay, first of all, what are some other
things that I can do in computer science beyond the introductory classes,” and there’s a
whole bunch of things. There’s something that we call artificial intelligence, or just AI,
for short. And there’s a whole bunch of aspects of artificial intelligence. That’s sort of the
highest level.
It’s the notion of trying to make your computer work more intelligently, and in some
sense, appear to be more intelligent, sort of on the order of the intelligence of a person.
But really this has a whole bunch of sub fields to it, for example, robotics and various
other things such as computational biology, there’s a lot of computational biology that’s
ground in artificial intelligence. Data analysis and I’ll show you some examples of these
as we go along. And this is today, and there’s a whole bunch of people in the world who
are wondering what happens tomorrow. And if you can do slightly better than 50 percent
predicting what happens tomorrow based on analyzing all the data from today and before,
you make tons of money. Okay. And if you wondered is this really the case? Yeah, in
fact, anyone heard of a company called D.E. Shaw? Yeah. Anyone. A few folks. Yeah.
It’s David Shaw. He was actually a grad student at Stanford in computer science. And
this whole – I wouldn’t say he started this whole thing, this actually existed long before
that, but there’s whole companies whose entire business is based on the notation of
quantitative analysis and guess who are a bunch of people that they employ? Computer
scientists who go and do the data analysis and actually figure this out. Okay.
So the application and understanding what are all the variables that you care about and
the information that exists in the stock market that you can extract and model with
different kinds of algorithms to make your prediction, is all part of what computer
science is all about. Besides, AI, there’s various other kinds of little areas. I’ll show you
some more pictures, like, robotics. Anyone heard of Darpa Grand Challenge or a little
robot called Junior or Stanley? Yeah. Oh, Junior, he’s so cute. Because it’s a robot, that
in some sense, is a car. Right. And there’s no reason why a car can’t be a robot. Just think
if Carol had wheels on it, and instead of move…you had move at 60 miles an hour, you’d
be doing the same thing, except you’d be doing it in a simulation. This is Stanford’s car,
Junior, and this is a car that’s basically a robot. It doesn’t have a human driver, at least
most of the time. Right? It has things like various kinds of sensors on it, various sorts of
radar and other kinds of laser range finding that sense what’s going on in the world and
Zgłoś jeśli naruszono regulamin