Macaulay2 » Documentation
Packages » RealRoots :: SturmCount
next | previous | forward | backward | up | index | toc

SturmCount -- the number of real roots of a rational univariate polynomial

Synopsis

Description

This computes the difference in variation of the Sturm sequence of f on the interval $(a,b]$. If a and b are not specified, the interval will be taken from $-\infty$ to $\infty$. If the coefficients of f are inexact, then the computations may be unreliable.

i1 : R = QQ[t]

o1 = R

o1 : PolynomialRing
i2 : f = (t - 5)*(t - 3)^2*(t - 1)*(t + 1)

      5      4      3      2
o2 = t  - 11t  + 38t  - 34t  - 39t + 45

o2 : R
i3 : roots f

o3 = {-1, 1, 3, 3, 5}

o3 : List
i4 : SturmCount(f)

o4 = 4
i5 : SturmCount(f,0,5)

o5 = 3
i6 : SturmCount(f,-2,2)

o6 = 2
i7 : SturmCount(f,-1,5)	       

o7 = 3

In the above example, multiplicity is not counted. To include it, make the multiplicity option true.

i8 : SturmCount(f,Multiplicity=>true)

o8 = 5
i9 : SturmCount(f,0,5,Multiplicity=>true)

o9 = 4
i10 : SturmCount(f,0,3,Multiplicity=>true)

o10 = 3

If a is an InfiniteNumber, then the lower bound will be $-\infty$, and if b is an InfiniteNumber, then the upper bound is $\infty$.

i11 : SturmCount(f,-infinity, 0)

o11 = 1
i12 : SturmCount(f,0,infinity)

o12 = 3
i13 : SturmCount(f,-infinity,infinity)

o13 = 4

See also

Ways to use SturmCount :

For the programmer

The object SturmCount is a method function with options.