Rules for Multiplying and Adding in Modulo # Calculation

  • Context: Undergrad 
  • Thread starter Thread starter MathewsMD
  • Start date Start date
  • Tags Tags
    Calculation Rules
Click For Summary

Discussion Overview

The discussion revolves around the rules for performing arithmetic operations, specifically addition and multiplication, under modulo arithmetic. Participants explore the implications of these rules while calculating the dot product of two vectors and address discrepancies in results obtained through different approaches.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant questions whether there are rules against the order of operations (adding or multiplying first) when using modulo arithmetic.
  • The same participant calculates the dot product of two vectors and initially arrives at a result of 0 (mod 11) but later realizes the correct result is 2 (mod 11) after correcting their arithmetic.
  • Another participant explains that addition in modulo arithmetic is associative, suggesting that the order of addition should not affect the outcome.
  • A later reply confirms the initial participant's realization that their solutions manual contained an incorrect value, leading to the conclusion that their confusion stemmed from this error.

Areas of Agreement / Disagreement

Participants generally agree on the associative property of addition in modulo arithmetic, but there is a lack of consensus on the initial confusion regarding the arithmetic calculations and the implications of the order of operations.

Contextual Notes

The discussion highlights potential misunderstandings related to arithmetic operations in modulo calculations, particularly in the context of vector dot products. There are unresolved aspects regarding the initial arithmetic errors and the interpretation of results.

MathewsMD
Messages
430
Reaction score
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
244 =242+2 = 11(11)+2 = 2 Mod 11. Basically, addition mod11 is associative :

(a+b)Mod11 =aMod11+ bMod11.
 
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.
 
No problem; glad it helped.
 
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)?
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 21 ·
Replies
21
Views
2K
  • · Replies 0 ·
Replies
0
Views
1K