Abstract Algebra
Groups, rings, and fields — the structures behind modular arithmetic, polynomials, and modern cryptography. We end with the Discrete Log problem and Diffie–Hellman key exchange.
4.1 Group Axioms
- Closure. $a, b \in G \Rightarrow a*b \in G$.
- Associativity. $(a*b)*c = a*(b*c)$.
- Identity. $\exists e \in G$ such that $e*a = a*e = a$ for all $a$.
- Inverse. $\forall a \in G, \exists a^{-1} \in G$ such that $a*a^{-1}=a^{-1}*a=e$.
The standard checklist
To prove a structure is a group, verify the four axioms in order. To disprove one, exhibit a failure of one axiom.
Example. Is $(\mathbb{Z}, +)$ a group?
- Closure: $a + b \in \mathbb{Z}$. ✓
- Associative: $(a+b)+c = a+(b+c)$. ✓
- Identity: $0$, since $0+a = a$. ✓
- Inverse: $-a$. ✓
Yes, $(\mathbb{Z}, +)$ is a group (and it's abelian).
Example. Is $(\mathbb{Z}, \times)$ a group?
Closure ✓, associative ✓, identity $1$ ✓. Inverses fail: there's no integer $b$ with $2b = 1$. So not a group.
Mini-tricks to verify quickly
- If the operation is "obviously" associative (matrix multiplication, function composition, modular addition/multiplication), don't waste time proving it — just say so.
- The identity is usually $0$ (additive group) or $1$ (multiplicative).
- Finite group, want to check it's a group? Build a Cayley table and ensure each row and column contains every element exactly once (this proves bijectivity, which gives identity + inverses if combined with closure + associativity).
Useful basic facts (proved in lecture, used freely)
- The identity is unique.
- Inverses are unique.
- $(a^{-1})^{-1} = a$.
- $(ab)^{-1} = b^{-1}a^{-1}$ (order swaps!).
- Cancellation: $ab = ac \Rightarrow b = c$; $ba = ca \Rightarrow b = c$.
4.2 Addition Modulo Groups $(\mathbb{Z}_n, +_n)$
$\mathbb{Z}_n = \{0, 1, 2, \ldots, n-1\}$ with addition $\pmod n$ is the canonical example of a finite group.
Example. $\mathbb{Z}_5 = \{0,1,2,3,4\}$.
Identity: $0$. Inverse of $2$: $3$ (since $2+3 \equiv 5 \equiv 0$). Inverse of $1$: $4$.
Cayley table $(+_5)$:
| + | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| 0 | 0 | 1 | 2 | 3 | 4 |
| 1 | 1 | 2 | 3 | 4 | 0 |
| 2 | 2 | 3 | 4 | 0 | 1 |
| 3 | 3 | 4 | 0 | 1 | 2 |
| 4 | 4 | 0 | 1 | 2 | 3 |
$(\mathbb{Z}_n, +_n)$ is always abelian and always a group, for any $n \geq 1$.
4.3 Multiplication Modulo Groups $(\mathbb{Z}_n^*, \times_n)$
$\mathbb{Z}_n^*$ is the set of elements of $\mathbb{Z}_n$ that are coprime to $n$. With multiplication mod $n$, it forms a group.
If $p$ is prime, $\mathbb{Z}_p^* = \{1, 2, \ldots, p-1\}$ and $|\mathbb{Z}_p^*| = p - 1$.
Example. $\mathbb{Z}_5^* = \{1,2,3,4\}$ under $\times_5$.
| × | 1 | 2 | 3 | 4 |
|---|---|---|---|---|
| 1 | 1 | 2 | 3 | 4 |
| 2 | 2 | 4 | 1 | 3 |
| 3 | 3 | 1 | 4 | 2 |
| 4 | 4 | 3 | 2 | 1 |
Identity: $1$. Inverse of $2$: $3$ (since $2\cdot 3 = 6 \equiv 1$). Inverse of $4$: $4$ itself.
Why not $\{1,2,\ldots,n-1\}$ for composite $n$? Take $n = 6$. Then $2 \cdot 3 = 6 \equiv 0$ — closure fails because $0$ is not in $\{1,\ldots,5\}$. Moreover, $2$ has no inverse mod 6 (since $\gcd(2,6) = 2 \neq 1$). $\mathbb{Z}_6^* = \{1, 5\}$ only.
4.4 Other Important Groups
| Name | Set | Operation | Order |
|---|---|---|---|
| $\mathbb{Z}$ | Integers | $+$ | infinite |
| $\mathbb{Q}^*, \mathbb{R}^*, \mathbb{C}^*$ | Nonzero rationals/reals/complex | $\times$ | infinite |
| $D_n$ (dihedral) | Symmetries of regular $n$-gon | composition | $2n$ — non-abelian |
| $S_n$ (symmetric) | Permutations of $\{1,\ldots,n\}$ | composition | $n!$ — non-abelian for $n\geq 3$ |
| $GL_n(\mathbb{R})$ | $n\times n$ invertible matrices | $\times$ | infinite, non-abelian |
| $SL_n(\mathbb{R})$ | determinant-1 matrices | $\times$ | infinite, non-abelian |
| $U(n)$ | $\{a : \gcd(a,n)=1\} = \mathbb{Z}_n^*$ | $\times_n$ | $\varphi(n)$ |
The dihedral group $D_4$ (square symmetries)
$D_4$ has 8 elements: 4 rotations $\{e, r, r^2, r^3\}$ (by $0°, 90°, 180°, 270°$) and 4 reflections. It is non-abelian: rotating then reflecting differs from reflecting then rotating.
4.5 Order of an Element / Order of a Group
The order of an element $a \in G$, denoted $\text{ord}(a)$, is the smallest positive integer $n$ such that $a^n = e$ (for multiplicative groups) or $na = e$ (for additive groups). If no such $n$ exists, $\text{ord}(a) = \infty$.
Example. In $\mathbb{Z}_{12}$ under addition, order of $4$?
$4, 8, 12\equiv 0$. So $\text{ord}(4) = 3$.
General formula: in $\mathbb{Z}_n$, $\text{ord}(a) = n/\gcd(a,n)$.
Example. In $\mathbb{Z}_5^*$, order of $2$?
$2^1=2, 2^2=4, 2^3=8\equiv 3, 2^4=16\equiv 1$. So $\text{ord}(2)=4 = |\mathbb{Z}_5^*|$. Hence $2$ is a generator.
Properties
- $\text{ord}(e) = 1$.
- $\text{ord}(a) = \text{ord}(a^{-1})$.
- If $a^m = e$, then $\text{ord}(a)$ divides $m$. (Key lemma; comes up in many problems.)
- If $\text{ord}(a) = n$, then $a^k = e \iff n \mid k$.
- $\text{ord}(a^k) = n/\gcd(n, k)$ where $n = \text{ord}(a)$.
4.6 Cyclic Groups
Examples
- $\mathbb{Z}$ is cyclic, generated by $1$ (also by $-1$).
- $\mathbb{Z}_n$ is cyclic for every $n$. Generators are the elements coprime to $n$. There are $\varphi(n)$ generators.
- $\mathbb{Z}_p^*$ for prime $p$ is cyclic of order $p - 1$.
- $D_4$ is NOT cyclic (it's non-abelian, but cyclic groups are always abelian).
Key theorems about cyclic groups
- Every cyclic group is abelian. Because $g^a \cdot g^b = g^{a+b} = g^b \cdot g^a$.
- Every subgroup of a cyclic group is cyclic.
- In a cyclic group of order $n$ generated by $g$, the subgroup generated by $g^k$ has order $n/\gcd(n,k)$.
- The generators of $\mathbb{Z}_n$ are exactly $\{k : \gcd(k, n) = 1\}$.
Example. Generators of $\mathbb{Z}_{12}$?
$k$ such that $\gcd(k, 12) = 1$: $k \in \{1, 5, 7, 11\}$. So $4$ generators.
Is $4$ a generator? $\gcd(4,12) = 4 \neq 1$. No — the subgroup generated by $4$ is $\{0,4,8\}$, of order $3$.
Example. Generators of $\mathbb{Z}_{24}$?
$k$ coprime to 24, $1 \leq k \leq 23$: $\{1, 5, 7, 11, 13, 17, 19, 23\}$ — that's $\varphi(24) = 8$ generators.
4.7 Lagrange's Theorem
Two crucial corollaries
Corollary 2. If $|G| = p$ (prime), then $G$ is cyclic and every non-identity element generates $G$.
Proof sketch of Corollary 1: $\langle a \rangle$ is a subgroup with $|\langle a \rangle| = \text{ord}(a)$. By Lagrange, this divides $|G|$.
Application. $|G| = 33$. Possible orders of elements?
Divisors of $33 = 3\cdot 11$ are $\{1, 3, 11, 33\}$. So $\text{ord}(a) \in \{1, 3, 11, 33\}$ for any $a \in G$. Specifically, $\text{ord}(a) = 1$ iff $a = e$.
Application. Group of order 30 — does an element of order 8 exist?
$8 \nmid 30$, so no. Possible orders: $\{1, 2, 3, 5, 6, 10, 15, 30\}$.
Application (Fermat's Little Theorem from Lagrange). If $p$ is prime and $\gcd(a, p) = 1$: $$a^{p-1} \equiv 1 \pmod p.$$ Proof: $|\mathbb{Z}_p^*| = p - 1$. So $\text{ord}(a)$ divides $p-1$, meaning $a^{p-1} = e = 1$. ∎
4.8 Rings
- $(R, +)$ is an abelian group (identity $0$).
- Multiplication is associative: $(ab)c = a(bc)$.
- Distributive laws: $a(b+c) = ab + ac$ and $(b+c)a = ba + ca$.
Standard examples
- $\mathbb{Z}, \mathbb{Q}, \mathbb{R}, \mathbb{C}$ are commutative rings with identity.
- $\mathbb{Z}_n$ for any $n$.
- $M_n(\mathbb{R})$, $n \times n$ real matrices, is a non-commutative ring with identity.
- $R[x]$ — polynomials over a ring $R$ — is a ring.
- $n\mathbb{Z} = \{0, \pm n, \pm 2n, \ldots\}$: ring without identity (for $n \neq 1$).
Units, zero-divisors, integral domains
- A unit is an element $a$ with a multiplicative inverse. The units of $\mathbb{Z}_n$ are $\mathbb{Z}_n^*$.
- A zero divisor is a nonzero $a$ with $ab = 0$ for some nonzero $b$. e.g., $2\cdot 3 = 0$ in $\mathbb{Z}_6$ — both 2 and 3 are zero divisors.
- An integral domain is a commutative ring with identity and no zero divisors.
- A field is a commutative ring with identity where every nonzero element is a unit.
Useful: $(-1)\cdot a = -a$ in any ring with identity
Proof: $0 = 0\cdot a = (1 + (-1))a = a + (-1)a$, so $(-1)a = -a$. ✓
4.9 Polynomial Rings $R[x]$
$R[x]$ is the set of polynomials $a_n x^n + \cdots + a_1 x + a_0$ with coefficients in $R$. Operations are the usual sum and product, with coefficient arithmetic in $R$.
Computing in $\mathbb{Z}_5[x]$.
$(3x^2 + 2x - 4) + (4x^2 + 2)$. Add coefficients mod 5:
- $x^2$: $3+4 = 7 \equiv 2$.
- $x^1$: $2 + 0 = 2$.
- $x^0$: $-4 + 2 = -2 \equiv 3$.
Sum: $2x^2 + 2x + 3$.
Product: $(3x^2 + 2x + 1)(4x^2 + 2)$ (using $-4 \equiv 1$):
$3x^2\cdot 4x^2 = 12x^4 \equiv 2x^4$$3x^2 \cdot 2 = 6x^2 \equiv x^2$
$2x \cdot 4x^2 = 8x^3 \equiv 3x^3$
$2x \cdot 2 = 4x$
$1\cdot 4x^2 = 4x^2$
$1 \cdot 2 = 2$
Sum: $2x^4 + 3x^3 + (1+4)x^2 + 4x + 2 = 2x^4 + 3x^3 + 0 \cdot x^2 + 4x + 2 = 2x^4 + 3x^3 + 4x + 2$.
Listing polynomials in $\mathbb{Z}_2[x]$ of degree $\leq 3$
Coefficients are 0 or 1. We have $a_3, a_2, a_1, a_0 \in \{0,1\}$ — that's $2^4 = 16$ polynomials. Examples: $0, 1, x, x+1, x^2, x^2+1, \ldots, x^3+x^2+x+1$.
Key facts
- If $R$ is a commutative ring with identity, so is $R[x]$.
- If $R$ is an integral domain, so is $R[x]$.
- $R[x]$ is never a field, even when $R$ is — because $x$ is not a unit (no polynomial $q(x)$ satisfies $x \cdot q(x) = 1$, since degrees don't match).
- In $F[x]$ where $F$ is a field, every polynomial of degree $n$ has at most $n$ roots in $F$.
4.10 Fields
Examples and non-examples
- ✓ $\mathbb{Q}, \mathbb{R}, \mathbb{C}$ — classic infinite fields.
- ✓ $\mathbb{Z}_p$ for $p$ prime. (Because every nonzero element is coprime to $p$, so invertible.) These are called $\mathbb{F}_p$.
- ✗ $\mathbb{Z}$ — only $\pm 1$ have inverses, so it's an integral domain but not a field.
- ✗ $\mathbb{Z}_n$ for $n$ composite — has zero divisors. e.g., $\mathbb{Z}_6$: $2\cdot 3 = 0$.
- ✓ $\mathbb{Q}(\sqrt 2) = \{a + b\sqrt 2 : a, b \in \mathbb{Q}\}$ — a field.
- ✗ $\mathbb{Z}[\sqrt 2]$ — not a field (e.g., $\sqrt 2$ has no inverse here).
Finite fields
A finite field has $p^k$ elements for some prime $p$ and $k \geq 1$. The simplest example is $\mathbb{F}_p = \mathbb{Z}_p$. For $p^k$ with $k\geq 2$, you build the field as $\mathbb{F}_p[x]/(f(x))$ where $f$ is an irreducible polynomial of degree $k$.
4.11 Primitive Elements (Generators of $\mathbb{Z}_p^*$)
How to test primitivity
To check if $g$ is a primitive root mod $p$:
- Factor $p - 1 = q_1^{a_1} q_2^{a_2} \cdots q_k^{a_k}$.
- For each prime factor $q_i$, compute $g^{(p-1)/q_i} \pmod p$.
- If any of these equals $1$, $g$ is NOT primitive. Otherwise, $g$ IS primitive.
Example. Test $g = 2$ in $\mathbb{Z}_{13}^*$.
$p - 1 = 12 = 2^2 \cdot 3$. Prime factors: $\{2, 3\}$.
$2^{12/2} = 2^6 = 64 = 4\cdot 13 + 12 \equiv 12 \pmod{13}$. Not $1$. ✓
$2^{12/3} = 2^4 = 16 \equiv 3 \pmod{13}$. Not $1$. ✓
So $2$ is a primitive root mod 13. ✓
Compute all powers of 2 mod 13:
| $n$ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| $2^n \pmod{13}$ | 2 | 4 | 8 | 3 | 6 | 12 | 11 | 9 | 5 | 10 | 7 | 1 |
All 12 distinct nonzero residues appear → 2 is primitive.
Test $g = 3$ in $\mathbb{Z}_{13}^*$.
$3^{6} \pmod{13}$: $3^2 = 9$, $3^4 = 81 \equiv 81 - 6\cdot 13 = 3$, $3^6 = 3^4 \cdot 3^2 = 3 \cdot 9 = 27 \equiv 1$. So $3^6 \equiv 1$ — fails. $3$ is NOT a primitive root mod 13.
4.12 Cryptography: Discrete Log & Diffie–Hellman
The Discrete Logarithm Problem (DLP)
For small $p$ this is easy by exhaustive search. For $p$ a 2048-bit prime, this is currently infeasible — no known polynomial-time algorithm. This asymmetry (easy to exponentiate, hard to invert) is what cryptography relies on.
Diffie–Hellman Key Exchange
Allows Alice and Bob to establish a shared secret over an insecure channel.
- Public agreement. Both agree on a prime $p$ and a primitive root $g$. These are public.
- Alice picks a private $a$, sends Bob $A = g^a \bmod p$.
- Bob picks a private $b$, sends Alice $B = g^b \bmod p$.
- Alice computes $K = B^a \bmod p$.
- Bob computes $K = A^b \bmod p$.
- Both have $K = g^{ab} \bmod p$ as their shared secret.
Example. $p = 13, g = 2$. Alice picks $a = 4$, Bob picks $b = 3$.
- $A = 2^4 \bmod 13 = 16 \bmod 13 = 3$.
- $B = 2^3 \bmod 13 = 8$.
- Alice: $K = B^a \bmod 13 = 8^4 \bmod 13$. $8^2 = 64 \equiv 12$, $8^4 = 12^2 = 144 \equiv 1 \cdot 144 - 11 \cdot 13 = 144 - 143 = 1$. So $K = 1$.
- Bob: $K = A^b \bmod 13 = 3^3 = 27 \equiv 1$. ✓ Match.
(Aside: $K = 1$ here is a degenerate but valid outcome. In practice $a, b$ are huge random numbers and $K$ is far from special.)
Eve's challenge
An eavesdropper Eve sees $p, g, A, B$. To recover $K$, she needs $a$ (or $b$) — but extracting $a$ from $A = g^a$ is the discrete log problem. For 2048-bit $p$, infeasible.
Cracking small DH. $p = 13, g = 2$, public keys $A = 3, B = 8$.
Eve solves $2^a \equiv 3 \pmod{13}$. From the powers-of-2 table above, $2^4 = 3$, so $a = 4$.
Shared key: $K = B^a = 8^4 \equiv 1 \pmod{13}$.
Modular arithmetic playground
Enter any modulus $n$ (2–100) and see Euler's totient, units, generators, element orders, and primitive roots — all computed instantly.
For prime $n$, primitive roots are listed. For composite $n$, you'll see the units and their orders.
Interactive — Cayley table generator
Pick a group; see its full Cayley table and the order of each element. Hover any cell to highlight its row, column, and the result.
Interactive — Diffie–Hellman walkthrough
Pick a small prime $p$, primitive root $g$, and the private keys $a$ and $b$. Step through the protocol and see what Alice, Bob, and Eve each know at every stage.
Problem Bank — Abstract Algebra
Drawn from DPP 9–13, algebra worksheets, and the midsem paper. Try each on paper first; reveal the solution to check your reasoning.
Define $a * b = a + b - 1$ on $\mathbb{Z}$. Show $(\mathbb{Z}, *)$ is a group.
Goal: Verify that the algebraic structure $(\mathbb{Z}, *)$ satisfies all four group axioms.
Proof:
- Closure: For any integers $a, b \in \mathbb{Z}$, the expression $a+b-1$ is also an integer because $\mathbb{Z}$ is closed under addition and subtraction. Thus, $a*b \in \mathbb{Z}$.
- Associativity: We must show $(a*b)*c = a*(b*c)$ for all $a, b, c \in \mathbb{Z}$. $$\text{LHS: } (a*b)*c = (a+b-1)*c = (a+b-1)+c-1 = a+b+c-2$$ $$\text{RHS: } a*(b*c) = a*(b+c-1) = a+(b+c-1)-1 = a+b+c-2$$ Since LHS $=$ RHS, the operation is associative.
- Identity Element: We seek an element $e \in \mathbb{Z}$ such that $a*e = a$ for all $a \in \mathbb{Z}$. $$a*e = a \iff a + e - 1 = a \implies e - 1 = 0 \implies e = 1$$ Check: $1*a = 1 + a - 1 = a$. So $e=1$ is the unique identity element.
- Inverse Element: For any $a \in \mathbb{Z}$, we seek an element $a' \in \mathbb{Z}$ such that $a*a' = e = 1$. $$a*a' = 1 \iff a + a' - 1 = 1 \implies a' = 2 - a$$ Since $a \in \mathbb{Z}$, $2-a$ is also an integer. Check: $a * (2-a) = a + (2-a) - 1 = 1$. Thus, every element has a valid inverse $a^{-1} = 2-a$.
Since all four axioms hold, $(\mathbb{Z}, *)$ is a group. ∎
$|G| = 33$. What are possible orders of elements?
Goal: Find the possible orders of elements in a group $G$ of order 33.
Step-by-Step Analysis:
- Lagrange's Theorem Constraint: By Lagrange's Theorem (Corollary 1), the order of any element $a$ in a finite group $G$ must divide the order of the group $|G|$. $$\text{ord}(a) \mid |G|$$
- Find divisors: The order of the group is $|G| = 33$. The prime factorization of 33 is $3 \cdot 11$. The positive divisors of 33 are: $$\{1, 3, 11, 33\}$$
Conclusion: The only possible orders of elements in $G$ are 1, 3, 11, and 33. (Note: Only the identity element $e$ has order 1). ∎
(a) Verify $G = \{1, -1, i, -i\}$ is a group under complex multiplication. (b) Order of each element. (c) Is $G$ cyclic? Find generators.
Goal: Verify the group axioms, compute element orders, and determine if the group of fourth roots of unity is cyclic.
Solution:
- (a) Group Verification:
We construct the Cayley table for complex multiplication over $G$:
× 1 −1 $i$ $-i$ 1 1 −1 $i$ $-i$ −1 −1 1 $-i$ $i$ $i$ $i$ $-i$ $-1$ $1$ $-i$ $-i$ $i$ $1$ $-1$ - Closure: No entries in the table lie outside $G$.
- Associativity: Multiplicative associativity is inherited from $\mathbb{C}^*$.
- Identity: The table shows $1$ acts as the identity element ($1 \cdot z = z$).
- Inverses: Every row contains $1$. Thus, inverses exist: $1^{-1}=1$, $(-1)^{-1}=-1$, $i^{-1}=-i$, and $(-i)^{-1}=i$.
- (b) Element Orders:
The order $\text{ord}(z)$ is the smallest $k \geq 1$ such that $z^k = 1$.
- $\text{ord}(1) = 1$
- $(-1)^1 = -1, (-1)^2 = 1 \implies \text{ord}(-1) = 2$
- $i^1 = i, i^2 = -1, i^3 = -i, i^4 = 1 \implies \text{ord}(i) = 4$
- $(-i)^1 = -i, (-i)^2 = -1, (-i)^3 = i, (-i)^4 = 1 \implies \text{ord}(-i) = 4$
- (c) Cyclic check: A group is cyclic if it has an element of order equal to the group order $|G| = 4$. Since $\text{ord}(i) = 4$, $G$ is cyclic. The generators are the elements of order 4, which are $i$ and $-i$. ∎
Show that $\{1,2,3,4,5\}$ under multiplication mod 6 is NOT a group.
Goal: Prove that the set $S = \{1, 2, 3, 4, 5\}$ does not form a group under multiplication modulo 6.
Proof of Failure:
- Check Closure: Let $a = 2$ and $b = 3$. Both are elements of $S$. Compute their product modulo 6: $$2 \times_6 3 = 6 \equiv 0 \pmod 6$$ Since $0 \notin S$, the set is not closed under the operation.
- Check Inverses:
Let $a = 2$. For $2$ to have an inverse, there must exist $x \in S$ such that $2 \cdot x \equiv 1 \pmod 6$.
We test all elements of $S$:
- $2 \cdot 1 \equiv 2$
- $2 \cdot 2 \equiv 4$
- $2 \cdot 3 \equiv 0$
- $2 \cdot 4 \equiv 2$
- $2 \cdot 5 \equiv 4$
Conclusion: Since closure and the existence of inverses both fail, the structure is not a group. ∎
Construct the Cayley table for $U(10) = \mathbb{Z}_{10}^*$ and identify the order of each element.
Goal: Construct the multiplication modulo 10 table for the group of units $U(10)$ and find the order of all elements.
Solution:
- Identify Elements: $U(10)$ consists of all elements in $\mathbb{Z}_{10}$ coprime to 10. $$U(10) = \{1, 3, 7, 9\}$$
- Construct Cayley Table:
× 1 3 7 9 1 1 3 7 9 3 3 9 1 7 7 7 1 9 3 9 9 7 3 1 - Determine Orders:
- $\text{ord}(1) = 1$
- $3^1=3, 3^2=9, 3^3=7, 3^4=1 \implies \text{ord}(3) = 4$
- $7^1=7, 7^2=9, 7^3=3, 7^4=1 \implies \text{ord}(7) = 4$
- $9^1=9, 9^2=1 \implies \text{ord}(9) = 2$
Conclusion: $U(10)$ is a cyclic group of order 4, generated by 3 or 7. ∎
$\sigma_1(\spadesuit)=\diamondsuit, \sigma_1(\heartsuit)=\heartsuit, \sigma_1(\diamondsuit)=\spadesuit$ and $\sigma_2(\spadesuit)=\heartsuit, \sigma_2(\heartsuit)=\spadesuit, \sigma_2(\diamondsuit)=\diamondsuit$. Compute $\sigma_2\circ\sigma_1$ and $\sigma_1\circ\sigma_2$. Are they equal?
Goal: Evaluate the composition of two permutations in both directions and check for commutativity.
Step-by-Step Composition:
- Evaluate $\sigma_2 \circ \sigma_1$ (evaluate right-to-left: first $\sigma_1$, then $\sigma_2$):
- $(\sigma_2 \circ \sigma_1)(\spadesuit) = \sigma_2(\sigma_1(\spadesuit)) = \sigma_2(\diamondsuit) = \diamondsuit$
- $(\sigma_2 \circ \sigma_1)(\heartsuit) = \sigma_2(\sigma_1(\heartsuit)) = \sigma_2(\heartsuit) = \spadesuit$
- $(\sigma_2 \circ \sigma_1)(\diamondsuit) = \sigma_2(\sigma_1(\diamondsuit)) = \sigma_2(\spadesuit) = \heartsuit$
- Evaluate $\sigma_1 \circ \sigma_2$:
- $(\sigma_1 \circ \sigma_2)(\spadesuit) = \sigma_1(\sigma_2(\spadesuit)) = \sigma_1(\heartsuit) = \heartsuit$
- $(\sigma_1 \circ \sigma_2)(\heartsuit) = \sigma_1(\sigma_2(\heartsuit)) = \sigma_1(\spadesuit) = \diamondsuit$
- $(\sigma_1 \circ \sigma_2)(\diamondsuit) = \sigma_1(\sigma_2(\diamondsuit)) = \sigma_1(\diamondsuit) = \spadesuit$
Conclusion: Comparing outputs on $\spadesuit$: $(\sigma_2 \circ \sigma_1)(\spadesuit) = \diamondsuit$ but $(\sigma_1 \circ \sigma_2)(\spadesuit) = \heartsuit$. Since they differ, the compositions are not equal ($\sigma_2 \circ \sigma_1 \neq \sigma_1 \circ \sigma_2$). This confirms that the symmetric group $S_3$ is non-abelian. ∎
Find all generators of $\mathbb{Z}_{24}$ under addition.
Goal: Identify all generating elements of the additive cyclic group $\mathbb{Z}_{24}$.
Step-by-Step Analysis:
- Apply Generator Theorem: In any additive cyclic group $(\mathbb{Z}_n, +_n)$, an element $k$ is a generator if and only if $k$ is coprime to $n$: $$\gcd(k, n) = 1$$
- Identify coprime numbers for $n=24$: The prime factorization of 24 is $2^3 \cdot 3$. Thus, we must find all integers $k$ in the range $1 \leq k < 24$ that are not divisible by 2 or 3. Applying Euler's totient function, the total number of generators is: $$\varphi(24) = 24 \cdot \left(1 - \frac{1}{2}\right) \cdot \left(1 - \frac{1}{3}\right) = 24 \cdot \frac{1}{2} \cdot \frac{2}{3} = 8$$
- List the elements: The 8 coprime integers are: $$\{1, 5, 7, 11, 13, 17, 19, 23\}$$
Conclusion: The generators of $\mathbb{Z}_{24}$ are 1, 5, 7, 11, 13, 17, 19, and 23. ∎
$|G| = 33$. $x \neq e$ and $x^{11} \neq e$. Possible orders of $x$? Justify.
Goal: Find the possible orders of element $x$ given the constraints on its powers.
Step-by-Step Analysis:
- Apply Lagrange's Corollary: The order $\text{ord}(x)$ of any element must divide the group order $|G| = 33$. $$\text{ord}(x) \in \{1, 3, 11, 33\}$$
- Eliminate based on constraints:
- Constraint 1: $x \neq e \implies \text{ord}(x) \neq 1$.
- Constraint 2: $x^{11} \neq e$. Recall that $a^m = e \iff \text{ord}(a) \mid m$. If the order of $x$ were 11, then $x^{11} = e$ would hold. Since it does not, the order of $x$ cannot be 11 (nor can it be 1). $$\text{ord}(x) \notin \{1, 11\}$$
Conclusion: The only remaining possible orders for $x$ are 3 and 33. ∎
Prove every cyclic group is abelian.
Goal: Prove that any cyclic group $G$ is commutative (abelian) under its binary operation.
Proof:
- Let $G$ be a cyclic group. By definition, there exists a generator $g \in G$ such that every element in $G$ can be expressed as a power of $g$. $$G = \langle g \rangle = \{g^k : k \in \mathbb{Z}\}$$
- Choose any two arbitrary elements $x, y \in G$. Since $g$ generates $G$, there must exist integers $a$ and $b$ such that: $$x = g^a \quad \text{and} \quad y = g^b$$
- Evaluate the group operation $x \cdot y$: $$x \cdot y = g^a \cdot g^b$$ By laws of exponents (since $a,b$ commute under integer addition): $$= g^{a+b} = g^{b+a} = g^b \cdot g^a = y \cdot x$$
- Since $x \cdot y = y \cdot x$ for all $x,y \in G$, the group is abelian. ∎
$D_5$ has order 10. What's the maximum element order? Is $D_5$ cyclic?
Goal: Find the maximum order of elements in the Dihedral group $D_5$ and determine if it is cyclic.
Step-by-Step Analysis:
- Analyze elements of $D_5$:
The group $D_5$ represents the symmetries of a regular pentagon. It contains 10 elements:
- 5 rotations: $\{e, r, r^2, r^3, r^4\}$. Since $\text{ord}(r) = 5$, the orders of these rotations are: $\text{ord}(e)=1$, $\text{ord}(r)=5$, $\text{ord}(r^2)=5$, $\text{ord}(r^3)=5$, $\text{ord}(r^4)=5$.
- 5 reflections: $\{s, sr, sr^2, sr^3, sr^4\}$. Every reflection in a dihedral group has order 2 because reflecting twice returns the shape to its original state: $s^2 = e$.
- Identify Maximum Order: The element orders present are $\{1, 2, 5\}$. Thus, the maximum element order is 5.
- Determine if Cyclic: For $D_5$ to be cyclic, it would require a generator of order equal to the group order $|D_5| = 10$. Since the maximum element order is 5, no element of order 10 exists. Thus, $D_5$ is not cyclic. (Alternative proof: Cyclic groups are always abelian, but $D_5$ is non-abelian (e.g. $sr \neq rs$), hence not cyclic). ∎
If $\text{ord}(a) = n$ and $a^m = e$, prove $n \mid m$.
Goal: Prove that if $a^m = e$ for a group element $a$ of order $n$, then $n$ must divide $m$.
Proof (using the division algorithm):
- By the Division Algorithm, we can write the integer $m$ as: $$m = qn + r \quad \text{where } q, r \in \mathbb{Z} \text{ and } 0 \leq r < n.$$
- Substitute this expression into the equation $a^m = e$: $$a^{qn + r} = e$$ $$(a^n)^q \cdot a^r = e$$
- Since $\text{ord}(a) = n$, we know $a^n = e$. Substituting this: $$(e)^q \cdot a^r = e \implies e \cdot a^r = e \implies a^r = e$$
- We now have $a^r = e$ with $0 \leq r < n$. By definition, the order $n$ is the *smallest positive* integer such that $a^n = e$. If $r$ were positive ($r > 0$), it would contradict $n$ being the smallest positive power since $r < n$. Therefore, the remainder $r$ must be exactly $0$.
- Since $r = 0$, we have $m = qn$, which proves that $n$ divides $m$ ($n \mid m$). ∎
In $\mathbb{Z}_{30}$, find $\text{ord}(21)$. List all other elements with the same order.
Goal: Find the additive order of 21 in $\mathbb{Z}_{30}$ and identify all other elements sharing this order.
Step-by-Step Calculation:
- Calculate $\text{ord}(21)$: In any additive group $\mathbb{Z}_n$, the order of an element $a$ is: $$\text{ord}(a) = \frac{n}{\gcd(a, n)}$$ Here $n = 30$ and $a = 21$. Find the greatest common divisor: $$\gcd(21, 30) = 3$$ Compute the order: $$\text{ord}(21) = \frac{30}{3} = 10$$
- Find other elements of order 10:
An element $x \in \mathbb{Z}_{30}$ has order 10 if and only if:
$$\frac{30}{\gcd(x, 30)} = 10 \iff \gcd(x, 30) = 3$$
We must find all elements in $\{0, \dots, 29\}$ that are multiples of 3 but not multiples of 2 or 5 (to avoid $\gcd$ being 6, 15, or 30).
- Multiples of 3: $\{0, 3, 6, 9, 12, 15, 18, 21, 24, 27\}$
- Remove multiples of 2 (even numbers): $\{3, 9, 15, 21, 27\}$
- Remove multiples of 5: $\{3, 9, 21, 27\}$
Conclusion: $\text{ord}(21) = 10$, and the other elements with order 10 are 3, 9, and 27. ∎
A ring $R$ is Boolean if $a^2 = a$ for all $a$. Show every Boolean ring is commutative.
Goal: Prove that if $a^2 = a$ for all elements in a ring $R$, then $ab = ba$ for all $a, b \in R$.
Proof:
- Part 1: Prove that $2x = 0$ (so $x = -x$) for all $x \in R$. For any element $x$, apply the Boolean property to $x+x$: $$(x+x)^2 = x+x$$ Expand the LHS using the distributive laws: $$(x+x)^2 = (x+x)(x+x) = x^2 + x^2 + x^2 + x^2$$ Substitute $x^2 = x$: $$x + x + x + x = x + x \implies 2x = 0 \implies x = -x$$
- Part 2: Expand $(a+b)^2$: For any $a, b \in R$, apply the Boolean property to $a+b$: $$(a+b)^2 = a+b$$ Expand the LHS: $$(a+b)(a+b) = a^2 + ab + ba + b^2 = a+b$$ Substitute $a^2 = a$ and $b^2 = b$: $$a + ab + ba + b = a + b$$ Subtract $a+b$ from both sides: $$ab + ba = 0 \implies ab = -ba$$
- Part 3: Substitute $-ba = ba$ (from Part 1): $$ab = ba$$
Since $ab = ba$ for all $a, b \in R$, the ring is commutative. ∎
Show that $\{a + ib\sqrt 2 : a, b \in \mathbb{Z}\}$ is a ring. Find the units.
Goal: Verify the ring properties for the set $R = \{a + ib\sqrt{2} : a, b \in \mathbb{Z}\}$ and find all units (invertible elements).
Solution:
- Ring Verification:
We can show $R$ is a subring of $\mathbb{C}$. Since $\mathbb{C}$ is a ring, we only need to verify closure under subtraction and multiplication:
- Subtraction: $(a_1 + ib_1\sqrt{2}) - (a_2 + ib_2\sqrt{2}) = (a_1-a_2) + i(b_1-b_2)\sqrt{2} \in R$.
- Multiplication: $$(a_1 + ib_1\sqrt{2})(a_2 + ib_2\sqrt{2}) = a_1a_2 - 2b_1b_2 + i(a_1b_2 + b_1a_2)\sqrt{2}$$ Since the coefficients are integers, the product lies in $R$.
- Finding Units:
Define the norm function $N(a + ib\sqrt{2}) = a^2 + 2b^2$. The norm is multiplicative: $N(zw) = N(z)N(w)$ for any $z, w \in R$.
If $u = a + ib\sqrt{2}$ is a unit, there exists $v \in R$ such that $uv = 1$.
$$N(uv) = N(u)N(v) = N(1) = 1^2 + 2(0)^2 = 1$$
Since $N(u), N(v)$ are non-negative integers, we must have:
$$a^2 + 2b^2 = 1 \quad \text{where } a,b \in \mathbb{Z}$$
- If $b \neq 0$, then $2b^2 \geq 2 \implies a^2 + 2b^2 \geq 2$ (no solution).
- Thus $b = 0$, leaving $a^2 = 1 \implies a = \pm 1$.
Conclusion: The units of the ring are $1$ and $-1$. ∎
Show $(-1)a = -a$ in any ring with identity.
Goal: Prove that multiplying any element $a$ in a ring $R$ by the additive inverse of identity $-1$ yields the additive inverse $-a$.
Proof:
- We evaluate the expression $a + (-1)a$: $$a + (-1)a = 1 \cdot a + (-1) \cdot a \quad \text{[by Multiplicative Identity]}$$ $$= (1 + (-1)) \cdot a \quad \text{[by Distributive Law]}$$
- By definition of the additive inverse, $1 + (-1) = 0$: $$= 0 \cdot a$$
- Recall the theorem that $0 \cdot x = 0$ for any ring element: $$0 \cdot a = 0 \implies a + (-1)a = 0$$
- By uniqueness of the additive inverse in the group $(R, +)$, since $a + (-1)a = 0$, we must have: $$(-1)a = -a \quad \text{∎}$$
Compute $(3x^2+2x-4)(4x^2+2)$ in $\mathbb{Z}_5[x]$.
Goal: Find the product of the polynomials $(3x^2+2x-4)$ and $(4x^2+2)$, performing all coefficient arithmetic modulo 5.
Step-by-Step Multiplication:
- Reduce coefficients modulo 5: $-4 \equiv 1 \pmod 5$. The expression simplifies to: $$(3x^2+2x+1)(4x^2+2)$$
- Distribute terms: $$= 3x^2(4x^2+2) + 2x(4x^2+2) + 1(4x^2+2)$$ $$= (12x^4 + 6x^2) + (8x^3 + 4x) + (4x^2 + 2)$$
- Combine terms with identical powers: $$= 12x^4 + 8x^3 + (6+4)x^2 + 4x + 2$$ $$= 12x^4 + 8x^3 + 10x^2 + 4x + 2$$
- Reduce final coefficients modulo 5:
- $12 \equiv 2 \pmod 5$
- $8 \equiv 3 \pmod 5$
- $10 \equiv 0 \pmod 5$
- $4 \equiv 4 \pmod 5$
- $2 \equiv 2 \pmod 5$
Conclusion: The product polynomial in $\mathbb{Z}_5[x]$ is: $$2x^4 + 3x^3 + 4x + 2$$ ∎
List all units in: (a) $\mathbb{Z}_{10}$, (b) $\mathbb{Z}_{12}$, (c) $\mathbb{Z}_7$.
Goal: Identify the set of elements in each ring that have a multiplicative inverse.
Analysis: An element $k \in \mathbb{Z}_n$ is a unit if and only if $\gcd(k, n) = 1$.
- (a) Units of $\mathbb{Z}_{10}$: Find all $k \in \{1, \dots, 9\}$ coprime to 10. $$\gcd(k, 10) = 1 \implies \mathbf{\{1, 3, 7, 9\}}$$
- (b) Units of $\mathbb{Z}_{12}$: Find all $k \in \{1, \dots, 11\}$ coprime to 12. $$\gcd(k, 12) = 1 \implies \mathbf{\{1, 5, 7, 11\}}$$
- (c) Units of $\mathbb{Z}_7$: Since 7 is a prime number, every nonzero element is coprime to 7. $$\gcd(k, 7) = 1 \implies \mathbf{\{1, 2, 3, 4, 5, 6\}}$$ ∎
Find $5^{-1}$ in $\mathbb{Z}_6$ if it exists. Find a non-unit. Is $\mathbb{Z}_6$ a field?
Goal: Find the multiplicative inverse of 5, identify a non-unit, and evaluate whether $\mathbb{Z}_6$ is a field.
Step-by-Step Analysis:
- Find $5^{-1} \pmod 6$: We seek $x \in \{1, \dots, 5\}$ such that $5x \equiv 1 \pmod 6$. $$5 \cdot 5 = 25 \equiv 1 \pmod 6 \implies 5^{-1} = 5$$
- Find a non-unit: An element $k \neq 0$ is a non-unit if $\gcd(k, 6) \neq 1$. For $k = 2$, $\gcd(2, 6) = 2 \neq 1$. Therefore, 2 has no inverse.
- Determine if $\mathbb{Z}_6$ is a field: By definition, a field is a commutative ring with identity where *every* nonzero element has a multiplicative inverse. Since $2 \in \mathbb{Z}_6$ is nonzero but has no inverse, $\mathbb{Z}_6$ is not a field.
(GATE-2024) Find $|GL_2(\mathbb{F}_3)|$, the number of invertible $2\times 2$ matrices over $\mathbb{F}_3$.
Goal: Calculate the order of the general linear group of $2 \times 2$ matrices over the field $\mathbb{F}_3 = \mathbb{Z}_3$.
Step-by-Step Calculation:
- An invertible matrix must have linearly independent rows. We choose the rows sequentially:
- Row 1 ($v_1$): Can be any nonzero vector in $\mathbb{F}_3^2$. The total number of vectors in $\mathbb{F}_3^2$ is $3^2 = 9$. $$\text{Choices for } v_1 = 9 - 1 = 8$$
- Row 2 ($v_2$): Must be linearly independent of $v_1$. This means $v_2$ cannot be a scalar multiple of $v_1$. The scalar multiples of $v_1$ in $\mathbb{F}_3$ are $c \cdot v_1$ for $c \in \{0, 1, 2\}$, which gives 3 vectors. $$\text{Choices for } v_2 = 9 - 3 = 6$$
- Multiply choices to find total matrices: $$|GL_2(\mathbb{F}_3)| = 8 \cdot 6 = 48$$
Conclusion: there are 48 invertible $2\times 2$ matrices over $\mathbb{F}_3$. ∎
Prove $1 + 2x$ is a unit in $\mathbb{Z}_4[x]$.
Goal: Find a polynomial $q(x) \in \mathbb{Z}_4[x]$ such that $(1+2x)q(x) \equiv 1 \pmod 4$.
Proof:
- Consider the algebraic identity for difference of squares: $$(1+2x)(1-2x) = 1 - 4x^2$$
- Perform arithmetic modulo 4: Since $4 \equiv 0 \pmod 4$, the term $4x^2$ becomes 0: $$1 - 4x^2 \equiv 1 - 0x^2 \equiv 1 \pmod 4$$
- Thus, $(1+2x)(1-2x) = 1$. In $\mathbb{Z}_4$, $-2 \equiv 2$, so $1 - 2x = 1 + 2x$. The polynomial is its own inverse: $(1+2x)^2 = 1 + 4x + 4x^2 \equiv 1 \pmod 4$. Since an inverse exists, $1+2x$ is a unit. ∎
Is $g=2$ a primitive root in $\mathbb{Z}_{13}^*$? Compute $2^n \bmod 13$ for $n=1,\ldots,12$.
Goal: Compute the modular powers of 2 modulo 13 and check if 2 is a generator of $\mathbb{Z}_{13}^*$.
Step-by-Step Calculation:
- Compute powers:
- $2^1 \equiv 2$
- $2^2 \equiv 4$
- $2^3 \equiv 8$
- $2^4 = 16 \equiv 3$
- $2^5 = 2^4 \cdot 2 \equiv 3 \cdot 2 = 6$
- $2^6 = 2^5 \cdot 2 \equiv 6 \cdot 2 = 12$
- $2^7 = 2^6 \cdot 2 \equiv 12 \cdot 2 = 24 \equiv 11$
- $2^8 = 2^7 \cdot 2 \equiv 11 \cdot 2 = 22 \equiv 9$
- $2^9 = 2^8 \cdot 2 \equiv 9 \cdot 2 = 18 \equiv 5$
- $2^{10} = 2^9 \cdot 2 \equiv 5 \cdot 2 = 10$
- $2^{11} = 2^{10} \cdot 2 \equiv 10 \cdot 2 = 20 \equiv 7$
- $2^{12} = 2^{11} \cdot 2 \equiv 7 \cdot 2 = 14 \equiv 1$
- Check if the set of powers matches $\mathbb{Z}_{13}^*$: The set of generated values is $\{2, 4, 8, 3, 6, 12, 11, 9, 5, 10, 7, 1\}$. Since this contains all 12 elements of $\mathbb{Z}_{13}^*$ ($|\mathbb{Z}_{13}^*| = 12$), the order of 2 is 12.
Conclusion: Since $\text{ord}(2) = 12 = |\mathbb{Z}_{13}^*|$, 2 is a primitive root mod 13. ∎
$p=13, g=2$. Alice picks $a=4$, Bob picks $b=3$. Compute $A, B$, and the shared key.
Goal: Perform the step-by-step calculations for the Diffie–Hellman key exchange protocol with the given parameters.
Step-by-Step Calculation:
- Alice computes her public key $A$: $$A = g^a \bmod p = 2^4 \bmod 13 = 16 \bmod 13 = 3$$
- Bob computes his public key $B$: $$B = g^b \bmod p = 2^3 \bmod 13 = 8$$
- Alice computes the shared key $K$: $$K = B^a \bmod p = 8^4 \bmod 13$$ Compute $8^2 = 64 \equiv 12 \equiv -1 \pmod{13}$. $$8^4 \equiv (-1)^2 \equiv 1 \pmod{13} \implies K = 1$$
- Bob computes the shared key $K$: $$K = A^b \bmod p = 3^3 \bmod 13 = 27 \bmod 13 = 1$$
Conclusion: Alice sends $A=3$, Bob sends $B=8$, and both compute the identical shared key $K=1$. ∎
Eve sees $p=13, g=2, A=3, B=8$. Find $a$ and the shared key $K$. Why isn't this practical for 2048-bit $p$?
Goal: Crack the DH parameters by solving the Discrete Logarithm Problem and explain the security limitations on large primes.
Solution:
- Solve for Alice's private key $a$: Eve knows $g^a \equiv A \pmod p \implies 2^a \equiv 3 \pmod{13}$. From the powers-of-2 table calculated previously: $$2^4 \equiv 3 \implies a = 4$$
- Calculate Shared Key: $$K = B^a \bmod p = 8^4 \bmod 13 \equiv 1 \pmod{13}$$
- Security for 2048-bit prime: For $p \approx 2^{2048}$, the group size is $\sim 10^{616}$. To find $a$ given $g^a \bmod p$, there is no known polynomial-time algorithm. Algorithms like Baby-step Giant-step or Index Calculus still require exponential or sub-exponential time, which makes brute-force or algebraic extraction computationally impossible on modern computers. ∎
Which of these are fields? (a) $\mathbb{Z}_{18}$, (b) $\mathbb{Q}(\sqrt 2)$, (c) $\mathbb{Z}[\sqrt 3]$, (d) $\mathbb{Z}_3[i]$.
Goal: Determine which of the given algebraic structures are fields, providing formal justifications.
Analysis: A field requires every nonzero element to have a multiplicative inverse.
- (a) $\mathbb{Z}_{18}$: Not a field. The modulus 18 is composite ($2 \cdot 9$), meaning $\mathbb{Z}_{18}$ contains zero divisors (e.g. $2 \cdot 9 \equiv 0$). Zero divisors cannot have inverses, so it is not a field.
- (b) $\mathbb{Q}(\sqrt 2) = \{a + b\sqrt{2} : a,b \in \mathbb{Q}\}$: Field. For any nonzero $a + b\sqrt{2}$, its inverse is: $$\frac{1}{a + b\sqrt{2}} = \frac{a - b\sqrt{2}}{a^2 - 2b^2} = \left(\frac{a}{a^2 - 2b^2}\right) + \left(\frac{-b}{a^2 - 2b^2}\right)\sqrt{2}$$ Since $a^2 - 2b^2 \neq 0$ (as $\sqrt{2}$ is irrational), the rational coefficients are well-defined. Thus, the inverse lies in $\mathbb{Q}(\sqrt 2)$.
- (c) $\mathbb{Z}[\sqrt 3] = \{a + b\sqrt{3} : a,b \in \mathbb{Z}\}$: Not a field. Consider the element $\sqrt{3} \in \mathbb{Z}[\sqrt 3]$. For $\sqrt{3}$ to have an inverse $x + y\sqrt{3}$, we must have: $$\sqrt{3}(x + y\sqrt{3}) = 3y + x\sqrt{3} = 1 \implies 3y = 1 \implies y = 1/3$$ Since $1/3 \notin \mathbb{Z}$, the inverse does not exist in the set.
- (d) $\mathbb{Z}_3[i] \cong \mathbb{Z}_3[x]/(x^2+1)$:
Field. This is a quotient polynomial ring. It is a field if and only if $x^2 + 1$ is irreducible over $\mathbb{F}_3$.
We check for roots in $\mathbb{Z}_3$:
- $0^2 + 1 = 1 \neq 0$
- $1^2 + 1 = 2 \neq 0$
- $2^2 + 1 = 5 \equiv 2 \neq 0$
- Group axioms checklist: closure → associativity → identity → inverse. Don't skip any.
- $\mathbb{Z}_n^*$ has $\varphi(n)$ elements, all coprime to $n$.
- Lagrange: order of subgroup / element divides order of group.
- Cyclic generators of $\mathbb{Z}_n$ are exactly those $k$ with $\gcd(k,n)=1$ — there are $\varphi(n)$ of them.
- Fields = "no zero divisors AND every nonzero has inverse." $\mathbb{Z}_p$ is a field for $p$ prime, never for $p$ composite.
- Primitive root test: for each prime $q \mid p-1$, check $g^{(p-1)/q} \not\equiv 1$.
- DH security rests entirely on DLP being hard. If anyone can compute discrete logs efficiently, DH is broken.