Proof by Contradiction

This deck shows how to start, run, and close a proof by contradiction: recognizing when it fits, negating a claim correctly - including flipping the quantifiers - and reasoning through to a genuine impossibility. It works the irrationality of the square root of 2, the infinitude of the primes, and a sketch of a greedy exchange argument. It targets four real misconceptions: negating "for all" incorrectly, confusing contradiction with contrapositive, declaring victory without a real impossibility, and assuming the claim instead of its negation.

Subject: CS3000 Algorithms · 128 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

Proof by contradiction is the tool CS3000 reaches for whenever a claim says something cannot happen. This lesson is built around the hardest part: getting started. By the end you can:

  1. Recognize when a claim's wording calls for contradiction rather than a direct proof.
  2. Correctly negate a claim to build your starting assumption, including flipping 'for all' into 'there exists' and back.
  1. Reason from that assumption to a genuine, checkable impossibility, and know what does and does not count as one.
  2. Tell proof by contradiction apart from proof by contrapositive, since they are set up differently even though they feel similar.
  1. Reproduce three classic contradiction proofs: the square root of 2 is irrational, there are infinitely many primes, and a greedy algorithm's first choice cannot be beaten.

2. What survived from Proof by Induction?

Warm-up

Discussion prompt

Before we open Proof by Contradiction: without looking back, what was the main idea of Proof by Induction, and what could you do by the end of it that you could not do before?

Hint: One sentence for the idea, one for the skill. If the second one is blank, that is the part to revisit.

Answer:

A from-scratch guide to STARTING an induction proof, not just following one: recognizing when a claim needs induction, writing the base case, the inductive hypothesis, and the inductive step, and choosing weak versus strong induction. Worked proofs cover a summation identity, an inequality, a divisibility claim, a strong-induction postage argument, and two recursive-structure proofs (a recursive sum function and binary-tree leaf counts) connecting induction to recursive algorithms.

3. Toolkit check-in: name them before you look

Concept

Before any new material: cover the screen.

You have named 6 reusable moves so far. Say as many as you can out loud, by number, from memory.

Do not advance until you have actually tried. Getting four of eight is information; skipping the exercise is not.

Here they are. Score yourself.

Today adds 2 moves to this list. Everything else you will need is already above.

The question that starts every proof from here on is not how do I begin. It is which of these applies here?

4. Break it if you can: Toolkit check-in: name them before you look

Counterexample

Discussion prompt

You have named 6 reusable moves so far. Say as many as you can out loud, by number, from memory.

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:

Do not advance until you have actually tried. Getting four of eight is information; skipping the exercise is not.

5. The minimal counterexample trick

Picture it

Animation

Shows: The minimal counterexample trick — a rendered Manim animation.

Rendered with Manim.

Takeaway: Well-ordering guarantees a smallest failure exists, which is what you attack.

6. Recognizing When Contradiction Fits

Section

Section 1

7. The big idea in one sentence

Concept

To prove a claim by contradiction, you assume the claim is false, reason correctly from that assumption, and arrive at something that is flatly impossible. Since your reasoning was valid, the only thing that could have been wrong is the assumption - so the claim must actually be true.

\[ \text{Assume } \lnot S \ \text{is true} \ \longrightarrow \ \text{valid reasoning} \ \longrightarrow \ \text{impossible fact} \ \Rightarrow \ S \text{ is true} \]

proof by contradiction — A proof that establishes a claim S by assuming its negation, deriving a statement that cannot possibly be true, and concluding that the negation must have been false - so S holds.

8. Another name: an indirect proof

Concept

In CS3000 you will sometimes hear this called an indirect proof, in contrast to a direct proof. A direct proof starts from what is given and pushes forward to the conclusion. An indirect proof starts from the conclusion's denial and pushes forward to a disaster.

Same destination, opposite starting point. Both are completely legitimate; you choose whichever gives you something concrete to grab onto.

9. By analogy: Another name: an indirect proof

Analogy

Discussion prompt

Explain Another name: an indirect proof 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:

Same destination, opposite starting point. Both are completely legitimate; you choose whichever gives you something concrete to grab onto.

10. Springing a trap on your own assumption

Intuition

Picture setting a trap. You do not fight the assumption head on - you let it in the door, treat it as true, and follow where it leads. If it is false, following it honestly will eventually walk it into a wall.

The moment you hit that wall - two facts that cannot coexist - the trap springs. The assumption is what breaks, not your reasoning. That is why every step before the wall must be airtight: a shaky step gives the assumption an escape route.

11. Why lowest terms is the load-bearing assumption

Picture it

Animation

Shows: Why lowest terms is the load-bearing assumption — a rendered Manim animation.

Rendered with Manim.

Takeaway: Without lowest terms there is nothing to contradict.

12. Meet the three ingredients

Concept

Every contradiction proof has exactly three moving parts, and naming them out loud is what turns a vague plan into an actual proof you can write.

The assumption

Why: The exact, correctly-formed negation of the claim. This is your only starting fact - everything else must follow from it.

The derivation

Why: A chain of ordinary, fully justified steps - the same kind you would use in any other proof - that follows from the assumption.

The impossibility

Why: A concrete fact that cannot be true: two contradictory statements, a violated definition, or an equation like 0 equals 1.

13. Teach it back: Meet the three ingredients

Explain it

Discussion prompt

Explain Meet the three ingredients 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:

Every contradiction proof has exactly three moving parts, and naming them out loud is what turns a vague plan into an actual proof you can write.

14. The detective ruling out a suspect

Intuition

A detective wants to show a suspect is innocent. She temporarily assumes the suspect is guilty, then traces out what must be true if that were so - the suspect would have to be in two cities at once.

Being in two places at once is impossible, so the guilty assumption collapses, and the suspect is innocent. Notice she never argued directly for innocence - she let the opposite assumption defeat itself.

15. The clue words that call for contradiction

Concept

Contradiction earns its keep on claims where a direct proof has nothing to build forward from - especially claims about things that supposedly do not exist or cannot happen.

Watch for phrases like: there is no largest such-and-such, this number cannot be written as a fraction, no algorithm can do better than this, this list has no smallest element, the set of primes is not finite.

16. Where contradiction shows up in algorithms

Picture it

Animation

Shows: Where contradiction shows up in algorithms — a rendered Manim animation.

Rendered with Manim.

Takeaway: Most greedy correctness proofs are contradictions wearing a different name.

17. Matching the wording to the tool

Intuition

If a claim already hands you an equation or an object to manipulate, try direct first. If the claim is really a denial - 'there is no X', 'you cannot do Y', 'Z is not possible' - a direct proof has nothing to grab, because there is no X to work with.

Contradiction flips that weakness into a strength: you manufacture the very thing the claim denies by assuming it exists, and then use it as your object to work with.

18. Direct proofs build, contradiction proofs break

Intuition

A direct proof is constructive - it builds the conclusion piece by piece from the hypothesis. A contradiction proof is destructive - it builds a scenario and then demolishes it.

Both are equally rigorous. The choice is about convenience, not correctness: pick whichever starting point gives you real material to reason with.

19. Try direct first

Picture it

Animation

Shows: Try direct first — a rendered Manim animation.

Rendered with Manim.

Takeaway: Contradiction is powerful and often longer than it needs to be.

20. The Contradiction Proof skeleton

Concept

Every proof of this kind has the same five or six moves in the same order. The order is not something you rediscover each time.

It is on the right. It will stay on the right through the worked examples that follow.

Why this matters: the structure is now handled. You are not spending working memory on what comes next — you are spending all of it on the one hard step.

Step 2 is where most wrong proofs are born, and step 5 is where you have to build something — the collision does not appear on its own. You go looking for it.

21. The shape of a contradiction proof

Picture it

Animation

Shows: The shape of a contradiction proof — a rendered Manim animation.

Rendered with Manim.

Takeaway: The impossibility is the whole proof; everything else is setup.

22. Decision point: you have assumed the negation. Now what?

Intuition

What move should we make next?

The claim is that there is no largest even number. We negated it and assumed the negation:

\[ \text{assume: there is a largest even number, call it } N \]

Nothing is contradictory yet. That statement sits there looking perfectly reasonable.

You are not going to find a contradiction by staring. You have to make one. What do you build out of N?

_Look at your toolkit. Say a move number out loud before this slide advances._ A wrong guess is useful. A silent guess is not.

23. What has to happen first: Warm-up: there is no largest even number

Ranking

Put in order

Put the moves of Warm-up: there is no largest even number into the order they have to happen.

  1. Recognize the shape: this is a 'there is no' claim
  2. Write the exact negation and assume it
  3. Manufacture a bigger even number from E
  4. Verify the contradiction

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. Nothing to build forward from directly - there is no largest number handed to us.

24. Warm-up: there is no largest even number

Worked example

Claim: no even number is bigger than every other even number.

\[ \text{Claim: there is no largest even number.} \]

Recognize the shape: this is a 'there is no' claim

Why: Nothing to build forward from directly - there is no largest number handed to us. That is the signal to try contradiction.

Write the exact negation and assume it

Why: The negation of 'no even number is largest' is 'there exists an even number that IS the largest'. Assume that number exists and name it E.

\[ \text{Assume } \exists\, E: \ E \text{ is even, and every even number} \leq E \]

Manufacture a bigger even number from E

Why: E is even, so E plus 2 is also even (an even number plus 2 stays even). And E plus 2 is strictly bigger than E.

\[ E + 2 \text{ is even}, \quad E + 2 > E \]

Verify the contradiction

Why: We assumed every even number is at most E, yet E plus 2 is an even number bigger than E. Both cannot be true, so the assumption breaks. There is no largest even number.

\[ E+2 \text{ even and } E+2 > E \ \Rightarrow\ \text{contradicts 'every even} \leq E\text{'}\ \checkmark \]

25. Warm-up: there is no largest even number — line by line

Picture it

Animation

Shows: Each line of the worked example "Warm-up: there is no largest even number", appearing one at a time.

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

Takeaway: We assumed every even number is at most E, yet E plus 2 is an even number bigger than E. Both cannot be true, so the assumption breaks. There is no largest even number.

26. Why is this step legal: Build the object the assumption forbids

Explain it to yourself

Discussion prompt

In The move we just made, named this move is made:

Build the object the assumption forbids

Why is that legal? Name the rule or definition it rests on before you read on.

Hint: If you can only say "because that is what you do", the rule is the thing to go and find.

Answer:

N is even and largest. Then N+2 is even and bigger. You did not find that — you constructed it, the same way you constructed the n that broke a big-O bound.

27. The move we just made, named

Concept

The move: #7 (Negate and assume), then #2 (The +1 trick).

Negate and assume: give the forbidden object a name

Why: The claim says no such thing exists. So assume one does and name it N. Naming it is what makes it something you can do arithmetic to.

Build the object the assumption forbids

Why: N is even and largest. Then N+2 is even and bigger. You did not find that — you constructed it, the same way you constructed the n that broke a big-O bound.

\[ N + 2 > N \quad \text{and} \quad N + 2 \text{ is even} \]

That is the whole trick, and it is #2 (The +1 trick) wearing a different hat. When a claim says for all or there is no, you win by building the one thing it says cannot exist.

28. Decode the notation: The move we just made, named

Notation

Annotate

From The move we just made, named — read this one piece at a time. What is each part doing?

On: \( N + 2 > N \quad \text{and} \quad N + 2 \text{ is even} \)

  • The claim says no such thing exists. So assume one does and name it N. Naming it is what makes it something you can do arithmetic to.
  • N is even and largest. Then N+2 is even and bigger. You did not find that — you constructed it, the same way you constructed the n that broke a big-O bound.

29. Something is wrong here: assuming the claim instead of its negation

Anomaly

Predict first

A student writes this, and it looks reasonable:

A student wants to prove there is no largest even number, so she starts by assuming exactly that - 'there is no largest even number' - and tries to reason forward from it.

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

Correct: This gives nothing to work with.

Assume the OPPOSITE of what you want to prove - the negation - because the negation hands you a concrete object to work with.

Why: This gives nothing to work with. 'No such number exists' names no object you can do algebra on - there is no E to add 2 to. The proof stalls before it starts.

30. Trap: assuming the claim instead of its negation

Trap

The trap

A student wants to prove there is no largest even number, so she starts by assuming exactly that - 'there is no largest even number' - and tries to reason forward from it.

\[ \text{Wanted: no largest even number} \]

Assume the claim itself is true

Why: This gives nothing to work with. 'No such number exists' names no object you can do algebra on - there is no E to add 2 to. The proof stalls before it starts.

\[ \text{Assumed: } \lnot(\exists E: E \text{ largest even})\ \text{--- same as the goal, no object to use} \]

The fix

Assume the OPPOSITE of what you want to prove - the negation - because the negation hands you a concrete object to work with.

\[ \text{Wanted: no largest even number} \]

Assume the negation: a largest even number DOES exist

Why: Now you have a specific object, E, with a specific property (every even number is at most E). That is something you can actually manipulate.

\[ \text{Assume } \exists\, E:\ E \text{ is the largest even number} \]

Only now can the proof move

Why: With E in hand, building E plus 2 and comparing it to E is a real algebraic step. The rule: always assume the negation of the goal, never the goal itself.

31. Plan first: There is no smallest positive real number

Step zero

Discussion prompt

There is no smallest positive real number — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.

Hint: It starts with: Negate correctly and assume it

Answer:

  1. Negate correctly and assume it
  2. Build a smaller positive number from s
  3. Verify the contradiction

32. There is no smallest positive real number

Worked example

Claim: among all positive real numbers, none of them is the smallest.

\[ \text{Claim: there is no smallest positive real number.} \]

Negate correctly and assume it

Why: The negation of 'no positive real is smallest' is 'some positive real number IS the smallest'. Assume it exists and name it s.

\[ \text{Assume } \exists\, s > 0:\ \text{every real } x > 0 \text{ satisfies } x \geq s \]

Build a smaller positive number from s

Why: Since s is positive, half of s is also positive, and cutting a positive number in half makes it strictly smaller.

\[ \frac{s}{2} > 0, \qquad \frac{s}{2} < s \]

Verify the contradiction

Why: We assumed every positive real is at least s, but s over 2 is a positive real number that is strictly smaller than s. Both statements cannot hold, so the assumption fails. No smallest positive real number exists.

\[ \tfrac{s}{2} > 0 \ \text{and}\ \tfrac{s}{2} < s \ \Rightarrow\ \text{contradicts 'every positive real} \geq s\text{'}\ \checkmark \]

33. There is no smallest positive real number — line by line

Picture it

Animation

Shows: Each line of the worked example "There is no smallest positive real number", appearing one at a time.

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

Takeaway: We assumed every positive real is at least s, but s over 2 is a positive real number that is strictly smaller than s. Both statements cannot hold, so the assumption fails. No smallest positive real number exists.

34. Negating Statements Correctly

Section

Section 2

35. Negation of a simple statement

Concept

Negating a plain statement, with no quantifier attached, is the easy case: flip it to its opposite. 'The light is on' negates to 'the light is off'; 'n is even' negates to 'n is odd'.

negation — The statement that is true exactly when the original is false, and false exactly when the original is true. A statement and its negation can never both be true, and can never both be false.

36. Negate the statement correctly

Picture it

Animation

Shows: Negate the statement correctly — a rendered Manim animation.

Rendered with Manim.

Takeaway: Half of failed contradiction proofs start with a bad negation.

37. Flipping the switch

Intuition

A negation behaves like a light switch: exactly one position is on at a time. If you flip a statement's truth value and get something that could still be true alongside the original, you have not actually written its negation - you have written something weaker or unrelated.

38. Negating 'for all' becomes 'there exists ... not'

Concept

This is the rule students get wrong most often, so read it slowly. A universal claim - 'for all x, property P holds' - is negated by switching the quantifier to 'there exists' AND negating the inside property.

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

In plain English: the opposite of 'every single one has property P' is 'at least one of them does NOT have property P'. It only takes one exception to break a 'for all' claim.

39. One bad apple sinks 'all apples are good'

Intuition

To disprove 'every apple in the basket is good', you do not need every apple to be bad - you only need to hold up one bad apple. That single witness is the whole negation.

This is exactly why the correct negation uses 'there exists' rather than another 'for all': denying a universal claim is a much weaker, much easier-to-satisfy statement than the original.

40. Negating 'there exists' becomes 'for all ... not'

Concept

The mirror-image rule: an existence claim - 'there exists an x with property P' - is negated by switching the quantifier to 'for all' AND negating the inside property.

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

In plain English: the opposite of 'at least one of them has property P' is 'none of them do' - equivalently, 'every single one lacks P'.

41. If you can't find even one, none exist

Intuition

To deny 'there is a coin in this jar', you must show that every single item in the jar is not a coin. Finding zero coins after checking everything is the same thing as 'for all items, it is not a coin'.

Both quantifier-flip rules follow the same shape: flip the quantifier, negate what is inside it. Memorize the shape, not two separate rules.

42. Plan first: Negation practice: is every score on the board passing

Step zero

Discussion prompt

Negation practice: is every score on the board passing — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.

Hint: It starts with: Identify the quantifier and the inner property

Answer:

  1. Identify the quantifier and the inner property
  2. Flip 'for all' to 'there exists'
  3. Negate the inner property and assemble
  4. Verify the negation is exhaustive and exclusive

43. Negation practice: is every score on the board passing

Worked example

Consider a claim about a scoreboard: every recorded score is a passing score.

\[ \text{Claim: } \forall\, x \in \text{scores},\ x \text{ is passing} \]

Identify the quantifier and the inner property

Why: The quantifier out front is 'for all', and the inner property is 'x is passing'. To negate it, both parts must change.

Flip 'for all' to 'there exists'

Why: By the quantifier-negation rule, denying a universal claim means asserting existence of a counterexample, not asserting the universal opposite.

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

Negate the inner property and assemble

Why: The inner property 'x is passing' negates to 'x is not passing'. Combine with the flipped quantifier to get the finished negation.

\[ \text{Negation: } \exists\, x \in \text{scores},\ x \text{ is NOT passing} \]

Verify the negation is exhaustive and exclusive

Why: The original is true exactly when every score passes; the negation is true exactly when at least one score fails. Every possible scoreboard satisfies exactly one of the two - so this is a genuine negation, and either one would be the correct assumption to open a contradiction proof about scores.

\[ \text{Either every score passes, or some score fails --- never both, never neither}\ \checkmark \]

44. Negation practice: is every score on the board… — line by line

Picture it

Animation

Shows: Each line of the worked example "Negation practice: is every score on the board passing", appearing one at a time.

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

Takeaway: The original is true exactly when every score passes; the negation is true exactly when at least one score fails. Every possible scoreboard satisfies exactly one of the two - so this is a genuine negation, and either one would be the correct assumption to open a contradiction proof about scores.

45. Something is wrong here: negating 'for all' into another 'for all'

Anomaly

Predict first

A student writes this, and it looks reasonable:

To prove by contradiction that every integer in a set S is even, a student assumes the negation is 'every integer in S is odd'.

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

Correct: This keeps the quantifier as 'for all' and just negates the inside - but the correct move is to CHANGE the quantifier to 'there exists', not keep it.

Negating a quantifier flips it: 'for all' becomes 'there exists', and only then do you negate the inside.

Why: This keeps the quantifier as 'for all' and just negates the inside - but the correct move is to CHANGE the quantifier to 'there exists', not keep it. This assumption is far stronger than the true negation, and it can even be false when the true negation is true.

46. Trap: negating 'for all' into another 'for all'

Trap

The trap

To prove by contradiction that every integer in a set S is even, a student assumes the negation is 'every integer in S is odd'.

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

Assume 'all elements are odd'

Why: This keeps the quantifier as 'for all' and just negates the inside - but the correct move is to CHANGE the quantifier to 'there exists', not keep it. This assumption is far stronger than the true negation, and it can even be false when the true negation is true.

\[ \lnot(\forall x,\ P(x)) \ \neq \ \forall x,\ \lnot P(x) \]

The fix

Negating a quantifier flips it: 'for all' becomes 'there exists', and only then do you negate the inside.

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

Assume 'some element of S is odd'

Why: This single-witness assumption is the true negation. It is weaker and easier to satisfy than 'all are odd', and it is what a real counterexample would look like.

\[ \text{Correct assumption: } \exists\, x \in S,\ x \text{ is odd} \]

Notice the gap the wrong version misses

Why: If S contains one odd number and one even number, the true negation is satisfied (some element is odd), but the wrong assumption 'all are odd' is false. The wrong version would have silently skipped a case that actually breaks the claim.

\[ S = \{2,3\}:\ \text{true negation holds (3 is odd); 'all odd' is false --- a missed case} \]

47. Say it in words: Trap: negating 'for all' into another 'for all'

Translation

\( \text{Correct assumption: } \exists\, x \in S,\ x \text{ is odd} \)

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.

48. Negating 'if P then Q' is 'P and not Q'

Concept

Many claims in CS3000 have the shape 'if P then Q'. To assume such a claim is false for a contradiction proof, you do NOT just negate P, and you do NOT just negate Q - you keep P true and add that Q fails.

\[ \lnot(P \Rightarrow Q) \ \equiv\ P \ \text{and}\ \lnot Q \]

In plain English: an implication is broken by exactly one scenario - the hypothesis holding while the conclusion fails. That scenario, held as true, is your contradiction-proof starting assumption.

49. What rests on this: Negating 'if P then Q' is 'P and not Q'

Socratic

Discussion prompt

In plain English: an implication is broken by exactly one scenario - the hypothesis holding while the conclusion fails. That scenario, held as true, is your contradiction-proof starting assumption.

Suppose that were not true. What is the first thing in Proof by Contradiction that would stop working?

Hint: Follow it one step downstream. The answer is whatever was quietly relying on it.

50. Assuming a solver exists, then breaking it

Picture it

Animation

Shows: Assuming a solver exists, then breaking it — a rendered Manim animation.

Rendered with Manim.

Takeaway: Self-reference is what turns the assumption against itself.

51. The only way to break a promise

Intuition

'If it rains, I will bring an umbrella' is broken in exactly one way: it rains, and you show up without an umbrella. It is not broken by 'it does not rain' - the promise says nothing about dry days.

So negating 'if P then Q' means holding onto P (it did rain) and denying Q (no umbrella appeared) at the same time. Both pieces are assumed true together - that is the whole starting point of the proof.

52. Why is this step legal: The square root wrecks it

Explain it to yourself

Discussion prompt

In Process: trying to prove it directly first this move is made:

The square root wrecks it

Why is that legal? Name the rule or definition it rests on before you read on.

Hint: If you can only say "because that is what you do", the rule is the thing to go and find.

Answer:

You get n equal to the square root of 2m, and there is no clean way to argue from that that n is a whole even number. The algebra will not carry you across.

53. Process: trying to prove it directly first

Intuition

Watch me not know the answer. This is what the first two minutes actually look like.

The claim: if n squared is even, then n is even.

Try it directly: start from n squared being even and push toward n

Why: n squared even means n squared is 2m for some whole number m. Now solve for n.

The square root wrecks it

Why: You get n equal to the square root of 2m, and there is no clean way to argue from that that n is a whole even number. The algebra will not carry you across.

Dead end. Not a mistake — a move that was worth trying and did not pay off. This happens in most proofs.

Back up. Negate the conclusion instead

Why: Assume n is odd and see what n squared has to be. Odd is a shape you can write down cleanly, which is exactly what the square root would not give you.

\[ n = 2j + 1 \;\Longrightarrow\; n^{2} = 4j^{2} + 4j + 1 = 2(2j^{2} + 2j) + 1 \]

So n squared is odd, which collides with the assumption that it is even. The pivot was choosing the side of the statement that has a usable form.

The expert does not see the whole path in advance. The expert tries something, reads the result, and adjusts. That is the skill.

54. State the rule before it runs: Contradiction proof: if n squared is…

Hypothesis

Predict first

Contradiction proof: if n squared is even, n is even 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: Negate the implication correctly

Why: The negation of 'P implies Q' is 'P and not Q', so assume the hypothesis holds AND the conclusion fails, both at once.

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.

55. Contradiction proof: if n squared is even, n is even

Worked example

Claim: whenever a whole number's square is even, the number itself is even.

\[ \text{Claim: } n^2 \text{ even} \Rightarrow n \text{ even} \]

Negate the implication correctly

Why: The negation of 'P implies Q' is 'P and not Q', so assume the hypothesis holds AND the conclusion fails, both at once.

\[ \text{Assume: } n^2 \text{ is even, AND } n \text{ is odd} \]

Use the odd half of the assumption

Why: An odd number is two times an integer plus one. Write n in that form using the assumption that n is odd.

\[ n = 2k+1 \quad (k \in \mathbb{Z}) \]

Square it and reorganize

Why: Expanding the square and pulling a factor of 2 out of the first two terms shows the result is odd.

\[ n^2 = 4k^2 + 4k + 1 = 2(2k^2+2k) + 1 \]

Verify the contradiction against the other half of the assumption

Why: We derived that n squared is odd, but the assumption also said n squared is even. A number cannot be both even and odd, so the assumption is impossible. The claim holds.

\[ n^2 = 2(2k^2+2k)+1 \ (\text{odd}) \ \text{but assumed } n^2 \ \text{even} \ \Rightarrow\ \text{contradiction}\ \checkmark \]

56. A short one, done properly

Picture it

Animation

Shows: A short one, done properly — a rendered Manim animation.

Rendered with Manim.

Takeaway: The counterexample is constructed FROM the assumption.

57. The Setup Recipe

Section

Section 3

58. Step 1: name P and Q exactly

Concept

Before writing a single symbol, say the claim out loud and identify its exact logical shape. Is it 'for all x, property holds'? Is it 'there is no object with this property'? Is it 'if this, then that'?

You cannot negate a claim you have not pinned down. Most stalled contradiction proofs stall right here, at the naming step, not later at the algebra.

59. Step 2: write the exact negation

Concept

Apply the rules from Section 2: flip 'for all' to 'there exists' (or the reverse), negate 'if P then Q' to 'P and not Q', and negate a plain statement to its plain opposite.

Write this negation down as its own sentence before doing anything else. This sentence is the entire foundation of the proof - get it wrong and every later step is answering the wrong question.

60. Step 3: assume the negation and reason forward

Concept

Treat the negation as a true fact, the same way you would treat a given hypothesis in a direct proof. Translate it into equations, definitions, or set memberships you can actually manipulate.

Every step from here follows the same rules of valid reasoning as any other proof - nothing about being 'inside a contradiction' relaxes the standards.

61. Where does each piece belong: Proof by Contradiction

Sorting

Sort into buckets

These are the pieces of Proof by Contradiction, out of order. Put each one back under the part of the lesson it belongs to.

Recognizing When Contradiction Fits
The big idea in one sentence; Another name: an indirect proof; Springing a trap on your own assumption
Negating Statements Correctly
Negation of a simple statement; Flipping the switch; Negating 'for all' becomes 'there exists ... not'
The Setup Recipe
Step 1: name P and Q exactly; Step 2: write the exact negation; Step 3: assume the negation and reason forward
s1
Recognizing When Contradiction Fits is where Proof by Contradiction puts The big idea in one sentence, Another name: an indirect proof, Springing a trap on your own assumption. Knowing which part of the lesson a problem belongs to is most of knowing which method to reach for.
s2
Negating Statements Correctly is where Proof by Contradiction puts Negation of a simple statement, Flipping the switch, Negating 'for all' becomes 'there exists ... not'. Knowing which part of the lesson a problem belongs to is most of knowing which method to reach for.
s3
The Setup Recipe is where Proof by Contradiction puts Step 1: name P and Q exactly, Step 2: write the exact negation, Step 3: assume the negation and reason forward. Knowing which part of the lesson a problem belongs to is most of knowing which method to reach for.

62. Step 4: hunt for two things that can't both be true

Concept

Keep pushing the assumption forward until you can point to two specific facts that directly conflict - a number that is both even and odd, a set that is both empty and has an element, a quantity that is both less than and greater than another.

This is the payoff step. Do not stop at something merely surprising or unlikely - it must be a genuine logical impossibility.

63. Step 5: conclude the original claim

Concept

State explicitly: since the assumption led to an impossibility through valid reasoning, the assumption must be false. Since the assumption was the negation of the claim, the claim itself must be true.

Do not skip this closing sentence. It is the step that turns 'we found something weird' into 'therefore the theorem holds' - a proof is not finished until you say it.

64. Why every link in the chain must be airtight

Intuition

A contradiction proof blames the assumption for the impossibility - but that is only fair if every other step in the chain was unquestionably valid. A single sloppy step could be the real source of the nonsense, not the assumption.

That is why contradiction proofs demand the same rigor as any other proof, step for step. The technique buys you a convenient starting point; it does not buy you looser standards along the way.

65. What a genuine impossibility looks like

Concept

A real impossibility is a specific, checkable clash - not a feeling that something is odd. Common forms: a value with two contradictory properties, an equation that reduces to a false numeric statement, a violation of how a definition was set up, or contradicting the very assumption you started with.

contradiction — Two statements that cannot both be true at once - for example, a number that is shown to be both even and odd, or a fraction claimed to be in lowest terms while both its numerator and denominator are shown to share a common factor.

66. Something is wrong here: declaring victory without a genuine impossibility

Anomaly

Predict first

A student writes this, and it looks reasonable:

Partway through a proof, a student reaches a step that looks messy or unlikely and writes 'this cannot happen, contradiction, done' without pinning down what actually clashes.

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

Correct: An expression looking awkward is not the same as it being impossible.

Name the exact two facts in conflict, and show precisely why they cannot coexist.

Why: An expression looking awkward is not the same as it being impossible. This fraction might genuinely be a non-integer sometimes - but that alone does not clash with anything previously assumed unless it is actually checked against a stated requirement.

67. Trap: declaring victory without a genuine impossibility

Trap

The trap

Partway through a proof, a student reaches a step that looks messy or unlikely and writes 'this cannot happen, contradiction, done' without pinning down what actually clashes.

\[ \text{Derived so far: } n = \frac{k^2+1}{k} \ \text{for some integer } k \]

Call an unusual-looking expression a contradiction

Why: An expression looking awkward is not the same as it being impossible. This fraction might genuinely be a non-integer sometimes - but that alone does not clash with anything previously assumed unless it is actually checked against a stated requirement.

\[ \text{'This looks weird' is not a proof of impossibility} \]

The fix

Name the exact two facts in conflict, and show precisely why they cannot coexist.

\[ \text{Suppose the assumption required } n \ \text{to be an integer} \]

State the specific clash

Why: If the assumption forced n to be an integer, and the derived formula for n only produces a non-integer for this particular k, then say exactly that: 'n was assumed an integer, but the derived value is not an integer for this k' - naming both sides of the clash.

\[ \text{Assumed: } n \in \mathbb{Z}. \quad \text{Derived: } n \notin \mathbb{Z}. \quad \text{Both cannot hold.} \]

Only then close the proof

Why: A genuine impossibility names both conflicting facts explicitly, in terms that trace directly back to a definition or an earlier assumption - never just an intuition that something feels off.

68. Break it on purpose: declaring victory without a genuine…

Break the constraint

Discussion prompt

The rule this trap just fixed:

Name the exact two facts in conflict, and show precisely why they cannot coexist.

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:

An expression looking awkward is not the same as it being impossible. This fraction might genuinely be a non-integer sometimes - but that alone does not clash with anything previously assumed unless it is actually checked against a stated requirement.

69. Classic Proofs

Section

Section 4

70. Why root 2 is a 'cannot be' claim

Concept

'The square root of 2 is irrational' really means 'there is no pair of integers whose ratio equals the square root of 2'. That is a denial of existence - exactly the shape contradiction handles best.

\[ \text{Claim: } \nexists\, a,b \in \mathbb{Z}: \ \sqrt{2} = \frac{a}{b} \]

So the setup writes itself: assume the negation - such integers DO exist - and see what breaks.

71. What feels wrong about this pair of facts?

Intuition

What feels wrong about this?

Assume the square root of 2 is a fraction, written in lowest terms. Push the algebra through and you learn two things:

\[ a \text{ is even} \quad \text{and} \quad b \text{ is even} \]

\[ \text{but } \; \frac{a}{b} \text{ was in lowest terms} \]

_Plain English only. No notation, no algebra. Just say what bothers you._

The feeling: you promised the fraction was already reduced, and then proved both halves share a factor of 2. You cannot have both.

That feeling is the proof. It is not a substitute for the proof — it is the thing the proof writes down.

Notice what supplied the collision: the words in lowest terms. That phrase was not decoration — it was the trap being set on purpose, several steps before it sprang.

72. What has to happen first: Root 2 is irrational

Ranking

Put in order

Put the moves of Root 2 is irrational into the order they have to happen.

  1. Assume the negation, in lowest terms
  2. Square both sides and clear the denominator
  3. Conclude a is even
  4. Substitute back and show b is even too
  5. Verify the contradiction

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. Suppose root 2 IS rational. Then it equals some fraction a over b, and we may always reduce a fraction so its numerator and denominator share no common factor.

73. Root 2 is irrational

Worked example

Claim: the square root of 2 cannot be written as a ratio of two integers.

\[ \text{Claim: } \sqrt{2} \text{ is irrational} \]

Assume the negation, in lowest terms

Why: Suppose root 2 IS rational. Then it equals some fraction a over b, and we may always reduce a fraction so its numerator and denominator share no common factor.

\[ \sqrt{2} = \frac{a}{b}, \quad \gcd(a,b) = 1 \]

Square both sides and clear the denominator

Why: Squaring removes the root, and multiplying both sides by b squared clears the fraction, leaving a clean equation in integers.

\[ 2 = \frac{a^2}{b^2} \ \Rightarrow\ a^2 = 2b^2 \]

Conclude a is even

Why: a squared equals 2 times an integer, so a squared is even. An earlier result (proved by contradiction on the previous slide) shows that whenever a number's square is even, the number itself is even. So a is even, and we may write a = 2c.

\[ a^2 = 2b^2 \ \text{(even)} \ \Rightarrow\ a \text{ even} \ \Rightarrow\ a = 2c \]

Substitute back and show b is even too

Why: Replacing a with 2c in a squared equals 2 b squared gives 4c squared equals 2 b squared, so b squared equals 2c squared - meaning b squared is even, so b is even by the same result.

\[ (2c)^2 = 2b^2 \ \Rightarrow\ 4c^2 = 2b^2 \ \Rightarrow\ b^2 = 2c^2 \ \Rightarrow\ b \text{ even} \]

Verify the contradiction

Why: Both a and b turned out even, so 2 divides both of them - but the assumption required a and b to share no common factor. That is a direct clash with the lowest-terms assumption, so no such a and b exist. Root 2 is irrational.

\[ 2 \mid a \ \text{and} \ 2 \mid b \ \Rightarrow\ \gcd(a,b) \geq 2 \ \text{contradicts} \ \gcd(a,b)=1\ \checkmark \]

74. The classic: root two is irrational

Picture it

Animation

Shows: The classic: root two is irrational — a rendered Manim animation.

Rendered with Manim.

Takeaway: The contradiction lands on the one assumption we were free to make.

75. The move that made the trap possible

Concept

The move: #8 (Take the extreme one).

Take the extreme one

Why: There are infinitely many fractions equal to the square root of 2, if any exist at all. Do not reason about a generic one — take the one with the smallest denominator, the fully reduced one.

Why the extreme choice pays

Why: Choosing the smallest gives you a property to violate. A generic fraction has no property that both even could contradict; the reduced one does.

You will see this again as the smallest counterexample argument, and again as take the shortest path that fails.

When an assumption gives you a whole set of objects, reach for the smallest or the largest. That is where the contradiction is cheapest to find.

76. Why infinitely many primes is a 'cannot be finite' claim

Concept

'There are infinitely many primes' is the denial of 'the primes form a finite, completable list'. Once again, there is no finite object handed to us to build with directly - so assume the opposite instead.

\[ \text{Claim: } \nexists\, \text{finite list containing every prime} \]

Euclid's classic move: assume a complete finite list exists, then manufacture a number that forces a prime missing from that very list.

77. The contradiction, written as a procedure

Concept

A contradiction proof that constructs something can be written as pseudocode. Reading it that way makes the construction concrete: hand the procedure the supposedly complete list, and watch it hand back something the list cannot contain.

NEW-PRIME(p[1..k])
  // assume p[1..k] is EVERY prime that exists
  N = 1
  for i = 1 to k
    N = N * p[i]
  N = N + 1
  // every p[i] divides N - 1, so none divides N
  return any prime factor of N

Line 8 always succeeds, because every integer above one has a prime factor. But line 7 says that factor is not on the list. So the list was not every prime after all, and the assumption on line 2 is dead.

78. Reading NEW-PRIME line by line

Notation

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

Annotate

  • The negation, stated as an input. Everything below runs inside the assumption you intend to destroy.
  • Multiply the whole list together. This is the construction — the part of a contradiction proof you have to invent.
  • Add one. This single line is what forces a remainder of one against every prime on the list.
  • Why no listed prime divides N: each divides the product exactly, so each leaves remainder one after the plus one.
  • The contradiction. This factor exists, and it is not on a list that was assumed to hold every prime.

79. Step NEW-PRIME yourself

Invariant

Watch the remainder. Whatever prime from the list you try, dividing N by it leaves one — never zero. That is the impossibility the whole proof was hunting for.

Step through it

Before the last step, try to name a prime on the list that divides N. Notice you cannot.

  1. Line 3: assume these are all of them
  2. Line 5:
  3. Line 5:
  4. Line 5: the whole list, multiplied
  5. Line 6: add one
  6. Line 7: not divisible by 2
  7. Line 7: nor by 3
  8. Line 7: nor by 5
  9. Line 8: a prime the list left out

80. Building the number the list cannot explain

Picture it

Animation

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

Rendered with Manim.

Takeaway: Multiply the assumed-complete list and add one: the result has a prime factor that the list does not contain, so no finite list can be complete.

81. Decision point: a finite list of every prime

Intuition

What move should we make next?

We assumed the negation, so we have a complete finite list of every prime that exists:

\[ p_{1}, \; p_{2}, \; \ldots, \; p_{k} \]

Again nothing is contradictory yet. Again you have to build something.

You have done this exact shape twice already today. Which move, and what would you build out of that list?

_Look at your toolkit. Say a move number out loud before this slide advances._ A wrong guess is useful. A silent guess is not.

82. Plan first: There are infinitely many primes

Step zero

Discussion prompt

There are infinitely many primes — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.

Hint: It starts with: Assume the negation: only finitely many primes exist

Answer:

  1. Assume the negation: only finitely many primes exist
  2. Build one more number from the whole list
  3. Show N needs a prime factor not on the list
  4. Verify the contradiction

83. There are infinitely many primes

Worked example

Claim: the list of prime numbers never ends.

Assume the negation: only finitely many primes exist

Why: Suppose the complete list of every prime number is p one through p sub k, with no prime beyond it.

\[ \text{Assume the complete list of primes is } p_1, p_2, \ldots, p_k \]

Build one more number from the whole list

Why: Multiply every prime on the list together and add 1. Dividing this number by any listed prime always leaves a remainder of 1, since the product part is exactly divisible.

\[ N = p_1 p_2 \cdots p_k + 1 \]

Show N needs a prime factor not on the list

Why: N is greater than 1, so it must have at least one prime divisor. But no p sub i on the list divides N, since each leaves remainder 1. So N's prime divisor is a prime that is missing from the supposedly complete list.

\[ p_i \nmid N \ \text{for every } i \ \Rightarrow\ N \text{ has a prime factor absent from the list} \]

Verify the contradiction

Why: We assumed the list contained every prime, yet produced a prime that is not on it. Both cannot be true, so the assumption of finitely many primes is impossible. There are infinitely many primes. Checking concretely with the first six primes: 2 times 3 times 5 times 7 times 11 times 13 plus 1 equals 30031, which equals 59 times 509 - two primes absent from that starting list.

\[ 2\cdot3\cdot5\cdot7\cdot11\cdot13+1 = 30031 = 59 \times 509\ \checkmark \]

84. Infinitely many primes

Picture it

Animation

Shows: Infinitely many primes — a rendered Manim animation.

Rendered with Manim.

Takeaway: The constructed number is what breaks the assumption.

85. Euclid's number is a witness, not a new prime factory

Intuition

A common misreading is that N itself must always be prime. It does not have to be - in the checked example, 30031 is not prime at all, it factors as 59 times 509.

\[ 30031 = 59 \times 509 \ \text{(neither factor was on the original list)} \]

What matters is only that SOME prime divides N, and that prime cannot be any of the ones on your assumed complete list. N is a witness that the list was incomplete - not necessarily a new prime by itself.

86. Contradiction vs. Contrapositive

Section

Section 5

87. Two roads that look alike

Concept

Both techniques feel similar because both involve negating something and reasoning forward. That surface similarity is exactly why students blend them - but they set up completely different starting assumptions.

Getting this distinction straight matters for grading in CS3000: writing a contrapositive proof but labeling it 'by contradiction' (or the reverse) is a structural error, even when every individual algebra step is correct.

88. Two different opening moves

Intuition

Think of them as two different opening moves in a game, both aiming for the same checkmate. Contrapositive makes ONE assumption - the conclusion is false - and marches directly to 'so the hypothesis is false too', no explosion required.

Contradiction makes TWO assumptions at once - the hypothesis is true AND the conclusion is false - and marches toward blowing something up. One move is a direct walk to a new true statement; the other is a walk toward self-destruction.

89. Contrapositive starts from denying the conclusion alone

Concept

To prove 'if P then Q' by contrapositive, assume ONLY 'not Q' is true, and give a straightforward, ordinary direct proof that 'not P' follows from it.

\[ \text{Assume } \lnot Q \ \longrightarrow \ \cdots \ \longrightarrow \ \lnot P \]

Nothing ever explodes here. You simply reach a new true statement, not P, and that alone finishes the proof, because 'not Q implies not P' is logically identical to 'P implies Q'.

90. Contradiction starts from denying the whole claim

Concept

To prove the very same 'if P then Q' by contradiction, assume BOTH 'P is true' AND 'Q is false' at the same time, and hunt for an impossibility - not merely a new fact.

\[ \text{Assume } P \ \text{and} \ \lnot Q \ \longrightarrow \ \cdots \ \longrightarrow \ \text{impossibility} \]

The extra assumption - P being true - is exactly what gives contradiction its explosive ingredient. Without it, you would just be doing a contrapositive proof under a different name.

91. The pigeonhole principle, in one picture

Picture it

Animation

Shows: The pigeonhole principle, in one picture — a rendered Manim animation.

Rendered with Manim.

Takeaway: Assume every hole holds at most one, count, and the arithmetic breaks.

92. Something is wrong here: confusing contradiction with contrapositive

Anomaly

Predict first

A student writes this, and it looks reasonable:

A student sets out to prove 'if n squared is even, then n is even' by contradiction, but only assumes 'n is odd' - forgetting to also assume the hypothesis.

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

Correct: This derivation is completely correct - but it is a CONTRAPOSITIVE proof, not a contradiction proof, because only one assumption was made and no impossibility was ever reached.

Either technique legitimately proves the claim - but each needs its own correctly stated setup.

Why: This derivation is completely correct - but it is a CONTRAPOSITIVE proof, not a contradiction proof, because only one assumption was made and no impossibility was ever reached. Labeling it 'by contradiction' misdescribes the argument's structure.

93. Trap: confusing contradiction with contrapositive

Trap

The trap

A student sets out to prove 'if n squared is even, then n is even' by contradiction, but only assumes 'n is odd' - forgetting to also assume the hypothesis.

\[ \text{Wanted 'by contradiction': } n^2 \text{ even} \Rightarrow n \text{ even} \]

Assume only 'n is odd', derive 'n squared is odd', stop

Why: This derivation is completely correct - but it is a CONTRAPOSITIVE proof, not a contradiction proof, because only one assumption was made and no impossibility was ever reached. Labeling it 'by contradiction' misdescribes the argument's structure.

\[ \text{Assume } \lnot Q \text{ only} \ \longrightarrow\ \lnot P \ \text{(this IS the contrapositive)} \]

The fix

Either technique legitimately proves the claim - but each needs its own correctly stated setup.

\[ \text{Wanted: } n^2 \text{ even} \Rightarrow n \text{ even} \]

For contrapositive: assume only 'not Q'

Why: Assume n is odd, derive n squared is odd directly - a single clean implication, no explosion, no second assumption.

\[ \text{Contrapositive: assume } n \text{ odd} \ \longrightarrow\ n^2 \text{ odd} \]

For contradiction: assume 'P and not Q' together

Why: Assume n squared is even AND n is odd, both at once, then derive that n squared must also be odd - directly clashing with the 'n squared is even' half of the assumption. That clash is what makes it a genuine contradiction proof.

\[ \text{Contradiction: assume } n^2 \text{ even AND } n \text{ odd} \ \longrightarrow\ n^2 \text{ odd (clashes with assumption)} \]

94. Which of these survive contact with Proof by Contradiction?

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
You have named 6 reusable moves so far. Say as many as you can out loud, by number, from memory.; Same destination, opposite starting point. Both are completely legitimate; you choose whichever gives you something concrete to grab onto.; Every contradiction proof has exactly three moving parts, and naming them out loud is what turns a vague plan into an actual proof you can write.
Breaks
A student wants to prove there is no largest even number, so she starts by assuming exactly that - 'there is no largest even number' - and tries to reason forward from it.; To prove by contradiction that every integer in a set S is even, a student assumes the negation is 'every integer in S is odd'.
sound
These are stated as this lesson states them — each one survives the edge cases Proof by Contradiction 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.

95. Plan first: Same claim, the contrapositive way

Step zero

Discussion prompt

Same claim, the contrapositive way — before any calculation: what is the plan? Name the moves in order, in plain English, without doing the arithmetic.

Hint: It starts with: Assume only the single statement 'n is odd'

Answer:

  1. Assume only the single statement 'n is odd'
  2. Square it and reorganize
  3. Verify the conclusion follows directly, with no impossibility needed

96. Same claim, the contrapositive way

Worked example

Prove the same claim as before, 'if n squared is even, then n is even', but this time using the contrapositive, to see the structural difference directly.

\[ \text{Contrapositive to prove: } n \text{ odd} \Rightarrow n^2 \text{ odd} \]

Assume only the single statement 'n is odd'

Why: Unlike the contradiction version, there is no second assumption bolted on. An odd number is two times an integer plus one.

\[ n = 2k+1 \quad (k \in \mathbb{Z}) \]

Square it and reorganize

Why: Expanding the square and factoring out a 2 from the first two terms exposes the odd structure directly - this is a forward, constructive step, not a search for a clash.

\[ n^2 = 4k^2+4k+1 = 2(2k^2+2k)+1 \]

Verify the conclusion follows directly, with no impossibility needed

Why: The result is two times an integer plus one, so n squared is odd - a plain true fact, reached with a single assumption and no clash. Since 'n odd implies n squared odd' is the contrapositive of the original claim, the original claim is proved. Checking n = 5: n squared is 25, which is odd, consistent with the derivation.

\[ n=5:\ n^2 = 25 = 2(12)+1\ \text{(odd)}\ \checkmark \]

97. Same claim, the contrapositive way — line by line

Picture it

Animation

Shows: Each line of the worked example "Same claim, the contrapositive way", appearing one at a time.

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

Takeaway: The result is two times an integer plus one, so n squared is odd - a plain true fact, reached with a single assumption and no clash. Since 'n odd implies n squared odd' is the contrapositive of the original claim, the original claim is proved. Checking n = 5: n squared is 25, which is odd, consistent with the derivation.

98. Contradiction in Algorithms

Section

Section 6

99. Optimality claims are 'cannot be beaten' claims

Concept

In CS3000, saying a greedy algorithm's first choice is optimal is really saying 'no other valid first choice produces a strictly better solution'. That is a denial of existence, aimed at a hypothetical rival plan - the same shape as 'there is no largest even number', just dressed in algorithm clothing.

So the same recipe applies: assume a rival, strictly-better plan exists, and hunt for why it cannot actually beat the greedy choice.

100. If a rival plan existed, we could steal its first move

Intuition

Picture two schedulers. One (greedy) always picks the task that frees you up soonest. Suppose, for the sake of argument, some rival scheduler beats greedy by picking a different first task.

Because greedy's first pick frees you up at least as soon as the rival's first pick, we can always swap greedy's choice into the rival's plan in place of the rival's first pick, without breaking anything later in the rival's schedule - it only ever frees up time, never costs it.

101. Teach it back: If a rival plan existed, we could steal its first move

Explain it

Discussion prompt

Explain If a rival plan existed, we could steal its first move 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:

Picture two schedulers. One (greedy) always picks the task that frees you up soonest. Suppose, for the sake of argument, some rival scheduler beats greedy by picking a different first task.

102. The exchange argument sketch

Concept

An exchange argument is a contradiction proof aimed at optimality: assume a strictly better solution exists, then show you can always swap in the greedy choice without making that solution any worse - contradicting 'strictly better'.

\[ \text{Assume: OPT is strictly better than greedy's choice } \ \longrightarrow\ \text{swap in greedy, lose nothing} \ \Rightarrow\ \text{contradiction} \]

exchange argument — A contradiction-based technique for proving a greedy choice is optimal: assume an optimal solution avoiding the greedy choice exists, then show swapping the greedy choice into it produces a solution at least as good - contradicting any claim that avoiding greedy was strictly necessary for optimality.

103. What has to happen first: The greedy earliest-finish-time choice can't be beaten

Ranking

Put in order

Put the moves of The greedy earliest-finish-time choice can't be beaten into the order they have to happen.

  1. Assume the negation: an optimal solution exists that skips a1
  2. Compare finish times
  3. Swap a1 in for b1
  4. Verify the contradiction

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. Suppose, for contradiction, that some optimal solution OPT achieves the maximum possible count while never including greedy's first pick, a1.

104. The greedy earliest-finish-time choice can't be beaten

Worked example

Setting: given a set of activities, each with a start and finish time, pick the largest possible group of activities where no two overlap. Greedy rule: always pick the still-available activity that finishes soonest.

\[ \text{Let } a_1 = \text{the activity greedy picks first (earliest finish time among all activities)} \]

Assume the negation: an optimal solution exists that skips a1

Why: Suppose, for contradiction, that some optimal solution OPT achieves the maximum possible count while never including greedy's first pick, a1. Let b1 be whichever activity OPT selects first, in order of finish time.

\[ \text{Assume OPT is optimal and } a_1 \notin \text{OPT; let } b_1 \text{ be OPT's first activity} \]

Compare finish times

Why: a1 was chosen because it has the earliest finish time of ANY activity, so a1 finishes no later than b1 does - this holds no matter which activity b1 happens to be.

\[ \text{finish}(a_1) \leq \text{finish}(b_1) \]

Swap a1 in for b1

Why: Every other activity in OPT starts after b1 finishes, and a1 finishes no later than b1, so replacing b1 with a1 cannot create any new overlap with the rest of OPT's schedule. The swapped solution has exactly the same number of activities as OPT.

\[ \text{OPT}' = (\text{OPT} \setminus \{b_1\}) \cup \{a_1\} \ \text{is valid and} \ |\text{OPT}'| = |\text{OPT}| \]

Verify the contradiction

Why: OPT' is a valid solution of the same size as OPT that DOES include a1 - so an optimal-size solution containing a1 exists after all. This contradicts nothing being lost by excluding a1, since we've shown a1 can always be included at no cost. So assuming an optimal solution must skip greedy's first choice is impossible; greedy's first choice is always safe to take. (The full proof repeats this exchange step down the whole schedule by induction - this is the sketch of that one key move.)

\[ \text{OPT}' \text{ contains } a_1, \ |\text{OPT}'|=|\text{OPT}| \Rightarrow \text{excluding } a_1 \text{ was never required}\ \checkmark \]

105. Decode the notation: The greedy earliest-finish-time choice can't be beaten

Notation

Annotate

From The greedy earliest-finish-time choice can't be beaten — read this one piece at a time. What is each part doing?

On: \( \text{OPT}' \text{ contains } a_1, \ |\text{OPT}'|=|\text{OPT}| \Rightarrow \text{excluding } a_1 \text{ was never required}\ \checkmark \)

  • Suppose, for contradiction, that some optimal solution OPT achieves the maximum possible count while never including greedy's first pick, a1. Let b1 be whichever activity OPT selects first, in order of finish time.
  • a1 was chosen because it has the earliest finish time of ANY activity, so a1 finishes no later than b1 does - this holds no matter which activity b1 happens to be.
  • Every other activity in OPT starts after b1 finishes, and a1 finishes no later than b1, so replacing b1 with a1 cannot create any new overlap with the rest of OPT's schedule. The swapped solution has exactly the same number of activities as OPT.

106. Same trap, new subject: algorithms

Intuition

Notice the exchange argument used the exact same three ingredients from Section 1: an assumption (a strictly-necessary-to-exclude greedy choice), a derivation (the swap), and an impossibility (a same-size solution existed that included the greedy choice anyway, so excluding it was never forced).

Whether the subject is numbers, primes, or scheduling algorithms, the contradiction skeleton never changes. Once you can name the three ingredients, you can build the proof in any subject CS3000 throws at you.

107. Where impossibilities come from in CS3000

Concept

Across this lesson, every impossibility traced back to one of a few sources: a number forced to be both even and odd (root 2, and the n-squared claim), a supposedly complete list caught missing an element (the primes), a minimality or lowest-terms assumption directly violated (root 2, smallest positive real), or a same-size solution existing despite an exclusion being claimed necessary (the greedy exchange).

When you are stuck hunting for a contradiction, ask which of these four shapes your derivation is closest to - it usually points straight at the clash you are missing.

108. By analogy: Where impossibilities come from in CS3000

Analogy

Discussion prompt

Explain Where impossibilities come from in CS3000 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:

When you are stuck hunting for a contradiction, ask which of these four shapes your derivation is closest to - it usually points straight at the clash you are missing.

109. Why is this step legal: 2. Write the exact negation

Explain it to yourself

Discussion prompt

In The contradiction template this move is made:

2. Write the exact negation

Why is that legal? Name the rule or definition it rests on before you read on.

Hint: If you can only say "because that is what you do", the rule is the thing to go and find.

Answer:

Flip quantifiers correctly (for all becomes there-exists-not, and the reverse); negate 'if P then Q' as 'P and not Q'; negate a plain statement to its opposite.

110. The contradiction template

Pattern

1. Name the claim's exact shape

Why: Pin down whether it's a 'for all', a 'there exists', an 'if-then', or a plain statement, before writing anything else.

2. Write the exact negation

Why: Flip quantifiers correctly (for all becomes there-exists-not, and the reverse); negate 'if P then Q' as 'P and not Q'; negate a plain statement to its opposite.

3. Assume the negation and reason forward with full rigor

Why: Treat it as a true premise and use ordinary, fully justified steps - the same standard as any other proof.

4. Reach a genuine, nameable impossibility

Why: Point to the two specific facts in conflict - not a vague sense that something looks wrong.

5. Conclude the original claim explicitly

Why: State that the assumption must be false because it produced nonsense, and therefore the original claim is true.

111. Where this shows up: Proof by Contradiction

Real world

Discussion prompt

Outside this lesson: where does Proof by Contradiction 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 The contradiction template 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 start, run, and close a proof by contradiction: recognizing when it fits, negating a claim correctly (including flipping quantifiers), and reasoning to a genuine impossibility. Covers the irrationality of the square root of 2, the infinitude of primes, and a greedy exchange-argument sketch.

112. Contradiction is not the contrapositive

Picture it

Animation

Shows: Contradiction is not the contrapositive — a rendered Manim animation.

Rendered with Manim.

Takeaway: The contrapositive is often shorter, and worth trying first.

113. Rule out three: Check 1: spot the right tool

Elimination

Eliminate the wrong options

Which claim is the best candidate to prove by contradiction rather than direct proof?

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. There is no algorithm that sorts this specific list faster than every other algorithm on this specific list.
  • B. If a and b are both divisible by 4, then a + b is divisible by 4.
  • C. The sum of the first n positive integers equals n(n+1)/2.
  • D. If a graph has n vertices and is a tree, then it has exactly n - 1 edges.

Survives elimination: A

Why: Option A is a denial of existence - 'there is no algorithm that does X' - which hands a direct proof nothing to build forward from. Assuming the negation (such an algorithm DOES exist) gives a concrete object to reason about and hunt for an impossibility, which is exactly when contradiction earns its keep.

114. Check 1: spot the right tool

Check

Consider four claims a CS3000 student might need to prove.

Check your understanding

Which claim is the best candidate to prove by contradiction rather than direct proof?

  • A. There is no algorithm that sorts this specific list faster than every other algorithm on this specific list. (correct)
  • B. If a and b are both divisible by 4, then a + b is divisible by 4.
  • C. The sum of the first n positive integers equals n(n+1)/2.
  • D. If a graph has n vertices and is a tree, then it has exactly n - 1 edges.

Answer: A

Why: Option A is a denial of existence - 'there is no algorithm that does X' - which hands a direct proof nothing to build forward from. Assuming the negation (such an algorithm DOES exist) gives a concrete object to reason about and hunt for an impossibility, which is exactly when contradiction earns its keep.

Why B tempts people
This is an 'if P then Q' claim with concrete algebraic hypotheses (a = 4m, b = 4n) ready to manipulate directly - a direct proof adds them and factors out a 4 with no need to assume a negation.
Why C tempts people
This is a formula claim naturally suited to mathematical induction (a base case plus an inductive step), not a denial of existence that contradiction is built for.
Why D tempts people
This if-then claim about trees has concrete structure (vertices, edges) to build from directly or by induction on the tree's size - there is no 'cannot exist' phrasing calling for contradiction.

115. Answer it before you see the options: Check 2: negate this for-all statement

Prediction

Predict first

What is the correct negation to assume as the starting point of the proof?

Answer it in your own words, now, with nothing to choose from. The options are on the next slide — and picking the right one off a list is an easier skill than producing it.

Correct: There exists a node in the list whose next pointer is null.

Why: The claim is 'for all nodes, next pointer is non-null'. Its negation flips the quantifier to 'there exists' and negates the inner property: 'there exists a node whose next pointer IS null'. That single witness node is exactly what you would assume exists and then work with.

116. Check 2: negate this for-all statement

Check

You want to prove the statement below by contradiction.

\[ \text{Claim: every node in this linked list has a non-null next pointer.} \]

Check your understanding

What is the correct negation to assume as the starting point of the proof?

  • A. There exists a node in the list whose next pointer is null. (correct)
  • B. Every node in the list has a null next pointer.
  • C. There exists a node in the list whose next pointer is non-null.
  • D. No node in the list exists.

Answer: A

Why: The claim is 'for all nodes, next pointer is non-null'. Its negation flips the quantifier to 'there exists' and negates the inner property: 'there exists a node whose next pointer IS null'. That single witness node is exactly what you would assume exists and then work with.

Why B tempts people
This keeps the quantifier as 'every' and only negates the inside, turning one 'for all' into another 'for all' - the classic quantifier-negation mistake. The quantifier itself must flip to 'there exists'.
Why C tempts people
This flips the quantifier correctly but forgets to negate the inner property - it restates a version of the original claim's property instead of denying it.
Why D tempts people
This is an unrelated, much stronger claim about the list's existence entirely, not a negation of the given statement about next pointers.

117. Check 3: contradiction or contrapositive?

Check

A student writes the following argument to prove 'if a graph has no cycles, then it has at most n - 1 edges': 'Assume the graph has more than n - 1 edges. I will show it must contain a cycle.' No second assumption is made, and the argument ends the moment a cycle is shown to exist.

Check your understanding

What proof technique did the student actually use?

  • A. Contrapositive - only the negated conclusion was assumed, and the negated hypothesis was derived directly. (correct)
  • B. Contradiction - because the argument ends by deriving a cycle, which is impossible.
  • C. Direct proof - because the argument reasons forward from an assumption to a conclusion.
  • D. It cannot be determined from the description given.

Answer: A

Why: Only one assumption was made - the negated conclusion, 'more than n - 1 edges' - and the argument walked straight to the negated hypothesis, 'contains a cycle', with no second assumption and no impossibility. That single-assumption, straight-line structure is exactly a contrapositive proof, even though a cycle sounds dramatic.

Why B tempts people
A derived cycle is not an impossibility by itself - graphs can genuinely contain cycles. Nothing here clashes with a second assumption, because no second assumption (like 'the graph has no cycles') was ever made alongside it.
Why C tempts people
A direct proof of the original claim would assume 'no cycles' and derive 'at most n - 1 edges' directly - but this argument instead assumed the negated conclusion and derived the negated hypothesis, which is the contrapositive pattern, not a direct proof of the original statement.
Why D tempts people
The structure is fully determinable: exactly one assumption (the negated conclusion) leading directly to the negated hypothesis is the textbook shape of a contrapositive proof.

118. How sure are you: Check 4: is this actually a contradiction?

Commit first

Predict first

Is 'the function calls itself forever on ever-smaller natural numbers, without reaching the base case' a genuine impossibility?

Commit to an answer, then rate it — certain, fairly sure, or guessing — and write the rating down before you turn the page.

Correct: Yes - it directly contradicts the fact that there is no infinite strictly-decreasing sequence of natural numbers.

Why: Natural numbers cannot decrease forever - any strictly decreasing sequence of natural numbers must be finite, since each step must land on a smaller natural number and there is a floor at 0. An infinite strictly-decreasing sequence of natural numbers is a genuine, nameable impossibility, tied directly to a known fact, not just an inconvenient outcome.

The rating matters as much as the answer: confident-and-wrong is the combination that survives revision, because nothing about it feels like it needs revisiting.

119. Check 4: is this actually a contradiction?

Check

A student is proving that a particular recursive function always terminates. Partway through, assuming for contradiction that it does NOT terminate, they derive that the function makes a call with a smaller input forever, without ever reaching the base case.

Check your understanding

Is 'the function calls itself forever on ever-smaller natural numbers, without reaching the base case' a genuine impossibility?

  • A. Yes - it directly contradicts the fact that there is no infinite strictly-decreasing sequence of natural numbers. (correct)
  • B. No - a function can call itself as many times as it wants, so this is not actually impossible.
  • C. Yes - because infinite loops are undesirable in practice, so this must be a contradiction.
  • D. It cannot be an impossibility unless the student also shows the function returns the wrong value.

Answer: A

Why: Natural numbers cannot decrease forever - any strictly decreasing sequence of natural numbers must be finite, since each step must land on a smaller natural number and there is a floor at 0. An infinite strictly-decreasing sequence of natural numbers is a genuine, nameable impossibility, tied directly to a known fact, not just an inconvenient outcome.

Why B tempts people
This confuses 'undesirable' with 'impossible'. The impossibility is not that repeated calls are disallowed - it is that the specific sequence of inputs would have to decrease forever within the natural numbers, which cannot happen.
Why C tempts people
Being undesirable in practice is not the same as being logically impossible - the correct contradiction must be tied to a specific fact (no infinite decreasing sequence of naturals exists), not a judgment about code quality.
Why D tempts people
The impossibility here is complete on its own - it is about the input sequence, not about output correctness. Requiring a wrong return value confuses this termination argument with a separate, unrelated correctness argument.

120. Answer it before you see the options: Check 5: negate this implication

Prediction

Predict first

What should you assume as the starting point of a contradiction proof of this claim?

Answer it in your own words, now, with nothing to choose from. The options are on the next slide — and picking the right one off a list is an easier skill than producing it.

Correct: A binary search tree has n nodes, and its height is less than log base 2 of n.

Why: The claim has the shape 'if P then Q' where P is 'has n nodes' and Q is 'height is at least log base 2 of n'. The negation of an implication is 'P and not Q' - keep the hypothesis true (n nodes) and deny the conclusion (height strictly less than log base 2 of n), both held true at once.

121. Check 5: negate this implication

Check

You want to prove the following claim by contradiction.

\[ \text{Claim: if a binary search tree has n nodes, then its height is at least} \ \log_2(n). \]

Check your understanding

What should you assume as the starting point of a contradiction proof of this claim?

  • A. A binary search tree has n nodes, and its height is less than log base 2 of n. (correct)
  • B. A binary search tree does not have n nodes.
  • C. A binary search tree has fewer than n nodes, and its height is at least log base 2 of n.
  • D. Every binary search tree with n nodes has height less than log base 2 of n.

Answer: A

Why: The claim has the shape 'if P then Q' where P is 'has n nodes' and Q is 'height is at least log base 2 of n'. The negation of an implication is 'P and not Q' - keep the hypothesis true (n nodes) and deny the conclusion (height strictly less than log base 2 of n), both held true at once.

Why B tempts people
This only negates the hypothesis P and drops Q entirely - it is not the negation of an implication, and it discards the very condition (n nodes) needed to reason about the tree's height.
Why C tempts people
This changes the hypothesis to something different ('fewer than n nodes') rather than keeping the original hypothesis true, and it keeps the conclusion true rather than denying it - both halves are handled backwards.
Why D tempts people
This turns a single implication into a universal claim over 'every' tree and does not negate the conclusion at all - it is not the logical negation of the original if-then statement.

122. Rule out three: Check 6: the exchange argument's contradiction

Elimination

Eliminate the wrong options

What exactly is the impossibility that closes this proof?

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. OPT' is a valid, same-size solution containing a1, so nothing required OPT to exclude a1 - contradicting the idea that excluding a1 was ever necessary.
  • B. OPT' has strictly more activities than OPT, which is impossible since OPT was assumed optimal.
  • C. a1 and b1 cannot both be valid activities in the same schedule, since they overlap.
  • D. OPT is not actually a valid schedule, since it was built without using the greedy rule.

Survives elimination: A

Why: The swap produces OPT', which is valid (no new overlaps, since a1 finishes no later than b1) and exactly the same size as OPT. That means a solution of optimal size containing a1 exists after all - directly undermining any version of the argument that treated excluding a1 as required for optimality. That is the specific, nameable clash that closes the proof.

123. Check 6: the exchange argument's contradiction

Check

In the greedy earliest-finish-time exchange argument, after assuming an optimal solution OPT exists that excludes greedy's first choice a1, the proof builds OPT' by swapping b1 out for a1.

Check your understanding

What exactly is the impossibility that closes this proof?

  • A. OPT' is a valid, same-size solution containing a1, so nothing required OPT to exclude a1 - contradicting the idea that excluding a1 was ever necessary. (correct)
  • B. OPT' has strictly more activities than OPT, which is impossible since OPT was assumed optimal.
  • C. a1 and b1 cannot both be valid activities in the same schedule, since they overlap.
  • D. OPT is not actually a valid schedule, since it was built without using the greedy rule.

Answer: A

Why: The swap produces OPT', which is valid (no new overlaps, since a1 finishes no later than b1) and exactly the same size as OPT. That means a solution of optimal size containing a1 exists after all - directly undermining any version of the argument that treated excluding a1 as required for optimality. That is the specific, nameable clash that closes the proof.

Why B tempts people
The construction only shows OPT' matches OPT's size, never that it exceeds it - claiming a size increase misstates what the swap actually produces and invents an impossibility that was never derived.
Why C tempts people
The whole point of the swap is that a1 does NOT overlap with the rest of OPT's schedule, precisely because it finishes no later than b1 - so this claims the opposite of what was shown.
Why D tempts people
OPT was assumed to be a valid, optimal schedule by hypothesis - nothing in the exchange argument questions OPT's validity; it only builds a second valid schedule, OPT', from it.

124. Toolkit update

Concept

Moves added today:

Moves you reused today:

Move #2 is a special case of what you did today. The +1 trick builds one value that breaks a for-all claim; move #8 builds one object that breaks an assumption. Same instinct, wider target.

Full toolkit so far: #1 through #8.

Next session opens with you naming every one of these from memory, before any new material.

125. Break it if you can: Toolkit update

Counterexample

Discussion prompt

Move #2 is a special case of what you did today. The +1 trick builds one value that breaks a for-all claim; move #8 builds one object that breaks an assumption. Same instinct, wider target.

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:

Next session opens with you naming every one of these from memory, before any new material.

126. Checking your own contradiction proof

Picture it

Animation

Shows: Checking your own contradiction proof — a rendered Manim animation.

Rendered with Manim.

Takeaway: The third question is the one people skip, and it is where proofs go wrong.

127. Connect it up: Proof by Contradiction

Connect it up

Draw it

One page, no notation unless you need it: draw how these connect — Recognizing When Contradiction Fits · Negating Statements Correctly · The Setup Recipe · Classic Proofs · Contradiction vs. Contrapositive · Contradiction in Algorithms. Put an arrow wherever one of them is what makes another possible, and label the arrow with why.

128. What you can do now

Recap

You now have a working recipe for starting - and finishing - a proof by contradiction, the technique CS3000 leans on for every 'cannot happen' claim.

Claim shapeCorrect starting assumption
For all x, P(x)There exists x, not P(x)
There exists x, P(x)For all x, not P(x)
If P then QP and not Q, together
Plain statement SNot S

Sources

  1. Rosen, Discrete Mathematics and Its Applications, 8th ed., Ch. 1.7-1.8 (proof by contradiction, methods of proof) — McGraw-Hill, 2019.
  2. Velleman, How to Prove It: A Structured Approach, 3rd ed., Ch. 3 (proof by contradiction, negating quantified statements) — Cambridge University Press, 2019.
  3. Cormen, Leiserson, Rivest, Stein, Introduction to Algorithms, 3rd ed., Ch. 16 (exchange-argument proofs of greedy optimality, activity selection) — MIT Press, 2009.
  4. All proofs re-derived by hand step by step; the primes example rechecked arithmetically (2\u00b73\u00b75\u00b77\u00b711\u00b713+1 = 30031 = 59\u00d7509); the exchange argument checked against the standard activity-selection optimality proof. — 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