Extended Euclidean Algorithm and Inverse Modulo Tutorial
Why Mathematics Stack Exchange recommends it
Mathematics Stack Exchange users link it when someone needs a concrete worked example of computing modular inverses with the extended Euclidean algorithm.
Recommended by 1 people across 1 different months, 2014 to 2016.
What it is
A short tutorial showing how to use the Euclidean algorithm and the extended Euclidean algorithm to find a modular inverse. It is a worked-example walkthrough from the Best Friends Farm channel.
What people said
Recommends Prakash Wadhwani · 2014-05 · Mathematics Stack Exchange · on “Modulo Inverse using extended euclidean”
@DonAntonio I am not expecting a magic method, but I am expecting some magical explanation that can help me grasp the concept quickly. Just for your reference, go through the explanations here, and read wiki page of extended euclidean algorithm. After that watch the videos, [this video] and [LINK] , then tell me what to expect.
Cites lucidgold · 2015-10 · Mathematics Stack Exchange · on “How to compute $8x \equiv 33 \pmod{35}$?”
How to compute $8x \equiv 33 \pmod{35}$? I followed this [this video] video to solve this problem. Is there a better way? My solution steps: Divide both sides by 8: $$x \equiv \frac{33}{8}^{-1} \pmod{35}$$ $$35 = \frac{33}{8} \cdot 8 +2 \tag 1$$ $$\frac{33}{8}=2\cdot\frac{16}{8}+\frac{1}{8} \tag 2 $$ $$2=\frac{1}{8}\cdot8+1$$ Now put $1$ by itself: $$1=2-\frac{1}{8}\cdot 8 \tag 3$$ Now put $2$ by itself from $(1)$: $$2 = 35 - \frac{33}{8} \cdot 8 \tag 4 $$ Now put $\frac{1}{8}$ by itself from (2): $$\frac{1}{8} = \frac{33}{8} - 2\cdot\frac{16}{8} \tag 5 $$ Now substitute $\frac{1}{8}$ with (5) in (3) and simplify: $$1=2-\left(\frac{33}{8} - 2\cdot\frac{16}{8}\right)\cdot8$$ $$1=2-\frac{33}{8}\cdo
Cites Noble Mushtak · 2016-06 · Mathematics Stack Exchange · on “Fast way of suming up polynoms”
We have that: $$A^n+A^{n-1}+...+1=\frac{A^{n+1}-1}{A-1} \equiv (A^{n+1}-1)(A-1)^{-1} \pmod{10^9+7}$$ We know that we can use the Extended Euclidean algorithm to find $(A-1)^{-1}$ [this video] because $10^9+7$ is prime, so the only way this wouldn't work is if $A-1$ is a multiple of $10^9+7$, which almost never happens. If we have $1 < A \leq 10^9$, then it definitely won't happen. However, for $A=1$, we have to make an exception . This is an "edge case" that will lead to a mistake. It's trivial that the answer is $n+1$ for $A=1$, but you need to program this in as an exception because this algorithm won't work for $A=1$. Also, for $A^{n+1}-1$, we use modular exponentiation to find $A^{n+1} \pmod{