Function Repository Resource:

RootDegree

Source Notebook

Get the polynomial degree of an algebraic number

Contributed by: Ed Pegg Jr

ResourceFunction["RootDegree"][s]

returns the polynomial degree of the algebraic number s.

Details

The polynomial degree of an algebraic number s is the degree of the polynomial of lowest degree for which s is a root.

Examples

Basic Examples (3) 

Find the root degree of the plastic constant, which satisfies the relation :

In[1]:=
ResourceFunction["RootDegree"][
Root[-1 - # + #^3& , 1, 0]]
Out[1]=

Find the root degree for roots of polynomials of orders 2 to 8:

In[2]:=
Table[ResourceFunction["RootDegree"][
  First[x /. Solve[x^k == x + 1]]], {k, 2, 8}]
Out[2]=

Find the root degree of some trigonometric roots:

In[3]:=
Table[ResourceFunction["RootDegree"][Sin[\[Pi]/k]], {k, 3, 20}]
Out[3]=
In[4]:=
Table[ResourceFunction["RootDegree"][Tan[\[Pi]/k]], {k, 3, 20}]
Out[4]=

Scope (2) 

Root degree of an AlgebraicNumber:

In[5]:=
ResourceFunction["RootDegree"][
 AlgebraicNumber[Root[#^3 + # + 1 &, 3], {1, -2, 2, -1, 1}]]
Out[5]=

Show the root degree of cumulative sums of roots of primes:

In[6]:=
primesqrt = FoldList[Plus, 1, Sqrt[{2, 3, 5, 7, 11}]];
ResourceFunction["RootDegree"] /@ primesqrt
Out[7]=

Possible Issues (3) 

The default $MaxRootDegree is 1000:

In[8]:=
$MaxRootDegree
Out[8]=

Under default conditions, a degree-1000 root may be evaluated:

In[9]:=
ResourceFunction["RootDegree"][
 Root[#^1000 - 123 #^777 + 211 #^356 - 127 #^123 + 888 #^11 - 2 &, 1]]
Out[9]=

A degree-1001 root will fail under default conditions:

In[10]:=
ResourceFunction["RootDegree"][
 Root[#^1001 - 123 #^777 + 211 #^356 - 127 #^123 + 888 #^11 - 2 &, 1]]
Out[10]=

RootDegree only works on exact algebraic numbers:

In[11]:=
ResourceFunction["RootDegree"][1.618033988749895]
Out[11]=

Use RootApproximant to get a number that can be given to RootDegree:

In[12]:=
ResourceFunction["RootDegree"][RootApproximant[1.618033988749895]]
Out[12]=

Some algebraic numbers might not be recognized by RootDegree:

In[13]:=
ResourceFunction["RootDegree"][
 HypergeometricPFQ[{1/5, 2/5, 3/5, 4/5}, {1/2, 3/4, 5/4}, 3125/256]]
Out[13]=
In[14]:=
N[HypergeometricPFQ[{1/5, 2/5, 3/5, 4/5}, {1/2, 3/4, 5/4}, 3125/256] ==
   Root[1 - # + #^5 &, 4], 50]
Out[14]=

Version History

  • 1.0.0 – 07 February 2022

Related Resources

License Information