Modular Exponentiation

You can use modular exponentiation to calculate the remainder of a number raised to a power. The trick to finding large exponentials is to break them down into smaller ones. Example: Given that $M^2 ≡ 51 (mod 59)$, what is $M^{12} (mod 59)$? M^12 = M^(4+8) M^12 = M^4 * M^8 M^12 = (M^2)^2 * (M^2)^3✅ M^2 ≡ 51 (mod 59) M^4 ≡ (M^2)^2 ≡ (51)^2 (mod 59) M^4 ≡ 2601 (mod 59) M^4 ≡ 5 (mod 59)✅ M^4 ≡ 5 (mod 59) M^8 ≡ (M^4)^2 ≡ (5)^2 (mod 59) M^8 ≡ 25 (mod 59)✅ M^12 = M^4 * M^8 M^12 ≡ [(5 mod 59) * (25 mod 59)] M^12 ≡ 5*25 (mod 59) M^12 ≡ 125 (mod 59) M^12 ≡ 7 (mod 59)✅

November 29, 2023 · 1 min · 124 words · Xavier Loera Flores

Multiplicative Inverse Mod

Multiplicative Inverse Modulo The multiplicative inverse of $x \mod y$ is a number $n ∈ Z+$ such that $xn\mod y=1$ Finding the Multiplicative Inverse Modulo: Given $x$ & $y$, to find the multiplicative inverse, $n$ of $x mod y$ you must find: $$xn \mod y = 1$$ $$or$$ $$xn ≡ 1 (mod\ y)$$ Substitute values of n to find congruence: x * A1 ≡ B1 !≡ 1 (mod 33) x * A2 ≡ B2 !...

November 29, 2023 · 1 min · 155 words · Xavier Loera Flores