1
$\begingroup$

It's from a programming language. "%' here is a modulo operation.

(a * 2^32 + b) % c = (((a % c) * (2^32 % c)) + b) % c
  • 0
    So, what you want to prove is that $a\cdot b(\mod c)=(a(\mod c)\cdot b(\mod c))(\mod c)$ and the same holds for addition, correct?2012-11-13
  • 0
    Mmm, probably right :) But I'm not a mathematician, so I would be glad to take a look at some basic articles on this theme.2012-11-13

1 Answers 1

1

In general, if you have two integers

a = j + kc
b = l + mc

Then

ab % c
= (j+kc)(l+mc) % c 
= (jl + jmc + lkc + kmc^2) % c
= jl
= (a % c)(b % c)
  • 0
    And the same for sums.2012-11-13
  • 0
    "jl + jmc + lkc + kmc^2 % c" - does '%' relate only to the last term? Why? And why this equals to 'jl'?2012-11-13
  • 0
    Just like (1+2+4+6)/2=(1/2)+1+2+3 (look at the parentheses), (jl + jmc + lkc + kmc^2) / c=(jl/c)+jm+lk+kmc. Think about what that means about (jl + jmc + lkc + kmc^2) % c.2012-11-13