CSC327 ยท 2076 ยท 5 marks
What is the role of the prime number in the Euler totient Function? Find the GCD of 12 and 16 using the Euclidean algorithm.
What is the role of the prime number in the Euler totient Function? Find the GCD of 12 and 16 using the Euclidean algorithm. [5]
Role of Prime Numbers in Euler's Totient Function and GCD by Euclidean Algorithm
Given Data
- Euler totient function context; find role of prime numbers.
- Numbers for GCD: $a = 16$, $b = 12$.
Part 1: Role of Prime Numbers in Euler's Totient Function
Definition
Euler's Totient Function $\phi(n)$ counts the number of positive integers in the range $1 \le k \le n$ that are relatively prime to $n$ (i.e. $\gcd(k, n) = 1$).
Role of a Prime Number
If $n = p$ is prime, then $p$ has no divisors other than $1$ and $p$ itself. Hence every integer in ${1, 2, \dots, p-1}$ is coprime to $p$.
$$\boxed{\phi(p) = p - 1}$$
For a prime power: $$\phi(p^k) = p^k - p^{k-1} = p^{k-1}(p-1)$$
Why It Matters
- Simplifies computation: For a prime, the totient is trivially $p-1$.
- Multiplicative building block: Since $\phi$ is multiplicative for coprime factors, any $n$ factored into primes gives $$\phi(n) = n \prod_{p \mid n}\left(1 - \frac{1}{p}\right)$$
- RSA cryptography: With $n = p \times q$ (product of two primes), $$\phi(n) = (p-1)(q-1)$$ which is the basis for choosing the encryption/decryption exponents.
Example
$\phi(7)$: since $7$ is prime, $\phi(7) = 7 - 1 = 6$. Check: ${1,2,3,4,5,6}$ are all coprime to $7$. Count $= 6$. โ
Part 2: GCD of 12 and 16 by Euclidean Algorithm
Rule: $\gcd(a,b) = \gcd(b,, a \bmod b)$ until the remainder is $0$; the last non-zero remainder is the GCD.
Take $a = 16,\ b = 12$:
| Step | Computation | Remainder |
|---|---|---|
| 1 | $16 = 1 \times 12 + 4$ | $4$ |
| 2 | $12 = 3 \times 4 + 0$ | $0$ |
Since the remainder is now $0$, the last non-zero remainder is $4$.
$$\boxed{\gcd(12, 16) = 4}$$
Verification
- $12 = 4 \times 3$ โ
- $16 = 4 \times 4$ โ
- $4$ is the largest common divisor. โ
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.