mathmodulus

Modulus operation on other side of equation?


If

I = (V+13) % 26

Then what is V in terms of 'I'. Basically how can you take the Mod operator on the other side of equation ?


Solution

  • I = (V+13) %26
    

    This means V+13 = k*26 + I, and k=Z, I=[0,1,...,26-1]. (1)

    so

    V = k*26 + I -13

    now, because I is remainder from division by 26, I=[0,1,...,26-1]. This means:

    I%26=I, I divided by 26 is just I.

    so:

    I = (V+13) %26
    
    I%26 = (V+13) %26
    

    this is not the same as I%26 = (V+13) because I%26 = (V+13) implies V+13 = [0,1,...,26-1] what contradicts (1), (V+13 might be greater than 26-1).


    Corollary:

    V = (I%26) - 13 is not correct

    V = (I%26) - 13 + k*26, k=Z is correct