Books and online resources (No textbook required)
Combinatorial Reasoning. Duane Detemple and William Webb.
Discrete Mathematics, An Open Introduction. Oscar Levin.
A Gentle Introduction to the Art of Mathematics. Joe Fields.
Discrete Mathematics Elementary and Beyond. Lázló Lovász, Jozsef Pelikán, and Katalin Vesztergombi.
Dwiscrete Mathematics and its Applications. Rosen.
A First Course in Discrete Mathematics. Ian Anderson.
Discrete Mathematics for Computer Scientists. Cliff Stein, Robert Drysdale, and Kenneth Bogart.
How to Write Proofs.
Mathematics for Computer Science. Eric Lehman, Tom Leighton, and Albert Meyer.
Discrete and Combinatorial Mathematics. Ralph Grimaldi.
Essential Discrete Mathematics for Computer Science. Harry Lewis and Rachel Zax.
Book of Proofs. Richard Hammack.
Instructional Team (will be updated soon...)
The team consists of 14 people (1 main lecturer, 3 recitation instructors, 8 TAs/tutors, 2 graders), and one Guinea Pig. Find us here.
Tutoring Schedule (mostly done by undergraduate TAs)
Find the schedule here
(No more Navigate approintments, just walk in to Dolciani Math Learning Center on the 7th floor of East building)
Recitations (Recitation instructors: Shayan, Anthony, and Taha)
Recitations will be added here on a regular basis. Each recitation instructor will use these as guide to cover what is appropriate given their recitation schedule.
Actual class notes from Spring 2024 (the current offering will be based on those, see also older lectures here)
PART I
Slides 1 Ch. 1 Sections 1, 2, and 3.
- The general topics one might encounter in Discrete Math. Big ideas: combinatorics, number theory, proofs, set/relations/functions, graph theory, ...)
- Example questions and settings that people study and how they relate to above.
- The sum $1+2+\ldots+n=n(n+1)/2$ using a geometric proof.
- Planar graphs.
Slides 2 Ch. 0 Sections 2, 3, and 6.
- The idea that counting reveals patterns and determines complexity of things we are dealing with.
- Counting: Euler's formula for planar graphs $v-e+f=2$.
- Counting: $1+2+\ldots+(n-1)$ is the number of pairs.
- Generalization to $a + (a+s) + (a+2s) + \ldots + b=\frac{a+b}{2}(\frac{b-a}{s}+1)$.
- Counting: permutations and $n!$.
- Sum and product notations $\Sigma$ and $\Pi$ (also seen as loops).
Slides 3 Ch.0 Section 11, Ch. 1 Section 4.
- Manipluation of sum and product notation.
- Splitting sums and nested sums (also seen as nested loops).
- Snakes and Ladders (counting pairs).
- Addition rule.
- Students must read about sets (Ch. 0).
- Product rule.
Slides 4 Ch. 1 Section 4.
- Putting the product rule to work through examples.
- Practicing the product rule and overcounting.
Slides 5 Ch. 2 Section 1, Section 6 first two pages.
- The 4 ways of selection: unordered/ordered, no repetition/repetition.
- $k$-permutations and $k$-combinations, with notation and formula.
- Selection with order and repetition: the $n^k$ formula.
- Some examples of counting with words.
- Application of the selection framework to counting problems should not be "literal".
Slides 6 Ch. 1 Section 5, Ch.2 Section 4.
- $n$ choose 2 themes
- Handshake Lemma
- Making pairs vs. making teams
Slides 7 Ch. 0 Section 11, Ch.2 Section 2 (excluding equivalence and partial order relations).
- Sets and their notation
- Subsets
- Intersection, union, product (relation to addition and product rules)
- The power set and the sum of binomial coefficients
Slides 8 Ch. 2 Section 2 (first two pages).
- Functions
- Onto (surjection), one-to-one (injection), and bijection
- Significance of bijection (equal cardinality, inverse function)
- Quantifiers $\forall$, $\exists$, $\exists!$, and if-then $\Rightarrow$ (implies)
- How to show one-to-one and onto
Slides 9 Ch. 2 Section 6.
- Counting with bijections
- Power sets $\rightarrow$ binary patterns
- Selecting $k$ from $n$ with repetition and no order $\rightarrow$ integer solutions to $x_1+x_2+\ldots+x_n=k, x_i\geq 0$
Slides 10 Ch. 2 Section 5.
- Review/practice of functions: one-to-one, onto, bijection
- Review/practice of binary pattern problems
- An example of counting binary patterns with $n$ bits and $k$ 1s, and integer solutions to $x_1+x_2+\ldots +x_n=k$
- Pascal triangle, binomial coefficients, and their properties
- Binomial Theorem (without proof)
Slides 11 Ch. 2 Sections 3 and 5.
- Binomial Theorem with proof
- Sum of binomial coefficients
- Alternating sum of binomial coefficients
- A fact about even and odd subsets
- Multinomials (Multinomial Theorem) and counting anagrams
PART II
Slides 12 Ch. 3 Section 6 and 1st page of Section 7.
- Propositions and proofs
- Logical operators, Not $\neg$, And $\wedge$, Or $\vee$, Implication $\Rightarrow$
- Understanding implication (why $0\Rightarrow 0$ and $0\Rightarrow 1$ are true)
- Truth tables
- Different ways of saying $P\Rightarrow Q$ (or it's opposite)
- The contrapositive ($P\Rightarrow Q$ is equivalent to $\neg Q\Rightarrow\neg P$)
Slides 13 Ch. 3 Section 6 and 1st page of Section 7.
- Contrapositive
- if and only if (iff), symbol $\Leftrightarrow$, (implication in both directions)
- Boolean functions and how to construct them with $\neg, \wedge, \vee$
- DeMorgan's Laws
- Commutative, Associative, and Distributive properties of $\wedge$ and $\vee$
Slides 14 Ch. 3 Section 7.
- Properties of implication
- The three techniques: Direct proof, Contrapositive, Proof by contradiction
- Examples of each of the above, covering even/odd numbers, rational numbers, and $\sqrt{2}$
Slides 15 Ch. 3 Sections 2, 3, and 7.
- Proof by contradiction $\neg P\Rightarrow$ False means that $P$ is true
- Technique: start with the negative of the statement, get to something false (called contradiction)
- Three examples of proof by contradiction, $\sqrt{2}$ is irrational, uncoverable grid, and primes are infinite
Slides 16
- More proofs
- How to prove iff
- A summary of proof techniques, here
Slides 17 Ch. 3 Section 8 (about countability).
- Hilbert's hotel (thought experiment)
- $S$ is countable iff ($S$ is finite or there is a bijection $f:S\rightarrow \mathbb{N}$)
- $S$ is countable iff there is a one-to-one function $f:S\rightarrow\mathbb{N}$
- S is countable iff elements can be ordered in such a way that every element has a finite rank
- $S$ is infinite and countable means $S$ and $\mathbb{N}$ have the same cardinality
- Subsets, Intersection, and Union of countable sets are countable
Slides 18 Ch. 3 Section 8
- $\mathbb{Z}$ is countable
- The product of two countable sets is countable
- $\mathbb{Q}$ is countable (think of $\mathbb{Q}$ as a "subset" of $\mathbb{Z}\times\mathbb{N}$)
- $\mathbb{R}$ is uncountable (Cantor's diagonalization proof)
- The power set of a set $S$ is "bigger" than $S$, there is no bijection $f:S\rightarrow \mathcal{P}(S)$ (similar diagonalization proof is possible)
Slides 19 Ch. 4 Sections 1, 2, 4, and 6
- Inclusion Exclusion
- General formula and proof
- The OR logic (for union)
- Divisibility example
- Good passwords example
- The lazy professor (read Section 3 for next time)
Slides 20 Ch. 4 Sections 3 and 5, and parts of Section 8
- The Lazy professor revisited (derangments vs. permutations)
- Counting derangements using Inclusion-Exclusion
- Formula for derangements is $!n=n!\sum_{i=0}^n \frac{(-1)^i}{i!} \approx n!/e$
- Basic form of Pigeonhole with examples
Slides 21 Ch. 4 Secrion 8
- Generalized Pigeonhole with $n$ objects and $m$ boxes
- The $\lceil m/n\rceil$ and $\lfloor(m-1)/n\rfloor +1$ formulas
- Examples of Pigeonhole
- The $m_1+m_2+\ldots+m_n-n+1$ variant form of Pigeonhole
Slides 22 Ch. 5 is written differently from notes, so follow notes
- Proof by induction
- Base case, inductive hypothesis, induction step
- Examples of proof by induction
Slides 23
- What can go wrong: no base case, inductive step does not work for all $k$, both ok but result is wrong
- Examples of what can go wrong
- Strong induction: inductive hypothesis $\wedge_{i\leq k}P(i)=P(k)\wedge P(k-1)\wedge\ldots$ as opposed to $P(k)$
- How many base cases are needed? (check values of $k$ for which inductive step actually works)
- Examples of strong induction
Slides 24
- Induction and recurrences
- Examples of strong induction
PART III
Slides 25 Ch. 6 Section 6
- Solving Linear Homogeneous Recurrences
- Recurrences of the form $a_n=Aa_{n-1}+Ba_{n-2}$
- The characteristic equation method <--- we are here
Slides 26 Ch. 6 Sections 1, 2, 3, 4
- Counting by establishing a recurrence
- Name the quantity your counting, e.g. $a_n$, then express $a_n$ in terms of $a_{n-1}, a_{n-2}, \ldots$
- Cutting a place with lines
- Tiling with dominos
- Tower of Hanoi
Slides 27 Ch.6 Sections 10, 11
- Generating functions
- Solving recurrences using the generating function method
- Solving recurrences asymptotically, e.g. Mergesort
- Divide-and-Conquer has recurrences of the form $T(n)=aT(n/b)+f(n)$
Slides 28 Ch. 6 Section 12
- More on making homogeneous recurrences
- Solving characteristic equations of degree 3 by guessing one solution and factoring
- Catalan numbers and the recurrence $c_n=c_0c_{n-1}+c_1c_{n-2}+\ldots+c_{n-1}c_0$
Slides 29 Ch. 7 Sections 1 and 2
- Divisibility, notation $a|b$
- Uniqueness of representation $b=aq+r$, where $0\leq r\lt a$
- $\gcd(a,b)$ and $\textrm{lcm}(a,b)$
- Finding $\gcd(a,b)$ by brute force and prime factorization
- Finding $\gcd(a,b)$ efficiently
Slides 30 Ch. 7 Sections 3 and 4
- Extended Euclidean algorithm
- Euclidean alg $\Rightarrow \gcd(a,b)=ar+bs$, where $r,s\in\mathbb{Z}$
- Using $ar+bs=a(r+b)+b(s-a)$, we can say: $\gcd(a,b)=ar-bs$, where $r,s\in\mathbb{Z}_{\geq 0}$
Slides 31 Ch. 7 Sections 5 and 9
- Coprimes: $gcd(a,b)=1\Leftrightarrow ar-bs=1$
- Inverse of $a$ modulo $n$ when $\gcd(a,n)=1$
- Finding the inverse of $a$ modulo $n$ using the extended Euclidean algorithm
- Modular arithmetic
Slides 32 Ch. 2 Section 2, Chp. 4 Section 11
- Equivalence relation: reflexive, symmetric, transitive
- Classes of equivalence
- Congruence is an equivalent relation
Slides 33 Ch. 2 Section 2
- Partial order relation: transitive, anti-symmetric
- In a finite set, a partial order relation has a minimum and a maximum (both not necessarily unique)
- Examples of partial order relations
- Partial order in program termination
Slides 34 Ch. 7 Sections 6, 7, 11, 12
- Prime numbers (with some properties)
- Uniqueness of prime factorization (Fundamental Theorem of Arithmetic)
- Fermat's Theorem (litte): if $p$ is prime and $p\not |a$, then $a^{p-1}\equiv 1\ (\bmod p)$
- Primality testing: $n\textrm{ prime}\Leftrightarrow \forall a\lt n, a^{n-1}\equiv 1\ (\bmod n)$
- Cryptography, basic RSA scheme
Slides 35 Ch. 8 Section 1, 2, and 3
- Graphs, vertices, edges, paths, cycles, walks, closed walks
- Connected components
- Euler formula and what is not planar
- Trees, definition, $E=V-1$
Slides 36 Ch. 8 Section 3 (partially)
- Which graphs are not planar, $K_{3,3}$ and $K_5$
- Counting trees (we only covered Caley's result without proof)
Slides 37 Ch. 8 Section 4 (partially) and Section 6 (partially)
- Minimum spanning tree, MST Greedy algorithm
- Traveling salesman
- Hamiltonian and Euler cycles
- Finind Euler cycles easily
Chapter 0
Read as much as possible from this as soon as you can. The topics of this chapter will be briefly covered as they come up. This chapter covers basic mathematical concepts that we will use at some point during the course. Make sure you are comfortable with most of these concepts.
Chapters 1 - 8 (main topics)
(1) Introduction - Euler formula: v-e+f=2 - Why counting? (the lazy professor example) - Basic examples of counting (snakes and ladders) - Addition and multiplication rules - Handshake lemma - Generalization (n choose k) (2) Counting - Permutations - Ordered selection - n choose k - Sets, relations, functions - Onto functions and one-to-one correspondence (bijection) - Equivalence relations and partial orders - Anagrams and forming teams - The binomial theorem and Pascal triangle - Selection with repetition (ordered and non-ordered) (3) What is a proof? - The pigeonhole principle - Primes are infinite - A water juggling puzzle - Proof by contradiction, by case analysis, by picture - What are proofs? - A false proof of Pythagoras - Some logic, Boolean gates/functions - What is implication? - Proof by counter example, contradiction (again), contrapositive - Self reference and diagonalization, the barber paradox - Countable vs. uncountable (4) Two useful principles - The inclusion-exlusion principle, two sets - What about more than two sets? - The lazy professor revisited - More examples of using inclusion-exclusion - The pigeonhole principle revisited (generalized) - Examples of using pigeonhole - The birthday paradox - Simplified Ramsey theory - Proving program termination by Ramsey (and partial order) |
(5) Inductive proofs - A weird proof - Proof by induction, definition - Some false proofs - Examples of proof by induction - Rules of thumb for induction (6) Recurrences - What is a recurrence? - Cutting the plane - Towers of Hanoi - Fibonacci - Solution for a_n=Aa_{n-1}+Ba_{n-2} - Generating functions - Sorting - Traveling in Manhattan and the Calatan numbers - Stirling numbers - Balls and bins (6 variantions) (7) Number theory - Divisibility and primes - The Euclidean algorithm, why not brute force? - The extended Euclidean algorithm - Co-primes - Fundamental theorem of arithmetic (uniqueness of prime factorization) - Properties and distribution of primes - Congruence as an equivalence relation - Multiplicative inverses - The Chinese remainder theorem - Fermat's little theorem and primality testing - Cryptography, breaking it by Chinese remaindering (8) Graphs - Vertices, edges, and connectivity - Trees - Counting trees - Finding the best tree - The traveling salesman problem - Hamiltonian cycles and Eulerian walks - Graph coloring and planarity |
Note: While these notes reflect what is covered in class, they are far from being perfect (e.g. typos) or complete. But they should be self contained. They are intended for class use only. Many examples and explanations are actually taken from the above references, although no referencing is explicit within the text. Therefore, I emphasize that these notes are intended for class use only. For outside visitors of this page, please use them for your own benefit only. Do not distribute. No one should upload these documents on third party websites!
Homework (weekly, not graded, reused from last semester)
Note 1: Although homework is not graded, it will be unlikely to succeed in the course without an individual, sincere effort to reasonably solve homework question.
Note 2: This is a reminder that none of the documents below may be shared or posted on third party websites, in any form, whether partial, complete, or a reproduction.
Homework 0
Homework 1
Some extra activities to check your basic understanding:
1) Generate all $4!=24$ permutations of $(1,2,3,4)$ by hand on paper. Can you figure out a systematic way of doing this?
2) We learned in class about trianular numbers, where $T_n=1+2+\ldots+n$. Come up with your own numbers; for instance, think of an animal (or anything else), say a bird, and come up with that animal numbers, say bird numbers. This will encourage you to use your imagination; for instance, in the same way people use methphors. Why you call your numbers as such, and what is the association?
3) Recall the breakfast sandwich problem. You can have it on a bagel, or a croissant, or without bread. In it, you can use or omit any of the ingredients: egg, cheese, bacon. In how many ways can you make the sandwiches? Explain clearly and convincingly why the following answer is wrong: There are 5 objects: bagel, croissant, egg, cheese, and bacon, and we are looking for different ways of using them to make the sandwiches, so that is $5!$. Another attempt: Actually, by observing that the bagel and the croissant cannot be used at the same time, we are actually dealing with 4 objects only, so that is $4!$. This is also a wrong reasoning, even though $4!=24$, which is the correct answer (including the empty sandwitch which has no bread and none of the three ingredients).
4) We descibed in class that placing a snake on an $n$ square board is equivalent to choosing a pair of squares with no order, so that would be "n choose 2" which is $n(n-1)/2$. However, there are two contradicting perspectives about snakes. On one hand, the head must have a higher number square than the tail, so order is relevant. On the other hand, if given two squares in any order, the snake can be placed in only one way, so order is irrelevant. Explain this inconsistency.
Homework 2
Some extra activities to check your basic understanding:
1) I demonstrated in class why the number of permutations in $n!$. I permuted 5 students by seating them on chairs, using the following procedure, and the product rule which leads to $5\cdot4\cdot3\cdot2\cdot1=5!$:
1. choose a student to sit on chair 1 ... 5 ways
2. choose a student to sit on chair 2 ... 4 ways
3. choose a student to sit on chair 3 ... 3 ways
4. choose a student to sit on chair 4 ... 2 ways
5. choose a student to sit on chair 5 ... 1 way
Explain why the following procedure overcounts and by how much:
1. choose a student ... 5 ways
2. choose a chair ... 5 ways
(seat that student of that chair in one way)
3. choose another student ... 4 ways
4. choose another chair ... 4 ways
(seat that student on that chair in one way)
etc...
2) We saw the following problem in class: How many words of length 3 can we make using the alphabet $\{a, b, c, \ldots, z\}$ if letters cannot repeat and must show up in alphabetical order. The answer was 26 choose 3, which is equal to $26\cdot 25\cdot 24/3!$ and correspondes to unordered selection with no repetition. Explain why unordered selection was used here even though the problem states clearly that letters must show up in alphabetical order.
3) Do you understand the different between the following scenarios: a) How many simultaneous pairs can we make given $2n$ things? b) In how many ways we can make one pair given $2n$ things? c) In how many ways can we pair up $2n$ things?
Homework 3
Homework 4
Test 1 from Fall 2024 with solution
Homework 5
Homework 6
Homework 7
Homework 8
Test 2 from Fall 2024 with solution
Solutions
(NEW)
Questions designed by TAs (Fall 2024)
Questions designed by TAs (Spring 2025, Part I)
Questions designed by TAs (Spring 2025, Part II, evolving...)
Programming Explorations and Fun Activities (optional, only for those who are interested)
here
Grading policy (this is subject to change, even during the semester, but any change can only be to one's benefit)
Test 1 25% (*) Test 1 will be on March 12 in class from 1:30 to 3:00 PM
Test 2 25% (*) Test 2 will be on April 9 in class from 1:30 to 3:00 PM
Final 50% (scheduled by Hunter College on 5/22/2025, 1:45 - 3:45)
Recitation attentance 5% (add on)
(*) Date will be announced at least 10 days in advance. For accommodations, please contact Saad directly and in person with the necessary paperwork.
(*) Given that lecture time is only 50 minutes (from 1:30 to 2:20), tests will use an extended class session from 1:30 to 3:00 to allow for more time.
Learning outcomes
The course should target goals 1(a), 1(d), and 3(a) as described on the department website, in addition to the following:
Knowledge: you will learn most of the topics listed on this webpage
Behavior: I will do my best to guide you through good study practices and to keep an open mind for mathematics
Attitude and values: I will do my best to change your perspective about mathematics to view it as something essential, useful, and beautiful
Abilities: you will learn how to combine different ideas/tools to obtain a solution for a given problem