0
$\begingroup$

Given the following function, f:

f (a b c d e) = (5*a + 4*b + 3*c + 2*b + 1*a) modulo 11

How can I distribute the modulo operation?

In short, How can I compute f without computing (5*a + 4*b + 3*c + 2*b + 1*a) first, and then mod-ing by 11.

  • 0
    I think you can do (a+b) mod c =[(a mod c)+(b mod c) ] mod c2017-02-28
  • 0
    Yes you can, but I assume you mean multiplying and adding the *right-hand* side.2017-02-28
  • 0
    Yes - updated my question per your point, @Oiler!2017-02-28
  • 0
    You can distribute the modulo over all terms, but there will be no simplification. On the opposite, you'll have to take five moduli (plus a final one) instead of a single.2017-02-28
  • 0
    Care to post as answer, Yves?2017-02-28

0 Answers 0