CS 106B
Programming Abstractions
Spring 2020
Stanford University
Computer Science Department
Instructors: Julie Zelenski
Chris Gregg
Instead of worrying about what you cannot control, shift your energy to what you can create.
― Roy T. Bennett, The Light in the Heart
What day is it? asked Pooh.
It’s today, squeaked Piglet.
My favorite day, said Pooh.
― A.A. Milne
Tell me and I forget, teach me and I may remember, involve me and I learn.
― Benjamin Franklin
Julie Zelenski
Chris Gregg
Lecturers
Head CA
Nick Bowman
When you learn, teach, when you get, give.
― Maya Angelou
There will be tons of Section Leaders, who will each lead a small online section, and will grade your work. They will also hold
individual grading sessions (IGs), and
they will staff the virtual LaIR for office hours.
SLs are a tremendously dedicated group, and are outstanding teachers in their own right.
Computer Science is no more about computers than astronomy is about telescopes
― Edsger Wybe Dijkstra
CS106B: Learn core ideas in how to
model and solve complex problems with computers
Complex Problem #1: Self Driving Cars
(00:32 - 01:05)
The most important property of a program is whether it accomplishes the intention of its user.
― C.A.R. Hoare
CS106B: Learn core ideas in how to
model and solve complex problems with computers
Complex Problem #2: Compressing Data
Comcast says that I should get "Download speeds up to 75 Megabits per second". If I did (I usually don't), it would be impossible to send video through Zoom.
At the end of the course, we will investigate (and you will program!) an encoding
52MB/s = 416Mbps
algorithm that produces lossless compression (Zoom is lossy compression, meaning that some data is lost, but hopefully not enough to compromise the viewability of the stream).
Speech recognition and the understanding of language is core to the future of search and information, but there are lots of hard problems such as understanding how a reference works, understanding what ‘he’, ‘she’ or ‘it’ refers to in a sentence. ... That’s just one of the millions of problems to solve in language.
― Ben Gomes, Head of Search at Google
CS106B: Learn core ideas in how to
model and solve complex problems with computers
Complex Problem #3: Speech Recognition
The fact that you can ask your phone, in your own language and with your own accent, a question and have it answer within seconds is incredible.
The technology that allows this is not only complex, but it takes a tremendous amount of processing -- your voice is analyzed in the cloud, not on your phone.
A goal without a plan is just a wish.
― Antoine de Saint-Exupéry
I think goals should never be easy, they should force you to work, even if they are uncomfortable at the time.
― Michael Phelps
Learn core ideas in how to model and solve complex problems with computers.
To that end:
Explore common abstractions
Harness the power of recursion
Learn and analyze efficient algorithms
Abstraction is one of the greatest visionary tools ever invented by human beings to imagine, decipher, and depict the world.
― Jerry Saltz
To that end:
Explore common abstractions
Harness the power of recursion
Learn and analyze efficient algorithms
Learn core ideas in how to model and solve complex problems with computers.
The first programming assignment I had in high school was to find the first 100 Fibonacci numbers. Instead, I thought it would be cooler to write a program to get the teacher's password and all the other students' passwords. And the teacher gave me an A and told the class how smart I was.
―Kevin Mitnick
How are user passwords kept secure when logging into a website (or, why shouldn't a website ever be able to send you your password?)
The radio doesn't want to play you until you're No.1 on Shazam, and you can't get No.1 on Shazam without getting played.
―Tones and I
How does Shazam figure out what song is playing by listening through your microphone?
I'm so fast that last night I turned off the light switch in my hotel room and was in bed before the room was dark.
―Muhammad Ali
How can it be possible to search for a value in a data structure without having to look at any of the other values (or at least only a few other values)? I.e., how can we program super fast search?
The best book on programming for the layman is 'Alice in Wonderland'; but that's because it's the best book on anything for the layman.
―Alan Perlis
What is a digital signature, and how can it be used to prove that I was the person that sent an email, or signed a document?
There was something amazingly enticing about programming.
―Vint Cerf
In order to understand recursion you must first understand recursion.
― Unknown
To that end:
Explore common abstractions
Harness the power of recursion
Learn and analyze efficient algorithms
Learn core ideas in how to model and solve complex problems with computers.
When students first encounter recursion, they often react with suspicion to the entire idea, as if they have just been exposed to some conjurer's trick rather than a critically important programming methodology.
― Eric S. Roberts
The logic behind the recursive tree below takes about five lines of code:
Learning to think in this new way requires students to examine recursion from several different perspectives.
― Eric S. Roberts
Recursion is a powerful tool that we will learn — once you start thinking recursively, you will be able to solve many problems that would be extremely hard to solve without it.
I took a computer-science course to fill a prerequisite at Stanford, and I realized that every day was a new problem, and every day you got to think about how to solve something new, how to reason through something new, how to develop an algorithm to solve for something you hadn't worked on before.
―Marissa Mayer
To that end:
Explore common abstractions
Harness the power of recursion
Learn and analyze efficient algorithms
Learn core ideas in how to model and solve complex problems with computers.
I took a computer-science course to fill a prerequisite at Stanford, and I realized that every day was a new problem, and every day you got to think about how to solve something new, how to reason through something new, how to develop an algorithm to solve for something you hadn't worked on before.
―Marissa Mayer