4A1. Abstract Algebra: Rings and fields - JulTob/Mathematics GitHub Wiki
Discover how rings and fields work by using a secret code system inspired by algebraic operations.
Imagine you are a spy working for a secret agency. You and your partner communicate using coded messages. The enemy intercepts your transmissions, so you must encrypt messages using a special number system.
One solution is the use of Groups: You can use a Cesar Cypher of N, where you slide all letters N positions. This is, letters form a group with the operation of 'addition' being the Next(letter) (cyclic) operation.
This is equivalent to a Group operation, with the
β»οΈ Algorithm (Ada):
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Characters.Handling; use Ada.Characters.Handling;
procedure ROT1_Cipher is
Input_Text, Output_Text : String(1 .. 100);
Length : Natural;
begin
-- Prompt user for input
Put("Enter a text to encrypt (up to 100 characters): ");
Get_Line(Input_Text, Length);
-- Encrypt the input using ROT-1
for I in 1 .. Length loop
if Input_Text(I) in 'A' .. 'Y' or Input_Text(I) in 'a' .. 'y' then
Output_Text(I) := Character'Val(Character'Pos(Input_Text(I)) + 1);
elsif Input_Text(I) = 'Z' then
Output_Text(I) := 'A';
elsif Input_Text(I) = 'z' then
Output_Text(I) := 'a';
else
Output_Text(I) := Input_Text(I); -- Non-alphabetic characters remain unchanged
end if;
end loop;
-- Display the encrypted text
Put_Line("Encrypted Text: " & Output_Text(1 .. Length));
end ROT1_Cipher;
But this is extremely easy to crack for long messages! And common words can give it away, such as 'the'. We should do better!
Let's try using Rings!
Our new encryption works as follows:
- Every letter is assigned a number (A = 0, B = 1, C = 2, ..., Z = 25).
- You perform operations modulo 26 (meaning numbers βwrap aroundβ after 26).
- You use two number operations: addition and multiplication.
However, not all numbers behave the same way under multiplication. Some numbers work like "zero" (they erase information), while others allow you to decode messages uniquely.
Can you figure out the best numbers to use for coding? π€
We are working with numbers modulo 26, meaning we only use:
where numbers "wrap around" after 26 (e.g., 27 is the same as 1, 28 is the same as 2, etc.).
β
This set forms a ring, denoted
Addition in
For example:
(What number behaves like zero?)
π‘ Solution
Multiplication is trickier. It follows normal rules but wraps around 26.
For example:
(This number is called a zero divisorβit "erases" information.)
π‘ Solution
A field is a ring where every nonzero number has a multiplicative inverse (i.e., for every number
However, in
For example:
-
3 has an inverse because
$( 3 \times 9 = 1 $ ). -
2 has no inverse because there is no number
$( x )$ where$( 2 \times x \equiv 1 \mod{26} )$ .
β
This means
(Hint: These numbers must be relatively prime to 26.)
π‘ Solution
π What Does It Mean for a Number to Have an Inverse? That
-
A number has an inverse in
$β€_{26}$ β if and only if it is coprime (relatively prime) to 26.- This means that the greatest common divisor (gcd) of the number and 26 must be 1
- Numbers that share a factor with 26 (like 2, 13, etc.) will not have an inverse.
-
The prime factorization of 26 is:
$26=2Γ13$ -
So any number in {
$1,2,...,25$ } that does not share a factor of$2$ or$13$ with$26$ will have an inverse.- These are {
$1,3,5,7,9,11,15,17,19,21,23,25$ }. Each of these numbers has a multiplicative inverse in$β€_{26}$
- These are {
In cryptography, we need fields, because we want every number to have an inverse so that we can decrypt messages.
Since
π§© Final Puzzle:
-
Find a prime number
$( p>26 )$ so that$( \mathbb{Z}_p )$ forms a field. -
What makes a number system a good choice for secret codes?
π‘ Solution
-
$29$ -
That all numbers have an inverse, this is a number such as
$aΒ·b = 1$ with $a,bβ
Great! Now that you've got a feel for rings, the next step in abstract algebra is ideals and quotient rings. These ideas help us understand how to simplify complex algebraic structures while keeping their fundamental properties.
We'll introduce them through a fun puzzle involving divisibility and breaking a number system into smaller pieces! π’π²
Learn about ideals and quotient rings by understanding how a factory deals with faulty machine parts.
You manage a machine factory that produces metal gears labeled with numbers. Each gear has a serial number from the set:
Some gears fail quality control because they are multiples of a faulty number. You need to remove all defective gears and organize the remaining ones.
The challenge:
- How can we describe the set of all defective gears?
- What happens when we "ignore" these bad gears and only work with the good ones?
- Can we still perform arithmetic operations in this new system?
One of your machines is faulty and produces all gears labeled with numbers that are multiples of 4:
This set is special because:
-
If a gear is defective, adding another defective gear still results in a defective gear:
$$4 + 8 = 12 \quad \text{(still in the set)}$$ -
If we multiply a defective gear by any number, the result is still defective:
$$4 \times 3 = 12, \quad 4 \times (-2) = -8$$
These properties define an ideal
Since every multiple of 4 is defective, we want to group numbers together based on how far they are from the defective ones.
To do this, we define new classes of numbers:
-
0-class: {β¦,
$-8, -4, 0, 4, 8, 12,$ β¦} (all multiples of 4) -
1-class: {β¦,
$-7, -3, 1, 5, 9, 13,$ β¦} -
2-class: {β¦,
$-6, -2, 2, 6, 10, 14,$ β¦} -
3-class: {β¦,
$-5, -1, 3, 7, 11, 15,$ β¦}
Each number is placed into a group based on its remainder when divided by 4. This new system is written as:
where:
β
This is called a quotient ring because we are "dividing out" the defective numbers (the ideal
Now, let's do math in this new system!
We add representatives from each class:
β Everything still works like a ring, but simpler! π
- We created a new number system by ignoring defective elements (an ideal).
-
We defined a quotient ring
$( \mathbb{Z}/4\mathbb{Z} )$ , which keeps a structured arithmetic system. - This method is used in modular arithmetic, cryptography, and abstract algebra.
- Find another ideal in ( \mathbb{Z} ), such as all numbers divisible by 5. What would the quotient ring look like?
- Can you describe addition and multiplication in ( \mathbb{Z}/5\mathbb{Z} )?
- What happens if we take ( \mathbb{Z}/p\mathbb{Z} ) where ( p ) is a prime? (Hint: It becomes a field!)
Would you like to:
- Explore fields by extending these ideas to prime numbers?
- See how quotient rings apply to cryptography and coding theory?
- Move on to another abstract algebra puzzle, like polynomials over finite fields?
Let me know, and weβll keep the fun going! π²β¨