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

18. Degrees & Isomorphism

19. Coloring & Connectivity

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

Trees

Let's talk about simple graphs without cycles.

A forest is an acyclic graph.
A tree is a connected acyclic graph.

Nodes with degrees of 11 are called the leaves.

Here is one example:

Tree example

Note: This section assumes some familiarity with terminology like the root node, parent node, child node, etc.


Let's look at some properties of trees:


Chromatic number of a tree with more than or equal to 2 vertices is 2: χ(tree)=2\chi(\text{tree}) = 2

We can choose any vertex as a root node and color the even-length distance vertices a certain color and the odd-length vertices another color, alternating between levels.


A subgraph that is a tree with all the vertices of the whole graph is called a spanning tree.
So, it is a subgraph that has all the vertices of the whole graph.

Here is one example:

One thing to note is that every connected graph has a spanning tree.

A minimum weight spanning tree of an edge-weighted graph GG is a spanning tree of GG with the smallest possible sum of edge weights.