{"id":21,"date":"2016-09-22T19:01:48","date_gmt":"2016-09-22T19:01:48","guid":{"rendered":"http:\/\/keithmellinger.com\/magma\/?page_id=21"},"modified":"2016-09-22T20:18:28","modified_gmt":"2016-09-22T20:18:28","slug":"factoring-polynomials","status":"publish","type":"page","link":"https:\/\/keithmellinger.com\/magma\/factoring-polynomials\/","title":{"rendered":"Factoring Polynomials"},"content":{"rendered":"<p>We know that factoring a polynomial can be radically different depending on which field makes up your coefficient ring. Let\u2019s illustrate this using <em>Magma<\/em>. We\u2019ll use the polynomial x<sup>5<\/sup> \u2013 5 and try to factor it over three different coefficient fields.<\/p>\n<p>To construct a polynomial ring over the ring of integers, we use the command:<\/p>\n<p><code>&gt; P&lt;x&gt; := PolynomialRing(Integers());<\/code><\/p>\n<p>This assigns P to be the desired polynomial ring and the variable we\u2019ll use is x. Once you have the ring defined, you can create polynomials in that ring, and ask <em>Magma <\/em>to factor them. Notice, however, that you must tell <em>Magma<\/em> to think of the polynomial as \u201cliving\u201d in that specified ring. Polynomials such as x<sup>5<\/sup> \u2013 5 can live in many rings! Watch what happens as we change the coefficient ring:<\/p>\n<p><code>&gt; P&lt;x&gt; := PolynomialRing(Integers());<br \/>\n&gt; f := P! x^5 - x;<br \/>\n&gt; Factorization(f);<br \/>\n[<br \/>\n&emsp;&emsp;&lt;x - 1, 1&gt;,<br \/>\n&emsp;&emsp;&lt;x, 1&gt;,<br \/>\n&emsp;&emsp;&lt;x + 1, 1&gt;,<br \/>\n&emsp;&emsp;&lt;x^2 + 1, 1&gt;<br \/>\n]<br \/>\n&gt; P2&lt;x&gt; := PolynomialRing(GF(2));<br \/>\n&gt; f := P2! x^5 - x;<br \/>\n&gt; Factorization(f);<br \/>\n[<br \/>\n&emsp;&emsp;&lt;x, 1&gt;,<br \/>\n&emsp;&emsp;&lt;x + 1, 4&gt;<br \/>\n]<br \/>\n&gt; P3&lt;x&gt; := PolynomialRing(GF(3));<br \/>\n&gt; f := P3! x^5 - x;<br \/>\n&gt; Factorization(f);<br \/>\n[<br \/>\n&emsp;&emsp;&lt;x, 1&gt;,<br \/>\n&emsp;&emsp;&lt;x + 1, 1&gt;,<br \/>\n&emsp;&emsp;&lt;x + 2, 1&gt;,<br \/>\n&emsp;&emsp;&lt;x^2 + 1, 1&gt;<br \/>\n]<\/code><\/p>\n<p><strong><em>Exercise:<\/em><\/strong> There are many more commands in <em>Magma<\/em> for working with polynomials. Define the polynomial ring P5 over the finite field with 5 elements. Then, use the <code>IsIrreducible(f)<\/code> command to determine if the following polynomials are irreducible. If not, find the factorizations (over GF(5)).<\/p>\n<ul>\n<li>x<sup>4<\/sup> + x<sup>2<\/sup> + 1<\/li>\n<li>x<sup>4<\/sup> + x<sup>3<\/sup> + 1<\/li>\n<li>x<sup>4<\/sup> + x + 1<\/li>\n<li>x<sup>4<\/sup> + x<sup>2<\/sup> + x + 1<\/li>\n<li>x<sup>4<\/sup> + x<sup>3<\/sup> + x<sup>2<\/sup> + 1<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>We know that factoring a polynomial can be radically different depending on which field makes up your coefficient ring. Let\u2019s illustrate this using Magma. We\u2019ll use the polynomial x5 \u2013 5 and try to factor it over three different coefficient fields. To construct a polynomial ring over the ring of integers, we use the command: &hellip; <a href=\"https:\/\/keithmellinger.com\/magma\/factoring-polynomials\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Factoring Polynomials<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-21","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/keithmellinger.com\/magma\/wp-json\/wp\/v2\/pages\/21","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/keithmellinger.com\/magma\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/keithmellinger.com\/magma\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/keithmellinger.com\/magma\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/keithmellinger.com\/magma\/wp-json\/wp\/v2\/comments?post=21"}],"version-history":[{"count":5,"href":"https:\/\/keithmellinger.com\/magma\/wp-json\/wp\/v2\/pages\/21\/revisions"}],"predecessor-version":[{"id":37,"href":"https:\/\/keithmellinger.com\/magma\/wp-json\/wp\/v2\/pages\/21\/revisions\/37"}],"wp:attachment":[{"href":"https:\/\/keithmellinger.com\/magma\/wp-json\/wp\/v2\/media?parent=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}