CS 106B

Programming Abstractions

Spring 2020

Stanford University

Computer Science Department

Instructors: Julie Zelenski

                     Chris Gregg

Lecture 1: Welcome!

  • Course lectures will be delivered on Zoom in a "Webinar" format, and students who attend live will be able to ask typed questions that will be moderated (likely by a CA or Section Leader) and passed to the instructor. Lectures will also be recorded, and students can watch them at any time during or after lecture delivery.
  • The course material will closely follow the regular CS 106B curriculum, and post-conditions for the course will be the same as any other quarter -- in other words: we are going to do our best to give you an equivalent experience as during a normal quarter, and we hope you will put in the work to learn as much as you can. We will have more logistical details later in this slide deck.

 

  • As you know, CS 106B is going to be completely online for the quarter, and all students will receive either an "S" (Satisfactory) grade or an "NC" (No Credit) grade for the course.

Lecture 1: It is a Brave New World

Instead of worrying about what you cannot control, shift your energy to what you can create.
Roy T. Bennett, The Light in the Heart

Lecture 1: Today's Topics

  • Instructor Introductions
  • What is CS 106B?
    • Goals for the Course
    • Components of CS 106B
    • Assignments, Grading, Due dates, Late days, Sections, Getting Help
    • Is CS 106B the right class for you?
  • C++
    • Why C++?
    • QT Creator
    • Our first program
    • Our second program
    • The importance of Data Structures
  • Assignments 0 and 1

What day is it? asked Pooh.
It’s today, squeaked Piglet.
My favorite day, said Pooh.
A.A. Milne

Lecture 1: Instruction Team: Lecturers and Head CA

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

Lecture 1: Instruction Team: Section Leaders

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.

Lecture 1: What is CS 106B?

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

Video

(00:32 - 01:05)

Lecture 1: What is CS 106B?

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).

Lecture 1: What is CS 106B?

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.

Lecture 1: CS 106B Goals

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

Lecture 1: CS 106B Goals

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.

Lecture 1: Common Abstractions

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?)

Lecture 1: Common Abstractions

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?

Lecture 1: Common Abstractions

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?

Lecture 1: Common Abstractions

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?

Lecture 1: Common Abstractions

There was something amazingly enticing about programming.

Vint Cerf

  • 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?)
  • How does Shazam figure out what song is playing by listening through your microphone?
  • 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?
  • 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?
  • It turns out that all of these are solved with the same abstraction! They all use hashing, which we will talk about near the end of the course.
  • By learning common abstractions, we can use those abstractions to solve many problems.
  • See the course website to see the list of topics we will cover.

Lecture 1: CS 106B Goals

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.

Lecture 1: CS 106B Goals

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:

Lecture 1: CS 106B Goals

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.

Lecture 1: CS 106B Goals

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.

Lecture 1: CS 106B Goals

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

Lecture 01: Introduction to CS 106B

By Chris Gregg

Lecture 01: Introduction to CS 106B

  • 1,538