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

17. Partial Orders and Equivalence

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

Degrees & Isomorphism

In a graph, when two different vertices are connected by only one edge, and that edge is undirected, we have a simple graph. Simple as that.
We can represent an edge connecting uu and vv as: uv\textlangle{u — v} \textrangle

The vertices of an undirected edge are called the endpoints of that edge.
So, where uvu \neq v, the endpoints of uv\textlangle{u — v} \textrangle are uu and vv.

Here is an example of a simple graph:

Simple graph example

If we call this graph HH, then the vertices can be represented as:

V(H)={A, B, C, D, E, F}V(H) = \{A, \ B, \ C, \ D, \ E, \ F\}

And, the edges are:

E(H)={AB, 〈AC, 〈BD, 〈CD, 〈CE, 〈EF}E(H) = \{\textlangle{A — B} \textrangle, \ \textlangle{A — C} \textrangle, \ \textlangle{B — D} \textrangle, \ \textlangle{C — D} \textrangle, \ \textlangle{C — E} \textrangle, \ \textlangle{E — F} \textrangle \}

Note that using capital letters for vertices is probably not a good idea.

Two vertices are adjacent if they are the endpoints of the same edge.
For example, AA and BB are adjacent.
An edge is incident to its endpoints.
For example, the edge AB\textlangle{A — B} \textrangle is incident to AA and BB.
The number of edges incident to a vertex is called that vertex's degree.
For example, the degree of the vertex AA is 22.

Simple graphs don't have self-loops.
As opposed to simple graphs, multigraphs have two endpoints that have more than one edge connecting them.


According to the handshaking lemma:

The sum of the degrees of vertices in a simple graph equals twice the number of edges.

It's because every edge contributes two to the sum of the degrees, one for each of its endpoints.

It also implies that the sum of the degrees can't be odd, because it's twice the number of edges:

2E=vVdeg(v)2|E| = \displaystyle\sum_{v \in V} \text{deg}(v)

A complete graph KnK_n is a simple graph that has exactly one edge between each pair of nn distinct vertices.

An example:

On the other hand, an empty graph has no edges.

An example:

Empty graph example

Note: For more special types of graphs, Kimberly Brehm's video does a pretty good overview.


We mentioned the concept of isomorphism briefly in Partial Orders and Equivalence, but let's take a look at it once more.

An isomorphism between graphs GG and HH is a bijection f : V(G)V(H)f \ : \ V(G) \rightarrow V(H) such that uvE(G)  iff  〈f(u)f(v)E(H)\textlangle{u — v} \textrangle \in E(G) \ \text{ iff } \ \textlangle{f(u) — f(v)} \textrangle \in E(H) for all uu, vv in V(G)V(G).

So, two graphs should have the same connections.

An example:

GG HH
Graph isomorphism a Graph isomorphism b

A simple graph is a bipartite graph if its vertices can be partitioned into two sets, L(G)L(G) and R(G)R(G) such that every edge has one endpoint in L(G)L(G) and the other endpoint in R(G)R(G):

Bipartite graph example