Spreadsheets have long been a useful tool for analysing problems numerically. More recently, computer algebra systems have hit the scene. We demonstrate how the Texas Instruments TI-92 goes some way to incorporate computer algebra into a simple spreadsheet environment. Examples of some unexpected applications will be investigated.
Firstly the basic functions and operations of the Data/Matrix Editor are reviewed. Then various activities covering a range of mathematical areas are proposed. The first three of these deal with numerical applications of the type that may be familiar to users of spreadsheets in the mathematics classroom, and serve to illustrate the spreadsheet-style use of the Data/Matrix Editor. The subsequent activities introduce some features of computer algebra systems that hitherto have not been available within a spreadsheet environment.
Participants are encouraged to review the activities and their usefulness or otherwise for demonstrating and investigating the mathematical concepts, to consider the advantages and technical limitations of the Data/Matrix Editor for this purpose, and to speculate on the future development of algebraic spreadsheets.
Introducing the Texas TI-92 Data/Matrix Editor
Before we start, let us create a new Folder called "spread" for our work:
VAR-LINK
F1: Manage
5: Create Folder and enter the name spread
The Data/Matrix editor is accessed by pressing the big blue APPS key:
APPS
6: Data/Matrix Editor
3: New…
and in the resulting dialog box call the new variable temp as shown:

An empty data table appears, which may look something like this:
The width of the columns can be changed:
F1:
9: Format…
Cell Width: 8 (this fits four columns in screen. Experiment with others)
Auto-calculate: ON (we will keep this setting throughout)
Data is entered in columns. Each column is a "list" (regular users of Texas calculators
will understand the significance of lists). Use the cursor pad to move around the cells of the
table. Note the name of the cell in the entry line, in the form r1c1=
Type the cell content in the entry line, then press ENTER or the down cursor. See what happens
if you try to enter something directly into cell r5c3, for example:

This illustrates that the Data/Matrix Editor thinks in complete columns (which can be up to
999 elements long). It is not possible to specify the content of an individual
cell in terms of another individual cell, as you can with standard spreadsheets. Try to get the
value 49.5 in r6c4 by defining it in the entry line as r6c4 = r5c3 / 2. No luck!
What you can do, and this is the key feature for using the Data/Matrix Editor
as a simple kind of spreadsheet, is to define one column as a function of others.
Let us try this. First clear the current screen by
F1:
8: Clear Editor
Enter the values 1, 2, 3, 4, 5, 6 in c1
Now highlight the column header c2 for the second column. You can now define column c2 as a
function of column c1. Try, for example
c2 = 2*c1
You should see the following screen, as expected. Note that the length of column c2 is
dictated by the length of column c1:

Now define columns c3 and c4, for example by
c3 = c2^2 and c4 = c1 + c2 + c3

Note that when you highlight a cell in a column which has been defined as a function of
other columns, a padlock appears against its name in the entry line. This shows that the
content of that cell is "locked" by the column definition and cannot be altered.
Of course, you can alter the contents of column c1. Note that, if you alter a value, the
corresponding values in the other columns change. Also, if you add an element, the other
columns increase in length accordingly:

The blank cells above the column headers can be used for column titles. Move the cursor to
the cell, and type in whatever seems appropriate:

You can clear the contents of the Data/Matrix Editor now by pressing
F1:
8: Clear Editor
The facility of the Data/Matrix Editor that we want to focus on here is the ability to
define data and column definitions symbolically. Enter yourself a variety of functions in
column c1, for example:

Now define subsequent columns as functions of c1:
c2 = c1^2 and c3 = d(c1,x) the derivative of c1

We note two things:
- This "algebraic spreadsheet" does not use "pretty print".
- Often the columns are too narrow to contain the full expression. This is shown by the . . .
at the end. Using the cursor to highlight a cell shows its content in the entry line (although,
as we will see, this does not always help). Of course, we could increase the width of the
columns, but the maximum width available is only 12 characters.
The reader may now wish to experiment further with the Data/Matrix Editor, or move on to
the structured activities overleaf.
Activity 1: A simple business spreadsheet
Start a new datasheet called "business" in your "spread" folder:
APPS
6: Data/Matrix Editor
3: New ...
Type: Data
Folder: spread
Variable: business
We shall assume you can do this in future!
Change the cell width to 6 (to get five columns on screen) and check auto-calculate on
F1:
9: Format...
And this!
We shall set ourselves up as ironmongers, and order in some stock. Enter the business data
as shown, including the column titles:

(Hint: Use Display Digits = Fix2 from the MODE options)
What is the total cost of our order? We define column c4 as the costs of each item:
c4 = c2 * c3
and obtain the order costs of each item:

The obvious thing to do now is to find the total order cost as a column total. In a standard
spreadsheet, we would do this by highlighting cell r5c4 and typing something like
r5c4=sum(c4). Try this now - no luck! You cannot edit the contents of any cell in c4
because the column is "locked" by its definition. What you have to do here is to define c5 as
the sum of c4: c5=sum(c4)

Now check yourself that changing any item cost in c2 and/or any order quantity in c3 will
result in the corresponding values in c4 and the total cost in c5 being updated automatically.
(Simply use the cursor pad to highlight which cell you want to change, and type the new
value.)
We can now extend the spreadsheet to include our selling prices, and get the spreadsheet to
automatically calculate our profit.
Enter some appropriate selling prices into column c6. Under the assumption that we will sell
all the items we stock, define c7 to be the take and define c7=c3*c6.
The total take can be shown in c8 by c8=sum(c7)
Now what about our profit on this business?
The actual profit can be shown in c9 by c9=c8-c5
The percentage profit can be shown in c10 by c10=(c9/c5)*100


We note that we soon hit upon the limitations of the TI-92's screen size, and need to scroll
backwards and forwards to keep track of what we are doing. However, we have created a simple
spreadsheet with similar functionality to a "real" one, in that a full "what if?" analysis can
be carried out by varying the costs, order numbers and selling prices (c2, c3 and c6) and
observing the effect on the profit.
Now comes something useful...
We recall that a function or variable defined in the Home screen of the TI-92 retains its
value in the Data/Matrix Editor. So suppose in this example, we wish to keep things simple
by making the selling prices of nuts and bolts the same, the selling price of a plate 4 times
that of a nut and the selling price of a rod 3 times that of a nut. This would mean entering
p, p, 4p and 3p into column c6. Note that subsequent columns which depend on c6
are recalculated in terms of p. Unfortunately, since their contents are locked, we
cannot work with them directly. However, let us vary the value of p.
Jump to the Home screen [¨] HOME and assign
p the value 0.50 by 0.50 STO> p .
Now revert to the current spreadsheet by APPS 6:Data/Matrix Editor 1:Current
and observe the updated values:


Can you guess a value of p which will yield a percentage profit of (say) 80%?
Activity 2: Solving an equation
This is a classic application of spreadsheets for solving mathematical problems. A solution
of f(x) = 0 is found by tabulating values of f(x) over an initial discrete
domain, and observing an interval where the function changes sign. This interval is then
tabulated in smaller steps, and the process repeated until the desired accuracy reached.
This procedure is particularly easy to apply on the TI-92.
For example, let us find the root of the equation
x3 + x - 100 = 0.
Start a new datasheet called "eqnsolve" in your "spread" folder, and choose cell width 12.
In this and subsequent Activities, we shall make use of the SEQ( ) function. Its syntax
is:
SEQ( expression , variable , low , high [, step] )
and it will automatically fill a column with a sequence. Default step is 1.
To set up an initial list of values for x, use the SEQ( ) function as follows:
c1 = SEQ( i , i , 0 , 6 )
The corresponding values of the function can be tabulated in column c2 by
c2 = c1^3 + c1 - 100

Thus we see that there is a change of sign between x = 5 and x = 6. So we
re-tabulate within this interval, to 1 decimal place now. Do this simply by editing the
column heading of c1 to read:
c1 = SEQ( i , i , 4 , 5 , 0.1 )
The function values in c2 are updated automatically. (HINT: If you still have the display set
to FIX2 from the previous activity, change it now to FLOAT8). By scrolling down, we see now
that the root must lie between x = 4.5 and x = 4.6
Repeated editing of the definition on the values in column c1 allows us to "zoom in" on the
position of the root of the equation.
After a few more iterations, we may end up with a table like the one below. (HINT: to edit
the column header, you do not need to scroll back up to the top of the column. Simply
press F4.)

Thus the solution would appear to be x = 4.569780 correct to 6 d.p.
Of course, the integrated nature of the TI-92 as a tool for doing mathematics means that
this solution can be verified by using the SOLVE( ) function in the Home screen, or by plotting
and zooming in on the graph of y = x3 + x -100 where it cuts the x-axis.
It is this interplay between numerical, analytical and graphical approaches to problem-solving
which can be supported by the new educational technology now available.
Activity 3: Locating a turning point
A spreadsheet approach similar to that of locating a root in the previous activity can be
used to locate a turning point of a function, by progressively "zooming in" on the local
maximum (or minimum) value and re-tabulating to greater accuracy.
For example, locate the maximum value of the function f(x) = x e -3x
Start a new datasheet called "tpoint" in your "spread" folder.
Set up an initial domain of x-values in column c1:
c1 = SEQ( i , i , 0 , 6 )
and define column c2 as the given function:
c2 = c1 * e^(-3*c1)
Note that you should use MODE to set results to approximate mode, in order to work
numerically:

Here, we can observe that the function achieves its maximum somewhere within the
"double-width interval" between x = 0 and x = 2. Zooming in on this by editing
the column header of c1 to
c1 = SEQ( i , i , 0 , 2 , 0.1 )
yields the new table

and repeating this process leads eventually to a table something like:

where we would deduce the approximate co-ordinates of the T.P as
(0.333 , 0.1226265)
There is an alternative approach to locating turning points using a spreadsheet, based on
the fact that the gradient changes sign on either side of the turning point.
Suppose f(x) is given for a discrete set of equispaced ordered points
{x1 , x2 , x3 , …}.
Then if f(xn) - f(xn-1) and
f(xn+1) - f(xn) are of different signs, then f has a
turning point for some x between xn-1 and xn+1 .
(Assumptions of continuity are made.)
This can be implemented neatly using the SHIFT( ) function, which shifts the elements of a
column a specified number of rows.
Start a new datasheet called "tpoint2" in your "spread" folder:
c1 = SEQ( i , i , 0 , 6 )
c2 = c1*e^(-3*c1)
c3 = SHIFT( c2 , 1 )
c4 = c2 - c3

By considering the change of sign in the slope, we identify that a turning point must be
located between x = 0 and x = 2. We edit column c1 accordingly:

The turning point is now identified as between x = 0.2 and x = 0.4.
Continuing likewise, we end up eventually with a table something like:

from which we deduce, as before, that the turning point is at approximately
x = 0.3333 , y = 0.1226265
Activity 4: Investigating surds
The rules for manipulating surd quantities are often taken on trust. Computer algebra
systems allow arithmetic to be done exactly, and answers can be given in simplified surd form.
Combining this with the tabular approach of a spreadsheet, the student can generate a variety
of examples quickly, and investigate the application of the underlying rules.
We focus here on the result
Öm * Ön =
Ömn
where Ömn may simplify further.
Start a new datasheet called "surds" in your "spread" folder.
We will make use here of the function RAND( n ), which generates a random integer
between 1 and n for a positive integer n. Therefore a random integer between 5 and 8
inclusive will be given by RAND(4) + 4, and a random integer between 10 and 15 inclusive will
be given by RAND(6) + 9. These two sets of numbers will generate appropriate data for our
investigation.
Firstly, set the MODE to exact. Then:
c1 = SEQ( RAND(4) + 4, i, 1, 20 )
c2 = SEQ( RAND(6) + 9, i, 1, 20 )
c3 = Ö(c1)
c4 = Ö(c2)
c5 = c3 * c4

Scrolling down the lists, the student should justify the values in column c5 on the basis
of the values in columns c3 and c4. Sometimes it is "obvious" - as in rows 2 and 3 in the
screendump above - but sometimes it needs further explanation - as in rows 4 and 5.
Note that a fresh screen of data is automatically generated if you highlight and enter
any column header (which re-invokes the RAND( ) function).
The connection with the factorisation of the product mn can be made clear by:
c6 = FACTOR( c1*c2 )

The student should be encouraged to produce a table of results similar to the one above,
and to explain each of the values in column c5. As a self-test, the student could scroll back
across to "hide" columns c5 and c6, and generate a new table like the one below, then work out
what s/he thinks the values in c5 will be given as:

Activity 5: Summing series
Spreadsheets are ideal tools for generating sequences and series, and to investigate sums
and limits. We shall consider how the TI-92 can deal with this for numerical and algebraic
series.
Start a new datasheet called "sumn" in your "spread" folder.
We firstly attempt to "discover" the result 
Generate the terms of the series in column c1 by
c1 = SEQ( i , i , 1 , 20 )
and then calculate the cumulative sums of this series in column c2 by
c2 = CUMSUM( c1 )

Now factorise the values in column c2:
c3 = FACTOR( c2 )
The results seem to be going up in pairs:
1*1 , 1*3 ; 2*3 , 2*5 ; 3*5 , 3*7 ; 4*7 , 4*9 ; ...
Perhaps it would be worth considering the even-numbered sums and the odd-numbered sums
separately. This necessitates re-structuring the spreadsheet:
c1 = SEQ( 2*i , i , 1 , 10 )
c2 = S( i , i , 1 , c1 )
c3 = FACTOR( c2 )
Note the difference between S( ) and SUM( )
Scrolling down the list, it appears that n/2 is always a factor of the sum when
n is even. The remaining factor(s) are 3, 5, 7, 9, 11, 13, 15 … which is a pretty clear
indication of (n+1). So the result (n/2)(n+1) appears to hold when n is
even.
Now modify the spreadsheet (edit c1) to give the outcome when n is odd:
c1 = SEQ( 2*i-1 , i , 1 , 10 )

Here, it appears that n is always a factor of the sum when n is odd. The
remaining factor(s) are 1, 2, 3, 4, 5, 6, 7 ... which is a pretty clear indication of
(n+1)/2. So the result
(n)(n+1)/2 appears to hold when n is odd.
We are thus in a position to hypothesise that the formula (n/2)(n+1) will hold for
any n. Of course, it is difficult for us as professional mathematicians to "unlearn"
this standard result and discover it anew in this manner. However, students might appreciate
the spreadsheet approach as a way of investigating the series.
We will now consider the well-known arithmetic and geometric series. Start a new datasheet
called "apgp" in your "spread" folder.
Generate the sum of terms of an A.P. with first term a and common difference
d
c1 = SEQ( i , i , 1 , 10 )
c2 = a + (c1 - 1)*d
c3 = CUMSUM( c2 )

As earlier, there seems to be a different underlying pattern for the even terms and the odd
terms. So we could re-structure the spreadsheet as follows
c1 = SEQ( 2*i , i , 1 , 10 )
c2 = S( a + (i-1)*d , i , 1 , c1 )
c3 = FACTOR( c2 )

Activity 6: Differentiation by first principles
Spreadsheets allow the generation of numerical sequences which tend to a limit. This can be
incorporated with the algebraic facilities of the TI-92 to allow a visualisation of the
limiting behaviour of the gradient function.
Start a new datasheet called "diff1" in your "spread" folder.
We wish to consider the limit of
as h
tends to zero.
In column c1 generate a sequence of values for h:
c1 = SEQ( 0.1^i , i , 1 , 10 )
Start off by considering the function f(x) = x2
c2 = ( (x + c1)^2 - x^2 ) / c1
and to make the final result clear
c3 = EXPAND( c2 )

Thus the result appears to be of the form 2x plus a quantity which tends to zero.
Editing column c2 allows us to easily repeat the process for other functions, for example
f(x) = x3
c2 = ( (x + c1)^3 - x^3 ) / c1

Unfortunately the limitations of the display do not make it obvious in this example that the
terms after the 3x2 do indeed tend to zero.
Let us try another function: f(x) = 1/x
c2 = ( 1/(x + c1) - 1/x ) / c1

Again, the output in column c2 is not obvious, but scrolling down the column and keeping an
eye on the entry line, we see that we have the sum of two fractions. In such a case the
function COMDENOM( ) comes in handy:
c3 = COMDENOM( c2 )

and we see that the result simplifies to the form
where k tends to zero, giving the expected result.
Finally, here is a very interesting example: f(x) = sin(x)
c2 = ( sin(x+c1) - sin(x) ) / c1
and to expand out the compound angle:
c3 = TEXPAND( c2 )
The initial screen seems to indicate a result of the form a.cos(x) + b.sin(x) where
a tends to 1 and b tends to 0. However, scrolling down a few lines gives a
remarkable result:


The above approach to "differentiation by first principles" is based on forward differences.
This is the standard approach generally take in schools and colleges, since the algebra is not
too difficult to do by hand. However, the central difference approach, namely

is not
only more quickly convergent but diagrammatically more intuitive and appealing:

We shall now investigate this method using a TI-92 spreadsheet.
Start a new datasheet called "diff2" in your "spread" folder.
We shall revert to the original example of f(x) = x2 and compare the two
methods:
c1 = SEQ( 0.1^i , i , 1 , 10 )
c2 = ( (x + c1)^2 - x^2 ) / c1
c3 = ( (x + c1)^2 - (x - c1)^2 ) / ( 2*c1 )

Amazing! Well, perhaps not so amazing if we approached it algebraically pen-and-paper,
since everything drops out neatly in the case of f(x) = x2.
Perhaps we could now compare the accuracy of the two methods by considering their errors.
Take the case f(x) = x3.
c1 = SEQ( 0.1^i , i , 1 , 10 )
c2 = ( (x + c1)^3 - x^3 ) / c1
c3 = ( (x + c1)^3 - (x - c1)^3 ) / ( 2*c1 )
c4 = c2 - d(x^3,x)
c5 = c3 - d(x^3,x)

So we see that in this case, the error of the second method is superior, being independent
of x. Also, in this particular example, we see most clearly confirmation of the
well-known result that the error of this method is of order h2.
Activity 7: Integration and areas
In the previous activity we considered differentiation by first principles. We shall now
consider integration and show how the integral is related to the area bounded by the graph.
We shall do so on the basis of upper Riemann sums and use the test function
f(x) = x2.
We shall demonstrate how the area beneath the curve between the limits x = 0
and x = t approaches
as the number of
rectangles increases.

Suppose there are n rectangles. Each will have width t/n. The height of the i'th
rectangle will be (i*(t/n))2 and hence the area will be
(t/n)*(i*(t/n))2 = (t/n)3 * (i)2
Therefore the total area of the rectangles is
for some specified n.
This simplifies to
and we shall take n to
be 1, 2, 4, 8, 16, ….
Start a new datasheet called "riemann" in your "spread" folder.
c1 = SEQ( 2^i , i , 0 , 50 )
c2 = t / c1
c3 = ( c2^3 ) * S( i^2 , i , 1 , c1 )


Note how the result converges, slowly but monotonically.
Activity 8: Reduction formulae
Sometimes it is possible to express an integral in terms of a related, but simpler,
integral. This is known as a reduction formula. A common application is for high powers of
trigonometric functions. For example,
A spreadsheet approach is suitable for investigating reduction formulae, since it is possible
to list results for all values of n (n = 1, 2, 3, 4, ... )
Firstly, let us verify the above reduction formula.
Start a new datasheet called "reduct" in your "spread" folder.
c1 = SEQ( i , i , 1 , 10 )
c2 = ò ( (cos(x))^c1 , x )
c3 = ò ( (cos(x))^(c1-2) , x )
c4 = c1*c2 - (c1-1)*c3

By scrolling down column c4, we see that it indeed appears to be the case that

thus verifying the reduction formula.
It is always useful to remember that functions defined in the Home screen retain their
definition in the Data/Matrix Editor. A more succinct implementation of the above is:
ò ( (cos(x))^n , x ) STO> I(n)

c1 = SEQ( i , i , 1 , 10 )
c2 = c1*I(c1) - (c1 - 1)*I(c1 - 2)
A particular application of reduction formulae leads to Wallis's Formulae.
Activity 9: Probability distributions
A numerical spreadsheet is an ideal environment for presenting the probabilities given by a
specified discrete probability density function, since P(X = x) is given as a function
of x. Furthermore, it is possible to change the values of the parameters and observe the
change in the shape of the distribution.
Let us run through a Binomial distribution, and generate some distributions.
Start a new datasheet called "bindist" in your "spread" folder
We shall consider a random variable X = Bin(n,p) with n = 6 and p
variable.
c1 = SEQ( i , i , 0 , 6 )
c2 = (6!/(c1!*(6-c1)!))* p^c1 * (1-p)^(6-c1)

The value of p can be set (e.g. to 0.2) by entering 0.2 STO> p in the
Home screen. By defining c3 = sum(c2) we can confirm that the total probability
is 1.

The graph of the distribution can be displayed.
F2: Plot Setup
F1: Define and fill in the dialog box as shown

[¨] WINDOW and choose -1<x<7 , -0.1<y<0.5
[¨] GRAPH

The algebraic facilities of the TI-92 allow us to analyse the general case of the Binomial
distribution. Let us now derive expressions for its mean and variance.
First delete the value of 0.2 we assigned to p earlier:
[2nd] VARLINK and scroll down until you find p
F1: Manage
1: Delete
We can also get rid of our column c3 (the total probability)
F6: Util
2: Delete
3: Column

Recall that the mean of a probability distribution is given by
and the variance is given by 
c3 = c1 * c2
c4 = SUM(c4)
c5 = c1^2 * c2
c6 = SUM(c5)
c7 = c6 - c4^2


Thus we achieve the well-known results E(X) = np , Var(X) = np(1-p)
In our example above, n = 6. However, to verify the results for other values of
n, all we need to do is to edit the definition of column c1 and choose a new upper
limit:
c1 = SEQ( i , i , 0 , new n )
as well as editing the definition of column c2 to replace the 6 by whatever new value we
choose:
c2 = (new n!/(c1!*( new n -c1)!) )* p^c1 * (1-p)^( new n -c1)
Try this!