For Undergraduates

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} \).

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] \)).

Worked Example

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

Enter a and b, then click Plot.

De Moivre’s Theorem

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

Solved Problem

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 \)

Interactive \( n \)-th Roots Calculator

🧩 Mini-Puzzle: Roots of Unity

The non-real cube roots of unity are the roots of which quadratic equation?

\( x^2 + x - 1 = 0 \)
\( x^2 + x + 1 = 0 \)
\( x^2 - x + 1 = 0 \)
\( x^2 + 1 = 0 \)

Hint: \( x^3 - 1 = (x-1)(x^2+x+1) \).

Theory of Equations

Fundamental Theorem of Algebra (Statement)

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.

Solved Problem

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:

Interactive Cubic Solver (Cardano sketch + numerical)

Enter coefficients of \( x^3 + ax^2 + bx + c = 0 \)

Descartes’ Rule of Signs & Sturm’s Theorem

Descartes’ Rule of Signs

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) \).

Descartes Sign Counter

Sturm’s Theorem (Statement)

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)?

Only 4
3 or 1
2 or 0
Exactly 2

Inequalities: AM ≥ GM ≥ HM & Cauchy–Schwarz

AM–GM–HM Inequality

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 \).

AM–GM–HM Calculator

Cauchy–Schwarz Inequality

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.

Classic Application

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).

Lattice

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.
Zorn’s Lemma (Statement)

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?

Yes — meet = gcd, join = lcm
No — not every pair has an upper bound
Only a meet-semilattice

Semigroups, Monoids & Groups

Semigroup: set with associative binary operation.
Monoid: semigroup with identity.
Group: monoid in which every element has an inverse.

Classic Examples

Elementary Properties
  • 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.

Interactive Cayley Table Generator (small groups)

Lagrange’s Theorem & Cyclic Groups

Lagrange’s Theorem

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.

Solved Problem

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) \)?

1
2
3
6

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.)

Characteristic

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.

Classic Examples
  • \( \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.

Is it a Field? Quick Checker

Number Theory Foundations

Well-Ordering Principle

Every non-empty subset of the natural numbers has a least element.

Pigeon-Hole Principle

If \( n \) items are put into \( m \) containers with \( n>m \), at least one container holds more than one item.

Division Algorithm

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)} \).

Interactive Euclidean Algorithm

Linear Diophantine Equations

Existence Criterion

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) \).

Diophantine Solver

🧩 Puzzle: Frobenius Coin Problem (two coins)

With coins of 4 and 7, what is the largest amount that cannot be obtained?

11
17
24
13

Formula for coprime a,b: ab−a−b.

Primes, Euclid’s Lemma & Fundamental Theorem of Arithmetic

Euclid’s Lemma

If a prime \( p \) divides \( ab \), then \( p \) divides \( a \) or \( p \) divides \( b \).

Fundamental Theorem of Arithmetic

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.

Prime Factorization & Square-Free Check

Sieve of Eratosthenes Visual (Chart.js + Canvas)

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.

Click a node to see its divisors and multiples.

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 \).

Chinese Remainder Theorem

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 \).

CRT Solver (two moduli)

Classic Application

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

Fermat’s Little Theorem

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 \).

Wilson’s Theorem

\( p \) is prime if and only if \( (p-1)! \equiv -1\pmod{p} \).

Sum of Two Squares (selected facts)

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.

Modular Power & Wilson Check

Arithmetic Functions: \( \varphi(n),\ d(n),\ \sigma(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}. \]

Arithmetic Function Calculator

Useful Identities
  • \( \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.

80

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.)

1
2
4
Not 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?

When all are equal
When one tends to zero
When they form a geometric progression of ratio 2

5. Lattice Identity

In a distributive lattice, which identity holds?

\( a\wedge(b\vee c)=(a\wedge b)\vee(a\wedge c) \)
\( a\wedge(b\vee c)=a\vee(b\wedge c) \)
Only modularity, not distributivity

6. Prime or Composite?

Is 91 prime?

Yes
No — 7 × 13
Yes, by Wilson’s theorem

7. Totient Value

What is \( \varphi(15) \)?

15
10
8
4