Bite-Sized Mathematics for Computer Science

Notes on MIT's 6.042J

Eda Eren
Table of Contents

Introduction

Prerequisites & Resources

Unit 1: Proofs

00. Introduction to Proofs

01. (Two) Proof Methods

03. Logic & Propositions

04. Quantifiers and Predicate Logic

05. Sets

06. Binary Relations

07. Induction

08. State Machines — Invariants

09. Recursive Definitions

10. Infinite Sets

Unit 2: Structures

11. GCDs

12. Congruences

13. Euler's Theorem

14. RSA Encryption

15. Digraphs: Walks and Paths

16. Directed Acyclic Graphs

17. Partial Orders and Equivalence

18. Degrees & Isomorphism

19. Coloring & Connectivity

20. Trees

21. Stable Matching

Unit 3: Counting

22. Sums & Products

23. Asymptotics

24. Counting with Bijections

25. Repetitions & Binomial Theorem

26. Pigeonhole Principle, Inclusion-Exclusion

Unit 4: Probability

27. Intro to Discrete Probability

28. Conditional Probability

29. Independence & Causality

30. Random Variables, Density Functions

31. Expectation

32. Deviation: Markov & Chebyshev Bounds

33. Sampling & Confidence

34. Random Walks & PageRank

The Well Ordering Principle

This is what the well ordering principle says:

Every nonempty set of nonnegative integers has a smallest element.

Yes, it looks like a grammatical mistake, but it isn't here. Let's see.

When we proved that 2\sqrt{2} is irrational, we actually have taken this principle for granted, we assumed that ab\frac{a}{b} can be written in the lowest terms.

We also have taken advantage of the Prime Factorization Theorem in the proof mentioned above, so let's use Well Ordering Principle to prove it.

Remember, the Prime Factorization Theorem states that every positive integer greater than 11 can be factored as a product of primes.

The proof is by well ordering.
Let's say that CC is the set of all integers greater than one that can't be factored as a product of primes. (we have chosen the letter CC to stand for counterexamples).
Now, if CC is a nonempty set, that means we have at least one counterexample that makes the theorem false.
So, we have to show that CC is empty in order to come to a conclusion that the theorem is true.
We are going to show a contradiction here, so let's assume that CC is nonempty. (that there is at least one element in it that is greater than one, and can't be factored as a product of primes.)
In that case, by well ordering, there has to be a smallest element nn in CC.
Let's call it nn, it has to be an integer greater than 11, and it can't be factored as a product of primes. nn also can't be prime because it would then still be considered as a product of one prime.
But still, nn has to be a product of two integers, aa and bb. Of course, aa and bb have to be less than nn, and both of them have to be greater than 11.
Remember that the smallest element in CC is nn, and that aa and bb are smaller than nn. So, aa and bb are not in CC. If they are not in CC, that means both aa and bb can be written as a product of primes.
Here is the thing: if aa can be written as a product of primes p1...pkp_1 ... p_k, and bb can be written as a product of primes q1...qkq_1 ... q_k, we can write nn as (p1...pk)(q1...qk)(p_1 ... p_k)(q_1 ... q_k).
That shows that nn can be written as a product of primes, and it contradicts our first assumption!
So, our assumption that CC is nonempty must be false.
CC is empty, therefore there are no counterexamples to our theorem.
Therefore, every positive integer greater that 11 can be factored as a product of primes. \blacksquare

That is actually a template to use Well Ordering Principle in proofs.

We first define a set of counterexamples CC, and assume that it is not empty. Since it is a nonempty set (of nonnegative integers), by well ordering principle it has to have a smallest element mm. At this point, we have to show a contradiction about this smallest element mm. There is no one way to go about it, but one is to find a counterexample that is smaller than mm, thus contradicting that mm is the smallest element in CC.
Another way is to show that mm is not a counterexample by showing that P(m)P(m) (that the theorem holds true for mm).