146
61A Lecture 1 Wednesday, August 24, 2016

61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

61A Lecture 1

Wednesday, August 24, 2016

Page 2: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Welcome to CS 61A!

2

I'm John DeNero

Page 3: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Welcome to CS 61A!

2

I'm John DeNero

Page 4: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Welcome to CS 61A!

2

I'm John DeNero

Page 5: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Welcome to CS 61A!

2

I'm John DeNero

Page 6: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Welcome to CS 61A!

2

How to contact John:[email protected]

I'm John DeNero

Page 7: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Welcome to CS 61A!

2

How to contact John:[email protected]

piazza.com/berkeley/fall2016/cs61a

I'm John DeNero

Page 8: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Welcome to CS 61A!

2

How to contact John:[email protected]

piazza.com/berkeley/fall2016/cs61a

John's office hours:

781 Soda

Monday & Wednesday 11am - 12pm

By appointment: denero.org/meet

I'm John DeNero

Page 9: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

The 61A Community

3

Page 10: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

The 61A Community

3

45 undergraduate student instructors / teaching assistants (TAs):

Page 11: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

The 61A Community

3

45 undergraduate student instructors / teaching assistants (TAs):

• Teach lab & discussion sections

Page 12: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

The 61A Community

3

45 undergraduate student instructors / teaching assistants (TAs):

• Teach lab & discussion sections

• Hold office hours

Page 13: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

The 61A Community

3

45 undergraduate student instructors / teaching assistants (TAs):

• Teach lab & discussion sections

• Hold office hours

• Lots of other stuff: develop assignments, grade exams, etc.

Page 14: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

The 61A Community

3

45 undergraduate student instructors / teaching assistants (TAs):

• Teach lab & discussion sections

• Hold office hours

• Lots of other stuff: develop assignments, grade exams, etc.

45+ tutors & mentors:

Page 15: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

The 61A Community

3

45 undergraduate student instructors / teaching assistants (TAs):

• Teach lab & discussion sections

• Hold office hours

• Lots of other stuff: develop assignments, grade exams, etc.

45+ tutors & mentors:

• Teach mentoring sections

Page 16: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

The 61A Community

3

45 undergraduate student instructors / teaching assistants (TAs):

• Teach lab & discussion sections

• Hold office hours

• Lots of other stuff: develop assignments, grade exams, etc.

45+ tutors & mentors:

• Teach mentoring sections

• Hold office hours

Page 17: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

The 61A Community

3

45 undergraduate student instructors / teaching assistants (TAs):

• Teach lab & discussion sections

• Hold office hours

• Lots of other stuff: develop assignments, grade exams, etc.

45+ tutors & mentors:

• Teach mentoring sections

• Hold office hours

• Lots of other stuff: homework parties, mastery sections, etc.

Page 18: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

The 61A Community

3

45 undergraduate student instructors / teaching assistants (TAs):

• Teach lab & discussion sections

• Hold office hours

• Lots of other stuff: develop assignments, grade exams, etc.

45+ tutors & mentors:

• Teach mentoring sections

• Hold office hours

• Lots of other stuff: homework parties, mastery sections, etc.

200+ lab assistants help answer your individual questions

Page 19: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

The 61A Community

3

45 undergraduate student instructors / teaching assistants (TAs):

• Teach lab & discussion sections

• Hold office hours

• Lots of other stuff: develop assignments, grade exams, etc.

45+ tutors & mentors:

• Teach mentoring sections

• Hold office hours

• Lots of other stuff: homework parties, mastery sections, etc.

200+ lab assistants help answer your individual questions

1,500+ fellow students make CS 61A unique

Page 20: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Parts of the Course

4

Page 21: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Parts of the Course

Lecture: Videos posted to cs61a.org before each live lecture

4

Page 22: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Parts of the Course

Lecture: Videos posted to cs61a.org before each live lecture

Lab section: The most important part of this course (next week)

4

Page 23: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Parts of the Course

Lecture: Videos posted to cs61a.org before each live lecture

Lab section: The most important part of this course (next week)

Discussion section: The most important part of this course (this week)

4

Page 24: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Parts of the Course

Lecture: Videos posted to cs61a.org before each live lecture

Lab section: The most important part of this course (next week)

Discussion section: The most important part of this course (this week)

Staff office hours: The most important part of this course (next week)

4

Page 25: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Parts of the Course

Lecture: Videos posted to cs61a.org before each live lecture

Lab section: The most important part of this course (next week)

Discussion section: The most important part of this course (this week)

Staff office hours: The most important part of this course (next week)

Online textbook: http://composingprograms.com

4

Page 26: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Parts of the Course

Lecture: Videos posted to cs61a.org before each live lecture

Lab section: The most important part of this course (next week)

Discussion section: The most important part of this course (this week)

Staff office hours: The most important part of this course (next week)

Online textbook: http://composingprograms.com

Weekly homework assignments, three exams, & four programming projects

4

Page 27: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Parts of the Course

Lecture: Videos posted to cs61a.org before each live lecture

Lab section: The most important part of this course (next week)

Discussion section: The most important part of this course (this week)

Staff office hours: The most important part of this course (next week)

Online textbook: http://composingprograms.com

Weekly homework assignments, three exams, & four programming projects

Lots of optional special events to help you complete all this work

4

Page 28: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

An Introduction to Computer Science

Page 29: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is Computer Science?

6

Page 30: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is Computer Science?

6

The study of

Page 31: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is Computer Science?

6

What problems can be solved using computation,The study of

Page 32: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is Computer Science?

6

What problems can be solved using computation,How to solve those problems, andThe study of

Page 33: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is Computer Science?

6

What problems can be solved using computation,How to solve those problems, andWhat techniques lead to effective solutions

The study of

Page 34: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is Computer Science?

Systems

6

What problems can be solved using computation,How to solve those problems, andWhat techniques lead to effective solutions

The study of

Page 35: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is Computer Science?

Systems

Artificial Intelligence

6

What problems can be solved using computation,How to solve those problems, andWhat techniques lead to effective solutions

The study of

Page 36: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is Computer Science?

Systems

Artificial Intelligence

Graphics

6

What problems can be solved using computation,How to solve those problems, andWhat techniques lead to effective solutions

The study of

Page 37: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is Computer Science?

Systems

Artificial Intelligence

Graphics

Security

6

What problems can be solved using computation,How to solve those problems, andWhat techniques lead to effective solutions

The study of

Page 38: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is Computer Science?

Systems

Artificial Intelligence

Graphics

Security

Networking

Programming Languages

Theory

Scientific Computing

...

6

What problems can be solved using computation,How to solve those problems, andWhat techniques lead to effective solutions

The study of

Page 39: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is Computer Science?

Systems

Artificial Intelligence

Graphics

Security

Networking

Programming Languages

Theory

Scientific Computing

...

6

What problems can be solved using computation,How to solve those problems, andWhat techniques lead to effective solutions

The study of

Page 40: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is Computer Science?

Systems

Artificial Intelligence

Graphics

Security

Networking

Programming Languages

Theory

Scientific Computing

...

6

Decision Making

What problems can be solved using computation,How to solve those problems, andWhat techniques lead to effective solutions

The study of

Page 41: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is Computer Science?

Systems

Artificial Intelligence

Graphics

Security

Networking

Programming Languages

Theory

Scientific Computing

...

6

Decision Making

Robotics

What problems can be solved using computation,How to solve those problems, andWhat techniques lead to effective solutions

The study of

Page 42: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is Computer Science?

Systems

Artificial Intelligence

Graphics

Security

Networking

Programming Languages

Theory

Scientific Computing

...

6

Decision Making

Robotics

Natural Language Processing

What problems can be solved using computation,How to solve those problems, andWhat techniques lead to effective solutions

The study of

Page 43: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is Computer Science?

Systems

Artificial Intelligence

Graphics

Security

Networking

Programming Languages

Theory

Scientific Computing

...

6

Decision Making

Robotics

Natural Language Processing

...

What problems can be solved using computation,How to solve those problems, andWhat techniques lead to effective solutions

The study of

Page 44: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is Computer Science?

Systems

Artificial Intelligence

Graphics

Security

Networking

Programming Languages

Theory

Scientific Computing

...

6

Decision Making

Robotics

Natural Language Processing

...

What problems can be solved using computation,How to solve those problems, andWhat techniques lead to effective solutions

The study of

Page 45: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is Computer Science?

Systems

Artificial Intelligence

Graphics

Security

Networking

Programming Languages

Theory

Scientific Computing

...

6

Decision Making

Robotics

Natural Language Processing

...

What problems can be solved using computation,How to solve those problems, andWhat techniques lead to effective solutions

The study of

Answering Questions

Page 46: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is Computer Science?

Systems

Artificial Intelligence

Graphics

Security

Networking

Programming Languages

Theory

Scientific Computing

...

6

Decision Making

Robotics

Natural Language Processing

...

What problems can be solved using computation,How to solve those problems, andWhat techniques lead to effective solutions

The study of

Answering Questions

Translation

Page 47: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is Computer Science?

Systems

Artificial Intelligence

Graphics

Security

Networking

Programming Languages

Theory

Scientific Computing

...

6

Decision Making

Robotics

Natural Language Processing

...

What problems can be solved using computation,How to solve those problems, andWhat techniques lead to effective solutions

The study of

Answering Questions

Translation

...

Page 48: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is This Course About?

7

Page 49: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is This Course About?

A course about managing complexity

7

Page 50: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is This Course About?

A course about managing complexity

Mastering abstraction

7

Page 51: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is This Course About?

A course about managing complexity

Mastering abstraction

Programming paradigms

7

Page 52: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is This Course About?

A course about managing complexity

Mastering abstraction

Programming paradigms

An introduction to programming

7

Page 53: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is This Course About?

A course about managing complexity

Mastering abstraction

Programming paradigms

An introduction to programming

Full understanding of Python fundamentals

7

Page 54: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is This Course About?

A course about managing complexity

Mastering abstraction

Programming paradigms

An introduction to programming

Full understanding of Python fundamentals

Combining multiple ideas in large projects

7

Page 55: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is This Course About?

A course about managing complexity

Mastering abstraction

Programming paradigms

An introduction to programming

Full understanding of Python fundamentals

Combining multiple ideas in large projects

How computers interpret programming languages

7

Page 56: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is This Course About?

A course about managing complexity

Mastering abstraction

Programming paradigms

An introduction to programming

Full understanding of Python fundamentals

Combining multiple ideas in large projects

How computers interpret programming languages

Different types of languages: Scheme & SQL

7

Page 57: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

What is This Course About?

A course about managing complexity

Mastering abstraction

Programming paradigms

An introduction to programming

Full understanding of Python fundamentals

Combining multiple ideas in large projects

How computers interpret programming languages

Different types of languages: Scheme & SQL

A challenging course that will demand a lot of you

7

Page 58: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Alternatives to CS 61A

Page 59: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

CS 10: The Beauty and Joy of Computing

9

Page 60: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

CS 10: The Beauty and Joy of Computing

9

Page 61: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

CS 10: The Beauty and Joy of Computing

9

Page 62: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

CS 10: The Beauty and Joy of Computing

Designed for students without prior experience

9

Page 63: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

CS 10: The Beauty and Joy of Computing

Designed for students without prior experience

A programming environment created by Berkeley, now used in courses around the world and online

9

Page 64: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

CS 10: The Beauty and Joy of Computing

Designed for students without prior experience

A programming environment created by Berkeley, now used in courses around the world and online

9

Page 65: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

CS 10: The Beauty and Joy of Computing

Designed for students without prior experience

A programming environment created by Berkeley, now used in courses around the world and online

9

Page 66: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

CS 10: The Beauty and Joy of Computing

Designed for students without prior experience

A programming environment created by Berkeley, now used in courses around the world and online

An introduction to fundamentals (& Python) that sets students up for success in CS 61A

9

Page 67: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

CS 10: The Beauty and Joy of Computing

Designed for students without prior experience

A programming environment created by Berkeley, now used in courses around the world and online

An introduction to fundamentals (& Python) that sets students up for success in CS 61A

Taught in Fall 2016 by Dan Garcia

9

Page 68: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

CS 10: The Beauty and Joy of Computing

Designed for students without prior experience

A programming environment created by Berkeley, now used in courses around the world and online

An introduction to fundamentals (& Python) that sets students up for success in CS 61A

Taught in Fall 2016 by Dan Garcia

More info: cs10.org

9

Page 69: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Data Science 8: Foundations of Data Science

10

Page 70: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Data Science 8: Foundations of Data Science

Fundamentals of computing, statistical inference, & machine learning applied to real-world data sets

10

Page 71: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Data Science 8: Foundations of Data Science

Fundamentals of computing, statistical inference, & machine learning applied to real-world data sets

10

Page 72: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Data Science 8: Foundations of Data Science

Fundamentals of computing, statistical inference, & machine learning applied to real-world data sets

Great programming practice for CS 61A

10

Page 73: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Data Science 8: Foundations of Data Science

Fundamentals of computing, statistical inference, & machine learning applied to real-world data sets

Great programming practice for CS 61A

Cross-listed as CS C8, Stat C8, & Info C8

10

Page 74: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Data Science 8: Foundations of Data Science

Fundamentals of computing, statistical inference, & machine learning applied to real-world data sets

Great programming practice for CS 61A

Cross-listed as CS C8, Stat C8, & Info C8

Taught in Fall 2016 by Ani Adhikari

10

Page 75: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Data Science 8: Foundations of Data Science

Fundamentals of computing, statistical inference, & machine learning applied to real-world data sets

Great programming practice for CS 61A

Cross-listed as CS C8, Stat C8, & Info C8

Taught in Fall 2016 by Ani Adhikari

More info: data8.org & databears.berkeley.edu

10

Page 76: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Course Policies

Page 77: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Course Policies

12

Page 78: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Course Policies

12

Learning

Page 79: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Course Policies

12

Learning

Community

Page 80: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Course Policies

12

Learning

Course Staff

Community

Page 81: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Course Policies

12

Learning

Course Staff

Details...

http://cs61a.org/articles/about.html

Community

Page 82: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Collaboration

13

Page 83: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Collaboration

13

Asking questions is highly encouraged

Page 84: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Collaboration

• Discuss everything with each other; learn from your fellow students!

13

Asking questions is highly encouraged

Page 85: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Collaboration

• Discuss everything with each other; learn from your fellow students!

• Homework can be completed with a partner

13

Asking questions is highly encouraged

Page 86: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Collaboration

• Discuss everything with each other; learn from your fellow students!

• Homework can be completed with a partner

• Projects should be completed with a partner

13

Asking questions is highly encouraged

Page 87: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Collaboration

• Discuss everything with each other; learn from your fellow students!

• Homework can be completed with a partner

• Projects should be completed with a partner

• Choose a partner from your discussion section

13

Asking questions is highly encouraged

Page 88: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Collaboration

• Discuss everything with each other; learn from your fellow students!

• Homework can be completed with a partner

• Projects should be completed with a partner

• Choose a partner from your discussion section

13

The limits of collaboration

Asking questions is highly encouraged

Page 89: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Collaboration

• Discuss everything with each other; learn from your fellow students!

• Homework can be completed with a partner

• Projects should be completed with a partner

• Choose a partner from your discussion section

13

• One simple rule: Don’t share your code, except with your partner

The limits of collaboration

Asking questions is highly encouraged

Page 90: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Collaboration

• Discuss everything with each other; learn from your fellow students!

• Homework can be completed with a partner

• Projects should be completed with a partner

• Choose a partner from your discussion section

13

• One simple rule: Don’t share your code, except with your partner

• Copying project solutions causes people to fail

The limits of collaboration

Asking questions is highly encouraged

Page 91: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Collaboration

• Discuss everything with each other; learn from your fellow students!

• Homework can be completed with a partner

• Projects should be completed with a partner

• Choose a partner from your discussion section

13

• One simple rule: Don’t share your code, except with your partner

• Copying project solutions causes people to fail

• We really do catch people who violate the rules, because...

The limits of collaboration

Asking questions is highly encouraged

Page 92: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Collaboration

• Discuss everything with each other; learn from your fellow students!

• Homework can be completed with a partner

• Projects should be completed with a partner

• Choose a partner from your discussion section

13

• One simple rule: Don’t share your code, except with your partner

• Copying project solutions causes people to fail

• We really do catch people who violate the rules, because...

• We also know how to search the web for solutions

The limits of collaboration

Asking questions is highly encouraged

Page 93: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Collaboration

• Discuss everything with each other; learn from your fellow students!

• Homework can be completed with a partner

• Projects should be completed with a partner

• Choose a partner from your discussion section

13

• One simple rule: Don’t share your code, except with your partner

• Copying project solutions causes people to fail

• We really do catch people who violate the rules, because...

• We also know how to search the web for solutions

• We use computers to check your work

The limits of collaboration

Asking questions is highly encouraged

Page 94: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Collaboration

• Discuss everything with each other; learn from your fellow students!

• Homework can be completed with a partner

• Projects should be completed with a partner

• Choose a partner from your discussion section

13

• One simple rule: Don’t share your code, except with your partner

• Copying project solutions causes people to fail

• We really do catch people who violate the rules, because...

• We also know how to search the web for solutions

• We use computers to check your work

The limits of collaboration

Asking questions is highly encouraged

Build good habits now

Page 95: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Expressions

Page 96: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Types of expressions

15

Page 97: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Types of expressions

15

An expression describes a computation and evaluates to a value

Page 98: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

18 + 69

Types of expressions

15

An expression describes a computation and evaluates to a value

Page 99: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

18 + 696

23

Types of expressions

15

An expression describes a computation and evaluates to a value

Page 100: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

18 + 696

23

p3493161

Types of expressions

15

An expression describes a computation and evaluates to a value

Page 101: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

18 + 696

23

p3493161

sin⇡

Types of expressions

15

An expression describes a computation and evaluates to a value

Page 102: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

18 + 696

23

p3493161

sin⇡

|� 1869|

Types of expressions

15

An expression describes a computation and evaluates to a value

Page 103: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

18 + 696

23

p3493161

sin⇡

100X

i=1

i

|� 1869|

Types of expressions

15

An expression describes a computation and evaluates to a value

Page 104: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

18 + 696

23

p3493161

sin⇡

100X

i=1

i

|� 1869|

✓69

18

Types of expressions

15

An expression describes a computation and evaluates to a value

Page 105: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

18 + 696

23

p3493161

sin⇡

f(x)100X

i=1

i

|� 1869|

✓69

18

Types of expressions

15

An expression describes a computation and evaluates to a value

Page 106: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

18 + 696

23

p3493161

sin⇡

f(x)100X

i=1

i

|� 1869|

✓69

18

2100

Types of expressions

15

An expression describes a computation and evaluates to a value

Page 107: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

18 + 696

23

p3493161

sin⇡

f(x)100X

i=1

i

|� 1869|

✓69

18

2100

log2 1024

Types of expressions

15

An expression describes a computation and evaluates to a value

Page 108: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

18 + 696

23

p3493161

sin⇡

f(x)100X

i=1

i

|� 1869|

✓69

18

2100

log2 1024

7 mod 2

Types of expressions

15

An expression describes a computation and evaluates to a value

Page 109: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

18 + 696

23

p3493161

sin⇡

f(x)100X

i=1

i

|� 1869|

✓69

18

2100

log2 1024

7 mod 2

limx!1

1

x

Types of expressions

15

An expression describes a computation and evaluates to a value

Page 110: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

18 + 696

23

p3493161

sin⇡

f(x)100X

i=1

i

|� 1869|

✓69

18

2100

log2 1024

7 mod 2

limx!1

1

x

Types of expressions

15

An expression describes a computation and evaluates to a value

Page 111: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Call Expressions in Python

All expressions can use function call notation

(Demo)

16

Page 112: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Anatomy of a Call Expression

17

Page 113: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Anatomy of a Call Expression

17

add ( 2 , 3 )

Page 114: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Anatomy of a Call Expression

17

add ( 2 , 3 )

Page 115: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Anatomy of a Call Expression

17

add ( 2 , 3 )

Operator

Page 116: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Anatomy of a Call Expression

17

add ( 2 , 3 )

Operator Operand Operand

Page 117: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Anatomy of a Call Expression

17

add ( 2 , 3 )

Operator Operand Operand

Operators and operands are also expressions

Page 118: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Anatomy of a Call Expression

17

add ( 2 , 3 )

Operator Operand Operand

Operators and operands are also expressions

So they evaluate to values

Page 119: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Anatomy of a Call Expression

17

Evaluation procedure for call expressions:

add ( 2 , 3 )

Operator Operand Operand

Operators and operands are also expressions

So they evaluate to values

Page 120: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Anatomy of a Call Expression

17

Evaluation procedure for call expressions:

add ( 2 , 3 )

Operator Operand Operand

Operators and operands are also expressions

1. Evaluate the operator and then the operand subexpressions

So they evaluate to values

Page 121: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Anatomy of a Call Expression

17

Evaluation procedure for call expressions:

add ( 2 , 3 )

Operator Operand Operand

Operators and operands are also expressions

1. Evaluate the operator and then the operand subexpressions

2. Apply the function that is the value of the operator subexpression to

the arguments that are the values of the operand subexpression

So they evaluate to values

Page 122: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

mul(add(4, mul(4, 6)), add(3, 5))

Evaluating Nested Expressions

18

Page 123: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

mul(add(4, mul(4, 6)), add(3, 5))

Evaluating Nested Expressions

18

Page 124: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

mul(add(4, mul(4, 6)), add(3, 5))

Evaluating Nested Expressions

18

mul

Page 125: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))

Evaluating Nested Expressions

18

mul

Page 126: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))

Evaluating Nested Expressions

18

mul

add

Page 127: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))

Evaluating Nested Expressions

18

mul

add 4

Page 128: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))

Evaluating Nested Expressions

18

mul

add 4

mul(4, 6)

Page 129: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))

Evaluating Nested Expressions

18

mul

add 4

mul(4, 6)

mul 4 6

Page 130: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))

Evaluating Nested Expressions

18

mul

add 4

mul(4, 6)

mul 4 6

Page 131: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))

Evaluating Nested Expressions

18

mul

add 4

mul(4, 6)

mul 4 6

24

Page 132: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))

Evaluating Nested Expressions

18

mul

add 4

mul(4, 6)

mul 4 6

24

Page 133: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))

Evaluating Nested Expressions

18

28mul

add 4

mul(4, 6)

mul 4 6

24

Page 134: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))

Evaluating Nested Expressions

18

28mul

add 4

mul(4, 6)

mul 4 6

24

add(3, 5)

Page 135: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))

Evaluating Nested Expressions

18

28mul

add 4

mul(4, 6)

mul 4 6

24

add(3, 5)

add 3 5

Page 136: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))

Evaluating Nested Expressions

18

28mul

add 4

mul(4, 6)

mul 4 6

24

add(3, 5)

add 3 5

Page 137: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))

Evaluating Nested Expressions

18

28mul

add 4

mul(4, 6)

mul 4 6

24

add(3, 5)

add 3 5

8

Page 138: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))

Evaluating Nested Expressions

18

28mul

add 4

mul(4, 6)

mul 4 6

24

add(3, 5)

add 3 5

8

Page 139: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

224mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))

Evaluating Nested Expressions

18

28mul

add 4

mul(4, 6)

mul 4 6

24

add(3, 5)

add 3 5

8

Page 140: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

224mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))28mul

add 4

mul(4, 6)

mul 4 6

24

add(3, 5)

add 3 5

8

Evaluating Nested Expressions

19

Page 141: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

224mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))28mul

add 4

mul(4, 6)

mul 4 6

24

add(3, 5)

add 3 5

8

Evaluating Nested Expressions

19

Expression tree

Page 142: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

224mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))28mul

add 4

mul(4, 6)

mul 4 6

24

add(3, 5)

add 3 5

8

Evaluating Nested Expressions

19

Expression tree

Operand subexpression

Page 143: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

224mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))28mul

add 4

mul(4, 6)

mul 4 6

24

add(3, 5)

add 3 5

8

Evaluating Nested Expressions

19

Expression tree

Operand subexpression

Value of subexpression

Page 144: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

224mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))28mul

add 4

mul(4, 6)

mul 4 6

24

add(3, 5)

add 3 5

8

Evaluating Nested Expressions

19

Expression tree

Operand subexpression

1st argument to mulValue of subexpression

Page 145: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

224mul(add(4, mul(4, 6)), add(3, 5))

add(4, mul(4, 6))28mul

add 4

mul(4, 6)

mul 4 6

24

add(3, 5)

add 3 5

8

Evaluating Nested Expressions

19

Expression tree

Operand subexpression

1st argument to mul

Value of the whole expression

Value of subexpression

Page 146: 61A Lecture 1 - University of California, Berkeleycs61a/fa16/assets/slides/... · 2017-01-10 · 61A Lecture 1 Wednesday, August 24, 2016. Welcome to CS 61A! 2 I'm John DeNero . Welcome

Functions, Objects, and Interpreters

(Demo)