Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 27

Congruence

In General You can not use division to solve


congruence , however
Often a-1 exists and you can multiply
Whenever the number your dividing by is a prime all its least
residues will have inverses and you can solve just by multiplying by
the inverse
2𝑥 ≡ 1 𝑚𝑜𝑑 (7) 𝑠𝑜 4 ∗ 2𝑥 ≡ 4 𝑚𝑜𝑑 7
𝑥 ≡ 4 𝑚𝑜𝑑 7 𝑡ℎ𝑢𝑠 𝑥 = 4 + 7𝑠
Alternatively you can use the Euclidian
Algorithm
1=5−2∗2
1=5−2∗ 7−5
1=3∗5−2∗7
1 = 3 ∗ 19 − 2 ∗ 7 − 2 ∗ 7
7𝑛 + 19𝑗 = 1
19 = 2 ∗ 7 + 5
1 = 3 ∗ 19 − 8 ∗ 7
7=5+2 𝑠𝑖𝑛𝑐𝑒 − 8 ≡ 11 𝑚𝑜𝑑(19)
5=2∗2+1 𝑠𝑜 𝑛 = 11 + 19s
If you have trouble finding the inverse you
can use https://planetcalc.com/3311/

Since 3 ∗ 8 ≡ 1 𝑚𝑜𝑑 23 𝑚𝑢𝑙𝑡𝑖𝑝𝑙𝑦𝑖𝑛𝑔 𝑏𝑦 3 𝑔𝑖𝑣𝑒𝑠 9 ∗ 8 ≡ 3 𝑚𝑜𝑑 23


𝑇ℎ𝑖𝑠 𝑔𝑖𝑣𝑒𝑠 𝑡ℎ𝑒 𝑔𝑒𝑛𝑒𝑟𝑎𝑙 𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛 𝑛 = 9 + 23𝑠
Example
Example

There are other ways. Often you can see a relation between the coefficient on the left and the number your diving by.
For example
Example
Example
Exercise
Example

So the general solution is n= 3 + 7s


Exercise
Exercise
What about when the divisor is not prime?
You may not have any solutions
• 8𝑛 ≡ 18 𝑚𝑜𝑑 24 𝑖𝑓𝑓 8𝑛 − 18 = 24𝑘 𝑓𝑜𝑟 𝑠𝑜𝑚𝑒 𝑘
𝑤ℎ𝑖𝑐ℎ 𝑖𝑠 𝑒𝑞𝑢𝑖𝑣𝑎𝑙𝑒𝑛𝑡 𝑡𝑜 8𝑛 − 24𝑘 = 18
which is impossible since gcd(8, 24) = 8 𝑑𝑜𝑒𝑠 𝑛𝑜𝑡 𝑑𝑖𝑣𝑖𝑑𝑒 18
Exercise
Solution
Exercise
Solution
Exercise
Solution
Exercise
Solution
Exercise
Solution

You might also like