Hello, I was to find the inverse of 2(mod5) by using Euclidean's Algorithm and I can't do it for this simple problem.
forwards steps:
2(mod5)
2=5(0)+2
5=2(2)+1
2=1(2)+0
Now find inverse (backwards steps):
1=5−2(2)
2=2−5(0) (this is what we'll substitute 2 from the previous equation for)
1=5−(2−5(0))(2)
1=5−2(2)
this is wrong because it should be 2(3) (the 3 is the inverse of 2 mod 5)
If i do it for a problem like 5(mod7) I get the right answer
forwards steps:
5(mod7)
5=7(0)+5
7=5(1)+2
5=2(2)+1
2=1(2)+0
backward steps:
1=5−2(2)
2=7−5(1) (this is what we'll substitute 2 from the previous equation for)
1=5−(7−5(1))(2)
1=5−7(2)+5(2) (simplify)
1=5(3)−7(2) (simplify)
5=5−7(0) (this is what we'll substitute 5 from the previous equation for)
1=(5−7(0))(3)−7(2)
1=5(3)−7(2)
this gives me the right solution because 3 is the inverse for 5 mod 7.
forwards steps:
2(mod5)
2=5(0)+2
5=2(2)+1
2=1(2)+0
Now find inverse (backwards steps):
1=5−2(2)
2=2−5(0) (this is what we'll substitute 2 from the previous equation for)
1=5−(2−5(0))(2)
1=5−2(2)
this is wrong because it should be 2(3) (the 3 is the inverse of 2 mod 5)
If i do it for a problem like 5(mod7) I get the right answer
forwards steps:
5(mod7)
5=7(0)+5
7=5(1)+2
5=2(2)+1
2=1(2)+0
backward steps:
1=5−2(2)
2=7−5(1) (this is what we'll substitute 2 from the previous equation for)
1=5−(7−5(1))(2)
1=5−7(2)+5(2) (simplify)
1=5(3)−7(2) (simplify)
5=5−7(0) (this is what we'll substitute 5 from the previous equation for)
1=(5−7(0))(3)−7(2)
1=5(3)−7(2)
this gives me the right solution because 3 is the inverse for 5 mod 7.