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

02. The Well Ordering Principle

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

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

Partial Orders and Equivalence

Remember that a digraph is a binary relation where the domain and codomain are the vertices.

Let's say that a relation R:AAR : A \rightarrow A is a digraph with vertices AA.

We can say that

RR is reflexive when every vertex has a self-loop:
xA. x R x\forall x \in A. \ x \ R \ x
RR is irreflexive when there are no self-loops:
¬[xA. x R x]\neg[\exists x \in A. \ x \ R \ x]
RR is symmetric if there is an edge from xx to yy, there is an edge back from yy to xx:
x, yA. x R y    y R x\forall x, \ y \in A. \ x \ R \ y \implies y \ R \ x
RR is asymmetric when there is at most one directed edge between any two vertices, and there are no self-loops:
x, yA. x R y    ¬(y R x)\forall x, \ y \in A. \ x \ R \ y \implies \neg(y \ R \ x)
RR is antisymmetric when there is at most one directed edge between any two distinct vertices, but there may be self-loops:
xyA. x R y    ¬(y R x)\forall x \neq y \in A. \ x \ R \ y \implies \neg(y \ R \ x)
that is,
x, yA. (x R yy R x)    x=y\forall x, \ y \in A. \ (x \ R \ y \land y \ R \ x) \implies x = y
RR is transitive if there is a positive length path from uu to vv, then there is an edge from uu to vv:
x, y, zA. (x R yy R z)    x R z\forall x, \ y, \ z \in A. \ (x \ R \ y \land y \ R \ z) \implies x \ R \ z
RR is linear when given any two vertices, there is an edge between them in one direction or the other:
xyA. (x R yy R x)\forall x \neq y \in A. \ (x \ R \ y \lor y \ R \ x)

Let's now define what is called a strict partial order:

A relation that is transitive and irreflexive is called a strict partial order.

Transitivity says that merging a walk from uu to vv with a walk from vv to ww gives a walk from uu to ww.

Irreflexivity says that there is no positive length walk from a vertex to itself.

We defined them using graph terminology, but we can even think of an example for a strict partial order that has nothing to do with graphs at all. Imagine the "less than" operation:
If x<yx \lt y and y<zy \lt z, then x<zx \lt z. It is transitive.
Since xxx \nless x implies irreflexivity, we can say that the "less than" operation is both transitive and irreflexive.


One distinction to note is that in asymmetry, self-loops are never allowed; it is antisymmetry that allows it. Since asymmetry implies irreflexivity, we can now better define strict partial orders:

A binary relation RR on a set AA is a strict partial order iff it is transitive and asymmetric.

Aside from strict partial orders, there are also weak partial orders. They allow self-loops:

A binary relation on a set is a weak partial order iff it is transitive, reflexive, and antisymmetric.


If you have two different numbers, one will be larger than the other. Partial orders with this property are called linear orders. They are also called total orders.


An equivalence relation is a relation that is reflexive, transitive, and symmetric.

A trivial example of an equivalence relation is equality (==). It's reflexive, transitive, and symmetric.

One thing to note that if there is a walk from uu to vv, and a walk from vv to uu (the symmetry property), it is also said that uu and vv are strongly connected.

The strong connectedness relation in a digraph is an equivalence relation.

There are also equivalence classes:

The equivalence classes of an equivalence relation on a set AA are the blocks of a partition of AA.

Note: We mentioned partition briefly in the previous section.


Graphs with the same connections are called isomorphic.
When there is an edge-preserving bijection between two graphs, it means that they are isomorphic.