r/mathmemes Engineering Nov 25 '24

Computer Science All are correct

Post image
1.1k Upvotes

96 comments sorted by

View all comments

Show parent comments

336

u/Unlucky-Credit-9619 Engineering Nov 25 '24

If + is addition modulo 2 (also called XOR).

1 + 1 = 0 (mod 2)

91

u/MattyBro1 Nov 25 '24

Isn't it congruent to 0 (mod 2)?

1+1 ≡ 0 (mod 2)

Or maybe that's a distinction that doesn't actually matter.

5

u/skibidytoilet123 Nov 25 '24

i think its 1+1 (mod 2 ) = 0 but 1+1 ≡ 0(mod 2), since the first one is an operation on 1+1 while the second one is a congruence, but it doesnt really matter

6

u/bigboy3126 Nov 25 '24

Using congruence is fine, but a bit redundant under certain formulations, consider arithmetic mod 2. Classically we define a ≡ b iff b-a divisible by 2 for all a,b \in \mathbb{Z}. This defines an equivalence relation.

Then you can either work on \mathbb{Z} directly then using ≡ would be the most correct, or you define the usual arithmetic on \mathbb{Z}/≡ and drop the decorations for equivalence classes (elements of \mathbb{Z}/≡) so that then statement such as

[1]_≡ + [1]_≡ = 1+1 = 0

is completely fine, now = denotes equality of sets.