### SecondThread's blog

By SecondThread, history, 11 months ago,

# Algorithms Dead Episode 1: Division Under Mod

Do you blindly do operations under mod without knowing why they work? Does it scare you when a problem asks you do print something mod a big number? If so, you should watch Episode 1 of Algorithms Dead!

In it, I talk about why mod operations (addition/subtraction/multiplication) are allowed, why mod inverses work, and what things are safe to do when you store fractions as $p*q^{-1}$.

• +144

 » 11 months ago, # |   +13 It was nice, your channel has many helpful videos,also loved the lecture on Game Theory.
 » 6 months ago, # |   0 @SecondThread : Can you please add some good questions for practice on this topic ?
 » 3 months ago, # |   -6 the answer for 8/7(mod 5) = 4 using prime modulo inverse , shouldn't it be 1 ?
•  » » 2 weeks ago, # ^ |   0 The denominator is 7 here, which is congruent to 2(mod 5).The multiplicative inverse of 2 under mod 5 is 3.So, the expression becomes = (8*3)(mod 5) = 24(mod 5) = 4