University of California, Berkeley
EECS Department - Computer Science Division
CS3 Lecture 27 : CS3 Course Summary
Overview of today's lecture
Final Exam Questions
- Final exam date and time announced in lecture
- Even if you aced the last, you need to study.
- DSP students speak to Dan to coordinate a time for your alternate
exam.
- Final exam review session time announced in lecture
Review
We took a final exam together
- Hopefully, after taking the practice exams you realized it
won't be too bad.
- However, even if you aced the last midterm, you still need
to study for the final
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
- We learned syntactic details of how to create compound
expressions
- Sentences and Words are constructors
and selectors taken from Logo (programming language)
which simplifies write programs which manipulate language (not
just numbers)
- We the boolean data type (and boolean functions and,
or, not)
- We saw how to save values in local variables via let
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: Embedded and Tail recursion
- 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)
- This is also known as iteration
- In other languages, it might be written somthing like while
(x > 0) do body end
- Advanced recursion usually involves multiple recursive
calls or calling another recursive function in your body
Abstraction -- the other BIG IDEA of cs3
- 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)
- It's also 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 several examples of new data types which were introduced:
lists (generalizations of sentences) and trees.
- Shall We Play a Game? and the Short Problems
introduced you to several new data types: positions, moves, slots,
etc.
Other
- Input and output (i.e., side-effects)
- Fractals (beautiful graphical examples of recursion)
- Cool research overview
- Artificial Intelligence overview
- Box and pointer diagrams (i.e., how it cons really
works)
Managing large programs
- Design (specifications of domain and range and how things
fit together)
- Functional decomposition
- Testing
- Debugging
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 Class - CS61A: The Structure and
Interpretation of Computer Programs [4 units]
- Course Format: Three hours of lecture, three
hours of discussion, and two and one-half hours of self-paced
programming 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.
- Dan will be teaching CS61A Spring 2002!!
Future Class - CS61B: Data Structures [4
units]
- Course Format: Three hours of lecture, one hour
of discussion, two hours of programming laboratory, and an average
of six hours of self-scheduled programming laboratory per week.
- 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
[3 units]
- Course Format: Two hours of lecture, one hour
of discussion, and an average of six hours of self-scheduled
programming laboratory per week.
- Prerequisites: 61B
- 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.
Electrical Engineering
- Analog vs. Digital
- Transistors, resistors, capacitors, differential equations
- Logic gates, digital design
- You get to build a computer from the ground up!
Cal
- Most importantly, you're off to join 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.
- 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 CS3 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
Puzzle : Golden Rope
- You are in a large room that has two 100' golden ropes hanging
a foot apart from a 100' ceiling.
- You want to steal as much rope as you can, and you have at
your disposal some super-strength crazy glue which can attach
rope to rope, rope to ceiling, etc., and scissors which can cut
through the rope.
- You have the ability to climb up and down the rope.
- The catch is, you can't survive a fall of even an inch because
you have weak ankles.
- How much rope can you steal?
Game : High Jump [Pentagames by
Pentagram, Fireside Publishing, 1990]
- Two players each have 12 counters set out as below.
- The object of the game is to capture or block the opponent's
counters.
- Take it in turn to move one square at a time in any direction
except diagonally.
- Captures are not compulsory, but are made by jumping over
an enemy piece in any straight line onto a vacant square immediately
beyond.
- In one turn, a counter may capture several counters in a
succession of short leaps.
- The player who captures or blocks all his opponent's pieces
is the winner.
x |
x |
x |
x |
x |
x |
x |
x |
x |
x |
x |
x |
* |
o |
o |
o |
o |
o |
o |
o |
o |
o |
o |
o |
o |
Puzzles & Game Summary
- We tried to introduce you to some games and puzzles that
highlight general-purpose problem solving
- Many of these games and puzzles can be "solved"
by scheme programs you now have the ability to write!