Warning: These notes are partial, ongoing, incomplete, and may contain typos/inaccuracies. (They are kept factually accurate, time permitting.)They are being united from many disparate notes created in the past and the layout/organization will gradually improve with time!Please view them on a computer as they are not optimized for mobile (although you can still view them on Mobile along with the Flashcards at your own risk)!Topics and code examples are lazy-loaded and may require two-clicks from the TOC to correctly calculate the updated x,y coordinates (after rendering). Thanks!
Math: Overview
Review of some basic Maths and Computer Science topics that are:
Necessary to apply to Graduate School (Computer Science programs).
Recent (since I tested out of a lot of topics long ago) so these Credits can be used to apply to Graduate School.
To solidify the Math I took in Philosophy Graduate School (basically, Logic and Discrete Math).
Because Math is fun!
FYI the typical Undergraduate Computer Science Program requires something like:
Discrete Math
Calculus I
Calculus II
Linear Algebra
College Algebra
Probability and Statistics
Also FYI, the above requirements can vary quite a bit by specific Program. For example, a B.A. in Computer Science waives all Math requirements and Information Technology often has fewer prerequisites.
ChatGPT helped generate some of the LaTex as its quite complicated.
Math: Probability
Probability calculates the likelihood of an Outcome occuring A Priori.
Probability Space
A Probability Space is defined as the Triple(Ω, E, P):
A Probability Function:
P mapped to the interval [0,1]
P : E → [0,1]
A Set of OutcomesΩ.
Say, a 6-sided dice is being represented: Ω = {1,2,3,4,5,6}
An Event SpaceE of all Events such that for every ∀(e ∈ E)(e ⊆ Ω).
E.g. - e₀ ∈ E and e₀ = {2, 5} (Complex Event where it lands on any of 2, 5.)
E.g. - e₁ ∈ E and e₁ = {1} (Lands on 1.)
Events
Indepdendent
Two events A, B are are Indepdendent if the liklihood of A doesn't influence the liklihood of B occurring.
Dependent
Two events A, B are are Dependent if the liklihood of A occurring influences the liklihood of B occurring.
Mutually Exclusive
Two events A, B are are Mutually Exclusive if they can never occur simultaneously.
Two events A, B are are Mutually Exclusive if A obtaining entails that B cannot also obtain.
Monthly Payments: M = (P * (r / 12)) / (1 - (1 + r / 12) ^ (-12 * t)) where P is the Principal, r is the Interest Rate (Annual), and t the number of years.
Principle and Interest Payments
As found when calculating most kinds of Mortgages:
$250,000 with 12% down $250,000 - ($250,000 * .12) = $250,000 - $30,000 or $220,000 the Mortgage Principal lent.
Suppose the Annual Interest Rate is 6%.
Total (first) Monthly Interest Payment is calculated: $220,000 * (.06 / 12) = $1,100.
Given a Monthly Payment of say $1,928 then Mortgage Principal is reduced by: $1,928 - $1,100 = $828 (the first month).
(The process then repeats for subsequent Monthly Payments.)
General method to calculate Simple Interest: I = P * r * t where P is the Principal, r is the Interest Rate (Annual or Monthly), and t the relevant duration of time.
JavaScript's Math.round(), Math.ceil(), and Math.floor() methods, combined with a multiplier, offer versatile solutions for computing to a specific Precision.
Given a Functionf, defined on an Interval(a,b), its Instantaneous Rate of Change at c in (a,b) is the value of the Forward and Backward Instantaneous Rates of Change at c when they both exist and are the same.
Given a Functionf defined on an Interval(a,b) and a c in (a,b) the Derivative of f at c (f'(c)) is its Instantaneous Rate of Change at c:
To compute the Instantaneous Rate of Change it's sometimes necessary to divide a Function into a Piecewise Functions and evaluate each part of the Piecewise Function definition with its corresponding Left- or Right-Sided Limit.
It may also be useful to break a Functionf into two non-Piecewise parts (to reduce the simplification of terms):
If f, g evaluated to ∞ and 0, how would we approach finding a solution? The prior Rules apply to Constants and other defined operations.
Determinate Forms
Evaluates to a single 0, C or +/-∞ (and is thus directly Differentiable, defined, and solved using the prior Rules).
Determinate Forms (where the left-hand side is the Limit of f, the middle operator the relevant infix operation between f and g, and the right g):
0+0
0-0
0×0
+/-∞ × +/-∞
0/∞,c/∞
∞/0,∞/c
c × ∞, c > 0
0^∞
n^∞, n ≠ 0
∞^∞
Indeterminate Forms
Does not evaluate to 0 or +/-∞ and is undefined.
Indeterminate Forms (where the left-hand side is the Limit of f, the middle operator the relevant infix operation between f and g, and the right g):
∞-∞
0/0
+/-∞/+/-∞
0 × ∞
0^0
∞^0
1^∞
L'Hôpital's Rule
L'Hôpital's Rules apply when two Functionsf and g are Diiferentiable, the right-hand Limit exists, they are equal to each other, and they both equal 0, -∞, ∞ (Indeterminate Form).
if the Limit on the right exists. Note that the Sign must match.
This is called L'Hôpital's ∞/∞ Rule.
Extensions
Sometimes, f and g may appear to be unsuitable for L'Hôpital's 0/0 or ∞/∞ Rule (although f, g are Indeterminate Ratio Forms).
However, upon closer inspection f, g might be assuaged into an acceptable Form. So, check before you conclude otherwise.
Helpful to rewrite a Function into Ratio Form (converts f into a Fraction):
$$\displaystyle f(x) = (1/f(x))^{-1}$$
Maxima and Minima
A Functionf has a Local Maximum at c if there exists an Open Interval I containing c such that I is contained in the Domain of f and f(c) ≥ f(x) for all x ∈ I.
A Functionf has a Local Minimum at c if there exists an Open Interval I containing c such that I is contained in the Domain of f and f(c) ≤ f(x) for all x ∈ I.
A function f has a Local Extremum at c if f has a Local Maximum at c or f has a Local Minimum at c.
Critical Number
We say that c is a Critical Number of f if f'(c) = 0 or f'(c) is undefined.
E.g. - The Zeroes of the First Derivative of f.
Fermat's Theorem
If f has a Local Extremum at c and f is Differentiable at c, then f'(c) = 0.
Mean Value Theorem
Let f be a Continuous Function over the Closed Interval [a,b] and Differentiable over the Open Interval (a,b).
There then exists at least one Pointc where c ∈ (a,b) such that:
Observe that the following is a special case of the Mean Value Theorem.
Let f be a Continuous Function over the Closed Interval [a,b] and Differentiable over the Open Interval (a,b) and f(a) = f(b).
There then exists at least one Pointc where c ∈ (a,b) such that f'(c) = 0.
Concavity
Test for Concavity
Let f be a Function that is twice Differentiable over an IntervalI.
If f′′(x) > 0 for all x ∈ I, then f is Concave Up over I.
If f′′(x) < 0 for all x ∈ I, then f is Concave Down over I.
First Derivative Test
Sppose that f is a Continuous Function over an Interval I containing a Critical Point (Critical Number) c. If f is Differentiable over I, except possibly at c, then f(c) satisfies one of the following descriptions:
If f′ changes sign from positive when x < c to negative when x > c, then f(c) is a Local Maximum of f.
If f′ changes sign from negative when x < c to positive when x > c, then f(c) is a Local Minimum of f.
If f' has the same sign for x < c and x > c, then f(c) is neither a Local Maximum nor a Local Minimum of f.
Second Derivative Test
Suppose f′(c) = 0, f′′ is Continuous over an Interval containing c.
Left, Right, MiddleRiemann Sums divide an Interval into nRectangles allowing of the Area under a Curved Line to be Approximately calculated.
The more the better (the more accurate) and that's the key intution is that as this number goes to Infinity, the more accurate the Approximation will be.
Left - we use the left-most Coordinate to compute each Y Value and Rectangle.
Right - we use the right-most Coordinate to compute each Y Value and Rectangle.
Middle - we use the middle Coordinate (Left - Right / 2) to compute each Y Value and Rectangle.
Given a partition Δx that divides an Interval[a,b] into x0, ..., xn.
We can Approximate the Area under a boundary defined by a Functionf (where x0 is some initial value) using the following method:
The Derivative of the Definite Integral of f(x) is just the original Function with the Upper Limit term (b, above) replacing the Variable of Integration (dt, above).
If the Upper Limit is an expression, use the FTC Chain Rule (below).
If both the Upper Limit and the Lower Limit are expressions, use Part Two (below).
Solve using the FTC Chain Rule for the Upper Limit and the Lower Limit then substract.
Part One
If f(x) is Continuous over an Interval[a,b] and the FunctionF(x) is defined by:
$$\displaystyle F(x) = \int_{a}^{x} f(t) dt $$
then the following holds over (a,b):
$$\displaystyle \frac{d}{dx} F(x) = f(x) $$
Part Two
If f is Continuous over an Interval[a,b] and the FunctionF(x) is any Anti-Derivative of f(x) then:
\[
\begin{array}{|l|l|}
\hline
\textbf{Set Algebra Rule} & \textbf{Identity} \\
\hline
\text{Identity Laws} &
A \cup \varnothing = A,\qquad A \cap U = A \\
\hline
\text{Domination Laws} &
A \cup U = U,\qquad A \cap \varnothing = \varnothing \\
\hline
\text{Idempotent Laws} &
A \cup A = A,\qquad A \cap A = A \\
\hline
\text{Complement Laws} &
A \cup \overline{A} = U,\qquad A \cap \overline{A} = \varnothing \\
\hline
\text{Double Complement Law} &
\overline{\overline{A}} = A \\
\hline
\text{Commutative Laws} &
A \cup B = B \cup A,\qquad A \cap B = B \cap A \\
\hline
\text{Associative Laws} &
(A \cup B) \cup C = A \cup (B \cup C),\qquad
(A \cap B) \cap C = A \cap (B \cap C) \\
\hline
\text{Distributive Laws} &
A \cup (B \cap C) = (A \cup B) \cap (A \cup C),\qquad
A \cap (B \cup C) = (A \cap B) \cup (A \cap C) \\
\hline
\text{Absorption Laws} &
A \cup (A \cap B) = A,\qquad
A \cap (A \cup B) = A \\
\hline
\text{De Morgan's Laws} &
\overline{A \cup B} = \overline{A} \cap \overline{B},\qquad
\overline{A \cap B} = \overline{A} \cup \overline{B} \\
\hline
\text{Difference Law} &
A - B = A \cap \overline{B} \\
\hline
\text{Complement of Universe} &
\overline{U} = \varnothing,\qquad \overline{\varnothing} = U \\
\hline
\end{array}
\]
Discrete Math: Algebraic Definitions and Proofs
Review of some topics.
Very helpful Math 208: Discrete Mathematics from the Department of Mathematics at The University of North Dakota.
Distributed under the GNU Free Documentation License.
Number- and Set- Theoretic Definitions
Natural Numbers
$$\displaystyle \mathbb{N} = \{x | x \ \text{is a non-negative whole number}\} = \{0,1,2,...\}$$
Integers
$$\displaystyle \mathbb{Z} = \{x | x \ \text{is a whole number}\} = \{...,-2,-1,0,1,2,...\}$$
$$\displaystyle n = 2k \ \text{where} \ n, k \in \mathbb{Z}$$
Odd Integers
$$\displaystyle n = 2k+1 \ \text{where} \ n, k \in \mathbb{Z}$$
Algebraic Proofs
Direct Proof Example
Example using the definition for Even Integers, Direct Proof, and Algebra:
\[
\begin{aligned}
&\text{If } n \in \mathbb{Z} \text{ and is even, then there exists some } k \in \mathbb{Z}
\text{ such that } n = 2k. \text{ (By the definition of Even.)} \\[0.5em]
&\text{To prove that } -n \in \mathbb{Z}\text{, first } -n = -2k
\text{ using } n = 2k \text{ from before.} \\[0.5em]
&\text{Then, rewrite the equation to } -n = 2(-k). \\[0.5em]
&\text{So, } -n = 2l \text{ where } l = -k. \\[0.5em]
&2l \in \mathbb{Z}
\text{ (where } l \text{ is some arbitrary number in the same way as } k \text{ above).} \\[0.5em]
&\therefore -n \in \mathbb{Z}.
\end{aligned}
\]
Indirect Proof Example
Example using the definition for Odd Integers, Indirect Proof, and Algebra:
$$\displaystyle \text{Prove that if} \ {n}^{2} \ \text{is even, then so is} \ n.$$
The above will be reformulated into a Logical Equivalence (Indirect Proof):
\[
\begin{aligned}
&(\forall n \in \mathbb{Z})\; ({n}^{2} \text{ is even})
\longrightarrow (n \text{ is even}) \\[0.5em]
&\equiv (\forall n \in \mathbb{Z})\; -(n \text{ is even})
\longrightarrow -({n}^{2} \text{ is even})
\quad \text{(By the Contrapositive.)} \\[0.5em]
&\equiv (\forall n \in \mathbb{Z})\; (n \text{ is odd})
\longrightarrow ({n}^{2} \text{ is odd})
\end{aligned}
\]
This will be the new starting point for the Proof:
\[
\begin{aligned}
&\text{Let } n \in \mathbb{Z} \text{ be given}. \\[0.5em]
&\text{Suppose } n \in \mathbb{Z} \text{ is odd}. \\[0.5em]
&\text{Then there exists some } k \in \mathbb{Z}
\text{ such that } n = 2k+1.
\quad \text{(By the definition of Odd.)} \\[0.5em]
&{n}^{2} = {(2k+1)}^{2} \\[0.5em]
&{n}^{2} = 4{k}^{2} + 4k + 1 \\[0.5em]
&\text{Then, rewrite the equation to } {n}^{2}
= 4({k}^{2} + k) + 1 \\[0.5em]
&\text{So, } {n}^{2} = 2l + 1
\text{ where } l = 2({k}^{2} + k). \\[0.5em]
&2l + 1 \in \mathbb{Z}
\text{ (where } l
\text{ is some arbitrary number in the same way as } k
\text{ above).} \\[0.5em]
&\therefore {n}^{2} \text{ is odd}.
\end{aligned}
\]
Proof by Contradiction
Example using the definition for Irrational and Rational Numbers, Proof by Contradiction, and Algebra:
\[
\begin{aligned}
&\text{Prove that the difference between an irrational and a rational number is irrational.} \\[0.5em]
&\text{Let } x,y \in \mathbb{R} \text{ be given.} \\[0.5em]
&\text{Suppose } x \text{ is rational and } y \text{ is irrational.}
\end{aligned}
\]
Hypothesis to assume (and to demonstrate that a Contradiction follows):
\[
\begin{aligned}
&\text{Suppose for the sake of the argument that } y-x
\text{ is rational.} \\[0.5em]
&\text{Then } (y-x)+x=y
\text{ such that } y
\text{ is rational (since the addition of a rational to a rational is itself rational). (By definition.)} \\[0.5em]
&\text{Then, } y \text{ is irrational and rational.} \\[0.5em]
&\text{But, that's a contradiction.} \\[0.5em]
&\therefore x-y
\text{ must be irrational (and not what we assumed).}
\end{aligned}
\]
Discrete Math: Functions and Relations
Review of some topics.
Very helpful Math 208: Discrete Mathematics from the Department of Mathematics at The University of North Dakota.
Distributed under the GNU Free Documentation License.
Relation Definitions
For some RelationR on SetA:
Reflexive
$$\displaystyle \forall x \in A,\ (x,x) \in R$$
Irreflexive
$$\displaystyle \forall x \in A,\ (x,x) \notin R$$
(R being both Symmetric and Anti-Symmetric) is notLogically Equivalent to (R being Anti-Symmetric).
Graphs
Bipartite
Directed Graph (Digraph)
Equivalence Relations
A RelationR on SetA is an Equivalence Relation when:
R is Reflexive
R is Symmetric
R is Transitive
Equivalence Classes (defined by R) Partition A into Disjoint Sets:
These are usually represented using one of following intensional notations:
[a] = { a + x = 2 | x ∈ ℤ }
R[a] = { b ∈ ℤ | aRb}
Sometimes extensionally R[a] = {1, 2, 3, 4, 5}
a's Type is usually specified in the surrounding text.
Generally, if aRb, e.g. - (a,b) ∈ R, then [a]=[b].
Function Definitions
Given a Functionf from SetA to B:
$$\displaystyle f(x) : A \longrightarrow B $$
A is called the Domain of f.
B is called the Codomain of f.
Recollect that each Element in the Domain of A is mapped to at most one Element in Codomain of B.
By convention, a Function is typically understood to be a Total Function (unless otherwise explicitly indicated). Every element in the Domain is used (but there's no guarantee that every element in the Codomain is).
Injective
Injective - a Functionf is Injective (or one-to-one) when no two Elements in the Domain map to the same Element in the Codomain:
"Different inputs always result in different outputs."
$$\displaystyle f(x) = f(y) \Rightarrow x = y $$
If the Cardinality of the Domain is greater than the Codomain, no such Function can exist.
Surjective
Surjective - a Functionf is Surjective (or onto) if every Element in the Codomain is distinctly mapped to by some Element in the Domain (doesn't map to any other element in the Codomain).
\[
\begin{aligned}
&\text{Given: } \displaystyle f(x) : A \longrightarrow B \\[0.5em]
&(\forall b \in B)(\exists a \in A)\ f(a) = b
\end{aligned}
\]
If the Cardinality of the Codomain is greater than the Domain, no such Function can exist.
Bijective
Bijective - a Functionf that's bothInjective and Surjective.
For (Total) Functions, this requires that the Cardinality of the Domain and Codomain are the same.
Examples
\begin{array}{ll}
\textbf{1. Bijective but Not Identity:}
& f:\mathbb{R}\to\mathbb{R},\quad f(x)=x+2 \\[4pt]
& \text{Injective: Yes. Surjective: Yes.} \\[4pt]
& \text{Bijective: Yes. Identity: No.} \\[10pt]
\textbf{2. Neither Injective nor Surjective:}
& f:\mathbb{R}\to\mathbb{R},\quad f(x)=x^2 \\[4pt]
& \text{Injective: No, since } f(-2)=f(2)=4. \\[4pt]
& \text{Surjective: No, since } f(x)\geq 0. \\[10pt]
\textbf{3. Injective but Not Surjective:}
& f:\mathbb{R}\to\mathbb{R},\quad f(x)=e^x \\[4pt]
& \text{Injective: Yes, since } e^a=e^b\Rightarrow a=b. \\[4pt]
& \text{Surjective: No, since } e^x>0. \\[4pt]
& \text{Zero and negative reals are not attained.} \\[10pt]
\textbf{4. Surjective but Not Injective:}
& f:\mathbb{R}\to\mathbb{Z},\quad f(x)=\lceil x\rceil \\[4pt]
& \text{Injective: No, since } \lceil 1.2\rceil=\lceil 1.8\rceil=2. \\[4pt]
& \text{Surjective: Yes, since every integer is attained.} \\[4pt]
\textbf{5. Neither Injective nor Surjective:}
& f:\mathbb{R}\to\mathbb{R},\quad f(x)=\lceil x\rceil \\[4pt]
& \text{Injective: No, since } \lceil 1.2\rceil=\lceil 1.8\rceil=2. \\[4pt]
& \text{Surjective: No, since } f(x)\in\mathbb{Z}. \\[4pt]
& \text{Non-integer real values are not attained.} \\[10pt]
\textbf{6. Surjective but Not Injective:}
& f:\mathbb{R}\to\mathbb{R},\quad f(x)=x^3-x \\[4pt]
& \text{Injective: No, since } f(-1)=f(0)=f(1)=0. \\[4pt]
& \text{Surjective: Yes, since } f \text{ is continuous,} \\[4pt]
& \displaystyle \lim_{x\to-\infty}f(x)=-\infty
\text{ and } \lim_{x\to\infty}f(x)=\infty. \\[4pt]
& \text{By the Intermediate Value Theorem, every real value is attained.}
\end{array}
0-1 Matrix
For some RelationR ⊆ A x B the 0-1 Matrix is depicted:
With A as the left-side set: its elements are listed top-to-bottom.
And B as the top-side set: its elements are listed left-to-right.
For R ⊆ A x B, the matrix entry is 1 exactly when (a,b) ∈ R.
Given:
$$\displaystyle A = \{a_1,a_2,a_3\}, \qquad B = \{b_1,b_2,b_3\}$$
$$\displaystyle R = \{(a_1,b_1),(a_1,b_3),(a_2,b_2),(a_3,b_1)\} \subseteq A \times B$$
Proof by Induction specific to Sequences and Summations.
Sequences
Closed Formula
$$\displaystyle a_n = f(n) \ \text{for each indexed term of the sequence} \ a_n$$
Recursive Formula
$$\displaystyle F_n = F_{n-1} + F_{n-2}$$
Summations
\begin{array}{ll}
\textbf{1. Summation Notation:}
& \displaystyle \sum_{i=1}^{n} a_i = a_1 + a_2 + a_3 + \cdots + a_n \\[4pt]
\textbf{2. Relationship to a Series:}
& \{a_n\} = a_1,a_2,a_3,\ldots \\[4pt]
& \text{A Series is the sum of the terms of a Sequence, while Summation Notation is a compact way} \\[4pt]
& \text{to represent that Series.} \\[10pt]
& \displaystyle \sum_{i=1}^{n}a_i = a_1+a_2+a_3+\cdots+a_n \\[4pt]
& \text{A Summation Formula provides a Closed Formula for its value.} \\[10pt]
\textbf{3. Summation Formula:}
& \text{A Summation Formula gives a closed expression for the value of a sum.} \\[4pt]
& \displaystyle \sum_{i=1}^{n} i =1+2+3+\cdots+n =\frac{n(n+1)}{2} \\[4pt]
& \text{For example, when } n=5,\quad \displaystyle\sum_{i=1}^{5}i =\frac{5(6)}{2}=15. \\[10pt]
\textbf{4. Double Summation:}
& \text{A Double Summation represents the sum of terms involving two indices.} \\[4pt]
& \displaystyle \sum_{i=1}^{m}\sum_{j=1}^{n}a_{ij} \\[4pt]
& \text{The inner sum is evaluated for each value of } i \text{ before the outer sum is evaluated.} \\[4pt]
& \displaystyle \sum_{i=1}^{2}\sum_{j=1}^{3}a_{ij}
= (a_{11}+a_{12}+a_{13})+(a_{21}+a_{22}+a_{23}) \text{ where } a_{ij} = i + j \\[6pt]
& \textbf{Example:}\quad
\displaystyle \sum_{i=1}^{2}\sum_{j=1}^{3}(i+j) \\[4pt]
& \displaystyle = (1+1)+(1+2)+(1+3)+(2+1)+(2+2)+(2+3) \\[4pt]
& \displaystyle = 2+3+4+3+4+5=21 \\[10pt]
\textbf{5. Next Term Equivalence:}
& \text{A Summation can be written Recursively by separating its final term.} \\[4pt]
& \displaystyle \sum_{i=1}^{n+1}a_i = \sum_{i=1}^{n}a_i+a_{n+1} \\[4pt]
& \text{Therefore, if } S_n=\displaystyle\sum_{i=1}^{n}a_i,\text{ then } S_{n+1}=S_n+a_{n+1}.
\end{array}
Well Ordering Principle
$$\displaystyle \text{If } S \text{ is a non-empty subset of the natural numbers} \ (\mathbb{N}), \text{ then } S \text{ contains a least element } m \text{.} $$
$$\displaystyle \forall S \subseteq \mathbb{N} \, (S \neq \emptyset \longrightarrow \exists m \in S \text{ such that } \forall x \in S, \, m \le x) $$
Mathematical Induction
\begin{array}{ll}
\textbf{1. Weak Mathematical Induction:}
& \text{Prove } P(k) \text{ is true and use it to prove } P(k+1). \\[4pt]
& \displaystyle P(k)\Rightarrow P(k+1) \\[10pt]
\textbf{2. Strong Mathematical Induction:}
& \text{Prove } P(n_0),P(n_0+1),\ldots,P(k) \text{ are all true and use them to prove } P(k+1). \\[4pt]
& \displaystyle P(n_0)\land P(n_0+1)\land\cdots\land P(k)\Rightarrow P(k+1) \\[10pt]
\textbf{3. Mathematical Induction:}
& \text{A proof method consisting of a Base Case (Basis) and an Inductive Step.} \\[4pt]
& \textbf{Base Case:}\quad P(n_0) \\[4pt]
& \textbf{Inductive Step:}\quad \text{Use the Inductive Hypothesis to prove } P(k+1). \\[4pt]
\textbf{Summary:}
& \text{ Weak Mathematical Induction proves only the prior case.} \\[4pt]
& \text{ Strong Mathematical Induction proves all previous cases.} \\[4pt]
& \text{ Mathematical Induction proves the base case (Basis).} \\[4pt]
\end{array}
$$\displaystyle \mathbb{Z} = \{x | x \ \text{is a whole number}\} = \{...,-2,-1,0,1,2,...\}$$
Axioms of Integer Number Theory
\begin{array}{ll}
\textbf{1. Closure Properties:}
& \forall a,b \in \mathbb{Z}, \\
& a+b \in \mathbb{Z} \text{ and } ab \in \mathbb{Z} \\[8pt]
\textbf{2. Commutative Properties:}
& \forall a,b \in \mathbb{Z}, \\
& a+b=b+a \\
& ab=ba \\[8pt]
\textbf{3. Associative Properties:}
& \forall a,b,c \in \mathbb{Z}, \\
& (a+b)+c=a+(b+c) \\
& (ab)c=a(bc) \\[8pt]
\textbf{4. Additive Identity:}
& 0 \text{ is the } \textbf{Additive Identity} \text{ such that } \forall a \in \mathbb{Z}, \\
& a+0=0+a=a \\[8pt]
\textbf{5. Additive Inverse:}
& \forall a \in \mathbb{Z}, \\
& \exists -a \in \mathbb{Z} \text{ such that} \\
& a+(-a)=(-a)+a=0 \\[8pt]
\textbf{6. Multiplicative Identity:}
& 1 \text{ is the } \textbf{Multiplicative Identity} \text{ such that } \forall a \in \mathbb{Z}, \\
& a \cdot 1=1 \cdot a=a \\[8pt]
\textbf{7. Distributive Property:}
& \forall a,b,c \in \mathbb{Z}, \\
& a(b+c)=ab+ac \\
& (a+b)c=ac+bc \\[8pt]
\textbf{8. Integer Cancellation Law:}
& \forall a,b,c \in \mathbb{Z}, \\
& \text{if } a+c=b+c, \text{ then } a=b. \\[4pt]
& \text{If } ac=bc \text{ and } c \ne 0, \text{ then } a=b \\[8pt]
\textbf{9. Trichotomy Law:}
& \forall a \in \mathbb{Z}, \\
& \text{exactly one of the following holds:} \\
& a<0,\quad a=0,\quad a>0 \\[8pt]
\textbf{10. Well-Ordering Principle:}
& \text{Every nonempty subset of the nonnegative integers} \\
& \text{has a least element.} \\
& \text{That is, if } S \subseteq \mathbb{Z}_{\geq 0} \text{ and } S \ne \varnothing, \\
& \exists m \in S \text{ such that} \\
& m \leq n \text{ for every } n \in S
\end{array}
The Divisibility Relation
We write:
a|b when a cleanly divides b.
And a∤b when a doesn't cleanly divide b.
Formally:
\begin{array}{ll}
\textbf{Divisibility Relation:}
& \forall a,b \in \mathbb{Z}, \\
& a \mid b \iff \exists k \in \mathbb{Z} \\
& \text{such that } b=ak
\end{array}
Note that from the formal definition 0|0 is true even though 0/0 is undefined.
The following hold of |:
\begin{array}{ll}
\textbf{1. Divisibility of Zero:}
& \forall a \in \mathbb{Z}, \\
& a \mid 0 \\[8pt]
\textbf{2. Divisibility by Units:}
& \forall a \in \mathbb{Z}, \\
& \pm 1 \mid a \\[8pt]
\textbf{3. Reflexive Property:}
& \forall a \in \mathbb{Z}, \\
& a \mid a \\[8pt]
\textbf{4. Divisibility of One:}
& \forall a \in \mathbb{Z}, \\
& a \mid 1 \iff a=\pm 1 \\[8pt]
\textbf{5. Divisibility and Negatives:}
& \forall a,b \in \mathbb{Z}, \\
& a \mid b \iff a \mid -b \\
& a \mid b \iff -a \mid b \\[8pt]
\textbf{6. Transitive Property:}
& \forall a,b,c \in \mathbb{Z}, \\
& \text{if } a \mid b \text{ and } b \mid c, \\
& \text{then } a \mid c \\[8pt]
\textbf{7. Divisibility of Sums and Differences:}
& \forall a,b,c \in \mathbb{Z}, \\
& \text{if } a \mid b \text{ and } a \mid c, \\
& \text{then } a \mid (b+c) \\
& \text{and } a \mid (b-c) \\[8pt]
\textbf{8. Divisibility of Linear Combinations:}
& \forall a,b,c,x,y \in \mathbb{Z}, \\
& \text{if } a \mid b \text{ and } a \mid c, \\
& \text{then } a \mid (bx+cy) \\[8pt]
\textbf{9. Multiplication Property:}
& \forall a,b,c \in \mathbb{Z}, \\
& \text{if } a \mid b, \text{ then } a \mid bc \\[8pt]
\textbf{10. Cancellation Property:}
& \forall a,b,c \in \mathbb{Z}, \\
& \text{if } a \mid b \text{ and } a \ne 0, \\
& \text{then } \frac{b}{a} \in \mathbb{Z} \\[4pt]
& \text{If } ac \mid bc \text{ and } c \ne 0, \\
& \text{then } a \mid b \\[8pt]
\textbf{11. Antisymmetry up to Sign:}
& \forall a,b \in \mathbb{Z}, \\
& \text{if } a \mid b \text{ and } b \mid a, \\
& \text{then } a=\pm b \\[8pt]
\textbf{12. Divisibility and Products:}
& \forall a,b,c,d \in \mathbb{Z}, \\
& \text{if } a \mid b \text{ and } c \mid d, \\
& \text{then } ac \mid bd \\[8pt]
\textbf{13. Divisibility of Powers:}
& \forall a,b \in \mathbb{Z}, \forall n \in \mathbb{Z}_{\geq 1}, \\
& \text{if } a \mid b, \\
& \text{then } a^n \mid b^n \\[8pt]
\textbf{14. Divisibility by a Nonzero Integer:}
& \forall a,b \in \mathbb{Z}, \\
& a \mid b \iff \exists k \in \mathbb{Z} \\
& \text{such that } b=ak \\[8pt]
\textbf{15. Negation Property:}
& \forall a \in \mathbb{Z}, \\
& a \mid -a \\[8pt]
\textbf{16. Comparison Property:}
& \forall a,b \in \mathbb{Z}, \\
& \text{if } a \mid b \text{ and } b \ne 0, \\
& \text{then } 0 < |a| \le |b|
\end{array}
Primes and Composites
Primes:
Are divisible only by 1 or themselves.
Formally:
\begin{array}{ll}
\textbf{Prime Number:}
& p \in \mathbb{Z} \text{ is prime} \iff p>1 \\
& \text{ and } \\
& \forall d \in \mathbb{Z}, d \mid p \implies d=\pm 1 \text{ or } d=\pm p \\[10pt]
\textbf{Composite Number:}
& n \in \mathbb{Z} \text{ is composite} \iff n>1 \\
& \text{ and } \\
& \exists a,b \in \mathbb{Z}, \quad 1 < a < n, \quad 1 < b < n, \quad n=ab \\[10pt]
\end{array}
\begin{array}{ll}
\textbf{The Division Algorithm for Integers:}
& \forall a,b \in \mathbb{Z}, \ b>0; \quad \exists q,r \in \mathbb{Z} \\
& \text{such that} \quad a=qb+r,\quad 0\le r < b \\[6pt]
& \text{where } q \text{ is the quotient and } r \text{ the remainder.}
\end{array}
Prime Factorization
\begin{array}{ll}
\textbf{Prime Factorization:}
& n \in \mathbb{Z},\ n>1 \text{ has a prime factorization} \iff n=p_1p_2\cdots p_k \\[2pt]
& \text{where } p_1,p_2,\ldots,p_k \text{ are primes } \\[2pt]
& \text{and the factorization is unique up to the order of the factors.} \\[10pt]
\textbf{Example:}
& 60=2\cdot2\cdot3\cdot5=2^2\cdot3\cdot5
\end{array}
\begin{array}{ll}
\textbf{Euclid's Lemma:}
& \text{If a prime number divides a product of two integers,} \\[2pt]
& \text{then it must divide at least one of the two integers.} \\[10pt]
\textbf{Formal Statement:}
& \text{If } p \text{ is prime and } p\mid ab, \text{ where } a,b\in\mathbb{Z}, \\[2pt]
& \text{then } p\mid a \text{ or } p\mid b. \\[10pt]
\textbf{Examples:}
& 3\mid(4\cdot9) \quad\text{and}\quad 3\mid9 \\[4pt]
& 5\mid(6\cdot15) \quad\text{and}\quad 5\mid15 \\[4pt]
& 7\mid(14\cdot11) \quad\text{and}\quad 7\mid14 \\[4pt]
& 2\mid(8\cdot15) \quad\text{and}\quad 2\mid8
\end{array}
Fundamental Theorem of Arithmetic
\begin{array}{ll}
\textbf{Fundamental Theorem of Arithmetic:}
& \text{Every integer } n>1 \text{ can be written as a product of prime numbers,} \\[2pt]
& \text{and this prime factorization is unique except for the order of the factors.} \\[10pt]
\textbf{Formal Statement:}
& \text{If } n>1 \text{ is an integer, then there exist prime numbers} \\[2pt]
& p_1\leq p_2\leq\cdots\leq p_r \text{ such that } n=p_1p_2\cdots p_r, \\[2pt]
& \text{and there is only one such prime factorization of } n. \\[10pt]
\textbf{Examples:}
& 12=2\cdot2\cdot3=2^2\cdot3 \\[4pt]
& 30=2\cdot3\cdot5 \\[4pt]
& 84=2\cdot2\cdot3\cdot7=2^2\cdot3\cdot7 \\[4pt]
& 105=3\cdot5\cdot7 \\[4pt]
& 180=2\cdot2\cdot3\cdot3\cdot5=2^2\cdot3^2\cdot5
\end{array}
GCD
\begin{array}{ll}
\textbf{Greatest Common Divisor (GCD):}
& \gcd(a,b)=d \iff d \mid a \text{ and } d \mid b, \\
& \text{and } \\
& \forall c \in \mathbb{Z}, (c \mid a \text{ and } c \mid b) \implies c \mid d \\[10pt]
\end{array}
\begin{array}{ll}
\textbf{Diophantine Equation:}
& \text{An equation in which the variables are required to have integer values.} \\[10pt]
\textbf{Formal Statement:}
& \text{A Diophantine equation is an equation of the form} \\[2pt]
& f(x_1,x_2,\ldots,x_n)=0, \quad x_1,x_2,\ldots,x_n\in\mathbb{Z}, \\[2pt]
& \text{where the goal is to find all integer solutions.} \\[10pt]
\textbf{Examples:}
& x+y=10,\quad x,y\in\mathbb{Z} \\[4pt]
& 3x+5y=17,\quad x,y\in\mathbb{Z} \\[4pt]
& x^2+y^2=25,\quad x,y\in\mathbb{Z} \\[4pt]
& x^2-y^2=15,\quad x,y\in\mathbb{Z}
\end{array}
Some important properties:
\begin{array}{ll}
\textbf{Bézout's Identity:}
& \gcd(a,b)=ax+by \quad \text{for some }x,y \in \mathbb{Z} \\
& \gcd(a,b)=1 \iff \exists\,x,y\in\mathbb{Z}\text{ such that }ax+by=1 \\
\\
\textbf{Linear Diophantine Solvability Criterion:}
& ax+by=n \text{ has an integer solution} \iff \gcd(a,b)\mid n \\
& \gcd(a,b)\nmid n \quad\Longrightarrow\quad ax+by=n \text{ has no integer solutions.}
\end{array}
The above is Theorem 25.1 (pp. 158) in the textbook.
Example Solutions
General approach:
\begin{array}{ll}
\textbf{Example Diaphantine Equation Solution:}
& \text{Let } a,b \in \mathbb{Z}\text{ be not both equal to } 0. \\[2pt]
& \text{Assume } \gcd(a,b) \mid c\text{ for some }c \in \mathbb{Z}. \\[2pt]
& \text{Finally, assume that } (d,e) \text{ is one solution of } ax+by=c. \\[10pt]
\textbf{Claim:}
& (x,y)\text{ is a solution of } ax+by=c \iff\\[2pt]
& (x,y)=\left(d+\frac{b}{\gcd(a,b)}k,\
e-\frac{a}{\gcd(a,b)}k\right) \text{ for some }k\in\mathbb{Z}. \\[10pt]
\textbf{Proof:}
& \text{Let }g=\gcd(a,b). \\[4pt]
& \text{Since }(d,e)\text{ is a solution, }ad+be=c. \\[6pt]
\textbf{1. Prove RHS:}
& \text{Suppose }
(x,y)=\left(d+\frac{b}{g}k,\ e-\frac{a}{g}k\right). \\[4pt]
& ax+by
=a\left(d+\frac{b}{g}k\right)
+b\left(e-\frac{a}{g}k\right) \\[4pt]
& \qquad=ad+\frac{ab}{g}k+be-\frac{ab}{g}k \\[4pt]
& \qquad=ad+be=c. \\[4pt]
& \therefore\ (x,y)\text{ is a solution.} \\[10pt]
\textbf{2. Prove LHS:}
& \text{Suppose }(x,y)\text{ is a solution. Then} \\[4pt]
& ax+by=c=ad+be. \\[4pt]
& \therefore\ a(x-d)+b(y-e)=0. \\[4pt]
& \therefore\ a(x-d)=-b(y-e). \\[6pt]
\textbf{3. Factor gcd:}
& \text{Since }\gcd(a,b)=g,\text{ write }a=ga'\text{ and }b=gb', \\[-1pt]
& \text{where }\gcd(a',b')=1. \\[4pt]
& \text{Then }a'(x-d)=-b'(y-e). \\[6pt]
\textbf{4. Apply Euclid's Lemma:}
& \text{Since }\gcd(a',b')=1,\text{ Euclid's Lemma gives }b'\mid(x-d). \\[4pt]
\textbf{5. Introduce }k:
& \text{Thus }x-d=b'k=\frac{b}{g}k
\text{ for some }k\in\mathbb{Z}. \\[4pt]
\textbf{6. Solve for }y:
& \text{Substituting into }a'(x-d)=-b'(y-e)\text{ gives} \\[4pt]
& a'b'k=-b'(y-e). \\[4pt]
& \therefore\ y-e=-a'k=-\frac{a}{g}k. \\[4pt]
& \therefore\ y=e-\frac{a}{g}k. \\[6pt]
\textbf{7. Combine:}
& \therefore\ (x,y)=\left(d+\frac{b}{g}k,\
e-\frac{a}{g}k\right). \\[8pt]
& \boxed{\therefore\ (x,y)\text{ is a solution }
\iff
(x,y)=\left(d+\frac{b}{\gcd(a,b)}k,\
e-\frac{a}{\gcd(a,b)}k\right),\ k\in\mathbb{Z}.}
\end{array}
Relative coprimes:
\begin{array}{ll}
\textbf{Example Diophantine Equation Solution:}
& \text{Consider } 37a+17b=19, \text{ where }a,b\in\mathbb{Z}. \\[6pt]
\textbf{1. Check relatively coprime:}
& \gcd(37,17)=1. \\[4pt]
& \therefore\ 37 \text{ and } 17 \text{ are relatively coprime.} \\[8pt]
\textbf{2. Find a particular solution:}
& \text{Using the Euclidean Algorithm:} \\[4pt]
& 37=2(17)+3, \\[2pt]
& 17=5(3)+2, \\[2pt]
& 3=1(2)+1. \\[6pt]
& \text{The final nonzero remainder is }1=3-2 \text{ (rewritten from the above).} \\[4pt]
& \text{Therefore, begin back-substituting the preceding remainders:} \\[4pt]
& 1=3-(17-5(3)) \\[2pt]
& \qquad=6(3)-17 \\[2pt]
& \qquad=6(37-2(17))-17 \\[2pt]
& \qquad=6(37)-13(17). \\[6pt]
& \text{Thus, }\gcd(37,17)=1=6(37)-13(17), \\[4pt]
& \text{which back-substitutes the original coefficients }37\text{ and }17\text{ into gcd}. \\[6pt]
& \text{Multiplying by } 19 \text{ gives: } 19=114(37)-247(17). \\[4pt]
& \text{Thus, }(114,-247) \text{ is a particular solution.} \\[6pt]
& \text{However, choosing }k=-7 \text{ gives the smaller solution:} \\[4pt]
& a=114+17(-7)=-5, \qquad b=-247-37(-7)=12. \\[4pt]
& \text{Therefore, }(-5,12) \text{ is a particular solution since:} \\[4pt]
& 37(-5)+17(12)=-185+204=19. \\[10pt]
\textbf{3. Find the general solution:}
& \text{Let }(a,b) \text{ be any solution and let }(-5,12)\text{ be a particular solution.} \\[4pt]
& \text{Then, } 37a+17b=19=37(-5)+17(12). \\[4pt]
& \therefore\ 37(a+5)+17(b-12)=0. \\[4pt]
& \therefore\ 37(a+5)=-17(b-12). \\[6pt]
\textbf{4. Apply coprimality:}
& \text{Since } \gcd(37,17)=1,\text{ Euclid's Lemma gives }17 \mid(a+5). \\[4pt]
& \text{Thus, }a+5=17k\text{ for some }k \in \mathbb{Z}. \\[4pt]
& \therefore\ a=-5+17k. \\[6pt]
\textbf{5. Solve for }b:
& \text{Substitute }a=-5+17k \text{ into }37(a+5)=-17(b-12): \\[4pt]
& 37(17k)=-17(b-12). \\[4pt]
& \therefore\ 37k=-(b-12). \\[4pt]
& \therefore\ b=12-37k. \\[8pt]
\textbf{6. General solution:}
& \boxed{a=-5+17k,\qquad b=12-37k, \qquad k \in \mathbb{Z}.} \\[8pt]
& \text{Therefore, every integer solution to } 37a+17b=19\text{ is of the form:} \\[4pt]
& \boxed{(a,b)=(-5+17k,\ 12-37k), \qquad k \in \mathbb{Z}.}
\end{array}
Not relative coprimes:
\begin{array}{ll}
\textbf{Example Diophantine Equation Solution:}
& \text{Consider }12a+18b=30,\text{ where }a,b\in\mathbb{Z}. \\[6pt]
\textbf{1. Check relatively coprime:}
& \gcd(12,18)=6. \\[4pt]
& \therefore\ 12 \text{ and }18\text{ are not relatively coprime.} \\[4pt]
& \text{Since } 6 \mid30, \text{ integer solutions exist.} \\[8pt]
\textbf{2. Find a particular solution:}
& \text{Using the Euclidean Algorithm:} \\[4pt]
& 18=1(12)+6, \\[2pt]
& 12=2(6)+0. \\[6pt]
& \text{The final nonzero remainder is }6=18-12 \text{ (rewritten from the above)}. \\[4pt]
& \text{Therefore, }\gcd(12,18)=6=18-12, \\[4pt]
& \text{which back-substitutes the original coefficients }12\text{ and }18 \text{ into gcd}. \\[6pt]
& \text{Multiplying by } 5 \text{ gives: }30=5(18)-5(12). \\[4pt]
& \text{Thus, }(-5,5) \text{ is a particular solution since:} \\[4pt]
& 12(-5)+18(5)=-60+90=30. \\[10pt]
\textbf{3. Reduce by the gcd:}
& \text{Since } \gcd(12,18)=6, \text{ divide the equation by }6: \\[4pt]
& 2a+3b=5. \\[4pt]
& \text{Now } \gcd(2,3)=1, \text{ so }2 \text{ and }3 \text{ are relatively coprime.} \\[8pt]
\textbf{4. Find the general solution:}
& \text{Let }(a,b) \text{ be any solution and let }(-5,5) \text{ be a particular solution.} \\[4pt]
& \text{Then, }12a+18b=30=12(-5)+18(5). \\[4pt]
& \therefore\ 12(a+5)+18(b-5)=0. \\[4pt]
& \therefore\ 12(a+5)=-18(b-5). \\[6pt]
\textbf{5. Factor out the gcd:}
& \text{Since } \gcd(12,18)=6, \text{ divide both sides by }6: \\[4pt]
& 2(a+5)=-3(b-5). \\[6pt]
\textbf{6. Apply coprimality:}
& \text{Since } \gcd(2,3)=1, \text{ Euclid's Lemma gives }3 \mid(a+5). \\[4pt]
& \text{Thus, }a+5=3k \text{ for some }k\in\mathbb{Z}. \\[4pt]
& \therefore\ a=-5+3k. \\[6pt]
\textbf{7. Solve for }b:
& \text{Substitute }a=-5+3k \text{ into }2(a+5)=-3(b-5): \\[4pt]
& 2(3k)=-3(b-5). \\[4pt]
& \therefore\ 2k=-(b-5). \\[4pt]
& \therefore\ b=5-2k. \\[8pt]
\textbf{8. General solution:}
& \boxed{a=-5+3k,\qquad b=5-2k,\qquad k\in\mathbb{Z}.} \\[8pt]
& \text{Therefore, every integer solution to }12a+18b=30\text{ is of the form:} \\[4pt]
& \boxed{(a,b)=(-5+3k,\ 5-2k),\qquad k\in\mathbb{Z}.}
\end{array}
Modular Arithmetic
Modulo Relation
\begin{array}{ll}
\textbf{Definition:} & a \equiv b \pmod{n} \iff n \mid (a-b) \\[6pt]
& \iff \exists\, k\in\mathbb{Z}\text{ such that }a-b=kn
\end{array}
The above is Theorem 26.3 (pp. 163) in the textbook.
\begin{array}{ll}
\textbf{Theorem:} & \text{For any integer } n\geq 2,\text{ the relation } a\equiv b\pmod n\\
& \text{is an equivalence relation.}\\[8pt]
\textbf{Proof:} & \text{(1) Reflexivity: } a-a=0=n(0),\text{ so }a\equiv a\pmod n.\\[6pt]
& \text{(2) Symmetry: If }a\equiv b\pmod n,\text{ then }n\mid(a-b).\\
& \qquad\text{Thus }n\mid -(a-b)=b-a,\text{ so }b\equiv a\pmod n.\\[6pt]
& \text{(3) Transitivity: If }a\equiv b\pmod n\text{ and }b\equiv c\pmod n,\\
& \qquad n\mid(a-b)\text{ and }n\mid(b-c).\\
& \qquad\text{Hence }n\mid[(a-b)+(b-c)]=a-c,\\
& \qquad\text{so }a\equiv c\pmod n.\\[6pt]
& \therefore\ a\equiv b\pmod n\text{ is an equivalence relation.}
\end{array}
\begin{array}{ll}
\textbf{Theorem:} & \text{The congruence } ax\equiv b\pmod m \text{ can be solved for }x\\
& \iff \gcd(a,m) \mid b\\[8pt]
\end{array}
\begin{array}{ll}
\textbf{Observation:} & \text{Writing } ax\equiv b\pmod m \text{ is the same as writing}\\
& ax+(-m)y=b\text{ (the Diaphantine Equation) for some integer }y.\\[8pt]
\textbf{Proof:} & (\Rightarrow)\text{ Suppose }ax\equiv b\pmod m.\\[6pt]
& \qquad\text{Then, }m\mid(ax-b).\\[6pt]
& \qquad\text{Thus, }ax-b=my\text{ for some }y\in\mathbb Z.\\[6pt]
& \qquad\text{Rearranging, we obtain }ax-my=b.\\[6pt]
& \qquad\text{Hence, }ax+(-m)y=b.\\[8pt]
& (\Leftarrow)\text{ Suppose }ax+(-m)y=b\text{ for some }y\in\mathbb Z.\\[6pt]
& \qquad\text{Then, }ax-my=b.\\[6pt]
& \qquad\text{Rearranging, we obtain }ax-b=my.\\[6pt]
& \qquad\text{Therefore }m\mid(ax-b).\\[6pt]
& \qquad\text{Hence, }ax\equiv b\pmod m.\\[8pt]
& \therefore\ ax\equiv b\pmod m\\
& \qquad\iff ax+(-m)y=b\\
& \qquad\text{for some integer }y.
\end{array}
The above is Theorem 26.8 (pp. 165-6) in the textbook.
Exponentiation Example
Helpful exponentiation example reprised from (pp. 165 in) the textbook: