Rules for Multiplying and Adding in Modulo # Calculation

In summary, the conversation discusses the use of modulo # in arithmetic operations and the question of whether multiplying or adding should be done first. The conversation includes an example of the dot product for two vectors and the resulting values when adding them in different orders. It is discovered that the incorrect value was used in the solution manual and the correct value is 2 (mod 11). The conversation concludes with understanding the associative property of addition in mod11.
  • #1
MathewsMD
433
7
Hi,

Are there any rules against multiplying or adding first when using modulo #?

The reason I ask is because I'm doing the dot product for two vectors:

[10, 9, 8, 7, 6, 5, 4, 3, 2, 1].[8, 0 ,3 ,7, 0, 9, 9, 0, 2, 6]

By doing this, I get:

80 + 0 + 24 + 49 + 0 + 45 + 36+ 0 + 4 + 6 = 0 (mod11) - it equals 244

Now, if I simplify first before adding:

3 + 0 + 2+ 5+ 0 + 1 + 3+ 4 + 6 = 2 (mod11)

I'm not exactly sure if my arithmetic is poor and I am completely missing a simple error, or if I am dismissing a fundamental concept, but I can't seem to find my problem. Is there any reason why I get 0 as one answer, and 2 as the other (in mod11)?
 
Physics news on Phys.org
  • #2
244 =242+2 = 11(11)+2 = 2 Mod 11. Basically, addition mod11 is associative :

(a+b)Mod11 =aMod11+ bMod11.
 
  • #3
WWGD said:
244 =242+2 = 11(11)+2 = 2 Mod 11. Basically, addition mod11 is associative :

(a+b)Mod11 =aMod11+ bMod11.

Thank you. So according to its associative property, it should not depend on when it is added/subtracted.

I just realized my solutions manual had an incorrect value. Thank you for the help and this question has been solved.
 
  • #4
No problem; glad it helped.
 
  • #5
MathewsMD said:
Hi,

Are there any rules against multiplying or adding first when using modulo #?

The reason I ask is because I'm doing the dot product for two vectors:

[10, 9, 8, 7, 6, 5, 4, 3, 2, 1].[8, 0 ,3 ,7, 0, 9, 9, 0, 2, 6]

By doing this, I get:

80 + 0 + 24 + 49 + 0 + 45 + 36+ 0 + 4 + 6 = 0 (mod11) - it equals 244
This is the error- the sum is indeed 244= 242+ 2= 11(22)+ 2 so this is 2 (mod 11), not 0.

Now, if I simplify first before adding:

3 + 0 + 2+ 5+ 0 + 1 + 3+ 4 + 6 = 2 (mod11)

I'm not exactly sure if my arithmetic is poor and I am completely missing a simple error, or if I am dismissing a fundamental concept, but I can't seem to find my problem. Is there any reason why I get 0 as one answer, and 2 as the other (in mod11)?
 

1. What is a modulo calculation?

A modulo calculation is a mathematical operation that calculates the remainder after dividing one number by another. It is often denoted by the symbol % and is commonly used in computer programming and cryptography.

2. How do you perform multiplication in modulo calculation?

To perform multiplication in modulo calculation, you first multiply the two numbers as usual. Then, you take the remainder when the result is divided by the modulo number. This is equivalent to finding the remainder after dividing the two original numbers by the modulo number and then multiplying those remainders.

3. What are the rules for adding in modulo calculation?

The rules for adding in modulo calculation are as follows:

  • Add the two numbers as usual.
  • If the result is larger than the modulo number, subtract the modulo number from the result until it is less than the modulo number.
  • If the result is negative, add the modulo number to the result until it is positive.

4. How is modulo calculation used in cryptography?

Modulo calculation is used in cryptography to ensure the security of encrypted data. It is used in a variety of algorithms, such as the RSA algorithm, to perform operations on large numbers and generate keys that are difficult to crack.

5. What is the significance of the modulo number in modulo calculation?

The modulo number is significant in modulo calculation because it determines the range of possible remainders. For example, if the modulo number is 10, the possible remainders will be between 0 and 9. Also, different modulo numbers will result in different patterns of remainders, which can be used in cryptography to create more complex and secure algorithms.

Similar threads

  • Linear and Abstract Algebra
Replies
2
Views
393
  • Linear and Abstract Algebra
Replies
2
Views
888
Replies
11
Views
465
  • Linear and Abstract Algebra
Replies
13
Views
1K
  • Linear and Abstract Algebra
Replies
3
Views
809
  • Linear and Abstract Algebra
Replies
3
Views
1K
  • Linear and Abstract Algebra
Replies
4
Views
1K
  • Linear and Abstract Algebra
Replies
7
Views
1K
  • Linear and Abstract Algebra
Replies
8
Views
852
  • Linear and Abstract Algebra
Replies
14
Views
2K
Back
Top