Introductory Algebra and Number Theory
Interactive undergraduate documentation covering Complex Numbers, Theory of Equations, Inequalities, Order Theory, Groups, Rings, Fields, and classical Number Theory. Worked examples, interactive calculators, visual demos, and short puzzles are embedded throughout so you learn by doing.
How to Use This Guide
- Read definitions and theorem statements carefully.
- Interact with the calculators and canvas demos, change inputs and observe results.
- Solve the mini-puzzles (marked with a purple border). Hints and solutions are available.
- Prove the short “Try to prove” challenges; they build the skills needed for exams and further algebra courses.
Math is rendered with MathJax. If equations look broken, wait a second or refresh.
Complex Numbers
A complex number is an expression \( z = a + bi \) where \( a,b \in \mathbb{R} \) and \( i^2 = -1 \). The set of all complex numbers is denoted \( \mathbb{C} \).
- Real part: \( \operatorname{Re}(z) = a \)
- Imaginary part: \( \operatorname{Im}(z) = b \)
- Modulus: \( |z| = \sqrt{a^2 + b^2} \)
- Conjugate: \( \overline{z} = a - bi \)
- Argument: \( \arg(z) = \theta \) such that \( z = |z|(\cos\theta + i\sin\theta) \)
Polar Form
Every non-zero \( z \) can be written \[ z = r(\cos\theta + i\sin\theta) = re^{i\theta} \] where \( r = |z| \) and \( \theta = \arg(z) \) (principal value usually taken in \( (-\pi,\pi] \)).
Convert \( -1 + i\sqrt{3} \) to polar form
\( r = \sqrt{(-1)^2 + (\sqrt{3})^2} = 2 \).
\( \theta = \tan^{-1}\bigl(\frac{\sqrt{3}}{-1}\bigr) \). Since the point is in the second quadrant,
\( \theta = \pi - \frac{\pi}{3} = \frac{2\pi}{3} \).
Thus \( -1 + i\sqrt{3} = 2\bigl(\cos\frac{2\pi}{3} + i\sin\frac{2\pi}{3}\bigr) \).
Interactive Argand Plane
De Moivre’s Theorem
De Moivre’s Theorem (for integer \( n \))
If \( z = r(\cos\theta + i\sin\theta) \), then for any integer \( n \), \[ z^n = r^n\bigl(\cos(n\theta) + i\sin(n\theta)\bigr). \]
For rational indices the statement extends carefully using roots of unity.
Applications
- Finding powers of complex numbers without expanding binomials.
- Extracting \( n \)-th roots: the \( n \) distinct \( n \)-th roots of \( re^{i\theta} \) are \[ \sqrt[n]{r}\Bigl(\cos\frac{\theta+2k\pi}{n} + i\sin\frac{\theta+2k\pi}{n}\Bigr),\quad k=0,1,\dots,n-1. \]
- Expressing \( \cos n\theta \) and \( \sin n\theta \) as polynomials in \( \cos\theta \) and \( \sin\theta \).
Find all cube roots of \( 8i \)
\( 8i = 8\bigl(\cos\frac{\pi}{2} + i\sin\frac{\pi}{2}\bigr) \).
Cube roots: \( 2\Bigl(\cos\frac{\pi/2 + 2k\pi}{3} + i\sin\frac{\pi/2 + 2k\pi}{3}\Bigr) \), \( k=0,1,2 \).
\( k=0 \): \( 2\bigl(\cos\frac{\pi}{6} + i\sin\frac{\pi}{6}\bigr) = \sqrt{3} + i \)
\( k=1 \): \( 2\bigl(\cos\frac{5\pi}{6} + i\sin\frac{5\pi}{6}\bigr) = -\sqrt{3} + i \)
\( k=2 \): \( 2\bigl(\cos\frac{3\pi}{2} + i\sin\frac{3\pi}{2}\bigr) = -2i \)
🧩 Mini-Puzzle: Roots of Unity
The non-real cube roots of unity are the roots of which quadratic equation?
Hint: \( x^3 - 1 = (x-1)(x^2+x+1) \).
Theory of Equations
Every non-constant polynomial with complex coefficients has at least one complex root. Consequently a polynomial of degree \( n \) factors completely into linear factors over \( \mathbb{C} \).
Relation Between Roots and Coefficients
For the monic polynomial \( x^n + a_{n-1}x^{n-1} + \cdots + a_0 = 0 \) with roots \( r_1,\dots,r_n \):
\[ \begin{aligned} \sum r_i &= -a_{n-1},\\ \sum_{i<j} r_i r_j &= a_{n-2},\\ &\vdots\\ r_1 r_2 \cdots r_n &= (-1)^n a_0. \end{aligned} \]These are Vieta’s formulae.
If the roots of \( x^3 - 6x^2 + 11x - 6 = 0 \) are \( \alpha,\beta,\gamma \), find \( \sum\alpha^2 \)
\( \sum\alpha = 6 \), \( \sum\alpha\beta = 11 \), \( \alpha\beta\gamma = 6 \).
\( \sum\alpha^2 = (\sum\alpha)^2 - 2\sum\alpha\beta = 36 - 22 = 14 \).
Transformation of Equations
Common transformations:
- To remove the second term: substitute \( x = y - \frac{a_{n-1}}{n} \).
- To obtain an equation whose roots are the squares of the original roots: replace \( x \) by \( \sqrt{y} \) and rationalize.
- Reciprocal equations: if roots come in reciprocal pairs, a substitution \( z = x + 1/x \) reduces degree.
Descartes’ Rule of Signs & Sturm’s Theorem
The number of positive real roots of a polynomial is equal to the number of sign changes in the sequence of its coefficients, or is less than that number by an even integer. For negative roots apply the rule to \( f(-x) \).
Sturm’s sequence of a polynomial \( f \) allows one to count the exact number of distinct real roots in any interval \( (a,b) \) by evaluating the number of sign variations of the sequence at the endpoints.
🧩 Puzzle: Sign Changes
How many positive real roots can \( x^4 - 3x^3 + 2x^2 + x - 1 = 0 \) have (possible numbers)?
Inequalities: AM ≥ GM ≥ HM & Cauchy–Schwarz
For positive real numbers \( a_1,\dots,a_n \), \[ \frac{a_1+\cdots+a_n}{n} \ge \sqrt[n]{a_1\cdots a_n} \ge \frac{n}{\frac{1}{a_1}+\cdots+\frac{1}{a_n}}, \] with equality if and only if \( a_1 = \cdots = a_n \).
For real sequences \( (a_i) \) and \( (b_i) \), \[ \Bigl(\sum a_i b_i\Bigr)^2 \le \Bigl(\sum a_i^2\Bigr)\Bigl(\sum b_i^2\Bigr). \] Equality holds when the sequences are linearly dependent.
Prove that for positive \( a,b,c \), \( (a+b+c)\bigl(\frac{1}{a}+\frac{1}{b}+\frac{1}{c}\bigr) \ge 9 \).
By Cauchy–Schwarz (or by AM-HM): left side \( \ge 3\cdot 3 = 9 \).
Partial Orders, Total Orders & Lattices
A partial order on a set \( S \) is a binary relation \( \le \) that is reflexive, antisymmetric and transitive. If every pair of elements is comparable, the order is total (linear).
- Partition of a set ↔ equivalence relation (fundamental theorem of equivalence relations).
- Greatest lower bound (glb / meet) and least upper bound (lub / join).
- Maximal / minimal elements need not be maximum / minimum.
A partially ordered set in which every two elements have a meet \( \wedge \) and a join \( \vee \) is a lattice. Special kinds:
- Bounded: has a least element \( 0 \) and greatest element \( 1 \).
- Modular: \( a\le c \implies a\vee(b\wedge c)=(a\vee b)\wedge c \).
- Distributive: meets distribute over joins and vice-versa.
- Complemented: every element has a complement.
If a partially ordered set is such that every chain has an upper bound, then the set contains a maximal element. (Used to prove existence of bases of vector spaces, algebraic closures, etc.)
🧩 Puzzle: Which is a Lattice?
Consider the set of positive integers ordered by divisibility. Is it a lattice?
Semigroups, Monoids & Groups
Semigroup: set with associative binary operation.
Monoid: semigroup with identity.
Group: monoid in which every element has an inverse.
Classic Examples
- \( (\mathbb{Z},+) \), \( (\mathbb{Q}^\times,\cdot) \), \( (\mathbb{R}^\times,\cdot) \)
- Symmetric group \( S_n \) (permutation group)
- Matrix groups: \( M_n(\mathbb{R}) \) (not a group under multiplication), \( \mathrm{GL}_n(\mathbb{R}) \), \( \mathrm{SL}_n(\mathbb{R}) \)
- \( \mathbb{Z}/n\mathbb{Z} \) under addition; \( (\mathbb{Z}/n\mathbb{Z})^\times \) under multiplication
- Identity is unique; inverses are unique.
- Cancellation laws hold.
- Order of an element \( a \): smallest positive integer \( k \) with \( a^k = e \) (or infinite).
- Subgroup criteria: closed under the operation and inverses (or under \( ab^{-1} \)).
Cosets, Normal Subgroups, Center
Left coset of \( H \) by \( a \): \( aH = \{ah : h\in H\} \). Cosets partition the group. A subgroup \( N \) is normal if \( gNg^{-1}=N \) for all \( g \) (equivalently left and right cosets coincide). The center \( Z(G) = \{z : zg=gz\ \forall g\} \) is always normal.
Lagrange’s Theorem & Cyclic Groups
If \( G \) is a finite group and \( H\le G \), then \( |H| \) divides \( |G| \). Consequently the order of every element divides \( |G| \).
Cyclic groups: \( G = \langle a\rangle \) for some \( a \). Finite cyclic groups of the same order are isomorphic. Subgroups of a cyclic group are cyclic; there is exactly one subgroup for each divisor of the order.
List all subgroups of \( \mathbb{Z}/12\mathbb{Z} \)
Divisors of 12: 1,2,3,4,6,12.
Subgroups: \( \{0\} \), \( \langle 6\rangle = \{0,6\} \), \( \langle 4\rangle = \{0,4,8\} \),
\( \langle 3\rangle = \{0,3,6,9\} \), \( \langle 2\rangle = \{0,2,4,6,8,10\} \), whole group.
🧩 Puzzle: Order of an Element
In \( S_3 \), what is the order of the permutation \( (1\ 2\ 3) \)?
Rings, Ideals, Integral Domains & Fields
A ring \( (R,+,\cdot) \) is an abelian group under \( + \), a semigroup under \( \cdot \), and multiplication distributes over addition. (Many texts require a multiplicative identity.)
- Subring: subset closed under the ring operations and containing the additive identity (and usually the multiplicative identity if present).
- Ideal (two-sided): additive subgroup \( I \) such that \( rI\subseteq I \) and \( Ir\subseteq I \) for all \( r\in R \).
- Integral domain: commutative ring with \( 1\neq 0 \) and no zero-divisors.
- Field: commutative ring with \( 1\neq 0 \) in which every non-zero element is a unit.
The characteristic of a ring is the smallest positive integer \( n \) such that \( n\cdot 1 = 0 \), or 0 if no such \( n \) exists. For an integral domain the characteristic is either 0 or prime.
- \( \mathbb{Z} \) — integral domain, not a field; ideals are \( n\mathbb{Z} \).
- \( \mathbb{Z}/n\mathbb{Z} \) — field iff \( n \) is prime.
- \( \mathbb{Q},\mathbb{R},\mathbb{C} \) — fields of characteristic 0.
- \( \mathbb{F}_p = \mathbb{Z}/p\mathbb{Z} \) — field of characteristic \( p \).
- Matrix ring \( M_n(\mathbb{R}) \) — non-commutative, has zero-divisors.
Number Theory Foundations
Every non-empty subset of the natural numbers has a least element.
If \( n \) items are put into \( m \) containers with \( n>m \), at least one container holds more than one item.
For any integers \( a \) and \( b>0 \) there exist unique integers \( q,r \) such that \( a = bq + r \) with \( 0\le r < b \).
GCD, Euclidean Algorithm & LCM
\( \gcd(a,b) \) is the largest positive integer dividing both \( a \) and \( b \). The Euclidean algorithm repeatedly replaces \( (a,b) \) by \( (b,a\bmod b) \) until the remainder is zero; the last non-zero remainder is the gcd. By Bézout’s identity there exist integers \( x,y \) with \( \gcd(a,b) = ax + by \).
\( \operatorname{lcm}(a,b) = \frac{|ab|}{\gcd(a,b)} \).
Linear Diophantine Equations
The equation \( ax + by = c \) has integer solutions if and only if \( \gcd(a,b) \) divides \( c \). If \( (x_0,y_0) \) is a particular solution, the general solution is \[ x = x_0 + \frac{b}{d}t,\quad y = y_0 - \frac{a}{d}t,\quad t\in\mathbb{Z}, \] where \( d = \gcd(a,b) \).
🧩 Puzzle: Frobenius Coin Problem (two coins)
With coins of 4 and 7, what is the largest amount that cannot be obtained?
Formula for coprime a,b: ab−a−b.
Primes, Euclid’s Lemma & Fundamental Theorem of Arithmetic
If a prime \( p \) divides \( ab \), then \( p \) divides \( a \) or \( p \) divides \( b \).
Every integer \( n>1 \) can be written uniquely (up to order) as a product of primes.
An integer is a perfect square iff every exponent in its prime factorization is even. It is square-free iff every exponent is 0 or 1.
Interactive Divisibility Network Graph
Nodes are positive integers up to a chosen limit. An edge from \( a \) to \( b \) means \( a \) divides \( b \) (and \( b/a \) is prime — so this is the Hasse diagram of the divisibility poset restricted to prime steps). Drag nodes to rearrange. Hover to highlight.
Congruences & Chinese Remainder Theorem
\( a\equiv b\pmod{m} \) means \( m \) divides \( a-b \). Congruence is an equivalence relation. Linear congruence \( ax\equiv b\pmod{m} \) is solvable iff \( \gcd(a,m) \) divides \( b \).
If \( m_1,\dots,m_k \) are pairwise coprime, then the system \[ x\equiv a_i\pmod{m_i},\quad i=1,\dots,k \] has a unique solution modulo \( M = m_1\cdots m_k \).
Find the smallest positive integer that leaves remainders 2,3,2 when divided by 3,5,7 respectively.
System: \( x\equiv 2\pmod{3} \), \( x\equiv 3\pmod{5} \), \( x\equiv 2\pmod{7} \).
Note \( x\equiv 2\pmod{3} \) and \( x\equiv 2\pmod{7} \) ⇒ \( x\equiv 2\pmod{21} \). Then solve with the middle congruence.
Modular Arithmetic Circle (Three.js / WebGL)
Residues modulo \( m \) live on a circle. Multiplication by a fixed unit \( a \) is a rotation of the circle (a permutation of the residues). Drag to rotate the view; the animation shows repeated multiplication by \( a \) mod \( m \).
Fermat’s Little Theorem, Wilson’s Theorem & Sum of Two Squares
If \( p \) is prime and \( p\nmid a \), then \( a^{p-1}\equiv 1\pmod{p} \). Equivalently \( a^p\equiv a\pmod{p} \) for all integers \( a \).
\( p \) is prime if and only if \( (p-1)! \equiv -1\pmod{p} \).
A positive integer can be written as a sum of two squares iff in its prime factorization every prime of the form \( 4k+3 \) has even exponent.
Arithmetic Functions: \( \varphi(n),\ d(n),\ \sigma(n) \)
- \( \varphi(n) \) (Euler’s totient) = number of integers in \( \{1,\dots,n\} \) coprime to \( n \).
- \( d(n) \) (or \( \tau(n) \)) = number of positive divisors of \( n \).
- \( \sigma(n) \) = sum of positive divisors of \( n \).
If \( n = p_1^{k_1}\cdots p_r^{k_r} \), then \[ \varphi(n) = n\prod_{i=1}^r\bigl(1-\tfrac{1}{p_i}\bigr),\quad d(n) = \prod(k_i+1),\quad \sigma(n) = \prod\frac{p_i^{k_i+1}-1}{p_i-1}. \]
- \( \sum_{d\mid n}\varphi(d) = n \)
- \( \varphi \) is multiplicative: \( \gcd(m,n)=1\Rightarrow\varphi(mn)=\varphi(m)\varphi(n) \)
- Euler’s theorem: if \( \gcd(a,n)=1 \) then \( a^{\varphi(n)}\equiv 1\pmod{n} \)
Arithmetic Functions — Live Charts (Chart.js)
Plot \( \varphi(n) \), \( d(n) \) and \( \sigma(n) \) for \( n = 1 \dots N \). Watch how irregular yet structured these classical functions are. Use the range slider to explore larger values.
Puzzle & Minigame Hub
Short challenges that reinforce the whole syllabus. Sticky-note style — try them without looking back first.
1. Modular Inverse Hunt
Find the inverse of 7 modulo 26 (i.e. solve \( 7x\equiv 1\pmod{26} \)).
2. Group Order Challenge
What is the order of the element 5 in the multiplicative group \( (\mathbb{Z}/12\mathbb{Z})^\times \)? (Note: first decide whether 5 is even a unit.)
3. CRT Quick Fire
Solve: \( x\equiv 1\pmod{4} \), \( x\equiv 2\pmod{5} \). Smallest positive solution?
4. AM-GM Application
For positive reals with fixed product, when is the sum minimized?
5. Lattice Identity
In a distributive lattice, which identity holds?
6. Prime or Composite?
Is 91 prime?
7. Totient Value
What is \( \varphi(15) \)?