Hacker News new | past | comments | ask | show | jobs | submit login

> If that sounds too complicated for your purposes, sorry.

Ehhh, GF(2) and even GF(5) are actually pretty easy to describe.

GF(2) is arithmetic modulo 2.

0+0 == 0

0+1 == 1

1+0 == 1

1+1 == 10, except we can only carry one bit in GF(2). Like an odometer, we can only keep the bottom bit, so the "1" drops off. 1+1 == 0.

Hey look, its XOR. The end.

----------

A "Field" in Abstract mathematics is simply a number-system that has add, additive-inverse (aka: subtraction), multiply, and multiply-inverse (aka: division). Note that "subtraction" and "division" are just simplifications of the concept, to be a true inverse, all inputs and outputs (domains-and-ranges) must be in the field.

So I proved that XOR is GF(2)'s addition. Funny note, 1 is also -1 (negative 1), aka the additive inverse of 1. And it turns out that XOR is _also_ the additive inverse (aka: subtraction). You see, -1 + 1 == 0, which happens to be 1+1 in GF(2). Ain't modulo math fun?

-----------

Multiplication is just AND btw.

0 * 0 == 0

0 * 1 == 0

1 * 0 == 0

1 * 1 == 1

The multiplicative inverse of 1 is... 1. That is, 1 * 1 equals 1. This one is a bit of a tautology, but it matches the technical definition of multiplicative-inverses (aka: division). This is why I prefer GF(5), because we get a less-trivial multiplicative-inverse.

----------

GF(5) is how I prefer to teach Galois fields. GF(2) and GF(3) are too simple. GF(5) is complex enough that the student actually has to learn Galois fields to understand it, but its simple enough that you can probably teach it to someone within 20 minutes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: