Reading Math Notation, Sets & Functions

This deck teaches how to read the symbolic vocabulary the rest of CS3000 is written in. It covers sets and set-builder notation, the difference between element-of and subset-of, union and intersection, ordered pairs and the Cartesian product, and functions with their domain and codomain. It then separates floor from ceiling from rounding, reads summation and product notation as accumulating loops, treats logarithms as the inverse of exponents, and ends with the for-all and there-exists quantifiers and how to set up each kind of proof. It targets reading symbols phonetically without meaning, confusing element-of with subset-of, mistaking floor for rounding, being intimidated by summation notation, and swapping the order of quantifiers.

Subject: CS3000 Algorithms · 124 slides · symbolic lesson

Open the interactive version of this deck · Homework for this lesson

What this lesson covers

The lesson, slide by slide

1. What you will be able to do

Objectives

Every course after this one is written in a small vocabulary of symbols. This lesson teaches you to read that vocabulary out loud and use it, not just recognize it. By the end you can:

  1. Read any set, function, or quantified statement out loud in plain English.
  2. Use element-of, subset-of, union, and intersection correctly - and never confuse them.
  1. Evaluate floor, ceiling, summation, product, and logarithm notation by hand.
  2. Translate for-all and there-exists statements, and set up how a proof of each one begins.

2. Notation is compressed English, not decoration

Concept

Every symbol you will see in this course stands in for a phrase in English. The symbol is not the idea itself - it is a shorthand for the idea, chosen because writing the full phrase out every single time would be exhausting.

When you cannot read a symbol, you cannot use it. Fluent reading is what lets you follow, and eventually write, a definition, a proof, or a running-time bound without stalling on the notation itself.

notation — A shorthand system of symbols that stands for words and phrases. Reading notation means mentally expanding each symbol back into the sentence it abbreviates.

3. Break it if you can: Notation is compressed English, not decoration

Counterexample

Discussion prompt

When you cannot read a symbol, you cannot use it. Fluent reading is what lets you follow, and eventually write, a definition, a proof, or a running-time bound without stalling on the notation itself.

That is stated as though it always holds. Do one of two things: produce a case where it fails, or say precisely what rules such a case out. "It just does" is not on the menu.

Hint: Hunt at the extremes first — zero, one, negative, empty, equal. If every extreme survives, the reason they survive is the proof.

4. The shorthand you will see in proofs

Picture it

Animation

Shows: The shorthand you will see in proofs — a rendered Manim animation.

Rendered with Manim.

Takeaway: An if-and-only-if is two proofs, and both are required.

5. You already read compressed language fluently

Intuition

Think about an abbreviation you already read without translating in your head. You do not sound it out letter by letter - you just know what it means. Math notation works the same way, once you have met each symbol.

The only difference is that nobody handed you the glossary yet. This lesson is that glossary - the first time each symbol appears, we will say its name out loud and what it means before we ever compute with it.

6. Reading subscripts: naming one item out of many

Concept

When a course talks about a whole list of numbers at once, it needs a way to point to just one of them by its position. That is what a subscript does - a small index written low and to the right of a letter, naming a specific position in that list.

Read the small number as 'sub' followed by that number: this whole list is 'a sub one', 'a sub two', 'a sub three', and so on up through 'a sub n' - each one naming a specific position.

\[ a_1,\ a_2,\ a_3,\ \ldots,\ a_n \]

The general entry, read 'a sub i', just means 'whichever entry sits in position i'. The letter i itself is called the index, and it can stand for any position at all.

\[ a_i \]

7. By analogy: Reading subscripts: naming one item out of many

Analogy

Discussion prompt

Explain Reading subscripts: naming one item out of many by analogy to something with no CS3000 Algorithms in it at all — a queue, a recipe, a map, a bank balance, whatever fits. Then say where your analogy breaks.

Hint: An analogy that never breaks is not an analogy, it is the same idea wearing a hat. Find the seam — that is the part that is actually new.

Answer:

Read the small number as 'sub' followed by that number: this whole list is 'a sub one', 'a sub two', 'a sub three', and so on up through 'a sub n' - each one naming a specific position.

8. What has to happen first: Read and evaluate a subscripted statement

Ranking

Put in order

Put the moves of Read and evaluate a subscripted statement into the order they have to happen.

  1. Set up: read the question 'what is a sub 3' correctly
  2. Count to position three and read off the value
  3. Read a comparison between two positions: is a sub 2 less than a sub 4?
  4. Check the comparison against the actual list

Why: These are the moves of the worked example in the order it makes them, and each one is set up by the one before it. This asks for whichever value sits in the third position of the list - it is not asking about the number 3 itself, only about position number three.

9. Read and evaluate a subscripted statement

Worked example

An autograder stores five quiz scores as a list a, indexed starting at one.

\[ a_1 = 88,\ a_2 = 73,\ a_3 = 95,\ a_4 = 60,\ a_5 = 81 \]

Set up: read the question 'what is a sub 3' correctly

Why: This asks for whichever value sits in the third position of the list - it is not asking about the number 3 itself, only about position number three.

\[ a_3 = ? \]

Count to position three and read off the value

Why: Position 1 holds 88, position 2 holds 73, position 3 holds 95 - so a sub three is 95.

\[ a_3 = 95 \]

Read a comparison between two positions: is a sub 2 less than a sub 4?

Why: This compares the value stored at position 2 against the value stored at position 4 - a comparison between two named positions, not between the index numbers 2 and 4.

\[ a_2 \overset{?}{<} a_4 \]

Check the comparison against the actual list

Why: a sub 2 is 73 and a sub 4 is 60. Since 73 is not less than 60, the statement a sub 2 less than a sub 4 is false.

\[ a_2 = 73,\ a_4 = 60,\ 73 \not< 60 \]

10. A set is a collection of distinct objects

Concept

A set is simply a collection of objects, called its elements or members. That is the entire idea - nothing more than 'these things are grouped together'.

set — A collection of distinct objects, with no notion of order or repetition. Curly braces list, or describe, its members.

\[ \{1, 2, 3\} \]

11. The three set operations you need

Picture it

Animation

Shows: The three set operations you need — a rendered Manim animation.

Rendered with Manim.

Takeaway: Every counting argument later is built from these.

12. Sets have no order and no duplicates

Concept

Two facts separate a set from a list you might store in code. First, the order you write the elements in does not matter - the set containing 1, 2, and 3 is identical no matter which order those three numbers are listed in.

\[ \{1,2,3\} = \{3,1,2\} \]

Second, listing an element more than once adds nothing new - a set only records whether something belongs, never how many times it happened to get mentioned.

\[ \{1,2,2,3\} = \{1,2,3\} \]

13. Teach it back: Sets have no order and no duplicates

Explain it

Discussion prompt

Explain Sets have no order and no duplicates to a student a year behind you. No notation, no jargon they have not met — and it still has to be true.

Hint: If your explanation needs a symbol they have never seen, you are describing the notation rather than the idea.

Answer:

Second, listing an element more than once adds nothing new - a set only records whether something belongs, never how many times it happened to get mentioned.

14. A set is a bag, not a list

Intuition

Picture a set as a bag you drop objects into. Once something is inside the bag, you cannot tell whether it was dropped in first or last, and dropping the same marble in twice does not give you two marbles - just one marble, still in the bag.

An array or list in code is different - it remembers position and allows repeats on purpose. Keep that contrast in mind whenever you move between set notation and code.

15. Set-builder notation

Concept

Instead of listing every element by hand, you can describe a set by a rule: start with a variable, then state the condition that variable must satisfy. This is called set-builder notation.

\[ \{\, x : \text{condition on } x \,\} \]

Read the colon inside the braces as the phrase 'such that'. The whole expression reads: 'the set of all x such that the condition on x holds'.

set-builder notation — A way to define a set by a property instead of a list: braces around a variable, a separator read as 'such that', and the condition the variable must meet.

16. Reading set-builder notation

Picture it

Animation

Shows: Reading set-builder notation — a rendered Manim animation.

Rendered with Manim.

Takeaway: Read the bar as the words such that and it stops being decoration.

17. Plan first: Build a set from set-builder notation

Step zero

Discussion prompt

Build a set from set-builder notation — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.

Hint: It starts with: Set up: read the definition out loud

Answer:

  1. Set up: read the definition out loud
  2. Find the smallest value that fits every condition
  3. List every other value that fits, in order
  4. Check the count and the boundary

18. Build a set from set-builder notation

Worked example

Consider this set-builder definition.

\[ \{\, x : x \in \mathbb{Z},\ 0 \le x \le 10,\ x \text{ is even} \,\} \]

Set up: read the definition out loud

Why: This says: the set of all x such that x is an integer, x is at least 0 and at most 10, and x is even.

Find the smallest value that fits every condition

Why: 0 is an integer, it sits between 0 and 10, and it is even, so 0 belongs to the set.

\[ 0 \in \{\,x : \ldots\,\} \]

List every other value that fits, in order

Why: Checking each integer from 0 to 10 and keeping only the even ones gives 0, 2, 4, 6, 8, and 10; every odd integer in that range fails the last condition.

\[ \{0, 2, 4, 6, 8, 10\} \]

Check the count and the boundary

Why: There are six values in total, and 10 itself is included because the condition allowed x equal to 10, not only values strictly less than 10.

\[ |\{0,2,4,6,8,10\}| = 6 \]

19. Big-O is really a set

Picture it

Animation

Shows: Big-O is really a set — a rendered Manim animation.

Rendered with Manim.

Takeaway: Which is why the equals sign here never works in both directions.

20. The symbol that means 'is an element of'

Concept

There is one symbol you will see constantly. It means exactly the phrase 'is an element of', or more casually, 'is one of'.

\[ n \in S \]

Read that line as 'n is an element of S', or 'n is one of the things in S'. It is a relationship between a single object and the set it belongs to.

is an element of — States that a specific object belongs to a set. Read the membership symbol out loud as 'is an element of' or 'is in'.

21. Something is wrong here: reading a symbol phonetically without meaning

Anomaly

Predict first

A student writes this, and it looks reasonable:

A student sees the membership symbol for the first time. Nobody ever told them what it stands for, so they just call it 'that funny E shape' and skip past it instead of translating it.

It is wrong. Say what breaks — and say it before you turn the page.

Correct: Without a meaning attached to the symbol, the student reads only 'n' and 'Z' and either guesses at the relationship or ignores it entirely, missing the actual claim the line is making.

Every symbol gets a name and a plain-English reading the first time it shows up. This one is called the membership symbol.

Why: Without a meaning attached to the symbol, the student reads only 'n' and 'Z' and either guesses at the relationship or ignores it entirely, missing the actual claim the line is making.

22. Trap: reading a symbol phonetically without meaning

Trap

The trap

A student sees the membership symbol for the first time. Nobody ever told them what it stands for, so they just call it 'that funny E shape' and skip past it instead of translating it.

\[ n \in \mathbb{Z} \]

Skip straight past the symbol to the surrounding letters

Why: Without a meaning attached to the symbol, the student reads only 'n' and 'Z' and either guesses at the relationship or ignores it entirely, missing the actual claim the line is making.

The fix

Every symbol gets a name and a plain-English reading the first time it shows up. This one is called the membership symbol.

\[ n \in \mathbb{Z} \]

Read the whole line as one sentence

Why: 'n is an element of Z' means 'n is one of the integers'. Once you can say the sentence out loud, you can reason with it - here, that n is a whole number, positive, negative, or zero.

23. Break it on purpose: reading a symbol phonetically without meaning

Break the constraint

Discussion prompt

The rule this trap just fixed:

Every symbol gets a name and a plain-English reading the first time it shows up. This one is called the membership symbol.

Now break it on purpose. Build a case that violates it and follow the consequences until something visibly fails. Where does the failure first show up — and would you have noticed it if you had not been looking?

Hint: The dangerous rules are the ones whose violation still produces an answer. If yours fails loudly, try to find one that fails quietly.

Answer:

Without a meaning attached to the symbol, the student reads only 'n' and 'Z' and either guesses at the relationship or ignores it entirely, missing the actual claim the line is making.

24. The symbol that means 'is a subset of'

Concept

A second, closely related symbol compares two whole sets to each other, rather than one object and one set. It means 'is a subset of'.

\[ A \subseteq B \]

Read that as 'A is a subset of B', meaning every single element of A is also an element of B. A is even allowed to equal B entirely - the symbol permits that.

is a subset of — States that every element of one set also belongs to another set. Read the symbol out loud as 'is a subset of'.

25. Term to definition: Reading Math Notation, Sets & Functions

Matching

Match the pairs

Match each term to the definition this lesson gave it — not the one you would guess from the word.

  • t1. notation
  • t2. set
  • t3. set-builder notation
  • t4. is an element of
  • t5. is a subset of
  • d1. A shorthand system of symbols that stands for words and phrases. Reading notation means mentally expanding each symbol back into the sentence it abbreviates.
  • d2. A collection of distinct objects, with no notion of order or repetition. Curly braces list, or describe, its members.
  • d3. A way to define a set by a property instead of a list: braces around a variable, a separator read as 'such that', and the condition the variable must meet.
  • d4. States that a specific object belongs to a set. Read the membership symbol out loud as 'is an element of' or 'is in'.
  • d5. States that every element of one set also belongs to another set. Read the symbol out loud as 'is a subset of'.

Why: These are the working definitions of notation, set, set-builder notation, is an element of, is a subset of as Reading Math Notation, Sets & Functions uses them. Pairing them correctly is the test of whether you could state each one with the slide switched off.

26. Guess the shape of the answer: Decide element-of vs. subset-of

Estimation

Predict first

Let S be a set of three numbers. We will test three different claims against it, one at a time.

Commit before you compute: what does Decide element-of vs. subset-of come out to? A rough magnitude and the right form is enough — the point is to have something concrete to be wrong about.

Correct: Check the two-element case, whether {1,2} is a subset of S

Why: A prediction you can defend turns the computation into a check rather than a leap of faith — and an answer that contradicts it is caught on the spot. Both elements of {1,2} - the 1 and the 2 - already appear in S, so {1,2} is a subset of S.

27. Decide element-of vs. subset-of

Worked example

Let S be a set of three numbers. We will test three different claims against it, one at a time.

\[ S = \{1,2,3\} \]

Set up: test whether 2 is an element of S

Why: 2 is one of the three things listed inside S. This claim compares a single number to the set, so it needs the membership symbol.

\[ 2 \in S \]

Test whether the set containing just 2 is a subset of S

Why: Every element of {2} - which is just the number 2 - is also in S, so this subset claim holds too, even though it looks similar to the last line.

\[ \{2\} \subseteq S \]

Check the two-element case, whether {1,2} is a subset of S

Why: Both elements of {1,2} - the 1 and the 2 - already appear in S, so {1,2} is a subset of S. All three claims check out once each symbol is read for exactly what it says.

\[ \{1,2\} \subseteq S \]

28. Element of, versus subset of

Picture it

Animation

Shows: Element of, versus subset of — a rendered Manim animation.

Rendered with Manim.

Takeaway: Confusing these turns a true statement into a type error.

29. Something is wrong here: confusing 'is an element of' with 'is a subset of'

Anomaly

Predict first

A student writes this, and it looks reasonable:

A student wants to say that the set containing just the number 2 is contained in S, and reaches for the membership symbol instead of the subset symbol.

It is wrong. Say what breaks — and say it before you turn the page.

Correct: This claims that the object {2} - a whole set - is itself listed among the members of S.

Match the symbol to what is being compared: a single object to a set uses membership, and a set to a set uses subset.

Why: This claims that the object {2} - a whole set - is itself listed among the members of S. But S's members are the plain numbers 1, 2, and 3, not the set {2}, so this claim is false.

30. Trap: confusing 'is an element of' with 'is a subset of'

Trap

The trap

A student wants to say that the set containing just the number 2 is contained in S, and reaches for the membership symbol instead of the subset symbol.

\[ S = \{1,2,3\} \]

Write that {2} is an element of S

Why: This claims that the object {2} - a whole set - is itself listed among the members of S. But S's members are the plain numbers 1, 2, and 3, not the set {2}, so this claim is false.

\[ \{2\} \in S \quad \text{(false)} \]

The fix

Match the symbol to what is being compared: a single object to a set uses membership, and a set to a set uses subset.

\[ S = \{1,2,3\} \]

Use membership for the number, subset for the set

Why: The plain number 2 is an element of S, and the set {2} is a subset of S. Two different symbols, because two different kinds of things sit on the left of each one.

\[ 2 \in S, \qquad \{2\} \subseteq S \]

Apply the rule that separates them going forward

Why: Ask whether the left side is a single object or a whole set before choosing a symbol. A single object never takes the subset symbol, and a set of objects never takes the membership symbol against another set this way.

31. Decode the notation: Trap: confusing 'is an element of' with 'is a subset…

Notation

Annotate

From Trap: confusing 'is an element of' with 'is a subset of' — read this one piece at a time. What is each part doing?

On: \( \{2\} \in S \quad \text{(false)} \)

  • This claims that the object {2} - a whole set - is itself listed among the members of S. But S's members are the plain numbers 1, 2, and 3, not the set {2}, so this claim is false.
  • The plain number 2 is an element of S, and the set {2} is a subset of S. Two different symbols, because two different kinds of things sit on the left of each one.
  • Ask whether the left side is a single object or a whole set before choosing a symbol. A single object never takes the subset symbol, and a set of objects never takes the membership symbol against another set this way.

32. Union and intersection

Concept

Two operations combine sets. Union collects everything that is in at least one of the two sets. Intersection keeps only what is in both at once.

Read the first symbol as 'union' - it means everything that is in A, or in B, or in both.

\[ A \cup B \]

Read the second symbol as 'intersection' - it means only the things that are in both A and B at the same time.

\[ A \cap B \]

33. What has to be given first: Compute a union and an intersection

Missing information

Discussion prompt

Consider two sets of four numbers each that overlap in the middle.

What do you need to know — or decide — before the first line can be written? List everything the problem has to hand you.

Hint: Anything you would have to invent to get started is a thing the problem must supply.

Answer:

List every number that appears in A, in B, or in both, without repeating any number twice - a set never lists a member twice.

34. Compute a union and an intersection

Worked example

Consider two sets of four numbers each that overlap in the middle.

\[ A = \{1,2,3,4\}, \qquad B = \{3,4,5,6\} \]

Set up: build the union by collecting everything from either set

Why: List every number that appears in A, in B, or in both, without repeating any number twice - a set never lists a member twice.

\[ A \cup B = \{1,2,3,4,5,6\} \]

Build the intersection by keeping only the shared numbers

Why: Only 3 and 4 appear in both A and B, so those two numbers are the only members of the intersection.

\[ A \cap B = \{3,4\} \]

Check the sizes add up correctly

Why: A has 4 elements and B has 4 elements, and they share 2, so the union should have 4 plus 4 minus 2 equals 6 elements - which matches the six numbers found above.

\[ 4 + 4 - 2 = 6 \]

35. Compute a union and an intersection — line by line

Picture it

Animation

Shows: Each line of the worked example "Compute a union and an intersection", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: A has 4 elements and B has 4 elements, and they share 2, so the union should have 4 plus 4 minus 2 equals 6 elements - which matches the six numbers found above.

36. Ordered pairs, tuples, and the Cartesian product

Concept

A set does not care about order, but sometimes order matters - like a coordinate, or an edge that runs from one node to another. For that, you use an ordered pair instead of a set.

\[ (a, b) \]

Read the parentheses as 'the ordered pair a, b'. Unlike a set, swapping the two entries gives a different object unless a and b happen to be equal.

A tuple is the same idea with more than two entries - an ordered triple has three entries, and so on.

The Cartesian product of two sets builds every possible ordered pair, taking the first entry from one set and the second entry from the other.

\[ A \times B \]

Cartesian product — Given two sets A and B, the set of every ordered pair whose first entry comes from A and whose second entry comes from B. Read the symbol as 'cross' - 'A cross B'.

37. Complete the line: List a Cartesian product

Fill the middle

Fill in the blanks

From List a Cartesian product — finish the line. Write what belongs on the right of the equals sign before you look.

A \times B = \{(1,x),(1,y),(2,x),(2,y)\}

Why: Producing the right-hand side unprompted is the difference between recognising this line and being able to use it. Starting from 1, combine it with x, then with y, always keeping 1 first since order matters in an ordered pair.

38. List a Cartesian product

Worked example

Consider two small sets.

\[ A = \{1,2\}, \qquad B = \{x,y\} \]

Set up: pair the first element of A with every element of B

Why: Starting from 1, combine it with x, then with y, always keeping 1 first since order matters in an ordered pair.

\[ (1,x),\ (1,y) \]

Pair the second element of A with every element of B

Why: Now repeat the same process starting from 2.

\[ (2,x),\ (2,y) \]

Check the total count against the sizes

Why: A has 2 elements and B has 2 elements, so A cross B should contain 2 times 2 equals 4 ordered pairs - and the four pairs listed above match exactly.

\[ A \times B = \{(1,x),(1,y),(2,x),(2,y)\} \]

39. List a Cartesian product — line by line

Picture it

Animation

Shows: Each line of the worked example "List a Cartesian product", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: A has 2 elements and B has 2 elements, so A cross B should contain 2 times 2 equals 4 ordered pairs - and the four pairs listed above match exactly.

40. A function is a rule: one output per input

Concept

A function is a rule that assigns exactly one output to every input it accepts. That word 'exactly' is the whole requirement - a single input can never produce two different outputs.

function — A rule that assigns each input in its domain to exactly one output. If a single input could give two different outputs, the rule would not be a function.

41. A function is a vending machine, not a maze

Intuition

Picture a vending machine: press button B3 and you always get the same snack, every time, guaranteed. That guarantee - one button always gives one specific snack - is exactly what a function promises about inputs and outputs.

A maze is the opposite picture: the same starting point could lead to several different exits depending on the choices made along the way. That unpredictability is exactly what a function is not allowed to do.

42. Injective, surjective, bijective

Picture it

Animation

Shows: Injective, surjective, bijective — a rendered Manim animation.

Rendered with Manim.

Takeaway: Only a bijection can be inverted.

43. Domain, codomain, and what f(n) means

Concept

Every function comes with two sets attached to it: the domain, which lists every input it is allowed to accept, and the codomain, which is the set its outputs are declared to live in.

\[ f : A \to B \]

Read that as 'f is a function from A to B' - A is the domain, B is the codomain.

To apply the function to a specific input, write the function's name followed by that input in parentheses. This is read as 'f of n', and it means 'the single output the rule f assigns to the input n'.

\[ f(n) \]

44. Not every input is safe: domain restrictions

Concept

The domain is not just decoration - it is a real restriction. A formula can produce nonsense, or nothing at all, for inputs outside its domain, so the domain states exactly which inputs are actually allowed.

A classic example is division: a rule that divides by the input breaks down completely at the one input that makes the denominator zero, so that value must be excluded from the domain.

domain — The complete set of inputs a function is defined for. An input outside the domain is simply not a legal thing to plug in.

45. Complete the line: Evaluate f(n) and state its domain and codomain

Fill the middle

Fill in the blanks

From Evaluate f(n) and state its domain and codomain — finish the line. Write what belongs on the right of the equals sign before you look.

\frac2.4 \notin \mathbb{N}___ = ___

Why: Producing the right-hand side unprompted is the difference between recognising this line and being able to use it. The domain is the six divisors of 12 listed above - the only inputs this rule is allowed to accept.

46. Evaluate f(n) and state its domain and codomain

Worked example

Consider this rule, restricted to the divisors of 12.

\[ g(n) = \frac{12}{n}, \qquad \text{domain} = \{1,2,3,4,6,12\} \]

Set up: state the domain and the codomain

Why: The domain is the six divisors of 12 listed above - the only inputs this rule is allowed to accept. The codomain is the natural numbers, the set every output is declared to live in.

Evaluate g at two domain values

Why: g of 3 means 12 divided by 3, which is 4. g of 6 means 12 divided by 6, which is 2.

\[ g(3) = 4, \qquad g(6) = 2 \]

Check that 5 is correctly excluded from the domain

Why: 12 divided by 5 is 2.4, not a natural number, so 5 cannot belong to the domain chosen for g - confirming why the domain was restricted to exactly the divisors of 12.

\[ \frac{12}{5} = 2.4 \notin \mathbb{N} \]

47. Domain, codomain, range

Picture it

Animation

Shows: Domain, codomain, range — a rendered Manim animation.

Rendered with Manim.

Takeaway: The range is what is actually hit; the codomain is what was promised.

48. Plan first: Decide whether a rule is actually a function

Step zero

Discussion prompt

Decide whether a rule is actually a function — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.

Hint: It starts with: Set up: test the rule on one input, n equal to 3

Answer:

  1. Set up: test the rule on one input, n equal to 3
  2. Find that two different values satisfy the rule
  3. Conclude the rule is not a function as stated
  4. Check the fix: require the non-negative value only

49. Decide whether a rule is actually a function

Worked example

Consider a rule that assigns to each nonzero integer n a value y whose square equals n squared.

\[ \text{rule: } y \text{ such that } y^2 = n^2 \]

Set up: test the rule on one input, n equal to 3

Why: We need to find every y whose square equals 9, since n squared is 9 when n is 3.

\[ n = 3,\quad y^2 = 9 \]

Find that two different values satisfy the rule

Why: Both y equal to 3 and y equal to negative 3 satisfy y squared equals 9, so the rule gives two different valid outputs for the very same input.

\[ y = 3 \ \text{or} \ y = -3 \]

Conclude the rule is not a function as stated

Why: A function must assign exactly one output per input. Since n equal to 3 has two valid outputs under this rule, it fails the defining requirement of a function.

Check the fix: require the non-negative value only

Why: Restricting the rule to 'y equals the non-negative square root of n squared' - the absolute value of n - picks out exactly one output for every input, so that restricted rule is a genuine function.

\[ y = |n| \ \Rightarrow\ n=3 \text{ gives the single output } y=3 \]

50. Floor and ceiling, defined

Concept

Floor and ceiling both take a real number and round it to a whole number, but in a specific direction rather than to whichever whole number happens to be closest.

Read the bracket-like symbols around x as 'the floor of x'. It means the largest whole number that is less than or equal to x - round down, always, no matter how close x already is to the next whole number.

\[ \lfloor x \rfloor \]

Read the other bracket-like symbols as 'the ceiling of x'. It means the smallest whole number that is greater than or equal to x - round up, always.

\[ \lceil x \rceil \]

51. Floor and ceiling in recurrences

Picture it

Animation

Shows: Floor and ceiling in recurrences — a rendered Manim animation.

Rendered with Manim.

Takeaway: Drop them while solving, then check the boundary once at the end.

52. Floor steps down, ceiling steps up

Intuition

Picture a staircase where only whole numbers are actual steps you can stand on. Floor asks: what is the nearest step at or below where you are standing? Ceiling asks the mirror question: what is the nearest step at or above you?

Neither one asks which step is closest overall - that question is rounding, and it is a completely different rule, which we will contrast directly in a moment.

53. Guess the shape of the answer: Compute floor and ceiling, including…

Estimation

Predict first

We will compute floor and ceiling for a positive value and a negative value.

Commit before you compute: what does Compute floor and ceiling, including negatives come out to? A rough magnitude and the right form is enough — the point is to have something concrete to be wrong about.

Correct: Check the ceiling of negative 3.2 for contrast

Why: A prediction you can defend turns the computation into a check rather than a leap of faith — and an answer that contradicts it is caught on the spot. The smallest whole number at or above negative 3.2 is negative 3.

54. Compute floor and ceiling, including negatives

Worked example

We will compute floor and ceiling for a positive value and a negative value.

Set up: compute the floor of 3.9

Why: The largest whole number still less than or equal to 3.9 is 3 - four would already be bigger than 3.9, so it cannot be the floor.

\[ \lfloor 3.9 \rfloor = 3 \]

Compute the ceiling of 3.9

Why: The smallest whole number greater than or equal to 3.9 is 4.

\[ \lceil 3.9 \rceil = 4 \]

Compute the floor of a negative number, negative 3.2

Why: The largest whole number at or below negative 3.2 is negative 4, not negative 3, since negative 3 sits above negative 3.2 on the number line.

\[ \lfloor -3.2 \rfloor = -4 \]

Check the ceiling of negative 3.2 for contrast

Why: The smallest whole number at or above negative 3.2 is negative 3. Floor and ceiling land on different numbers here, exactly as they should for any value that is not already whole.

\[ \lceil -3.2 \rceil = -3 \]

55. Compute floor and ceiling, including negatives — line by line

Picture it

Animation

Shows: Each line of the worked example "Compute floor and ceiling, including negatives", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: The smallest whole number at or above negative 3.2 is negative 3. Floor and ceiling land on different numbers here, exactly as they should for any value that is not already whole.

56. Something is wrong here: floor is not the same as rounding

Anomaly

Predict first

A student writes this, and it looks reasonable:

A student sees the floor of 3.9 and assumes floor works like ordinary rounding - since 3.9 is so close to 4, they round it up to 4.

It is wrong. Say what breaks — and say it before you turn the page.

Correct: Ordinary rounding looks at how close the decimal part is to the next whole number.

Floor always drops down to the whole number below, however close x already is to the next one.

Why: Ordinary rounding looks at how close the decimal part is to the next whole number. Floor ignores that entirely - it always drops down to the whole number below, no matter how close x is to the next one up.

57. Trap: floor is not the same as rounding

Trap

The trap

A student sees the floor of 3.9 and assumes floor works like ordinary rounding - since 3.9 is so close to 4, they round it up to 4.

\[ \lfloor 3.9 \rfloor \overset{?}{=} 4 \]

Round to the nearest whole number instead of applying floor

Why: Ordinary rounding looks at how close the decimal part is to the next whole number. Floor ignores that entirely - it always drops down to the whole number below, no matter how close x is to the next one up.

The fix

Floor always drops down to the whole number below, however close x already is to the next one.

\[ \lfloor 3.9 \rfloor = 3 \]

Apply the actual rule: the largest whole number at or below

Why: 3.9 sits between 3 and 4. Floor keeps only the whole number at or below 3.9, which is 3 - even though 3.9 looks like it 'should' round to 4.

Contrast the negative case, where the gap is starkest

Why: Rounding negative 0.1 gives 0, the nearest whole number. But the floor of negative 0.1 is negative 1, since negative 1 is the largest whole number at or below negative 0.1. Floor and rounding disagree even more sharply once negative numbers are involved.

\[ \lfloor -0.1 \rfloor = -1 \ \ne\ \text{round}(-0.1) = 0 \]

58. Say it in words: Trap: floor is not the same as rounding

Translation

\( \lfloor 3.9 \rfloor \overset{?}{=} 4 \)

Draw it

Translate both ways. First write the expression above as a sentence with no symbols in it at all. Then cover it, and write your sentence back as notation. If the two versions disagree, the disagreement is the thing to fix.

59. State the rule before it runs: Floor inside a real CS3000 formula

Hypothesis

Predict first

Floor inside a real CS3000 formula is about to be worked. State your hypothesis first: which rule or definition decides this one, and what is the first move it forces? Then watch whether the example agrees with you.

Correct: Set up: plug in the endpoints lo equal to 0, hi equal to 7

Why: Before flooring, average the two endpoints: 0 plus 7, divided by 2, is 3.5.

A hypothesis you wrote down is falsifiable; a vague sense of how it will go is not. If the example opens somewhere else, that gap is the thing worth chasing.

60. Floor inside a real CS3000 formula

Worked example

Binary search picks a middle index using this formula.

\[ \text{mid} = \left\lfloor \frac{\text{lo} + \text{hi}}{2} \right\rfloor \]

Set up: plug in the endpoints lo equal to 0, hi equal to 7

Why: Before flooring, average the two endpoints: 0 plus 7, divided by 2, is 3.5.

\[ \frac{0+7}{2} = 3.5 \]

Apply the floor

Why: The floor of 3.5 is 3, so mid is 3 - a valid whole index, even though the raw average was not a whole number.

\[ \lfloor 3.5 \rfloor = 3 \]

Check that 3 is a legal index in the range

Why: The range from 0 to 7 has 8 valid indices, 0 through 7, and 3 is one of them - so flooring produced a usable index rather than a fractional one.

\[ 0 \le 3 \le 7 \]

61. Floor inside a real CS3000 formula — line by line

Picture it

Animation

Shows: Each line of the worked example "Floor inside a real CS3000 formula", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: The range from 0 to 7 has 8 valid indices, 0 through 7, and 3 is one of them - so flooring produced a usable index rather than a fractional one.

62. Sigma notation: add these up

Concept

A capital Greek letter shaped like an angular S is used to mean 'add up a bunch of terms'. It is called sigma.

\[ \sum_{i=1}^{n} a_i \]

Read that whole expression as 'the sum, as i runs from 1 to n, of a sub i'. The small numbers below and above sigma are the starting and stopping values for the index i, and whatever comes right after sigma is the term you add up once for each value of i.

summation notation — A compact way to write a running total: a sigma symbol, a starting and stopping value for the index variable, and the term added once per value of the index.

63. Sigma notation is a for loop wearing a Greek letter

Concept

Every part of a sigma expression has a matching part in a loop. Once you can point at which is which, the notation stops being a wall and becomes a recipe you can run.

SUM(A, n)
  total = 0
  for i = 1 to n
    total = total + A[i]
  return total

The index under the sigma became the loop variable. The number on top became where the loop stops. The expression to the right of the sigma became the line inside the loop. Nothing was added and nothing was dropped.

64. Reading SUM line by line

Notation

Every line of SUM says one thing. Read the line, then read what it does — not the other way round.

Annotate

  • The name, and what it needs to be given. Sigma notation hides this header — you are expected to know the array and its length from context.
  • The empty sum is zero. Sigma notation never writes this line, and it is the one people forget when they turn a sum into code.
  • The index and its range: the little letter under the sigma, and the number sitting on top of it.
  • The body — whatever sits to the right of the sigma symbol. It runs once per value of the index.
  • The value the whole sigma expression stands for. A sum is one number, not a process.

65. Step SUM yourself

Invariant

Watch total. After the loop has run for the index value i, total holds the sum of the first i entries and nothing else. That sentence is the loop invariant, and it is the whole reason the answer at the end is correct.

Step through it

At every step, say what total holds in words before you look at the next line.

  1. Line 2: the empty sum
  2. Line 3: the index starts at the number under the sigma
  3. Line 4: add the first entry
  4. Line 3:
  5. Line 4: add the second
  6. Line 3:
  7. Line 4:
  8. Line 3: the index reaches the number on top
  9. Line 4:
  10. Line 5: one number, not a process

66. A sigma is a loop you can run

Picture it

Animation

Shows: SUM executing: the current line of pseudocode is highlighted while the data it touches changes.

Rendered with Manim.

Takeaway: The index becomes the loop variable, the top number becomes the stopping point, and the body becomes the line inside — a sigma is a loop.

67. Sigma is a for-loop that accumulates

Intuition

If you have written a loop that adds something onto a running total on every pass, you have already executed a sum like this by hand - sigma just writes down that exact process without any code.

Compare the summation to this loop: total starts at zero, and each pass through adds the next term before moving on to the next index.

total = 0
for i in range(1, n + 1):
    total = total + a[i]

The loop variable i is exactly the index. The loop's start and stop values are exactly sigma's bottom and top limits. And whatever gets added inside the loop body is exactly the term written right after sigma.

68. What has to happen first: Evaluate a sum by unrolling sigma

Ranking

Put in order

Put the moves of Evaluate a sum by unrolling sigma into the order they have to happen.

  1. Set up: read the sum out loud
  2. Unroll it into one term per value of i
  3. Add the terms in the order given
  4. Check the total by adding in a different order

Why: These are the moves of the worked example in the order it makes them, and each one is set up by the one before it. This says: add up i, as i runs from 1 to 5.

69. Evaluate a sum by unrolling sigma

Worked example

Consider this sum.

\[ \sum_{i=1}^{5} i \]

Set up: read the sum out loud

Why: This says: add up i, as i runs from 1 to 5.

Unroll it into one term per value of i

Why: Write out each pass of the loop by hand: i equal to 1, then 2, then 3, then 4, then 5.

\[ 1 + 2 + 3 + 4 + 5 \]

Add the terms in the order given

Why: Adding left to right: 1 plus 2 is 3, plus 3 is 6, plus 4 is 10, plus 5 is 15.

\[ \sum_{i=1}^{5} i = 15 \]

Check the total by adding in a different order

Why: Pairing the first and last, then the second and fourth, leaving the middle alone: (1 plus 5) plus (2 plus 4) plus 3 equals 6 plus 6 plus 3, which is 15 - the same total, confirming the sum.

\[ (1+5) + (2+4) + 3 = 15 \]

70. Splitting and shifting a sum

Picture it

Animation

Shows: Splitting and shifting a sum — a rendered Manim animation.

Rendered with Manim.

Takeaway: Splitting at k is the move behind almost every recurrence expansion.

71. Something is wrong here: the summation symbol is a loop, not a monster

Anomaly

Predict first

A student writes this, and it looks reasonable:

A student is intimidated by the sigma symbol and, wanting to get past it quickly, guesses at the total instead of unrolling every term - stopping one term too early.

It is wrong. Say what breaks — and say it before you turn the page.

Correct: Rushing past the symbol, the student adds only 1 plus 2 plus 3, stopping before i reaches the actual top limit of 4, and gets 6 - missing the last term entirely.

There is no shortcut needed - treat the top limit as inclusive and unroll every single term, exactly like a loop that runs all the way through its final index.

Why: Rushing past the symbol, the student adds only 1 plus 2 plus 3, stopping before i reaches the actual top limit of 4, and gets 6 - missing the last term entirely.

72. Trap: the summation symbol is a loop, not a monster

Trap

The trap

A student is intimidated by the sigma symbol and, wanting to get past it quickly, guesses at the total instead of unrolling every term - stopping one term too early.

\[ \sum_{i=1}^{4} i \]

Guess a shortcut instead of unrolling every term

Why: Rushing past the symbol, the student adds only 1 plus 2 plus 3, stopping before i reaches the actual top limit of 4, and gets 6 - missing the last term entirely.

\[ 1+2+3 = 6 \quad \text{(missing } i=4\text{)} \]

The fix

There is no shortcut needed - treat the top limit as inclusive and unroll every single term, exactly like a loop that runs all the way through its final index.

\[ \sum_{i=1}^{4} i \]

Unroll every value of i up to and including the top limit

Why: i runs from 1 through 4, inclusive, so there are four terms to add, not three: 1, 2, 3, and 4.

\[ 1+2+3+4 \]

Add all four terms

Why: 1 plus 2 plus 3 plus 4 equals 10, the correct total once the last term is not skipped.

\[ \sum_{i=1}^{4} i = 10 \]

73. Decode the notation: Trap: the summation symbol is a loop, not a monster

Notation

Annotate

From Trap: the summation symbol is a loop, not a monster — read this one piece at a time. What is each part doing?

On: \( \sum_{i=1}^{4} i = 10 \)

  • Rushing past the symbol, the student adds only 1 plus 2 plus 3, stopping before i reaches the actual top limit of 4, and gets 6 - missing the last term entirely.
  • i runs from 1 through 4, inclusive, so there are four terms to add, not three: 1, 2, 3, and 4.
  • 1 plus 2 plus 3 plus 4 equals 10, the correct total once the last term is not skipped.

74. Pi notation: multiply these up

Concept

A capital Greek letter shaped like a doorframe is used the same way sigma is, except it multiplies instead of adds. It is called pi, and it is unrelated to the circle constant that happens to share its lowercase name.

\[ \prod_{i=1}^{n} a_i \]

Read it as 'the product, as i runs from 1 to n, of a sub i'. Everything about the index, the limits, and the term works exactly like sigma - only the operation changes from adding to multiplying.

75. Summation notation, unpacked

Picture it

Animation

Shows: Summation notation, unpacked — a rendered Manim animation.

Rendered with Manim.

Takeaway: This one sum shows up in nearly every loop analysis you will do.

76. Complete the line: Evaluate a product using pi notation

Fill the middle

Fill in the blanks

From Evaluate a product using pi notation — finish the line. Write what belongs on the right of the equals sign before you look.

\prod_1}^{4} i}

Why: Producing the right-hand side unprompted is the difference between recognising this line and being able to use it. Write out each factor by hand: i equal to 1, then 2, then 3, then 4.

77. Evaluate a product using pi notation

Worked example

Consider this product.

\[ \prod_{i=1}^{4} i \]

Set up: unroll it into one factor per value of i

Why: Write out each factor by hand: i equal to 1, then 2, then 3, then 4.

\[ 1 \cdot 2 \cdot 3 \cdot 4 \]

Multiply the factors in order

Why: 1 times 2 is 2, times 3 is 6, times 4 is 24.

\[ \prod_{i=1}^{4} i = 24 \]

Check the result against a different grouping

Why: Group the factors differently: (1 times 4) times (2 times 3) equals 4 times 6, which is also 24 - the same product, confirming the result.

\[ (1\cdot4)\cdot(2\cdot3) = 24 \]

78. Evaluate a product using pi notation — line by line

Picture it

Animation

Shows: Each line of the worked example "Evaluate a product using pi notation", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: Group the factors differently: (1 times 4) times (2 times 3) equals 4 times 6, which is also 24 - the same product, confirming the result.

79. What log base 2 of n asks

Concept

A logarithm answers a question about exponents, run in reverse. Log base 2 of n asks exactly one question: 2 raised to what power gives n?

\[ \log_2 n \]

Read that as 'log base 2 of n'. Whatever number answers the question - the power 2 must be raised to, in order to land exactly on n - is the value of the logarithm.

logarithm — The inverse question to exponentiation: log base b of n is the power you must raise b to, in order to get n.

80. A logarithm counts halvings

Intuition

For base 2 specifically, there is a very physical way to picture the answer: log base 2 of n counts how many times you can cut n in half before you reach 1.

This is exactly why logarithms show up whenever an algorithm repeatedly cuts its input in half, like a binary search narrowing down a range - the number of halving steps it takes is a logarithm.

81. The logarithm identities that keep appearing

Picture it

Animation

Shows: The logarithm identities that keep appearing — a rendered Manim animation.

Rendered with Manim.

Takeaway: The last one is why the base of a log never matters inside big-O.

82. Plan first: Compute a logarithm and verify with the exponent form

Step zero

Discussion prompt

Compute a logarithm and verify with the exponent form — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.

Hint: It starts with: Set up: ask the defining question

Answer:

  1. Set up: ask the defining question
  2. Search powers of 2 until one matches
  3. Read off the exponent as the answer
  4. Check by converting back to exponent form

83. Compute a logarithm and verify with the exponent form

Worked example

Compute this logarithm.

\[ \log_2 32 = ? \]

Set up: ask the defining question

Why: Log base 2 of 32 asks: 2 raised to what power gives 32?

Search powers of 2 until one matches

Why: 2 to the first is 2, to the second is 4, to the third is 8, to the fourth is 16, to the fifth is 32 - a match.

\[ 2^1=2,\ 2^2=4,\ 2^3=8,\ 2^4=16,\ 2^5=32 \]

Read off the exponent as the answer

Why: Since 2 raised to the fifth power equals 32 exactly, log base 2 of 32 is 5.

\[ \log_2 32 = 5 \]

Check by converting back to exponent form

Why: The logarithm and exponent statements say the same thing two ways: log base 2 of 32 equals 5 exactly when 2 to the fifth equals 32 - and 2 to the fifth really is 32, so the answer checks out.

\[ 2^5 = 32\ \checkmark \]

84. Compute a logarithm and verify with the exponent… — line by line

Picture it

Animation

Shows: Each line of the worked example "Compute a logarithm and verify with the exponent form", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: The logarithm and exponent statements say the same thing two ways: log base 2 of 32 equals 5 exactly when 2 to the fifth equals 32 - and 2 to the fifth really is 32, so the answer checks out.

85. Solve for x in a logarithmic equation

Worked example

Solve this equation for x.

\[ \log_2 x = 6 \]

Set up: rewrite the logarithm as its equivalent exponent statement

Why: Log base 2 of x equals 6 is exactly the same fact as 2 to the sixth equals x - flipping between these two forms is the core move for solving any logarithmic equation.

\[ \log_2 x = 6 \iff 2^6 = x \]

Compute the exponent

Why: 2 to the sixth power is 2 multiplied by itself six times: 2, 4, 8, 16, 32, 64.

\[ 2^6 = 64 \]

Check by plugging x back into the original logarithm

Why: If x is 64, log base 2 of 64 asks what power gives 64 - and 2 to the sixth is 64, so the equation holds.

\[ \log_2 64 = 6\ \checkmark,\quad x = 64 \]

86. Solve for x in a logarithmic equation — line by line

Picture it

Animation

Shows: Each line of the worked example "Solve for x in a logarithmic equation", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: If x is 64, log base 2 of 64 asks what power gives 64 - and 2 to the sixth is 64, so the equation holds.

87. 'For all' and its symbol

Concept

Some statements claim something is true no matter which object you pick from a set - every single one, without exception. There is a symbol dedicated to exactly this claim: an upside-down capital A.

\[ \forall n \in \mathbb{N} \]

Read that as 'for all n in the natural numbers' or 'for every n that is a natural number'. Whatever statement follows must hold for every single one of those values of n, with zero exceptions allowed.

universal quantifier — The symbol read as 'for all'. It claims a property holds for every object in a given set, with no exceptions.

88. 'There exists' and its symbol

Concept

Other statements only claim that at least one object with a property can be found - not all of them, just one. There is a separate symbol for this: a backwards capital E.

\[ \exists n \in \mathbb{N} \]

Read that as 'there exists an n in the natural numbers' or 'for some n that is a natural number'. Whatever statement follows only needs to hold for at least one such n - finding a single one is enough.

existential quantifier — The symbol read as 'there exists'. It claims at least one object in a given set has a property - a single example is all it takes.

89. A universal promise vs. a treasure hunt

Intuition

A for-all statement is a promise that covers everyone in the set at once - to break the promise, someone only needs one exception, but to keep it, the property must hold everywhere, with no shortcut around checking it in general.

A there-exists statement is a treasure hunt - you only need to find one single object with the property to win. Once you produce it, the hunt is over; you never have to search the rest of the set.

90. 'Such that' attaches the condition

Concept

A quantifier by itself just names which objects are in play. The phrase 'such that' is what attaches the actual condition those objects must satisfy.

\[ \exists n \in \mathbb{N} \ \text{such that}\ n > 10 \]

Read the whole line as 'there exists a natural number n such that n is greater than 10'. Everything after 'such that' is the requirement the chosen n has to meet.

This same phrase connects back to set-builder notation - the colon we read earlier as 'such that' is exactly the same connecting word, just written with a symbol instead of spelled out.

91. Teach it back: 'Such that' attaches the condition

Explain it

Discussion prompt

Explain 'Such that' attaches the condition to a student a year behind you. No notation, no jargon they have not met — and it still has to be true.

Hint: If your explanation needs a symbol they have never seen, you are describing the notation rather than the idea.

Answer:

A quantifier by itself just names which objects are in play. The phrase 'such that' is what attaches the actual condition those objects must satisfy.

92. Setting up a proof: what each quantifier asks you to do first

Concept

Reading a quantified statement is only half the skill - the other half is knowing how to even start proving one, since the two quantifiers demand completely different opening moves.

To prove a for-all statement, you may not just check a handful of examples. The correct setup is to let an arbitrary, unspecified object be given from the set - give it a generic name - and then show the property holds for that one object using nothing except the fact that it belongs to the set.

To prove a there-exists statement, the setup is the opposite, and much shorter: produce one single concrete object, by name or by calculation, and show it satisfies the required property. No arbitrary object, no generality needed - just one witness.

witness — A specific, concrete object you exhibit to prove a there-exists statement. Producing one witness that satisfies the condition is enough to prove the whole statement true.

93. By analogy: Setting up a proof: what each quantifier asks you to…

Analogy

Discussion prompt

Explain Setting up a proof: what each quantifier asks you to do first by analogy to something with no CS3000 Algorithms in it at all — a queue, a recipe, a map, a bank balance, whatever fits. Then say where your analogy breaks.

Hint: An analogy that never breaks is not an analogy, it is the same idea wearing a hat. Find the seam — that is the part that is actually new.

Answer:

Reading a quantified statement is only half the skill - the other half is knowing how to even start proving one, since the two quantifiers demand completely different opening moves.

94. Quantifier order changes the meaning

Picture it

Animation

Shows: Quantifier order changes the meaning — a rendered Manim animation.

Rendered with Manim.

Takeaway: Same symbols, opposite claims. Order is not stylistic.

95. What has to be given first: Translate a quantified CS3000 statement and…

Missing information

Discussion prompt

Consider this claim about the natural numbers - that no natural number is the biggest one.

What do you need to know — or decide — before the first line can be written? List everything the problem has to hand you.

Hint: Anything you would have to invent to get started is a thing the problem must supply.

Answer:

This says: for every natural number n, there is some natural number m that is bigger than n. In other words, whatever number you pick, a bigger one always exists.

96. Translate a quantified CS3000 statement and check it

Worked example

Consider this claim about the natural numbers - that no natural number is the biggest one.

\[ \forall n \in \mathbb{N},\ \exists m \in \mathbb{N} \ \text{such that}\ m > n \]

Set up: read the statement in plain English first

Why: This says: for every natural number n, there is some natural number m that is bigger than n. In other words, whatever number you pick, a bigger one always exists.

Pick an arbitrary n to test the setup

Why: Since the claim is 'for all n', the correct way to test it is to imagine an arbitrary, unspecified n - not just one convenient number - and see whether a bigger m can always be found for it.

\[ \text{let } n \text{ be an arbitrary natural number} \]

Produce a witness m for that arbitrary n

Why: No matter what n turns out to be, m equal to n plus 1 is always a natural number and is always bigger than n - so this single formula for m works as a witness for every possible n.

\[ m = n + 1 \]

Check the witness on a concrete number

Why: Try n equal to 100: the witness is m equal to 101, and 101 is indeed greater than 100 - confirming the pattern that produced the witness in general.

\[ n=100,\ m=101,\ 101 > 100 \]

97. Translate a quantified CS3000 statement and check it — line by line

Picture it

Animation

Shows: Each line of the worked example "Translate a quantified CS3000 statement and check it", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: Try n equal to 100: the witness is m equal to 101, and 101 is indeed greater than 100 - confirming the pattern that produced the witness in general.

98. Something is wrong here: swapping the order of the quantifiers changes the…

Anomaly

Predict first

A student writes this, and it looks reasonable:

A student reads 'for all n there exists m such that m is greater than n' and, thinking the order of the two quantifiers does not matter, swaps them.

It is wrong. Say what breaks — and say it before you turn the page.

Correct: This swapped version claims that one single m is bigger than every natural number n, all at once.

The order the quantifiers are written in is part of the meaning - swapping for-all and there-exists produces a different statement, not a rephrasing of the same one.

Why: This swapped version claims that one single m is bigger than every natural number n, all at once. That is a completely different, and false, claim - no natural number can be bigger than all the others, since a bigger n could always be picked.

99. Trap: swapping the order of the quantifiers changes the meaning

Trap

The trap

A student reads 'for all n there exists m such that m is greater than n' and, thinking the order of the two quantifiers does not matter, swaps them.

\[ \exists m \in \mathbb{N} \ \text{such that}\ \forall n \in \mathbb{N},\ m > n \]

Treat the swapped statement as saying the same thing

Why: This swapped version claims that one single m is bigger than every natural number n, all at once. That is a completely different, and false, claim - no natural number can be bigger than all the others, since a bigger n could always be picked.

\[ \text{swapped statement is false} \]

The fix

The order the quantifiers are written in is part of the meaning - swapping for-all and there-exists produces a different statement, not a rephrasing of the same one.

\[ \forall n \in \mathbb{N},\ \exists m \in \mathbb{N} \ \text{such that}\ m > n \]

Read each version in the order it is actually written

Why: 'For all n, there exists m bigger than n' lets the witness m depend on n - a new, bigger m for each n - and this is true. 'There exists m such that for all n, m is bigger than n' demands one fixed m that beats every n at once - and this is false.

Use this to tell the two apart from now on

Why: Whenever for-all comes before there-exists, the witness is allowed to depend on the earlier variable. Whenever the order is reversed, the witness must work uniformly for everything that follows it - a much stronger, often false, requirement.

100. Which of these survive contact with Reading Math Notation, Sets & Functions?

Two truths and a lie

Sort into buckets

Some of these hold up and some are the exact mistakes this lesson is built to prevent. Sort them.

Holds up
The general entry, read 'a sub i', just means 'whichever entry sits in position i'. The letter i itself is called the index, and it can stand for any position at all.; A set is simply a collection of objects, called its elements or members. That is the entire idea - nothing more than 'these things are grouped together'.; Second, listing an element more than once adds nothing new - a set only records whether something belongs, never how many times it happened to get mentioned.
Breaks
Skip straight past the symbol to the surrounding letters; A student wants to say that the set containing just the number 2 is contained in S, and reaches for the membership symbol instead of the subset symbol.
sound
These are stated as this lesson states them — each one survives the edge cases Reading Math Notation, Sets & Functions puts it through.
flawed
Each of these is lifted from a trap in this deck: reasonable-sounding, and wrong in a way that only shows up once you rely on it.

101. Prove a 'there exists' claim by producing one witness

Worked example

Consider this claim.

\[ \exists n \in \mathbb{N} \ \text{such that}\ n^2 > 100 \]

Set up: recognize this needs only one witness

Why: Because the claim only says 'there exists', the entire proof is finding a single natural number whose square is bigger than 100 - no generality required.

Try a candidate value

Why: Try n equal to 10 first, since 10 squared is a round number to check.

\[ n=10,\quad 10^2 = 100 \]

Notice 10 does not satisfy the strict inequality, and adjust

Why: 10 squared is exactly 100, not greater than 100, so 10 fails the strict condition - try the very next natural number instead.

Check that 11 works as the witness

Why: 11 squared is 121, and 121 is indeed greater than 100, so n equal to 11 is a valid witness - the statement is proved true by exhibiting this one example.

\[ n=11,\quad 11^2 = 121 > 100 \]

102. Prove a 'there exists' claim by producing one… — line by line

Picture it

Animation

Shows: Each line of the worked example "Prove a 'there exists' claim by producing one witness", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: 11 squared is 121, and 121 is indeed greater than 100, so n equal to 11 is a valid witness - the statement is proved true by exhibiting this one example.

103. Negating a quantified statement

Concept

To deny a for-all claim, you do not need to show it fails everywhere - you only need one exception. That is exactly why the negation of a for-all statement turns into a there-exists statement.

\[ \lnot(\forall x,\ P(x)) \equiv \exists x,\ \lnot P(x) \]

Symmetrically, denying a there-exists claim means showing that not even one example can be found - so its negation turns into a for-all statement instead.

\[ \lnot(\exists x,\ P(x)) \equiv \forall x,\ \lnot P(x) \]

104. Break it if you can: Negating a quantified statement

Counterexample

Discussion prompt

To deny a for-all claim, you do not need to show it fails everywhere - you only need one exception. That is exactly why the negation of a for-all statement turns into a there-exists statement.

That is stated as though it always holds. Do one of two things: produce a case where it fails, or say precisely what rules such a case out. "It just does" is not on the menu.

Hint: Hunt at the extremes first — zero, one, negative, empty, equal. If every extreme survives, the reason they survive is the proof.

Answer:

Symmetrically, denying a there-exists claim means showing that not even one example can be found - so its negation turns into a for-all statement instead.

105. Guess the shape of the answer: Negate a quantified statement correctly

Estimation

Predict first

Consider this statement about a set S, and negate it.

Commit before you compute: what does Negate a quantified statement correctly come out to? A rough magnitude and the right form is enough — the point is to have something concrete to be wrong about.

Correct: Check the negation against a concrete set

Why: A prediction you can defend turns the computation into a check rather than a leap of faith — and an answer that contradicts it is caught on the spot. Let S be {2,4,5}. The original claim - every element is even - is false because of 5.

106. Negate a quantified statement correctly

Worked example

Consider this statement about a set S, and negate it.

\[ \forall x \in S,\ x \text{ is even} \]

Set up: identify the quantifier and the property being negated

Why: The statement is 'for all x in S, x is even'. Its quantifier is for-all, and the property attached to it is being even.

Flip the quantifier from for-all to there-exists

Why: Negating a for-all statement always turns it into a there-exists statement over the same set.

\[ \exists x \in S \ \text{such that}\ \ldots \]

Negate the inner property

Why: The negation of 'x is even' is 'x is odd', so the condition attached to the witness becomes odd instead of even.

\[ \exists x \in S \ \text{such that}\ x \text{ is odd} \]

Check the negation against a concrete set

Why: Let S be {2,4,5}. The original claim - every element is even - is false because of 5. The negation - some element is odd - is true, with 5 as that odd witness. The two statements have opposite truth values, exactly as a correct negation should.

\[ S = \{2,4,5\}: \text{ original false, negation true via witness } 5 \]

107. Negate a quantified statement correctly — line by line

Picture it

Animation

Shows: Each line of the worked example "Negate a quantified statement correctly", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: Let S be {2,4,5}. The original claim - every element is even - is false because of 5. The negation - some element is odd - is true, with 5 as that odd witness. The two statements have opposite truth values, exactly as a correct negation should.

108. This vocabulary is the language of the rest of the course

Concept

Every one of these symbols reappears constantly starting in the very next lesson. Running-time bounds are written with quantifiers. Recurrences are written with floor and ceiling. Correctness proofs are written with for-all, there-exists, and set membership, chained together.

None of these later topics introduces a pile of brand new symbols - it mostly combines the ones from this lesson into longer sentences. If you can read this lesson's vocabulary fluently, the rest of the course reads as a story instead of a puzzle.

109. Plan first: Decode the formal definition of Big-O

Step zero

Discussion prompt

Decode the formal definition of Big-O — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.

Hint: It starts with: Set up: read the definition symbol by symbol

Answer:

  1. Set up: read the definition symbol by symbol
  2. Identify which quantifier comes first
  3. Identify what the for-all then demands
  4. Check the definition on a concrete pair of functions

110. Decode the formal definition of Big-O

Worked example

Consider the formal definition used throughout the course.

\[ f(n) = O(g(n)) \iff \exists\, c>0,\ n_0 \ \text{such that}\ \forall n \ge n_0,\ f(n) \le c \cdot g(n) \]

Set up: read the definition symbol by symbol

Why: This says: f of n is big-O of g of n exactly when there exist positive constants c and n-naught such that, for all n at least n-naught, f of n is less than or equal to c times g of n.

Identify which quantifier comes first

Why: There-exists comes first, over the constants c and n-naught - so those two numbers get chosen once, and are then fixed for the rest of the statement.

\[ \exists\, c > 0,\ n_0 \]

Identify what the for-all then demands

Why: Once c and n-naught are fixed, the statement demands that the inequality hold for every n from n-naught onward, forever - not just for a few chosen values.

\[ \forall n \ge n_0,\ f(n) \le c \cdot g(n) \]

Check the definition on a concrete pair of functions

Why: Let f(n) be 3n + 5 and g(n) be n squared, with c equal to 8 and n-naught equal to 1. At n=1: 3(1)+5=8 and 8(1)^2=8, so the inequality holds with equality; at n=2: 3(2)+5=11 and 8(2)^2=32, and 11 is at most 32. Since n squared grows faster than n, the gap only widens for larger n, so this witness pair of constants satisfies the definition.

\[ n=1:\ 8 \le 8; \quad n=2:\ 11 \le 32 \]

111. Decode a recurrence that uses floor notation

Worked example

Consider this recurrence, made of a base case and a rule for bigger n.

\[ T(1) = 0, \qquad T(n) = T\!\left(\left\lfloor \frac{n}{2} \right\rfloor\right) + 1 \]

Set up: read the recurrence as a base case plus a smaller call

Why: T of 1 is given directly as 0 - the base case. For any bigger n, T of n is defined using a smaller call: T of the floor of n over 2, plus 1.

Trace the recursive calls starting from T(8)

Why: T(8) needs T of the floor of 8 over 2, which is T(4). T(4) needs T of the floor of 4 over 2, which is T(2). T(2) needs T of the floor of 2 over 2, which is T(1), the base case.

\[ T(8) \to T(4) \to T(2) \to T(1) \]

Add up the plus-ones on the way back

Why: T(1) is 0. T(2) is T(1) plus 1, which is 1. T(4) is T(2) plus 1, which is 2. T(8) is T(4) plus 1, which is 3.

\[ T(2)=1,\ T(4)=2,\ T(8)=3 \]

Check T(8) against the halving count

Why: The floor keeps cutting n in half until it reaches 1: 8 to 4 to 2 to 1 is exactly 3 halvings, matching T(8) equal to 3 - this recurrence is really just counting halving steps, the same count a base-2 logarithm gives.

\[ \log_2 8 = 3 = T(8) \]

112. Counting subsets

Picture it

Animation

Shows: Counting subsets — a rendered Manim animation.

Rendered with Manim.

Takeaway: One binary choice per element — which is why the count is a power of two.

113. What has to happen first: Formalize an English claim about a list using…

Ranking

Put in order

Put the moves of Formalize an English claim about a list using quantifiers into the order they have to happen.

  1. Set up: identify what 'every entry' should become
  2. Read the formal version back in English to check the translation
  3. Test it against a concrete list
  4. Check the claim holds for every index, not just a sample

Why: These are the moves of the worked example in the order it makes them, and each one is set up by the one before it. 'Every entry' is a for-all claim ranging over all valid index positions, and 'entry at position i' is written using the subscript notation from earlier - a sub i.

114. Formalize an English claim about a list using quantifiers

Worked example

Consider this English claim about a list, stored using the subscript notation from earlier: every entry of the list is positive.

Set up: identify what 'every entry' should become

Why: 'Every entry' is a for-all claim ranging over all valid index positions, and 'entry at position i' is written using the subscript notation from earlier - a sub i.

\[ \forall i \ \text{such that}\ 1 \le i \le n,\ a_i > 0 \]

Read the formal version back in English to check the translation

Why: 'For all i such that i is between 1 and n, a sub i is greater than 0' is exactly 'every entry of the list is positive', just written symbolically instead of in words.

Test it against a concrete list

Why: Let the list be (2, 5, 7, 1), so n is 4. Check each entry: a sub 1 is 2, a sub 2 is 5, a sub 3 is 7, a sub 4 is 1 - all four are positive.

\[ a_1=2,\ a_2=5,\ a_3=7,\ a_4=1 \]

Check the claim holds for every index, not just a sample

Why: Since all four entries - every single index from 1 to n - were checked and each is positive, the for-all statement holds for this list. If even one entry had been zero or negative, the for-all claim would be false, no matter how many other entries were fine.

115. Formalize an English claim about a list using… — line by line

Picture it

Animation

Shows: Each line of the worked example "Formalize an English claim about a list using quantifiers", appearing one at a time.

The same working the example does, in the order a tutor would write it.

Takeaway: Since all four entries - every single index from 1 to n - were checked and each is positive, the for-all statement holds for this list. If even one entry had been zero or negative, the for-all claim would be false, no matter how many other entries were fine.

116. How to read any math statement, step by step

Pattern

1. Find every symbol you do not instantly know

Why: Do not skip past anything unfamiliar - each symbol stands in for a specific English phrase, and guessing at it is exactly how misreadings start.

2. Name each symbol out loud in plain English

Why: Element-of, subset-of, union, floor, sigma, for-all - say the actual words the symbol stands for before trying to reason with it.

3. Read the whole expression left to right as one sentence

Why: String the plain-English names together in order, exactly as written, so the notation becomes a sentence you could say out loud to someone else.

4. Restate what the sentence is actually claiming

Why: Separate the quantifier or set relationship from the specific condition attached to it, so you know exactly what would make the statement true or false.

5. Sanity-check on one concrete number or example

Why: Plug in an actual value and confirm the statement behaves the way your reading says it should - this catches a wrong reading before it costs you a whole proof.

117. Where this shows up: Reading Math Notation, Sets & Functions

Real world

Discussion prompt

Outside this lesson: where does Reading Math Notation, Sets & Functions actually turn up? Name one concrete situation — a job, a piece of software someone ships, a decision somebody has to make — and say which part of How to read any math statement, step by step is doing the work in it.

Hint: Vague is the failure mode here. "Engineering" is not a situation; "deciding whether this build is fast enough to ship" is.

Answer:

How to read the symbolic vocabulary the rest of CS3000 is written in: sets and set-builder notation, element-of vs. subset-of, union and intersection, ordered pairs and the Cartesian product, functions with domain and codomain, floor vs.

118. Check yourself: element-of vs. subset-of

Check

Consider this set.

\[ S = \{1, 2, 3\} \]

Check your understanding

Which statement about S is true?

  • A. {1,2} is a subset of S (correct)
  • B. {1,2} is an element of S
  • C. 2 is a subset of S
  • D. 4 is an element of S

Answer: A

Why: {1,2} is a subset of S because every element of {1,2} - namely 1 and 2 - is also in S. The set {1,2} is not itself one of S's members, and a lone number never takes the subset symbol.

Why B tempts people
This mistakes subset for element. S's members are the plain numbers 1, 2, and 3, not the set {1,2}, so {1,2} is not an element of S even though it is a subset.
Why C tempts people
This applies the subset symbol to a single number instead of a whole set. A lone number can be an element of S, but 'subset of' only ever compares two sets.
Why D tempts people
4 does not appear among S's members at all - S only contains 1, 2, and 3, so this claim is false regardless of which symbol is used.

119. Check yourself: floor vs. rounding

Check

Consider the value 7.8.

Check your understanding

What is the floor of 7.8?

  • A. 7 (correct)
  • B. 8
  • C. 7.8
  • D. -7

Answer: A

Why: The floor of 7.8 is the largest whole number less than or equal to 7.8, which is 7. Floor always drops down to the number below, even though 7.8 is close to 8, unlike ordinary rounding.

Why B tempts people
This applies ordinary rounding instead of floor - rounding to the nearest whole number gives 8 since 7.8 is closer to 8, but floor always rounds down regardless of closeness.
Why C tempts people
This leaves the number unchanged instead of applying the floor operation at all - floor must produce a whole number, and 7.8 is not one.
Why D tempts people
This confuses 'round down' with 'make negative'. Floor always moves toward the whole number below the given value, but for a positive number that whole number is still positive.

120. Rule out three: Check yourself: summation evaluation

Elimination

Eliminate the wrong options

What is the value of the sum shown above?

3 of these 4 are wrong. Strike them one at a time, and say what rules each one out before you strike the next. The survivor is the answer.

  • A. 14
  • B. 6
  • C. 9
  • D. 30

Survives elimination: A

Why: Unrolling the sum: 1 squared is 1, 2 squared is 4, 3 squared is 9. Adding these three terms gives 1 + 4 + 9 = 14, which is the value of the sum.

121. Check yourself: summation evaluation

Check

Consider the following sum.

\[ \sum_{i=1}^{3} i^2 \]

Check your understanding

What is the value of the sum shown above?

  • A. 14 (correct)
  • B. 6
  • C. 9
  • D. 30

Answer: A

Why: Unrolling the sum: 1 squared is 1, 2 squared is 4, 3 squared is 9. Adding these three terms gives 1 + 4 + 9 = 14, which is the value of the sum.

Why B tempts people
This sums i itself (1+2+3=6) instead of squaring each term first. The expression written after sigma must be applied to each i before adding.
Why C tempts people
This only evaluates the last term of the sum (i=3, giving 9) instead of adding up all three terms for i=1, i=2, and i=3.
Why D tempts people
This includes an extra term for i=4 (adding 16), running one step past the sum's actual upper limit of 3 - the classic off-by-one mistake with an inclusive top limit.

122. Check yourself: quantifier order

Check

All four statements below are about the natural numbers.

Check your understanding

Which of these statements is true?

  • A. For all n, there exists m such that m > n. (correct)
  • B. There exists m such that for all n, m > n.
  • C. For all n, there exists m such that m < n.
  • D. There exists n such that for all m, n > m.

Answer: A

Why: This says every natural number has a bigger one after it, since you can always choose m = n + 1. It is true because there is no biggest natural number - the witness m is allowed to depend on n.

Why B tempts people
This demands one single m that is bigger than every natural number at once - impossible, since a bigger n could always be named than any proposed m. Swapping the quantifier order turned a true statement into a false one.
Why C tempts people
This fails at the smallest natural number: when n is 0, there is no smaller natural number m to serve as a witness, so the claim breaks at that edge case.
Why D tempts people
This claims some single natural number is bigger than every other natural number - but for any candidate n, n + 1 is a bigger natural number, so no such greatest n can exist.

123. Connect it up: Reading Math Notation, Sets & Functions

Connect it up

Draw it

One page, no notation unless you need it: draw how these connect — How to read any math statement, step by step · Notation is compressed English, not decoration · You already read compressed language fluently · Reading subscripts: naming one item out of many · A set is a collection of distinct objects. Put an arrow wherever one of them is what makes another possible, and label the arrow with why.

124. What you can do now

Recap

You now have the reading vocabulary the rest of CS3000 assumes you already know: sets, functions, floor and ceiling, sums and products, logarithms, and the two quantifiers - plus how to set up a proof of a for-all or a there-exists claim.

SymbolRead it as
n ∈ Sn is an element of S
A ⊆ BA is a subset of B
A ∪ B / A ∩ BA union B / A intersection B
⌊ x ⌋ / ⌈ x ⌉floor of x / ceiling of x
Σ a_ithe sum of the terms a sub i
∀ / ∃for all / there exists

Sources

  1. Cormen, Leiserson, Rivest, and Stein - Introduction to Algorithms, 3rd ed., Section 3.2 (Standard notations and common functions: floor, ceiling, logarithms, factorials) and Appendix B (Sets, relations, and functions) — MIT Press, 2009.
  2. Rosen - Discrete Mathematics and Its Applications, 8th ed., Chapters 1-2 (sets, functions, quantifiers, sequences and summations) — McGraw-Hill, 2019.
  3. Sipser - Introduction to the Theory of Computation, 3rd ed., Section 0 (Mathematical Preliminaries: sets, sequences, functions, relations) — Cengage Learning, 2013.
  4. All symbol definitions and computed examples (floor/ceiling values, logarithms, sums, products, Cartesian products, the Big-O witness constants, and the recurrence trace) re-derived by hand and cross-checked against the standard definitions above. — Verified 2026-07-18.
  5. Northeastern University CS 3000, Algorithms and Data (Summer 2026) — course page and syllabus — course.ccs.neu.edu/cs3000su26. Sets Cormen, Leiserson, Rivest and Stein, Introduction to Algorithms (3rd ed.) as the textbook; listings follow its conventions.
  6. CS 3000 course notes and midterm references circulated by students — github.com/vigneshsaravanakumar404/CS-3000-Algorithms-Data. Notes are typeset with the algpseudocode package, which is the style the listings in this deck follow.

Want this taught 1-on-1? Alexander tutors CS3000 Algorithms — $55/session, free consultation.

Book on Wyzant · Text (657) 465-8108