Ask Your Question
2

Calculate Inverses

asked 2015-11-22 13:54:35 +0100

bruno171092 gravatar image

updated 2015-11-22 15:39:32 +0100

Hello Guys, i have the following problem.

I got the Ring $ R = \mathbb{Z} /(x^7 -1)$ and the polynom f(x) = $x^6 - x^4 +x^3 + x^2 -1 \in R$ and want to compute the inverse of f(x), $f(x)^{-1}$. How do I do that?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2015-11-22 14:46:43 +0100

tmonteil gravatar image

updated 2015-11-22 17:10:55 +0100

You will find your inverse if you work over the rationals, that is if $ R = \mathbb{Q}[x] /(x^7 -1)$. There, you can do:

sage: R.<x> = QQ[]
sage: RR = R.quotient(x^7 - 1)
sage: f = RR(x^6-x^4+x^3+x^2-1)
sage: g = f^(-1)
sage: g
16/43*xbar^6 + 11/43*xbar^5 + 21/43*xbar^4 + 1/43*xbar^3 - 2/43*xbar^2 + 4/43*xbar - 8/43
sage: g*f
1
sage: f*g

EDIT answers to the further questions asked in comment:

If you want to work on $ R = (\mathbb{Z} /7 \mathbb{Z}) /(x^7 -1)$, this is very similar:

sage: Zmod(7)
Ring of integers modulo 7
sage: R.<x> = Zmod(7)[]
sage: R
Univariate Polynomial Ring in x over Ring of integers modulo 7
sage: RR = R.quotient(x^7 - 1)
sage: RR
Univariate Quotient Polynomial Ring in xbar over Ring of integers modulo 7 with modulus x^7 + 6
sage: f = RR(x^6-x^4+x^3+x^2-1)
sage: f
xbar^6 + 6*xbar^4 + xbar^3 + xbar^2 + 6
sage: g = f^(-1)
sage: g
2*xbar^6 + 4*xbar^5 + xbar^3 + 5*xbar^2 + 4*xbar + 6
sage: g.parent()
Univariate Quotient Polynomial Ring in xbar over Ring of integers modulo 7 with modulus x^7 + 6
sage: g*f
1
sage: f*g
1

As for your second question, when i write R.<x>=... i define both the polynomial ring R and its undeterminate x, so x^6-x^4+x^3+x^2-1 is an element of R. when i write RR(x^6-x^4+x^3+x^2-1), i make a conversion of x^6-x^4+x^3+x^2-1 into the quotient ring RR, you can have a look at : http://doc.sagemath.org/html/en/tutor... to learn more.

edit flag offensive delete link more

Comments

Thanks a lot. Sorry to bother you more, but... when i use $ R = (\mathbb{Z} /7 \mathbb{Z}) /(x^7 -1)$ instead, does it work the same? And in you line 3 you say: "f = RR(x^6-x^4+x^3+x^2-1)"... i dont know exactely what this is good for (like i said... i am totally new to sage). Does that mean you are are looking at x^6-x^4+x^3+x^2-1 as an element in RR?

bruno171092 gravatar imagebruno171092 ( 2015-11-22 15:21:55 +0100 )edit

I updated my answer to answer your questions.

tmonteil gravatar imagetmonteil ( 2015-11-22 17:11:46 +0100 )edit

Thanks once more.

bruno171092 gravatar imagebruno171092 ( 2015-11-22 19:52:46 +0100 )edit

Note that you can also use GF(7) instead of Zmod(7), to see it as a field instead of a ring.

slelievre gravatar imageslelievre ( 2015-11-24 10:16:21 +0100 )edit
0

answered 2015-11-22 14:43:43 +0100

FrédéricC gravatar image

updated 2015-11-22 14:45:10 +0100

Over QQ you can do that

sage: R = PolynomialRing(QQ, 'x')
sage: x = R.gen()
sage: quot = R.quotient_by_principal_ideal(x**7-1)
sage: y = quot.gen()
sage: 1/(y**6-y**4+y**3-y**2+1)
2/13*xbar^6 - 1/13*xbar^5 + 3/13*xbar^4 - 1/13*xbar^3 + 2/13*xbar^2 + 4/13*xbar + 4/13
sage: 1/(y**6-y**4+y**3+y**2-1)
16/43*xbar^6 + 11/43*xbar^5 + 21/43*xbar^4 + 1/43*xbar^3 - 2/43*xbar^2 + 4/43*xbar - 8/43

and you can see that the inverses do not exist over ZZ, as 13 or 43 must be invertible

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-11-22 13:54:35 +0100

Seen: 4,384 times

Last updated: Nov 22 '15