Ask Your Question

Escolopendra's profile - activity

2023-01-25 06:54:11 +0200 received badge  Famous Question (source)
2023-01-25 06:54:11 +0200 received badge  Notable Question (source)
2022-11-30 16:17:01 +0200 received badge  Popular Question (source)
2021-11-28 14:10:36 +0200 commented question Finding an irreducible polynomial in Z [x] but reducible in F2 [x]

Thank you, it helped a lot.

2021-11-17 23:31:39 +0200 received badge  Self-Learner (source)
2021-11-17 23:31:39 +0200 received badge  Teacher (source)
2021-11-17 23:04:25 +0200 answered a question Finding an irreducible polynomial in Z [x] but reducible in F2 [x]

I managed to get the answer, so for anyone that is interested here is the code: R.<x> = PolynomialRing(ZZ) F = G

2021-11-17 23:02:15 +0200 commented question Finding an irreducible polynomial in Z [x] but reducible in F2 [x]

I am not going to lie to you. Yeah it is.

2021-11-17 23:00:07 +0200 commented answer How can you define a function that finds the Greatest Common Divisor (Gcd) two polynomials for every field?

Thank you very much it works perfectly.

2021-11-17 22:59:13 +0200 marked best answer How can you define a function that finds the Greatest Common Divisor (Gcd) two polynomials for every field?

Hi, as the title says I`m trying to define a function that finds the gcd of two polynomial without using the pre-established function gcd. I've tried everything I thought it would work:

First, I tried to use the Euclidan Algorithm, for that you need to divide the polynomials. Knowing so, I tried to find the degrees of the different polynomials to divide in consequence of the degrees (which gave me error). Then I tried it without the degree part and it didn't work at all since % couldn't be used as a divisor of polynomials.

def GCD(field, f, g):
  R.<x> = PolynomialRing(field, 'x')
  x.parent() 
  a = f.degree()
  b = g.degree()
  if a>b:
    while g != 0: 
        r = g
        g = f%g
  else:
    while f != 0:
        r = g
        f = g%f
  return r

Shortly after I tried to factor both of the polynomial and make the función return the part that repeated. But I rapidly saw my hopes decay when I realized I have not a single clue in how to do so (even though I've done some research I couldn't find the answer).

def mcd(field, f, g): 
  R.<x> = PolynomialRing(field) 
  a = f.factor()
  b = g.factor()

And this was the last code I wrote before asking for some enlightening:

def MCD(Field,PolynomialA, PolinomialB):
  R.<x> = PolynomialRing(Field, 'x')
  a = PolynomialA
  b = PolynomialB
  c = 1
  while c != 0:
    c = a%b 
    a = b
    b = c
  return a
2021-11-17 22:59:13 +0200 received badge  Scholar (source)
2021-11-17 16:59:50 +0200 edited question Finding an irreducible polynomial in Z [x] but reducible in F2 [x]

Finding an irreducible polynomial in Z [x] but reducible in F2 [x] Hi everyone, I've been trying to find an irreducible

2021-11-17 16:59:47 +0200 edited question Finding an irreducible polynomial in Z [x] but reducible in F2 [x]

I`m trying to find an irreducible polynomial in Z [x] but reducible in F2 [x]? Hi everyone, I've been trying to find an

2021-11-17 16:59:47 +0200 received badge  Editor (source)
2021-11-17 16:59:01 +0200 asked a question Finding an irreducible polynomial in Z [x] but reducible in F2 [x]

I`m trying to find an irreducible polynomial in Z [x] but reducible in F2 [x]? Hi everyone, I've been trying to find an

2021-11-17 11:47:43 +0200 received badge  Student (source)
2021-11-17 11:34:23 +0200 asked a question How can you define a function that finds the Greatest Common Divisor (Gcd) two polynomials for every field?

How can you define a function that finds the Greatest Common Divisor (Gcd) two polynomials for every field? Hi, as the t