Lecture notes · Algorithms · Lecture 1

Algorithms and Computation

MIT 6.006 Introduction to Algorithms, lecture 1, explained in plain English

Want this lecture to stick? In LessonBound you get checked practice questions for every part, can ask about anything you don't get, and can listen with your screen off. Free, no ads.

Learn this lecture free

Watch or read the original lecture: MIT OpenCourseWare.

Part 1 · 0:00–10:00

This part explains what a computational problem and an algorithm are, and why the course cares about proving that solutions are correct and efficient.

Key ideas

Words to know

binary relation
A pairing rule between two groups. Here it means each input is linked to the outputs that count as correct for it.
predicate
A yes-or-no test. For a problem, it checks whether a given output is correct for a given input.
bipartite graph
A picture with two separate groups of dots, where lines only join a dot in one group to a dot in the other. Here, one group is the inputs and the other is the outputs.
deterministic
Always giving the same result for the same input, with no randomness involved.

Example

Think of a problem like an answer key that says which answers are acceptable for each question, with more than one answer sometimes allowed. An algorithm is like a student who reads a question and writes down one answer. A good student's answer should always be one that the key accepts.

3 checked practice questions for this part are in the app.

Part 2 · 10:00–20:00

This part explains what an algorithm is, shows a birthday-matching example, and begins a proof that the example always gives the right answer.

Key ideas

Words to know

algorithm
A clear set of steps that takes an input and produces an output, like a recipe.
function
A rule that gives exactly one output for each input.
induction
A way to prove something is true for every size of a group by proving it for a starting case and then showing that each step carries it to the next size.
base case
The simplest starting case in an induction proof, which is shown to be true first.

Example

Think of a teacher checking a class roster for two students with the same birthday by asking each student in turn and writing their birthday on a list. Checking a small class by hand is easy, but a school of 300 needs a proof that the method always works. Induction gives that proof without checking every possible group.

3 checked practice questions for this part are in the app.

Part 3 · 20:00–30:00

This part explains how to prove an algorithm gives the right answer, and how to measure how efficient it is by counting basic steps instead of timing it.

Key ideas

Words to know

inductive hypothesis
A statement you assume is true for some number of cases, so you can prove it still holds for one more case.
base case
The simplest starting case that you can show is true without any work, so the rest of the proof has a foundation.
operation
One basic step a computer does, treated as taking a fixed amount of time, such as a single comparison or a single addition.
asymptotic analysis
A way of describing how the number of steps an algorithm needs grows as the input gets larger.

Example

Imagine checking a line of people one at a time to see if any of them has a certain birthday. If you already know the first k people do not match, you only need to check person k plus 1, and you can keep going one person at a time until the line ends. This is the same step-by-step reasoning the lesson uses to prove an algorithm correct.

3 checked practice questions for this part are in the app.

Part 4 · 30:00–40:00

This part explains how we measure how fast an algorithm runs, using input size and common growth patterns, and introduces the simple computer model used to count steps.

Key ideas

Words to know

big O notation
A way to describe an upper limit on how fast an algorithm's running time grows as the input gets bigger.
polynomial time
Running time that grows like n raised to a fixed power, such as n squared or n cubed. In this class, it counts as efficient.
exponential time
Running time that grows like a fixed number raised to the power of n. It gets very large very fast, so it is considered bad.
word
The fixed number of bits the computer's processor can take from memory and work on at one time.

Example

Think of a checkout line where each extra person adds the same amount of waiting time. That steady, one-for-one growth is like linear time. If the wait instead doubled with every extra person, it would grow so fast that it would quickly become unworkable, which is like exponential time.

3 checked practice questions for this part are in the app.

Part 5 · 40:00–45:32

This part explains why computer memory has size limits, how fast a CPU can work on small versus large amounts of data, and how the course is organized.

Key ideas

Words to know

word
A fixed-size chunk of data that the CPU reads and writes as one unit.
constant time
An operation that takes the same amount of time no matter how much data is involved.
linear time
A task whose time grows in step with the amount of data, so twice the data takes about twice as long.
data structure
A way of organizing a large collection of data so you can store it and work with it quickly.

Example

Think of checking one mailbox in a building. That takes the same short time whether the building has 10 mailboxes or 1,000, which is like constant time. Checking every mailbox to find one letter takes longer as the building gets bigger, which is like linear time.

3 checked practice questions for this part are in the app.

Lecture 2: Data Structures and Dynamic Arrays →

Notes written by AI (Claude) from the lecture's official transcript, so check anything important against the lecture. MIT OpenCourseWare · CC BY-NC-SA 4.0 · not affiliated with or endorsed by MIT. These notes are shared under the same license.

LessonBound · Free lecture notes · Privacy · Terms · New York