Main Menu | A-Level Resources Menu | Program Menu
Peter McPolin, St Mary's College of Education, Belfast
This program uses Sturm’s method to calculate the total number of real zeros of a given polynomial with real coefficients. It will also give the number of zeros lying in any specified interval. Multiple zeros are only counted once. The program may be used as an investigative tool, for example, to study how changes in the coefficients of a given polynomial affect its zeros or to investigate zeros of families of polynomials of a given form. It may also be used as a simple tool for roughly locating the zeros of polynomials before either graphing or using the built-in TI-82 root finder.
The main program is called STURM and when you run it you obtain the following main menu called .

ENTER POLYNOMIAL MENU
The program allows the user three ways to load a polynomial:
1. enter the coefficients directly one at a time (option 1);
2. use stored data from the last calculation (option 2);
3. use coefficients stored in matrix E (option 3).
1. ENTER COEFFS
This option allows the user to enter the coefficients of the polynomial:
A0+A1X+A2X2+...
The user is first prompted for the degree n of the polynomial (n
2) and is then prompted in turn for each coefficient, starting with the
constant coefficient A0 and ending with the coefficient of the highest
power of X, namely An - see input screen below.

2. RCL LAST POLY
This option allows the user to continue working with the stored data of a previously entered polynomial. This data is in fact the Sturm sequence for the last entered polynomial and is stored in matrix A. Consequently the option can only be used provided A has not altered since the program was last run. If this is the case the option takes the user directly (without further calculation) to the COUNT ZEROS menu (see below) to continue investigating the zeros of this last-entered polynomial.
Because another program or operation may have overwritten A since STURM was last used, it is advisable to check the integrity of the matrix A before choosing this option. As a quick check, row 1 of A should contain the coefficients of the last entered polynomial starting with the constant term, row 2 should contain the coefficients of the derivative and there should be at least three rows.
3. USE MATRIX E
This option allows the user to read in the polynomial coefficients from matrix E. It is particularly useful if the polynomial has a high degree with only a few non-zero coefficients (i.e. a ‘sparse’ polynomial). Further, since the data in this matrix is not altered by the program, it is a convenient way to investigate families of polynomials having a specific form - the user can easily change the data using the calculator’s matrix editing facilities between runs of the program.
The coefficients are encoded as follows: the matrix E is a 2 x k matrix, where k is the number of non-zero coefficients of the polynomial to be entered; the first row of E contains the actual coefficient values and directly under each of these is the corresponding power of X.
For example, the matrix corresponding to the polynomial:
2x11-3x7+32
is displayed in the screen below.

COUNT ZEROS MENU
After entering the polynomial the program calculates its Sturm sequence and stores it in matrix A. (This stage would be by-passed if the user had selected RCL LAST POLY - see option 2 above.) This calculation may take some time, depending on the degree of the polynomial, but it has the virtue of having to be calculated only once for that particular polynomial - the subsequent calculations will use the stored sequence. After the calculation is complete the following menu is displayed.

The action of each option in this menu is described below:
1. TOTAL NUMBER
This option will output the total number of zeros of the currently entered polynomial - multiple zeros are only counted once - together with an interval (X,Y) in which all of these zeros lie. This interval will in general be rather crude, so the user may wish to investigate a smaller interval within this range - see option 2 below.
For example, the output screen corresponding to the polynomial:
2x11-3x7+32
is shown below.

Pressing [ENTER] returns the user to the COUNT ZERO menu.
2. GIVE INTERVAL
Here the user is prompted for an interval (X,Y). The program will count the number of zeros of the currently entered polynomial which lie within this interval. (Multiple zeros are only counted once). An example of an input screen is shown below.

The resulting output screen is similar to that obtained from option 1 above and again pressing [ENTER] at this output screen returns the user to the COUNT ZERO menu.
3. EXIT
This option returns the user to the main menu: ENTER POLYNOMIAL.
The overall program consists of the main program STURM and 8 sub-programs:
(Click to view listing)
| STURM STURMCF STURMCZ STURMDF STURMDP STURMEV STURMMC STURMSC STURMSE |
- Main Program - Enter coefficients. - Counts zeros. - Constructs the derivative polynomial. - Polynomial Remainder Routine. - Evaluates the Sturm sequence at X and Y. - Input routine from matrix E. - Counts sign changes form evaluated Sturm sequence. - Calculates Sturm Sequence. |
The program requires 3093 bytes of memory. It uses matrix A to store the Sturm Sequence, each row of which contains the coefficients of the sequence’s polynomials. Matrices B and C are used in the evaluation of the Sturm sequence. The various routines make use of the lists L1-L6.
Instructions for downloading at the Texas Program Archive.