- Home
- Diploma in Computer Science and Programming

This course aims to provide students with an understanding of the role computation can play in solving problems. It also aims to help students, regardless of their major, to feel justifiably confident of their ability to write small programs that allow them to accomplish useful goals. The class will use the Python programming language.

A verifiable certificate in PDF format is available to download after fulfilling all the course requirements.

This course is aimed at students with **little or no prior programming experience** but a desire to understand computational approaches to problem solving.

- Ability to write small programs.
- Map scientific problems into computational frameworks.
- Position students so that they can compete for jobs by providing competence and confidence in computational problem solving.
- Prepare college freshmen and sophomores who have no prior programming experience or knowledge of computer science for an easier entry into computer science or electrical engineering majors.
- Prepare students from other majors to make profitable use of computational methods in their chosen field.

26 Lessons336h

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.

This lecture covers the building blocks of straight line and branching programs: objects, types, operators, variables, execution, and conditional statements.

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.

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'.

This lecture introduces Python tuples, lists, and dictionaries, as well as the concept of mutability and how to avoid problems relating to it.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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).

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.

This lecture introduces dynamic programming, and discusses the notions of optimal substructure and overlapping subproblems.

This lecture discusses some common ways that people use statistics to draw invalid or misleading conclusions.

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.

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.

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.

MIT OpenCourseWare (OCW) is a free, publicly accessible, openly-licensed digital collection of high-quality teaching and learning materials, presented in an easily accessible format. OCW Scholar courses provide you with all the resources you need for independent study.

1 Courses

2 students

Want to receive push notifications for all major on-site activities?

✕