# LU decomposition in TI-84

As an extension to a previous entry on doing LU decomposition in Nspire and R, the TI-84 is covered here. There is no built-in function like in the Nspire for this, but there are many programs available online, with most of them employing a simple Doolittle algorithm without pivoting.

The non-pivoting program described here for the TI-84 series is with a twist. No separate L and U matrix variables are used and the calculations are done in place with the original input matrix A. The end result of both L and U are also stored in this input matrix. This is made possible by the property of the L and U matrices in this decomposition are triangular. Therefore, at the little price of some mental interpretation of the program output, this program will take up less memory and run a little faster than most simple LU decomposition programs online for the same class of calculator. From a simple benchmark with a 5 x 5 matrix, this program took 2 seconds while another standard program took 2.7 seconds.

The input matrix A.

Results are stored in the same matrix.

L, U, and verification.

# Shipping option decision by linear regression on TI-84

An online store offered the following shipping options:

Monday – \$142
Tuesday – \$86
Friday – \$63

Applying linear regression in TI-84, the following parameters are obtained.

Plotting the results in Stat Plot:

It therefore appears delivery on Tuesday is the most appealing choice.

# Durbin-Watson statistic in TI-84

Unlike the more sophisticated TI-89 and Nspire, the Durbin-Watson statistic is not included in the TI-84. Yet, calculating it is fairly straight-forward using list functions.

This statistics of regression is given as

where e is the residual list of values. To obtain this list (using a previous multiple regression example), simply subtract the actual values from the regression formula (Y7 below):

Finally, run the formula below for answer.

# Graphical visualization of data distribution in TI-84 and R

For visualizing data distribution, the TI-84 Stat plot can provide some insights. Using the same data set as in the previous installment on Shapiro-Wilk test, TI-84 Stat plot is a quick and convenient tool.

In R, the command qqnorm() will show the following plot for the same data.

# P value of Shapiro-Wilk test on TI-84

To calculate the p-value from this W statistic obtained, the following steps can also be done on the TI-84 using some standard statistics function. Note that the approximation below are for the case 4 ≤ n ≤ 11.

The mean and standard deviation are derived using the below equations.

The W statistic is assigned from the correlation calculation results, and another variable V is calculated for the transformed W.

Finally, the standardized Z statistic and p-value is calculated using the mean, standard deviation, and the transformed W value.

# Micro SD card performance with different adaptor

There are several way to connect a micro SD card to a PC. The most popular being a versatile USB card reader that is capable to read different storage media. There are also built-in card reader on notebook computer.

Since the Android phone supported USB external media via OTG interface, there is a new kind of micro SD adapter on the market that work with both mobile device and PC, and are made very compact like the one on the right below.

To compare whether there will be difference in access speed, a simple test is performed using CrystalDiskMark with the two adapter devices above. Three groups of 10 sample read data (an internal SD reader of a notebook computer, a standard USB interface, and a USB 3.0 interface) are collected for the same micro-SD card which is a SanDisk 32GB class 4. The data are analysed using the ANOVA function available on the TI-84.

Looking at the p-value, there is a significant difference between any of the mean reading speed.

# Moving average calculation on scientific vs financial calculator

The idea behind moving average is very simple. It used to be quite cumbersome for older generations of calculator to do this sort of calculation. With modern models, this is a piece of cake as the List feature is almost becoming a standard feature.

For the popular TI-84 series, the list feature can be used to store values into variables. Not only can the list be named, the name assigned can also consist of multiple characters. With the list defined, the moving averages can easily be calculated with arbitrary parameters.

On the financial model arena, the HP17bII+ is a special breed alongside its popular and successful line of signature financial calculator HP12c. The manual for the 17b provided an example that make use of the built-in solver for this. The menu driven 17b is quite convenient to use.

# Solving linear programming problem with Nelder-Mead method

For solving linear programming problem, the simplex method is often applied to search for solution. On the other hand, the Nelder-Mead method is mostly applied as a non-linear searching technique. It would be interesting to see how well it is applied to a linear programming problem previously solved using the Simple Method in TI-84.

The Nelder-Mead method is ran under the TI Nspire CX CAS with NM program written in the TI Basic program. The program accepts arguments including the name of the function to maximize as a string and a list of initial parameters to execute the Nelder-Mead algorithm. The function itself is declared using piece-wise function to bound the return value to the function to maximize while giving penalty to values that violate any constraints (as in the inequalities of the standard simplex method).

Previous program in the TI-84 using the simplex method obtained {200,400} as the solution. The Nelder-Mead returned a solution very close to it.

# Date arithmetic in TI Nspire

The TI Nspire CX (and also 83, 84, 89 series) provided a useful date function, dbd(), for finding the number of days between two input dates. However, after nothing turn up searching for function to perform days addition, a quick and dirty program is developed by taking advantage of this built-in function.

The program takes two parameters: a date and the number of day to add, and basically brute force a range of dates to check if the dbd() function returns a value equals that of the intended number of days to add. The program assumed the format DDMM.YY, while the built-in dbd() function accepts format in either DDMM.YY or MM.DDYY.

# Nelder-Mead algorithm on the TI-84 Plus SE

This mean nothing more than to prove that implementing the Nelder-Mead algorithm on the TI-84 is possible. In reality, the time it will take for a TI-84 Plus SE to arrive a solution for any practical non-linear problem renders this somewhat a last resort option. That is, in the absence of any modern computer or even a decent mobile phone 🙂

The program is implemented in the native TI-Basic, which is ported from the program for the same problem previously done on TI Nspire and Casio fx-9860GII. It took some efforts to port the program as the resources on the TI-84 is comparatively limited. For example,variable names are also restricted to single character, but thanks to list, things are easier.

With the availability of the new generation TI-Connect software, the Program Editor has returned and this tool greatly helped programming the Nelder-Mead on TI-84. Although unlike the more advanced Nspire Software which is able to run the program on PC instead of having to download the program to the TI-84 every time, editing TI-Basic in PC with a full keyboard and full screen is way more comfortable than to doing so on the calculator. The new TI-Connect CE PC software looks really nice.

Screens of the actual program running on a TI-84 Plus Pocket SE. The equation to solve is the Rosenbrock function of f(x,y) = (a-x)^2 + b(y-x^2)^2, using a=1 and b=100.

The TI-84 Plus Pocket SE took 12 minutes to complete, while its big brother TI Nspire took only 22 seconds.