We will start the course by discussing the difference between imperative knowledge and definitional knowledge, between fixed program and stored program computers, and finally the definitions of syntax, static semantics, and semantics. We cover straight line, branching, and looping programs. Other topics include binary representation of numbers, orders of growth, and debugging programs.
Python concepts covered in this unit include values, types, int, float, boolean, strings (str), tuples, dictionaries (dict), and lists. We will also learn about expressions and statements, especially how to effectively use print statements in your programs. Other topics include assignment, conditionals, loops, assert, functions, scope, object models, mutation, and mutability.
By the end of Unit 1 you should be familiar with the following algorithmic techniques: guess and check, linear search, bisection search, successive approximation, and Newton-Raphson (Newton's method). You will also learn recursive definitions, problem solving techniques, and how to structure programs using decomposition and abstraction, including specifications and parameters.
Unit 1 ends with a quiz covering all material (lectures, recitations, and problem sets) through Efficiency and Order of Growth.
This lecture covers course expectations, introduces computer programming and its uses, and begins to familiarize you with concepts related to how programs work.
Problem Set 0
Core Elements of a Program
This lecture covers the building blocks of straight line and branching programs: objects, types, operators, variables, execution, and conditional statements.
Core Elements of a Program00:49:49
Problem Set 1
This lecture covers the use of iteration to build programs whose execution time depends upon the size of inputs. It also introduces search problems and brute force and bisection for solving them.
Machine Interpretation of a Program
This lecture introduces the notion of decomposition and abstraction by specification. It also covers Python modules, functions, parameters, and scoping. Finally, it uses the Python assert statement and type 'str'.
Machine Interpretation of a Program00:57:42
Problem Set 2
Objects in Python
This lecture introduces Python tuples, lists, and dictionaries, as well as the concept of mutability and how to avoid problems relating to it.
Objects in Python00:50:59
This lecture finishes the discussion of dictionaries, then introduces inductive reasoning and recursion. Examples include generating the Fibonacci sequence and solving the Towers of Hanoi problem.
Problem Set 3
This lecture starts with a brief explanation of why floating point numbers are only an approximation of the real numbers. Most of the lecture is about a systematic approach to debugging.
Problem Set 4
Efficiency and Order of Growth
This lecture revolves around the topic of algorithmic efficiency. It introduces the random access model (RAM) of computation and "big O notation" as a way to talk about order of growth. It concludes with binary search.
Efficiency and Order of Growth00:50:10
Memory and Search Methods
This lecture discusses how indirection is used to provide an efficient implementation of Python lists and other data structures. It also presents and analyzes the efficiency of selection and merge sort.
Memory and Search Methods00:48:08
Quiz 1 covers all material (lectures, recitations, and problem sets) from the beginning of the course through Efficiency and Order of Growth.
Unit 2 begins with hash functions, which are useful for mapping large data sets. We will continue with a broad introduction to object-oriented programming languages (Python is an example), covering objects, classes, subclasses, abstract data types, exceptions, and inheritance. Other algorithmic concepts covered are "Big O notation," divide and conquer, merge sort, orders of growth, and amortized analysis.
The next several lectures introduce effective problem-solving methods which rely on probability, statistical thinking, and simulations to solve both random and non-random problems. A background in probability is not assumed, and we will briefly cover basic concepts such as probability distributions, standard deviation, coefficient of variation, confidence intervals, linear regression, standard error, and plotting techniques. This will include an introduction to curve fitting, and we introduce the Python libraries numpy and pylab to add tools to create simulations, graphs, and predictive models.
We will spend some time on random walks and Monte Carlo simulations, a very powerful class of algorithms which invoke random sampling to model and compute mathematical or physical systems. The Monty Hall problem is used as an example of how to use simulations, and the knapsack problem introduces our discussion of optimization. Finally, we will begin looking at supervised and unsupervised machine learning, and then turn to data clustering.
At the end of Unit 2 there will be an exam covering all material (lectures, recitations, and problem sets) from the beginning of the course through More Optimization and Clustering.
Hashing and Classes
This lecture starts by showing how hashing can be used to achieve near constant time lookups and the concept of classes as understood by a computer. It then introduces exceptions.
Hashing and Classes00:44:57
Problem Set 5
OOP and Inheritance
In this lecture, we learn about object-oriented programming (OOP) and how classes are used to implement new types of objects in Python. As part of that discussion we introduce inheritance.
OOP and Inheritance00:49:37
Introduction to Simulation and Random Walks
This lecture completes the introduction of classes by showing a way to implement user-defined iterators. It then discusses simulation models, and illustrates some of the ideas underlying simulations modeling by simulating a random walk.
Introduction to Simulation and Random Walks00:50:24
Problem Set 6
Some Basic Probability and Plotting Data
This lecture returns briefly to random walks, and moves on to discuss different views of non-determinism and an introduction to probability. It concludes with examples of using pylab to plot data.
Some Basic Probability and Plotting Data00:42:49
Sampling and Monte Carlo Simulation
This lecture starts with some examples of how to use pylab's plotting mechanisms. It then returns to the topic of using probability and statistics to derive information from samples.
Sampling and Monte Carlo Simulation00:50:52
Problem Set 7
This lecture presents ways of ascertaining how dependable information extracted from samples is likely to be. It covers standard deviation, coefficient of variation, and standard error. It also shows how to use pylab to produce histograms.
Using Randomness to Solve Non-random Problems
This lecture starts by defining normal (Gaussian), uniform, and exponential distributions. It then shows how Monte Carlo simulations can be used to analyze the classic Monty Hall problem and to find an approximate value of pi.
Using Randomness to Solve Non-random Problems00:49:44
Problem Set 8
This lecture is about how to use computation to help understand experimental data. It talks about using linear regression to fit a curve to data, and introduces the coefficient of determination as a measure of the tightness of a fit.
Optimization Problems and Algorithms
This lecture continues the discussion of curve fitting, emphasizing the interplay among theory, experimentation, and computation and addressing the problem of over-fitting. It then moves on to introduce the notion of an optimization problem, and illustrates it using the 0/1 knapsack problem.
Optimization Problems and Algorithms00:49:42
More Optimization and Clustering
This lecture continues to discuss optimization in the context of the knapsack problem, and talks about the difference between greedy approaches and optimal approaches. It then moves on to discuss supervised and unsupervised machine learning optimization problems. Most of the time is spent on clustering.
More Optimization and Clustering00:49:43
Quiz 2 covers all material (lectures, recitations, and problem sets) from the beginning of the course through More Optimization and Clustering.
We start Unit 3 by continuing our discussion of data clustering from Unit 2. We introduce graphs as a set of nodes and edges, and learn how these can help solve degrees-of-separation problems and find a shortest path. We will practice using pseudocode as preparation for writing code, and learn about dynamic programming as we attempt to write optimally efficient programs.
In order to become better statistical thinkers, we will learn to spot and avoid several common logical and statistical fallacies, such as bias, data enhancement, causal fallacies, and the Texas sharpshooter fallacy. We introduce queuing network simulations, and compare the most common queue disciplines. The last session presents different possible careers in computer science, and its application across diverse fields and industries.
Unit 3 concludes with a Final Exam covering all material (lectures, recitations, and problem sets) from the beginning of the course through Queuing Network Models.
This lecture covers hierarchical clustering and introduces k-means clustering.
Using Graphs to Model Problems, Part 1
This lecture begins by finishing up k-means clustering. It then moves on to introduce the notion of modeling things using graphs (sets of nodes and edges that link them).
Using Graphs to Model Problems, Part 100:50:51
Using Graphs to Model Problems, Part 2
This lecture returns to graph theory. It defines and gives examples of some classic graph problems: shortest path, shortest weighted path, cliques, and min-cut. It then shows how memoization can be used to speed up some algorithms.
Using Graphs to Model Problems, Part 200:48:54
This lecture introduces dynamic programming, and discusses the notions of optimal substructure and overlapping subproblems.
Avoiding Statistical Fallacies
This lecture discusses some common ways that people use statistics to draw invalid or misleading conclusions.
Avoiding Statistical Fallacies00:49:36
Queuing Network Models
This lecture introduces queuing network models and simulations. It also prepares students to read the code they are asked to study in preparation for the final exam.
Queuing Network Models00:52:39
What Do Computer Scientists Do?
This lecture provides some perspective on the material covered in the course. In addition to giving a high-level view of the topics covered, it provides a glimpse of what one might do with an education in computer science.
What Do Computer Scientists Do?00:50:05
Quiz 3 covers all material (lectures, recitations, and problem sets) from the beginning of the course through Queuing Network Models, but will be weighted towards topics from the last unit.