Computer Science 60
Principles of Computer Science
Lecture notes and schedule, Spring 2000
On This Page
Lecture Slides
Tentative Lecture Schedule
Fall 1999 Lecture Slides
Lecture Slides (Microsoft PowerPoint)
Lecture 1 slides (T 1/18 or W 1/19)
Lecture 2 slides (Th 1/20 or M 1/24)
Lecture 3 slides (T 1/25 or W 1/26)
Lecture 4 slides (Th 1/27 or M 1/31)
Lecture 5 slides (T 2/1 or W 2/2 )
Lecture 6 slides (Th 2/3 or M 2/7 )
Lecture 7 slides (T 2/8 or W 2/9 )
Lecture 8 slides (Th 2/10 or M 2/14)
Lecture 9 slides (T 2/15 or W 2/16)
Lecture 10 slides (Th 2/17 or M 2/21)
Lecture 11 slides (T 2/22 or W 2/23)
Lecture 12 slides (Th 2/24 or M 2/28)
Lecture 13 slides (T 2/29 or W 3/1 )
Lecture 14 slides (Th 3/2 or W 3/8 )
Lecture 15 slides (M 3/20 or T 3/21)
Lecture 16 slides (W 3/22 or Th 3/23)
Lecture 17 slides (T 3/28 or W 3/29)
Lecture 18 slides (M 4/3 or T 4/4 )
Lecture 19 slides (W 4/5 or Th 4/6 )
Lecture 20 slides (W 4/5 or Th 4/6 )
Lecture 21 slides (W 4/10 or Th 4/11)
Lecture 22 slides (W 4/12 or Th 4/13)
Lecture 23 slides (M 4/17 or T 4/18)
Lecture 24 slides (W 4/19 or Th 4/20)
Lecture 25 slides (M 5/1 or T 5/2 )
Lecture 26 slides (W 5/3 )
Somehow we managed to get two lectures in on the same day!
Lecture Schedule
This list constitutes the basic topics of CS60; they
will be the focus of the lectures, assignments, and exams
for the course. This is tentative... .
- Week 1 (1/17) - Is computer science more than programming?
Lecture 1 slides
- If the answer isn't yes, this will be a short course.
- If it is yes, what else is there?
- Imperative Programming (Java)
- Functional Programming (Rex)
- Logical Programming (Prolog)
- Hey, isn't this all programming?
- How programming languages work
- Categorizing problems' difficulty
- Representing Information: Lists
- Implementing computers with logic and circuits
- Factorial, logs, binary numbers
- Week 1 - Encoding and decoding information
Lecture 2 slides
- Recursive data structures
- Using recursion effectively to write functions
- Recursion, recursion, recursion!
- Open lists
- Trees and graphs as lists and their operations
- The no-side-effects paradigm
- Base Case (phew!)
- Week 2 (1/24) - Putting the function in functional programming
Lecture 3 slides
- First-class objects
- Function composition
- Higher-order functions: some common examples
- Anonymous functions
- Rewrite rules as function definition
- Rewrite rules as computation in general!
- Week 2 - Higher-order functions
Lecture 4 slides
- Predicates as special functions
- Functions as special predicates
- More general entities: relations
- Functional decomposition of problems
- Assignment 1
- Warming up with Unix and Rex, the king of programming languages
- Week 3 (1/31) - Techniques for implementing Rex functions
Lecture 5 slides
- Accumulators
- Recursion; tail recursion
- Tree search: BFS, DFS
- Week 3 - Advanced functional programming
Lecture 6 slides
- Guards: equational, conditional
- Laziness
- Infinite lists
- Currying
- Types
- Assignment 2
- Larger project using Rex: Unicalc
- -- aka --
- Seven days to spaceship-saving software
- Week 4 (2/7) - Object-oriented programming
Lecture 7 slides
- Java syntax review
- List implementation
- Open lists vs. closed lists: nature or nurture?
- References and pointers
- Week 4 - More Java Data Structures
Lecture 8 slides
- Stacks/Queues and variants
- Deep vs. shallow equality
- Virtual memory
- More references and pointers
- Assignment 3
- From rex to java: java's easier, right ?
- Using an open list class
- Week 5 (2/14) - The Object Oriented Paradigm: Inheritance
Lecture 9 slides
- Classes and objects
- Static vs. Nonstatic
- Interfaces
- Object state and methods for making transitions
- Mutability
- appropriate uses of class derivation: "is a" not "part of"
- Week 5 - Inheritance and overriding functions
Lecture 10 slides
- Dynamic dispatch
- Message metaphor; upcasting vs downcasting
- Polymorphism and container classes
- The java built-in hierarchy
- Virtual functions
- Applets
- The java GUI hierarchy
- Assignment 4
- Extend assignment 3 to take advantage of the properties
of inheritance hierarchies.
- Trying some graphics programming: an applet
- Week 6 (2/21) - Event-driven programming
Lecture 11 slides
- Graphics syntax and AWT
- Event handling
- Double buffering
- Interfaces revisited
- Week 6 - Additional Java programming
Lecture 12 slides
- 2d arrays; matrices
- Breadth-first search, depth-first search
- Game states and transitions: chess vs. go
- Assignment 5
- Writing a full-fledged applet
- Week 7 (2/28)- Implementation of programming languages
Lecture 13 slides
- Grammars aas a specification tool for languages
- Inductive definitions
- More general notion of "language"
- General proof by induction
- Expression trees
- Precedence and associativity: tighter-binding functions
are closer further from the root
- Week 7 - Parsing of expressions
Lecture 14 slides
- Grammar generates; parser tests for membership
- Compilation steps: tokenize, parse, translate
- Parsing and recursive descent
- Assignment 6
- A Parsing program in Java
- Using an inheritance hierarchy to distribute
an application's work.
- Week 8 (3/6) - Do computers think logically?
Lecture 15 slides
- Propositional Logic
- Boolean algebra
- Combinational functions
- Encoding sets in binary
- Two-term operators
- Completeness of nor
- Tautologies, satisfiability
- Week 8 - Manipulating and analyzing logical functions
Lecture 16 slides
- Minterm reduction
- Shannon expansions
- SOP == DNF representation
- Karnaugh maps
- Computing circuits
- "Don't cares" bits; LED example
- Assignment 7
- Solving SAT
- Extra credit for polynomial-time algorithms
Spring Break
- Week 9 (3/20) - Predicate logic
Lecture 17 slides
- Variables representing individuals
- Quantifiers
- Graphs as binary relations -- equivalent to predicates
- DeMorgan's laws for quantifiers and simplifying expressions
- Representing problems as contraints: Prolog
- Week 9 - Programming in Logic
Lecture 18 slides
- Prolog and its syntax
- Computes variables within predicates
- Answering database queries
- Closed-world assumption and assumed quantifiers
- Examples: geneology, puzzle-like problems
- Solving problems without work!
- Assignment 8
- Programs in prolog, e.g., restaurant-query example and
puzzle-solving examples.
- Week 10 (3/27) - Midterm
- Week 10 - Is this program correct?
Lecture 19 slides
- Program correctness: proving vs. debugging
- Program specification: states and transitions
- Assertions
- Loop invariants
- Proofs of correctness; assertion proofs
- examples
- Assignment 9
- Prolog, java, and rex review
- Week 11 (4/3) - Analyzing algorithms
Lecture 20 slides
- Sorting
- Program (profiler) vs. computational complexity
- Other possibilities: memory complexity
- Dependence on input size
- Counting steps: loops and recursion
- Writing and unrolling recurrences
- Growth rate and big-O definition
- Week 11 - More algorithms
Lecture 21 slides
- Comparison sorting is N*logN
- Empirical and code-analysis techniques
- Asymptotic growth rates
- Proving one function is O(another)
- Heaps
- Min-extraction
- Dynamic programming vs. divide and conquer vs. greedy strategies
- Assignment 10
- 1/3 written: Proof of correctness
- 1/3 written: Running time analyses
- 1/3 coding: Empirical running time experiments
- Week 12 (3/10) - Models for computers
Lecture 22 slides
- Finite-state machines
- DFA NFA and regular expressions
- More generally, what languages are accepted by what machines
- Week 12 - More models for computers
Lecture 23 slides
- Nondeterminism
- P vs. NP
- Turing machines
- Implementing finite state machines in logic
- Latches
- Assignment 11
- 1/2 jflap: create machines!
- 1/2 written: algorithm analysis
- Week 13 (4/17) - More models for computers
Lecture 24 slides
- Clocks, flip-flops
- Buses
- Multiplexors, etc.
- Latches
- Adders, registers
- RAM, one-hot selection
- Week 13 - Stored-program computers
Lecture 25 slides
- Conceptual model
- ISC assembly language
- Implementing recursion in ISC and C
- Factorial in ISC
- Memory-mapped I/O : other services of the OS
- Other hardware-related issues
- Interrupts, traps, signals
- Pipelining
- Strobes
- Types of addressing
- Assignment 12
- Write ISC programs, including implementing recursion.
- Week 14 (4/27-5/3) - Limitations of practical computing
Lecture 26 slides
- Practical limitations: exponential running time
- Examples of difficult important problems
- P ?= NP
- Real problems: undecidability
- Week 14 - Limitations of Turing computing
Lecture 27 slides
- TM limitations: undecidability
- Turing's thesis
- Other computational models: do they change things?
- Molecular computation, quantum, reversible, nerual nets,
genetic programming (not really a model of computation, but...)
- Assignment 13
- JFLAP II: turing machines
- Final Exam
Fall 1999 Lecture Slides
Professor
Keller's lecture slides
Professor
Dodds's lecture slides