Computation in a ring and Galois Field
04-04-2023, 10:18 PM (This post was last modified: 04-04-2023 10:30 PM by ftneek.)
Post: #1
 ftneek Member Posts: 74 Joined: Oct 2022
Computation in a ring and Galois Field
I'm taking an applied abstract algebra course and am trying figure out how to check my work using the hp prime. Attached are a few problems we did in class. My professor gave me a skeptical look when I said I think my calculator is able to do these types of calculations, so I'd like to show them it can.

I worked out problem 4 by hand and got the inverse is x^3 + x + 1. On my calculator I entered GF(2,k^5 + k^3 + 1) and was able to enter inv(k^3 + 1) to obtain k^3 + k + 1, and the product is indeed 1.

Now when I try problem 1 I know there is an inverse because the gcd of the the two polynomials is 1 (in mod 2). But when I clear my variables and tried entering GF(2,k^4) I'm met with the error that k^4 is not irreducible. I was able to check my answer I got by hand by using the expression ((x^3 + x^2 + 1)%%2)*((x^3 + x^2 + 1)%%2) mod ((x^4)%%2). To find the inverse using my calculator I tried a few expressions such as inv(((x^3 + x^2 + 1)%%2) mod ((x^4)%%2)) but it returned a fraction which isn't what I was expecting. My question is how can I actually find this inverse using my calculator?

I'm still learning about Galois fields, I'm more familiar working in integers mod p or m. I think I understand it wouldn't be a field if the polynomial is reducible, so it makes sense why GF is giving that error. But is there some other way to perform these types of computations on the hp prime where the modulus polynomial is reducible?

Attached File(s) Thumbnail(s)

- neek
04-06-2023, 03:05 PM
Post: #2
 parisse Senior Member Posts: 1,310 Joined: Dec 2013
RE: Computation in a ring and Galois Field
You can not build a finite field with a polynomial that is not irreducible. But that's not the right way to invert a polynomial modulo another one, the right way is a call to the extended gcd algorithm. The commandname is egcd.
For example if a:=x^3 + 1 %% 2and b:=x^5+x^3+1 %% 2, egcd(a,b) will return three polynomials u, v and d such that d is the gcd of the input polynomials and a*u+b*v=d. If a and b are coprime, d will be 1 and modulo b you have a*u==1, therefore the inverse of a is u.
04-06-2023, 05:48 PM
Post: #3
 ftneek Member Posts: 74 Joined: Oct 2022
RE: Computation in a ring and Galois Field
Thanks for the explanation, I appreciate it.

One more question about the egcd() command. If integers/constants are polynomials of degree 0, should the command work for integers as well? For example I tried egcd(161,70) and it returned [1 0 161] while gcd(161,70) returns 7.

- neek
04-09-2023, 07:47 PM
Post: #4
 parisse Senior Member Posts: 1,310 Joined: Dec 2013
RE: Computation in a ring and Galois Field
For integers, the commandname is iegcd.
 « Next Oldest | Next Newest »