University of California, Berkeley
EECS Department - Computer Science Division
CS3L OaW Lecture 15
Course Summary
Final Exam Questions and other Announcements
- Final Exam
- Final exam review session date, time and location announced in lecture
- Final exam date, time and location announced in lecture
- Even if you aced the midterm, you still need to study.
- Open book, open notes (as always)
- DSP students speak to your head TA to coordinate a time & location for your alternate exam.
- Other Announcements
- The project demo day, time and location announced in lecture
- The project winner demos day, time and location announced in lecture
Past (what have we learned?)
Overview : Functional programming
- Characterized by the aggregation, or composition of
small functions that combine to solve a large problem
- Each small function does one thing and returns one value.
- Because each function is small, it can be tested in isolation
to confirm that it adheres to specs (domain & range)
- No assignment of variables such as imperative and
sequential programming (such as Pascal & C)
Functions and Datatypes
- We learned syntactic details of how to create compound
expressions
- Sentences and Words are a datatype with constructors
and selectors taken from Logo (programming language) which simplified write programs which manipulated language (not just numbers)
- We saw the boolean data type (and boolean functions and,
or, not)
- We saw how to save values in local variables via let
- We learned how to make our own functions, which were indistinguishable from those built-in.
Functions as Data
- Higher Order Functions (HOFs) allow us to...
- Encapsulate a generalized recursive process into a
single function that takes a function as an argument.
(and might even return a function!)
- Write very powerful functions with little effort (the labor
is done by the HOF)
- We saw some examples with every, keep, accumulate, map,
filter, reduce
- We wrote our own: keep-if, all?
- Lambda
- The powerful, anonymous function builder
- Useful (and often necessary) with HOFs
Recursion -- one of the BIG IDEAS of cs3
- Roughly, two classifications: Linear and Non-linear
- Linear recursion is classified by the simple processing of every object once in a collection (like every word in a sentence) and has two broad types: Embedded and Tail
- Embedded recursion
- No saved values -- instead embedding the recursive call inside a combiner
- Tail recursion
- Saving values as we go in our arguments (e.g., sum-so-far)
- We often (but not necessarily) need a helper function so that we can seed our so-far variables
- This is also known as iteration
- In other languages, it might be written somthing like this:
while (x > 0) do body end
- Non-linear recursion is classified by all other types of recursion and has two broad types: Nested recursion and Advanced recursion
- Nested recursion is described by nesting linear recursive calls. E.g., a top-level nested recursive program would call a linear-recursive helper on all the words in its sentence.
- Advanced recursion usually involves multiple recursive calls
Functional and Data Abstraction -- the other BIG IDEA of cs3
- Functional Abstraction is the idea that you can make use of a
system or program without knowing how it works as long as the
specifications are clear (domain and range and side-effects)
- Data Abstraction is the idea that (as software architect) you can introduce a new idea, device, data type, program which can be used and built-upon by people as long as your have provided a clear interface
(constructors & selectors).
- We saw an example of a new data types which was introduced:
lists (generalizations of sentences).
- Shall We Play a Game? introduced you to several new data types: positions, moves, boards, slots, etc.
Other fun computing applications
- Input and output (i.e., side-effects)
- Fractals (beautiful graphical examples of recursion)
- MapReduce paradigm
(a wonderful API to do parallel programming!)
- Game Theory basics (a case
Managing large programs
- Design (specifications of domain and range and how things
fit together)
- Functional decomposition
- Testing
- Debugging
- Style
Present (where are we now?)
What can we do with what we've learned?
- Tremendous potential to grow.
- You've seen the tip of the iceberg
- Computer Science is like "The Incredible Machine"
- I.e., which tool do you choose for the task?
- There's so much more to software engineering than what you
know now
Future (where can you go?)
Future opportunities to help teach CS3L
- Typically the path is:
- Do well in CS3L
- Become a lab assistant for units (3 hours = 1 unit); sign up with Jenny Jones or Julie Aquino in 339 Soda Hall -- we never turn anyone away!
- Become a paid reader for CS3L – grade homework and help with exams
- Become a paid undergraduate TA for CS3L – 5/6 of our TAs this semester are undergrads!
Future Class - CS61A: The Structure and
Interpretation of Computer Programs [4 units]
- Course Format: 3 hours of lecture, 1.5
hours of discussion, and 2.5 hours of unscheduled laboratory per week.
- Prerequisites: Mathematics 1A (may be taken concurrently);
programming experience equivalent to that gained in 3 or the
Advanced Placement Computer Science A course.
- Description: Introduction to programming and computer science. This course exposes students to techniques of abstraction at several levels: (a) within a programming language, using higher-order functions, manifest types, data-directed programming, and message-passing; (b) between programming languages, using functional and rule-based languages as examples. It also relates these techniques to the practical problems of implementation of languages and algorithms on a von Neumann machine. There are several significant programming projects, programmed in Scheme.
Future Class - CS61BL: Data Structures [4
units]
- Course Format: 1 hour of lecture and 6 hours of laboratory per week and an average of 5 hours of self-scheduled programming laboratory.
- Prerequisites: A grade of B- or better in 61A
or Engineering 77N.
- Description: Fundamental dynamic data structures,
including linear lists, queues, trees, and other linked structures;
arrays strings, and hash tables. Storage management. Elementary
principles of software engineering. Abstract data types. Algorithms
for sorting and searching. Introduction to the Java programming
language.
Future Class - CS61C: Machine Structures [4 units]
- Course Format: Three hours of lecture, one hour of discussion, two hours of lab, and an average of six hours of self-scheduled programming per week.
- Prerequisites: 61A
- Description: The internal organization and operation
of digital computers. Machine architecture, support for high-level
languages (logic, arithmetic, instruction sequencing) and operating
systems (I/O, interrupts, memory management, process switching).
Elements of computer logic design. Tradeoffs involved in fundamental
architectural design decisions.
MS-DOS X (Macintosh Student Developers for OS X) [2 units, P/NP]
- Learn to program Macintoshes!
- Req: Interest. Owning a mac helps, not required.
- Taught as a DeCal by MS-DOS X veterans Tu 5:30-7:30pm this Spring
UCBUGG (UC Berkeley Undergraduate Graphics Group) [2 units, P/NP]
- Develop 3D computer-generated images, animations.
- Req: (depending on demand) 3D experience, portfolio
- Taught as a DeCal by UCBUGG veterans
Th 5:30-7:30pm this Spring
GamesCrafters (Undergraduate Computational Game Theory Research and Development) [2 units, P/NP]
- Join a group of 20+ other students interested in solving big games!
- Req: Do well in CS3 and enjoy the final project (and want to do more with it!)
- Taught by me MWF 1-2pm this Spring
Electrical Engineering
- Hardware!!
- Analog vs. Digital
- Transistors, resistors, capacitors, differential equations, Bode plots, Karnaugh maps
- Logic gates, digital design, timing analysis
- Transmission, waves, radiation, frequency analysis
- You learn how cool things work!
- You get to build a computer from the ground up!
Cal
- Most importantly, you're now part of the greater UC Berkeley
community, steeped in tradition and excellence.
- As you and your work helps to define who and what Cal is
in the future, it's also important to understand what has come
before you.
- Cal has been the home to many academic and athletic accomplishments
-- you should be aware of arguably the most famous of these...The
Play!
Summary
- Teaching this class has truly been a pleasure, thank you for allowing me the opportunity to share my knowledge and enthusiasm.
- We'll see you at the final...
- Good luck with the rest of your Berkeley education! It will change your life...
If, years later, when your education is put into perspective,
you believe CS3L was a positive or memorable or life-changing experience,
let me know! The following email will always allow you to contact
me:
ddgarcia@alum.mit.edu
In lab this week you'll...
- finish up your project, get ready for the project demos and think about the final.
In life this week you'll see...
- Hopefully the Dow continue to rally as it has this last week
- Excitement building around our fall sports teams...