Disaster

Routine Summary

Returns a list of the frequency of values in another list.

Inputs

L₁ - the list you want to find the frequency of

Outputs

L₂ - the values of L₁ without repetition
L₃ - the frequencies of the values in the list L₂

Variables Used

L₁, L₂, L₃, I

Calculator Compatibility

TI-83/84/+/SE

Author

DarkerLine

URL: United TI

listfrequency.zip

:{L₁(1→L₂
:{1→L₃
:For(I,2,dim(L₁
:If max(L₂=L₁(I:Then
:L₃+(L₂=L₁(I→L₂
:Else
:augment(L₂,{L₁(I→L₂
:augment(L₂,{1→L₃
:End:End


With our list of values stored in L₁, we store the first element of L₁ to L₂ to initialize it, and store a value of one to L₃ because that value has appeared once in the list (by default it is the first value and thus we know it appeared). We then begin looping in the second element to avoid an extra increment and then through all of the elements of L₁.

When determining the frequency of a value, we need to check to see if the particular element (in this case, L₁(I)) has already appeared in L₂. If it has, we increment (add one) to its respective frequency in L₂. However, if the value has never appeared in L₁, we add that value as a new element to the end of L₂ and also set its frequency to one. We repeat this until we have the frequency of all of the values in L₁ stored in L₂.

When you are done using L₁, L₂, and L₃, you should clean them up at the end of your program.

Command Summary

The E symbol is used for entering numbers in scientific notation.

Command Syntax

mantissa E exponent

Press [2nd][EE] to paste the E command.

TI-83/84/+/SE

1 byte

The E symbol is used for entering numbers in scientific notation: it's short for *10^. This means that in many cases, its function is identical to that of the 10^( command (aside from the parenthesis). However, the exponent of E is limited to constant integer values ‾99 to 99.

The E symbol is used in display by the calculator for large numbers, or when in Sci (scientific) or Eng (engineering) mode.

Unlike the exponent of E, the mantissa (a special term for the A in A*10^B, in scientific notation) isn't limited in variable type: it can be a constant, a real or complex variable or expression, a list, a matrix, or even omitted entirely (and then it will be assumed to equal 1). The reason for this versatility is simple: internally, only the exponent is taken to be an actual argument for this command. The rest of the calculation is done through implied multiplication.

5E3
………………5000
E‾5
……………….00001

E99 and -E99 are often used for negative and positive infinity because the TI-83 series of calculators doesn't have an infinity symbol. Commands that often need to use infinity include solve(, fnInt(, normalcdf( (and the other distributions), and many others. The error introduced in this way is usually irrelevant, because it's less than the minimum calculator precision, anyway: E99 is mindbogglingly huge.

# Optimization

Don't add the mantissa when it's 1:

1E5
should be
E5

In addition, E2 or E3 can be used as shorthand ways of writing 100 and 1000 respectively. This could be continued, in theory, for higher powers of 10, but those aren't necessary as often.

# Command Timings

E is much faster than using the 10^( command or typing out 10^. The drawback, of course, is that it's limited to constant values.

# Related Commands

Command Summary

Puts the calculator in fixed point display mode, displaying value digits after the decimal.

Command Syntax

Fix value

While editing a program, press:

1. MODE to access the mode menu.
2. Use arrows to select a number 0-9 from the 2nd line.

This will paste Fix number. Outside a program, it will simply put the calculator in the appropriate mode.

TI-83/84/+/SE

1 byte

The Fix command puts the calculator in fixed-point display mode: all numbers will be displayed with a fixed number of digits (0-9) after the decimal, depending on the argument of Fix. This could be useful if you're trying to display potentially fractional numbers in a limited amount of space.

A note on more technical aspects: first, if more digits are available than are displayed, the calculator will round off the displayed number (but not its stored value), so 3.97 will be displayed as 4 in Fix 1 mode. Second, the Fix command can't force more than 10 significant digits to be displayed, so something like 123456789.1 will only display one decimal digit even in Fix 9 mode.

Finally, note that the Float and Fix commands only change the way numbers are displayed: they are saved in the same way in each case. Even if you're in Fix 0 mode, the calculations are not done using integers, and in general the calculations are still done using floating-point numbers no matter the number mode. The one exception is with regressions: if you store a regression to an equation in Fix N mode, it will truncate the numbers involved before storing them to the equation, and as a result, the equation will be different.

# Related Commands

Command Summary

Puts the calculator in floating decimal display mode.

Command Syntax

Float

Press:

1. MODE to access the mode menu.
2. Use arrows and ENTER to select Float.

TI-83/84/+/SE

1 byte

The Float command makes the calculator display numbers with a "floating decimal point" — only as many digits after the decimal as needed are displayed (so whole numbers, for example, are shown without any decimal points). This is the default mode, and usually the most useful.

A technicality of displaying real numbers on the calculator: A maximum of 14 significant digits are stored in a number, but only 10 of them are actually displayed (or used for comparisons) — the rest are used for additional precision. This means that if a number is displayed as a whole number, it isn't necessarily whole. For example, 1234567890.7 will be displayed as 1234567891 (rounded to 10 significant digits), and 1.0000000003 will be displayed as 1.

This makes sense from many perspectives: if you get a result of 1.0000000003 after a calculation, odds are that this should be 1, and isn't just because of a precision error. Because the extra digits are there, though, even if they're not displayed, such a number will still be invalid for functions such as Pxl-On( or sub( that want integer arguments, and this sort of error is hard to track down.

Finally, note that the Float and Fix commands only change the way numbers are displayed: they are saved in the same way in each case. Even if you're in Fix 0 mode, the calculations are not done using integers, and in general the calculations are still done using floating-point numbers no matter the number mode. The one exception is with regressions: if you store a regression to an equation in Fix N mode, it will truncate the numbers involved before storing them to the equation, and as a result, the equation will be different.

# Related Commands

Command Summary

Sets all equations to use the dotted-line graphing style, and makes it the default setting.

Command Syntax

Dot

Press:

1. MODE to access the mode menu.
2. Use arrows to select Dot.

TI-83/84/+/SE

2 bytes

The Dot command sets all equations to use the disconnected "dotted-line" graph style: it calculates and draws points on the graph, but doesn't connect them. In addition, this graph style is made the default, so that when a variable is deleted it will revert to this graph style. The other possible setting for this option is Connected.

Compare this to the GraphStyle( command, which puts a single equation into a specified graph style.

The Connected and Dot commands don't depend on graphing mode, and will always affect all functions, even in other graphing modes. The exception to this is that sequence mode's default is always the dotted-line style, even when Connected mode is set. The Connected command will still change their graphing style, it just won't change the default they revert to.

In addition to graphing equations, this setting also affects the output of DrawF, DrawInv, and Tangent(.

Functions graphed using the dotted-line graph style are very strongly affected by the Xres setting (which determines how many points on a graph are chosen to be graphed). If Xres is a high setting (which means many pixels are skipped), functions in dotted-line mode will be made up of fewer points (in connected mode, this will also be the case, but because the points are connected this isn't as noticeable). You should probably set Xres to 1 if you're going to be using the dotted-line graph style — even 2 is pushing it.

# Related Commands

Command Summary

Sets all equations to use the connected graphing style, and makes it the default setting.

Command Syntax

Connected

Press:

1. MODE to access the mode menu.
2. Use arrows to select Connected.

TI-83/84/+/SE (Not available on TI-84+CE calculators)

2 bytes

The Connected command sets all equations to use the usual graph style - a connected line. In addition, this graph style is made the default, so that when a variable is deleted it will revert to this graph style. The other possible setting for this option is Dot.

Compare this to the GraphStyle( command, which puts a single equation into a specified graph style.

The Connected and Dot commands don't depend on graphing mode, and will always affect all functions, even in other graphing modes. The exception to this is that sequence mode's default is always the dotted-line style, even when Connected mode is set. The Connected command will still change their graphing style, it just won't change the default they revert to.

In addition to graphing equations, this setting also affects the output of DrawF, DrawInv, and Tangent(.

# Related Commands

Command Summary

Take the square root of a number.

Command Syntax

√(input)

Press 2nd √ to paste the √( command.

TI-83/84/+/SE

1 byte

Takes the square root of a positive or negative number. It works exactly the same as 2×√ or ^(1/2) but is smaller and uses an ending parenthesis. If used on a list, it will return a list with the square root of each element.

√(4)
2
√(2)
1.414213562

√({1,-1})
{1 i}


This may return a complex number or throw ERR:NONREAL ANS (depending on mode settings) if taking the square root of a negative number.

# Optimization

Never raise something to the one-half power explicitly; use this command instead.

:X^(1/2)→X
can be
:√(X→X


# Related Commands

Command Summary

Returns the reciprocal of a number (1 divided by the number). For matrices, finds the matrix inverse.

Command Syntax

valueֿ¹

Press [xֿ¹]

TI-83/84/+/SE

1 byte

The ֿ¹ command returns the reciprocal of a number, equivalent to dividing 1 by the number (although reciprocals are sometimes more convenient to type). It also works for lists, by calculating the reciprocal of each element.

The ֿ¹ command can also be used on matrices, but it is the matrix inverse that is computed, not the reciprocal of each element. If [A] is an N by N (square) matrix, then [A]ֿ¹ is the N by N matrix such that [A][A]ֿ¹=[A]ֿ¹[A] is the identity matrix. ֿ¹ does not work on non-square matrices.

4ֿ¹
.25
{1,2,3}ֿ¹
{1 .5 .3333333333}
[[3,2][4,3]]ֿ¹
[[3  -2]
[-4 3 ]]


Much like the number 0 does not have a reciprocal, some square matrices do not have inverses (they are called singular matrices) and you'll get an error when you try to invert them.

# Optimization

Writing Aֿ¹B instead of B/A is sometimes beneficial when B is a complicated expression, because it allows you to take off closing parentheses of B. For example:

:(P+√(P²-4Q))/2
can be
:2ֿ¹(P+√(P²-4Q


This may be slower than dividing. There are also situations in which this optimization might lose precision, especially when the number being divided is large:

7fPart(4292/7
1
7fPart(7ֿ¹4292
.9999999999


# Related Commands

Routine Summary

Calculates the day of week of a date, without using dayOfWk( (because it's only available on the 84+ and 84+SE)

Inputs

D - The day
M - The month
Y - The year (1950 through 2049)

Outputs

Ans - 0-6 = the day of week (Sunday - Saturday)

Variables Used

D, M, Y, Ans

Calculator Compatibility

TI-83/84/+/SE

weekday.zip

:round(7fPart(dbd(101.5,DE2+M+fPart(.01Y))/7


Using the dbd( command, we return the number of days between the given date and January 1, 1950, our base date. dbd('s argument, in this case, is of the form DDMM.YY, so we put the date we're given in that form with DE2+M+fPart(.01Y. Once we have the number of days between the two dates, we divide it by seven (as there are seven days in a week) to get the number of weeks.

However, we are not interested in the number of weeks between two dates, we are interested in how far into the week we are. That would be the fractional part of the number of weeks. For example, if there was fourteen days between two dates (the first date being a Sunday) and we divide that by seven, we would have the equation 14/7=2.00. The .00 means that the week hasn't yet begun (and so, the day is Sunday).

If there was 15 days between two dates, the equation would give 15/7=2.1428571. The .1428571 means that we are .1428571 into the week, and if we multiply that by seven, we get the equation .1428571*7=1. This means that we are one day into the week (and so, the day is Monday). So in our formula, after finding out the number of days between two dates, we find the fractional part of it, and multiply that by seven. Finally, round( gets rid of any minor rounding errors.

As the 1st of January, 1950 was a Sunday (which is the date we have inputed into the above routine), so the number of days into the week will always be relative to Sunday. That is, the output 0 through 6 is relative to the days Sunday through Saturday respectively. If you want 0 to be Monday instead, make the base date January 2 instead by changing 101.5 to 201.5.

This routine can handle dates from January 1, 1950 to December 31, 2049. For other dates, it will assume the year is in that range instead. There is also an alternative routine that handles dates in an unlimited range.

# Display Day

Append the following code to display the day of the week:

:Disp sub("SUNDAY***MONDAY***TUESDAY**WEDNESDAYTHURSDAY*FRIDAY***SATURDAY*",9Ans+1,9      //replace *s with spaces


Or this code, which should display the day of the week, only the display method takes less space and space pads it.
Disp sub("***SUN***MON**TUESWEDNES*THURS***FRI*SATUR",6Ans+1,6)+"DAY       //replace *s with spaces


# Related Routines

Two-byte tokens beginning with the byte 0xBB are miscellaneous tokens, used for various commands that didn't fit in the one-byte range. With later OS versions, various symbols were also added to the 0xBB tokens.

The two tables on this page are split by calculator type, which means that (among other things) the tokens in the second table can't be sent to a TI-83 calculator from a TI-83+ calculator. Further version differences: tokens CF through DA are available with OS 1.15 or higher. Tokens DB through F5 are available with OS 1.16 or higher.

Miscellaneous 2-Byte Tokens (0x00 - 0x67)
0 1 2 3 4 5 6
0 npv( normalcdf( tvm_Pmt ►Polar χ²-Test( ExprOn unused
1 irr( invNorm( tvm_I% e ZInterval ExprOff unused
2 bal( tcdf( tvm_PV SinReg 2-SampZInt( ClrAllLists unused
3 Σprn( χ²cdf( tvm_N Logistic 1-PropZInt( GetCalc( unused
4 ΣInt( Fcdf( tvm_FV LinRegTTest 2-PropZInt( DelVar G-T
5 ►Nom( binompdf( conj( ShadeNorm( GraphStyle( Equ►String( ZoomFit
6 ►Eff( binomcdf( real( Shade_t( 2-SampTTest String►Equ( DiagnosticOn
7 dbd( poissonpdf( imag( Shadeχ² 2-SampFTest Clear Entries DiagnosticOff
8 lcm( poissoncdf( angle( ShadeF( TInterval Select( (next table)
9 gcd( geometpdf( cumSum( Matr►list( 2-SampTInt ANOVA( (next table)
A randInt( geometcdf( expr( List►matr( SetUpEditor ModBoxplot (next table)
B randBin( normalpdf( length( Z-Test( Pmt_End NormProbPlot (next table)
C sub( tpdf( ΔList( T-Test Pmt_Bgn unused (next table)
D stdDev( χ²pdf( ref( 2-SampZTest( Real unused (next table)
E variance( Fpdf( rref( 1-PropZTest( re^θi unused (next table)
F inString( randNorm( ►Rect 2-PropZTest( a+bi unused (next table)
Miscellaneous 2-Byte Tokens (0x68 - 0xF5)
6 7 8 9 A B C D E F
0 (prev. table) Â Î Û β a p reserved 0 x
1 (prev. table) Ä Ï Ü γ b q @ 1
2 (prev. table) á í ú Δ c r # 2
3 (prev. table) à ì ù δ d s $3 4 (prev. table) â î û ε e t & 4 5 (prev. table) ä ï ü λ f u  5 6 (prev. table) É Ó Ç μ g v ; 6 7 (prev. table) È Ò ç π h w \ 7 8 Archive Ê Ô Ñ ρ i x | 8 9 UnArchive Ë Ö ñ Σ j y _ 9 A Asm( é ó ´ unused k z % 10 B AsmComp( è ò  φ unused σ C AsmPrgm ê ô ¨ Ω l τ D compiled asm ë ö ¿$\hat{p}$m Í ß E Á unused Ú ¡ χ n GarbageCollect x F À Ì Ù α F o ~ T unused Routine Summary Returns the sum of the elements of a matrix. Inputs [A] - the matrix whose elements you want to sum Outputs Ans - the sum of the matrix elements Variables Used [A], L₁, Ans Calculator Compatibility TI-83/84/+/SE Author zada URL: United TI Download sumofmatrix.zip :dim([A] :Matr►list(cumSum([A])T,Ans(1),L1 :sum(L1 The cumSum( command gets the cumulative sum of each column in the matrix, adding the value of the previous element to the next element, and repeating this for each consecutive element in the column. When the cumSum( command is finished, the last element in each column will contain the sum of that column. Taking the T (transpose) of the resulting matrix switches columns and rows. Then, using the Matr►list( command, the last column of this result is stored to L₁. This column was originally the last row of cumSum('s output, so it contains all the column sums. Finally, by calculating the sum of that list, we get the total of the matrix elements. L₁ is no longer necessary, and can be deleted. If you want to use the sum for future use, you can store it to a more permanent variable, such as A or X. When you are done using [A], you should clean it up at the end of your program. The term "e" is ambiguous and may refer to: • e, the mathematical natural logarithmic base constant. • e^(, the exponent command raising an expression to the e constant. • E, the scientific notation command for expressing very large or small numbers. If an internal link led you here, you may wish to change the link to point directly to the intended article. Command Summary Raises the input to the second power. Command Syntax value² Menu Location Press [x²] TI-83/84/+/SE 1 byte The ² command raises an input to the second power. It has exactly the same function as "^2", but is one byte smaller. If used on a list, it will return a list with all of the elements squared. If used on a matrix, it will return the second matrix power of the input matrix. 2² 4 {1,‾2,3}² {1 4 9} [[2,‾1][‾3,0]]² [[1 ‾2] [6 ‾3]]  # Optimization Use this command instead of ^2 in all instances. :X^2 can be :X²  # Related Commands Command Summary Formats a displayed number as a degree-minute-second angle. Command Syntax value►DMS Menu Location Press: 1. 2nd ANGLE to access the angle menu. 2. 4 to select ►DMS, or use arrows and ENTER. TI-83/84/+/SE 1 byte The ►DMS command can be used when displaying a real number on the home screen, or with the Disp and Pause commands. It will then format the number as an angle with degree, minute, and second parts. 30►DMS 30°0'0" 100/9°►DMS 11°6'40"  It will also work when displaying a number by putting it on the last line of a program by itself. It does not work with Output(, Text(, or any other more complicated display commands. Although ►DMS is meant as a way to format angles in Degree mode, it doesn't depend on the angle mode chosen, only on the number itself. Note that entering a number as degree°minute'second" will also work, in any mode, and it will not be converted to radians in Radian mode. # Error Conditions • ERR:SYNTAX is thrown if the command is used somewhere other than the allowed display commands. • ERR:DATA TYPE is thrown if the value is complex, or if given a list or matrix as argument. # Related Commands Command Summary R►Pθ( calculates the angle coordinate (in polar coordinates) given the Cartesian coordinates. Command Syntax R►Pθ(x,y) Menu Location Press: 1. 2nd ANGLE to access the angle menu. 2. 6 to select R►Pθ(, or use arrows and ENTER. TI-83/84/+/SE 1 byte R►Pθ( (Rectangular to polar θ) takes the (x,y) (Cartesian) coordinate, and returns the angle that the ray from (0,0) to (x,y) makes with the positive x-axis. This is the θ-coordinate of the same point in (r,θ) (polar) mode. The identity used for this conversion is tan(θ)=y/x, with the correct inverse being chosen depending on the quadrant that the point is in. The range of the angle returned is -π<θ≤π. R►Pθ( can also be used on lists. R►Pθ( is equivalent to the atan2() instruction seen in C/++ and FORTRAN. R►Pθ(3,4) .927295218 tanֿ¹(4/3) .927295218 R►Pθ(0,{1,-1}) {1.570796327, -1.57096327}  R►Pθ( is affected by Degree and Radian mode in its output, which is an angle measured in degrees or radians respectively. # Advanced Uses If you want the result to always be a radian angle, regardless of mode settings, you can divide the result by 1r: R►Pθ(x,y)/1^^r  If you want the result to always be a degree angle, regardless of mode settings, you can divide the result by 1°: R►Pθ(x,y)/1°  # Error Conditions # Related Commands Command Summary R►Pr( calculates the radius component (in polar coordinates) given the Cartesian coordinates. Command Syntax R►Pr(x,y) Menu Location Press: 1. 2nd ANGLE to access the angle menu. 2. 5 to select R►Pr(, or use arrows and ENTER. TI-83/84/+/SE 1 byte R►Pr( (Rectangular to polar radius) takes the (x,y) (Cartesian) coordinates, and gives the radius coordinate r of the same point in (r,θ) (polar) mode. The identity used for this conversion is r² = x²+y² R►Pr(3,4) 5 √(3²+4²) 5 R►Pr({6,5},{8,12}) {10 13}  The function works even when the equivalent √(x²+y²) fails due to overflow: R►Pr(3e99,4e99) 5e99  # Optimization R►Pr( is the smallest way to implement the distance formula$d=\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}$. Just give the values x1-x2 and y1 - y2 as arguments: :√((5-2)²+(4-0)²) can be :R►Pr(5-2,4-0)  # Error Conditions # Related Commands Command Summary P►Ry( calculates the y-value (in Cartesian coordinates) given Polar coordinates. Command Syntax P►Ry(r,θ) Menu Location Press: 1. 2nd ANGLE to access the angle menu. 2. 8 to select P►Ry(, or use arrows and ENTER. TI-83/84/+/SE 1 byte P►Ry( (polar to rectangular y-coordinate) calculates the y-coordinate of a polar point. Polar coordinates are of the form (r,θ), where θ is the counterclockwise angle made with the positive x-axis, and r is the distance away from the origin (the point (0,0)). The conversion identity y=r*sin(θ) is used to calculate P►Ry(. The value returned depends on whether the calculator is in radian or degree mode. A full rotation around a circle is 2π radians, which is equal to 360°. The conversion from radians to degrees is angle*180/π and from degrees to radians is angle*π/180. The P►Ry( command also accepts a list of points. P►Ry(5,π/4) 3.535533906 5*sin(π/4) 3.535533906 P►Ry({1,2},{π/4,π/3}) {.7071067812 1.732050808}  # Advanced Uses You can bypass the mode setting by using the ° (degree) and r (radian) symbols. This next command will return the same values no matter if your calculator is in degrees or radians: P►Ry(1,{π/4^^r,60°}) {.7071067812 .8660254038}  # Optimization In most cases P►Ry(r,θ) can be replaced by r*sin(θ) to save a byte: :P►Ry(5,π/12) can be :5sin(π/12)  Conversely, complicated expressions multiplied by a sine factor can be simplified by using P►Ry(r,θ) instead. :(A+BX)sin(π/5) can be :P►Ry(A+BX,π/5)  # Error Conditions # Related Commands Routine Summary Displays random lines. Inputs None Outputs None Variables Used A, B, C Calculator Compatibility TI-83/84/+/SE Download randomlines.zip :ClrDraw :ZStandard :Delvar ADelvar B :Repeat getKey :randInt(Xmin,Xmax→C :randInt(Ymin,Ymax :Line(A,B,C,Ans :Ans→B:C→A :End  Before we can start displaying random lines on the graph screen, we need to perform some basic setup. We then create two variables for the first (X,Y) coordinate by setting their initial values to zero. Once inside the Repeat loop, we randomly select the second (X,Y) coordinate for the line. (Please note we didn't need to store the second variable, since Ans is able to hold a numeric value, and it is also faster.) Now that we have the two coordinates for the line figured out, we draw the line on the screen and store the first coordinate values to the second coordinate values, i.e., the second coordinate becomes the new first coordinate. This gets repeated over and over again until you press a key. Routine Summary Displays the Sierpinski Triangle. Inputs None Outputs None Variables Used L₁, L₂, A, B, C Calculator Compatibility TI-83/84/+/SE Author Weregoose URL: United TI Download sierpinski.zip :ClrDraw :0→Xmin:2→Xmax :0→Ymin:1→Ymax :rand→A:rand→B :{0,1,2→L₁ :{0,1,0→L₂ :Repeat getKey :randInt(1,3→C :mean({A,L₁(C→A :mean({B,L₂(C→B :Pt-On(A,B :End  A Sierpinski triangle is a very common fractal that almost everybody has seen. It consists of a large triangle divided into three smaller triangles, which are then themselves divided into three smaller triangles, and this is repeated infinitely until the triangles are so small you can barely see them. In order to construct a Sierpinski triangle on the calculator, you need to use the graph screen. Before we can use the graph screen, however, we need to perform some basic setup. We then create our variables: two lists (one for the X coordinates and one for the Y coordinates) and two numerics (one for a random X number and one for a random Y number). Once we have our variables created, we start randomly coming up with places to display the pixels that will make up the triangle. Based on the formula used to generate the triangle, we take the average of the random list values and the random numbers that were generated, and use those for the coordinates of the next pixel. This gets repeated over and over again until either the triangle is completed or you press a key. Command Summary This command doesn't exist. A token for it does, though. Command Syntax PrintScreen Menu Location This command requires a hex editor to access. TI-83/84/+/SE 1 byte This command is probably the vestigial remnant of a planned function that wasn't implemented. A token is set aside for it, but the command doesn't actually do anything, and will cause an error if you try to use it. It's not accessible through any menus, though, so that's okay. The only potential use is to save on memory if you ever need to display "PrintScreen" somewhere - you can display this token instead. # Error Conditions • ERR:INVALID is thrown when trying to use this command. Routine Summary Displays the Pythagorean triples. Inputs C - how many triples you want to display Outputs None Variables Used A, B, C Calculator Compatibility TI-83/84/+/SE Author Weregoose URL: United TI Download pythagoreantriples.zip :For(A,2,C :For(B,1,A-1 :Disp {A²-B²,2AB,A²+B² :If getKey:Pause :End:End  A Pythagorean triple occurs when, while using the Pythagorean Theorem a2+b2=c2 to find the three sides of a right triangle, all three values are whole integers. For example, a common triple is 3,4,5 — in this case, 9 (32) + 16 (42) = 25 (52). The general formula that can be derived to figure out when a triple occurs is: a=(A2-B2) b=(2AB) c=(A2+B2). Now that you know what a Pythagorean triple is, the routine should be pretty clear. We are essentially looping over the range of values that we want to find triples in, and then displaying the triples as a three element list using the above mentioned formula. Because there can be many triples found, and displaying all of them would just be like a blur on the screen, the Pause command allows you to temporarily halt the program so you can see the triples that are currently displayed. TI-Basic features are fairly extensive set of commands and functionality, which allows you to do almost anything you want. This tutorial provides a brief overview of some of these things, along with links to further documentation available elsewhere on the wiki. # Basic Syntax A TI-Basic program consists of one or more statements, which can be commands, functions, or combination thereof. However, there are some general rules that you need to follow concerning syntax when using statements: While a command or function looks like it just made up of individual characters that you can type in, it is in fact a token that must be obtained in the appropriate menu or by pressing a key on the calculator. Using tokens allows the calculator to quickly lookup a command or function, rather than having to compile it together before you can use it. Each statement gets placed on its own line, which starts with a colon. The calculator automatically puts a colon at the beginning of the line, which cannot be edited. If you delete the line, however, the colon gets deleted as well. In addition to the built-in colons, you can artificially put multiple statements on the same line by separating each one with a colon. The calculator treats each of these statements as being on their own line. There is no built-in support for comments, although you can make your own by using strings. If you place a string of text inside a double quote on its own line, the calculator will simply read through this and not do anything with it. The calculator does not allow you to put quotes or the store arrow inside a string because those are used for indicating the beginning and end of the string. Whitespace is not allowed between the arguments of a command or function, and will cause an error if you try to put it there. However, if you have whitespace inside a string, the space is preserved by the calculator, and will impact how the string appears on the screen or gets used in the program. In addition, blank lines in a program are perfectly legal, although they do take up space. You can omit the closing parenthesis, quote, square bracket, curly brace, etc. at the end of a command or function. Each of these things take up space, and will impact the size of a program. However, if you have a complex expression involving lots of math, or you have multiple commands on one line, then you should keep them. (for more information, see Tokens and Token Size, Code Conventions, and Commenting Your Code) # Variable Types TI-Basic has four main built-in variable types: numerics, lists, matrices, and strings. Unlike other programming languages, TI-Basic does not allow you to create your own variables (with the exception of custom lists), and all of the variables are available globally across the calculator. You can use the variables inside functions and commands, and even combine several of them together to make new variables. Numerics A numeric represents a single number value, such as -5 or 2683.45, and there are 27 numeric variables (A-Z and theta). A value can be either real or complex (meaning it is an imaginary number), and the calculator represents each number as a floating point, with 14 decimal positions stored (although only 10 are accessible). :5→A  Lists A list represents a collection of expressions, consisting of numbers and/or numeric variables, stored together as one variable. There are six built-in list variables (L1,…,L6). You can also make your own custom list by using the little L character. When you construct a list, you need to put an opening curly brace, and then separate each value with a comma. You can have up to 999 values in a list. :{1,B,2,C→L1  Matrices A matrix represents a collection of expressions, consisting of numbers and/or numeric variables, stored together as one two-dimensional (row x column) variable. There are ten built-in matrix variables ([A],…[J]). When you construct a matrix, you need to put an opening square bracket, place an opening and closing bracket around each row, and separate each value with a comma. You can have up to 99x99 in a matrix. :[[1,2,3][4,5,6→[A]  Strings A string represents a sequence of characters, consisting of letters, numbers, symbols, commands, and functions, stored together as one variable. There are ten built-in string variables (Str1,…,Str0). When you construct a string, you need to put an opening double quote, and then list the characters one after another. A string's size is limited only by the amount of free RAM available. :"ABC DEF 123→Str1  (for more information, see Variable Types) # Program Flow TI-Basic has the majority of the standard conditional and looping structures that you find in other programming languages. A condition can be almost anything, including values, variables, or a combination thereof. Because of the way that TI-Basic interprets expressions, a condition is true if its value is one or non-zero, and false if its value is zero. Conditionals The simplest conditional involves just using the If command. You usually only use this when you just have one command or statement that you want to be executed. If you have two or more statements that you want executed when the conditional is true, you need to add a Then and End command to the If statement. The Then goes on the line right after the If command, and the End command goes after all of the statements that you want executed. The most complicated conditional is when you want to execute certain statements if the condition is true, and other statements if the condition is false. The conditional looks essentially the same as the multi-line conditional, with the only difference being that you insert an Else command in between the true and false statements. :If A=2:Then :Disp "A was 2 :A→B :End  Loops There are three different kinds of loops: While, Repeat, and For(. A While loop loops while the condition is true, whereas a Repeat loop repeats itself until the condition is true. A For( loop is essentially a specialized While loop, with the main differences being that it loops a set number of times and it has the condition built-in. :For(X,1,8 :Output(X,1,"Hello :End  Branching Branching allows the calculator to jump from one point in a program to another. You use the Goto and Lbl commands together to achieve this. The Lbl command specifies a location in the program, and the Goto command tells the program to jump to the location with the matching label. Loops are generally preferred over branching because it has some major disadvantages associated with using it. :Goto A ... :Lbl A  (for more information, see Controlling Program Flow and Logical Operators) Command Summary Puts the calculator into re^θi mode. Command Syntax re^θi Menu Location Press: 1. MODE to access the mode menu. 2. Use the arrow keys and ENTER to select re^θi TI-83/84/+/SE 1 byte The re^θi command puts the calculator into polar complex number mode. This means that: • Taking square roots of negative numbers, and similar operations, no longer returns an error. • Complex results are displayed in the form re^(θi) (hence the name of the command) The mathematical underpinning of this complex number format is due to the fact that if (x,y) is a point in the plane using the normal coordinates, it can also be represented using coordinates (r,θ) where r is the distance from the origin and θ is the angle that the line segment to the point from the origin makes to the positive x-axis (see Polar and PolarGC for more information on polar coordinates and graphing). What does this have to do with complex numbers? Simple: if x+yi is a complex number in normal (rectangular) form, and re^(θi) is the same number in polar form, then (x,y) and (r,θ) represent the same point in the plane. Of course, that has a lot to do with how you define imaginary exponents, which isn't that obvious. An equivalent form to polar form is the form r[cos(θ)+isin(θ)]. Unfortunately, the calculator seems to have some confusion about the use of degree and radian angle measures for θ in this mode (the answer is: you can only use radians — degrees make no sense with complex exponents). When calculating a value re^(θi) by using the e^( command and plugging in numbers, the calculator assumes θ is a radian angle, whether it's in Degree or Radian mode. However, when displaying a complex number as re^(θi), the calculator will display θ in radian or degree measure, whichever is enabled. This may lead to such pathological output as: Degree:re^θi Done e^(πi) 1e^(180i) Ans=e^(180i) 0 (false)  It's recommended, then, to use Radian mode whenever you're in re^θi mode. # Related Commands Command Summary Puts the calculator into a+bi mode. Command Syntax a+bi Menu Location Press: 1. MODE to access the mode menu. 2. Use the arrow keys and ENTER to select a+bi TI-83/84/+/SE 1 byte The a+bi command puts the calculator into rectangular complex number mode. This means that: • Taking square roots of negative numbers, and similar operations, no longer returns an error. • Complex results are displayed in the form a+bi (hence the name of the command) This is the standard way of displaying complex numbers, though they can also be displayed in polar form (see re^θi for more details). To extract the coefficients a and b, use the real( and imag( commands. # Advanced Uses Rather than switch to a+bi mode, you might want to force the calculations to use complex numbers by making the original argument complex. The general way to do this is by adding +0i to the number. However, there may be an optimization in any particular case. See the quadratic formula routine for a good example of this. Real Done √(-1) (causes an error) √(-1+0i) i  # Related Commands # See Also Command Summary Enables real number only mode. Command Syntax Real Menu Location While editing a program, press: 1. MODE to access the mode menu. 2. Use arrows and ENTER to select Real. TI-83/84/+/SE 1 byte The Real command puts the calculator in real number-only mode. This shouldn't be taken quite literally, as you can still type in i to get complex numbers, and do operations with them (they will be displayed as in a+bi mode, in that case). However, any operation done with real numbers that comes out to a complex result, such as taking the square root of a negative number, will throw a ERR:NONREAL ANS error. There is no real advantage to using Real mode over a+bi mode — it just adds another error condition that wouldn't be triggered otherwise. However, it is the default setting, and so there's a good chance that the calculator will be in Real mode when someone runs your program. Thus, when using complex numbers implicitly (such as in a quadratic equation solver) you should do something about this. # Advanced Uses Rather than switch to a+bi mode, you might want to force the calculations to use complex numbers by making the original argument complex. The general way to do this is by adding +0i to the number. However, there may be an optimization in any particular case. See the quadratic formula routine for a good example of this. Real Done √(-1) (causes an error) √(-1+0i) i  # Related Commands # See Also Command Summary Puts the calculator in Degree mode. Command Syntax Degree Menu Location While editing a program, press: 1. MODE to access the mode menu. 2. Use arrows and ENTER to select Degree. TI-83/84/+/SE 1 byte The Degree command puts the calculator into Degree mode, where the inputs and/or outputs to trig functions are assumed to be degree angles. Angles measured in degrees range from 0 to 360, with 0 being an empty angle, 90 being a right angle, 180 being a straight angle, and 360 being a full angle all the way around a circle. To convert from a radian angle to a degree angle, multiply by 180/π. To go the other way, and get a radian angle from a degree angle, multiply by π/180. The following commands are affected by whether the calculator is in Radian or Degree mode: The input is differently interpreted: The output is differently expressed: However, some commands are notably unaffected by angle mode, even though they involve angles, and this may cause confusion. This happens with the SinReg command, which assumes that the calculator is in Radian mode even when it's not. As a result, the regression model it generates will graph incorrectly in Degree mode. Also, complex numbers in polar form are an endless source of confusion. The angle( command, as well as the polar display format, are affected by angle mode. However, complex exponentials (see the e^( command), defined as$e^{i\theta}=\cos\theta+i\sin\theta$, are evaluated as though in Radian mode, regardless of the angle mode. This gives mysterious results like the following: Degree:re^θi Done e^(πi) 1e^(180i) Ans=e^(180i) 0 (false)  Overall, it's better to put your calculator in Radian mode when dealing with polar form of complex numbers, especially since no mathematician would ever use degrees for the purpose anyway. # Optimization It's sometimes beneficial to use the ° symbol instead of switching to Degree mode. The ° symbol will make sure a number is interpreted as a degree angle, even in Radian mode, so that, for example: Radian Done sin(90) -.8011526357 sin(90°) 1  This is smaller when only one trig calculation needs to be done. Also, it doesn't change the user's settings, which are good to preserve whenever possible. # Related Commands Command Summary Puts the calculator in Radian mode. Command Syntax Radian Menu Location While editing a program, press: 1. MODE to access the mode menu. 2. Use arrows and ENTER to select Radian. TI-83/84/+/SE 1 byte The Radian command puts the calculator into Radian mode, where the inputs and/or outputs to trig functions are assumed to be radian angles. Angles measured in radians range from 0 to 2π. They are defined as the arc length of the arc, on a unit circle (circle with radius 1), that corresponds to the angle when it is placed in the center. This definition actually only differs from degree measurements by a constant factor. To convert from a degree angle to a radian angle, multiply by 180/π. To go the other way, and get a radian angle from a degree angle, multiply by π/180. The following commands are affected by whether the calculator is in Radian or Degree mode: The input is differently interpreted: The output is differently expressed: However, some commands are notably unaffected by angle mode, even though they involve angles, and this may cause confusion. This happens with the SinReg command, which assumes that the calculator is in Radian mode even when it's not. As a result, the regression model it generates will graph incorrectly in Degree mode. Also, complex numbers in polar form are an endless source of confusion. The angle( command, as well as the polar display format, are affected by angle mode. However, complex exponentials (see the e^( command), defined as$\definecolor{darkgreen}{rgb}{0.90,0.91,0.859}\pagecolor{darkgreen} e^{i\theta}=\cos\theta+i\sin\theta, are evaluated as though in Radian mode, regardless of the angle mode. This gives mysterious results like the following: Degree:re^θi Done e^(πi) 1e^(180i) Ans=e^(180i) 0 (false)  Overall, it's better to put your calculator in Radian mode when dealing with polar form of complex numbers, especially since no mathematician would ever use degrees for the purpose anyway. # Optimization It's sometimes beneficial to use the r command instead of switching to Radian mode. The r symbol will make sure a number is interpreted as a radian angle, even in degree mode, so that, for example: Degree ………………Done sin(π) ……………….0548036651 sin(πr) ………………0 This is smaller when only one trig calculation needs to be done. Also, it doesn't change the user's settings, which are good to preserve whenever possible. # Related Commands Command Summary Calculates the inverse hyperbolic tangent of a value. Command Syntax tanhֿ¹(value) Menu Location The tanhֿ¹( command is only found in the catalog. Press: 1. 2nd CATALOG to access the command catalog. 2. T to skip to commands starting with T. 3. Scroll down and select tanhֿ¹( TI-83/84/+/SE 1 byte The tanhֿ¹( command calculates the inverse hyperbolic tangent of a value. tanhֿ¹(x) is the number y such that x = tanh(y). tanhֿ¹(x), although it can be defined for all real and complex numbers, is real-valued only for x in the open interval (-1,1). Since Z80 calculators have their hyperbolic functions and inverses restricted to real values, ERR:DOMAIN is thrown when x is outside the interval (-1,1). The tanhֿ¹( command also works for lists. tanhֿ¹(0) 0 tanhֿ¹({-.5,.5}) {-.5493061443 .5493061443}  # Error Conditions • ERR:DOMAIN when taking the inverse tanh of a number not between -1 and 1. # Related Commands Command Summary Calculates the inverse hyperbolic cosine of a value. Command Syntax coshֿ¹(value) Menu Location The coshֿ¹( command can only be found in the catalog. Press: 1. 2nd CATALOG to access the command catalog. 2. C to skip to commands starting with C. 3. Scroll down and select coshֿ¹( TI-83/84/+/SE 1 byte The coshֿ¹( function gives the inverse hyperbolic cosine of a value. coshֿ¹(x) is the number y such that x = cosh(y). Although coshֿ¹(x) can be defined for all real and complex numbers, it assumes real values only for x≥1. Since hyperbolic functions in the Z80 calculators are restricted only to real values, ERR:DOMAIN is thrown when x<1. The coshֿ¹( command also works for lists. coshֿ¹(1) 0 coshֿ¹({2,3}) {1.316957897 1.762747174}  # Error Conditions • ERR:DOMAIN when taking the inverse cosh of a number less than 1. # Related Commands Command Summary Calculates the inverse hyperbolic sine of a value. Command Syntax sinhֿ¹(value) Menu Location The sinhֿ¹( command is only found in the catalog. Press: 1. 2nd CATALOG to access the command catalog. 2. S to skip to commands starting with S. 3. Scroll down and select sinhֿ¹( TI-83/84/+/SE 1 byte The sinhֿ¹( command calculates the inverse hyperbolic sine of a value. sinhֿ¹(x) is the number y such that x = sinh(y). Unlike for the standard trig functions, this uniquely determines the inverse hyperbolic sine of any real number. The sinhֿ¹( command also works for lists. sinhֿ¹(0) 0 sinhֿ¹({1,2,3}) {.881373587 1.443635475 1.818446459}  # Related Commands Command Summary Formats a complex value in rectangular form when displaying it. Command Syntax value►Rect Menu Location Press: 1. MATH to access the math menu. 2. RIGHT RIGHT to access the CPX submenu. 3. 6 to select ►Rect, or use arrows and ENTER. TI-83/84/+/SE 2 bytes The ►Rect command can be used when displaying a complex number on the home screen, or with the Disp and Pause commands. It will then format the number as though a+bi mode were enabled, even when it's not. It also works with lists. i►Polar 1e^(1.570796327i) Ans►Rect i  It will also work when displaying a number by putting it on the last line of a program by itself. It does not work with Output(, Text(, or any other more complicated display commands. To actually separate a number into the components of rectangular form, use real( and imag(. # Error Conditions • ERR:SYNTAX is thrown if the command is used somewhere other than the allowed display commands. • ERR:DATA TYPE is thrown if the value is real. # Related Commands Command Summary Formats a complex value in polar form when displaying it. Command Syntax value►Polar Menu Location Press: 1. MATH to access the math menu. 2. RIGHT RIGHT to access the CPX submenu. 3. 7 to select ►Polar, or use arrows and ENTER. TI-83/84/+/SE 2 bytes The ►Polar command can be used when displaying a complex number on the home screen, or with the Disp and Pause commands. It will then format the number as though re^θi mode were enabled. It also works with lists. i i i►Polar 1e^(1.570796327i) {1,i}►Polar {1 1e^(1.570796327i)}  It will also work when displaying a number by putting it on the last line of a program by itself. It does not work with Output(, Text(, or any other more complicated display commands. To actually separate a number into the components of polar form, use abs( and angle(. # Error Conditions • ERR:SYNTAX is thrown if the command is used somewhere other than the allowed display commands. • ERR:DATA TYPE is thrown if the value is real. # Related Commands Command Summary Calculates the hyperbolic tangent of a value. Command Syntax tanh(value) Menu Location The tanh( command is only found in the Catalog. Press: 1. 2nd CATALOG to access the command catalog. 2. T to skip to commands starting with T. 3. Scroll down and select tanh(. TI-83/84/+/SE 1 byte Calculates the hyperbolic tangent of a value. The hyperbolic trig functions sinh(, cosh(, and tanh( are an analog of normal trig functions, but for a hyperbola, rather than a circle. They can be expressed in terms of real powers of e, and don't depend on the Degree or Radian mode setting. tanh(0) 0 tanh(1) .761594156  Like normal trig commands, tanh( works on lists as well, but not on complex numbers, even though the function is often extended to the complex numbers in mathematics. # Advanced Uses The tanh( command can be used to approximate the sign function: (1) \begin{align} \operatorname{sgn} x=\begin{cases}-1&\text{if }x<0,\\0&\text{if }x=0,\\1&\text{if }x>0.\end{cases} \end{align} As the absolute value of the input becomes large, the convergence is achieved at a point closer to zero. For the function to work as intended generally, numbers having lesser orders of magnitude need to be multiplied by a factor large enough for the argument to arrive at ±16.720082053122, which is the smallest input to produce ±1 (respectively) to fourteen digits of accuracy. 5/12→X .4166666667 tanh(E9X) 1 tanh(-E9X) -1  # Formulas The definition of the hyperbolic tangent is: (2) \begin{align} \tanh{x}=\frac{e^x-e^{-x}}{e^x+e^{-x}}=\frac{e^{2x}-1}{e^{2x}+1} \end{align} # Related Commands Command Summary Calculates the hyperbolic cosine of a value. Command Syntax cosh(value) Menu Location The cosh( command is only found in the Catalog. Press: 1. 2nd CATALOG to access the command catalog. 2. C to skip to commands starting with C. 3. Scroll down and select cosh(. TI-83/84/+/SE 1 byte Calculates the hyperbolic cosine of a value. The hyperbolic trig functions sinh(, cosh(, and tanh( are an analog of normal trig functions, but for a hyperbola, rather than a circle. They can be expressed in terms of real powers of e, and don't depend on the Degree or Radian mode setting. cosh(0) 1 cosh(1) 1.543080635  Like normal trig commands, cosh( works on lists as well, but not on complex numbers, even though the function is often extended to the complex numbers in mathematics. # Formulas The definition of hyperbolic cosine is: (1) \begin{align} \cosh{x}=\frac{e^x+e^{-x}}{2} \end{align} # Related Commands Command Summary Calculates the hyperbolic sine of a value. Command Syntax sinh(value) Menu Location The sinh( command is only found in the Catalog. Press: 1. 2nd CATALOG to access the command catalog. 2. S to skip to commands starting with S. 3. Scroll down and select sinh(. TI-83/84/+/SE 1 byte Calculates the hyperbolic sine of a value. The hyperbolic trig functions sinh(, cosh(, and tanh( are an analog of normal trig functions, but for a hyperbola, rather than a circle. They can be expressed in terms of real powers of e, and don't depend on the Degree or Radian mode setting. sinh(0) 0 sinh(1) 1.175201194  Like normal trig commands, sinh( works on lists as well, but not on complex numbers, even though the function is often extended to the complex numbers in mathematics. # Formulas The definition of hyperbolic sine is: (1) \begin{align} \sinh{x}=\frac{e^x-e^{-x}}{2} \end{align} # Related Commands Command Summary Returns the inverse tangent (also called arctangent) Command Syntax tanֿ¹(number) Menu Location Press: 1. [2nd] 2. [tanֿ¹] TI-83/84/+/SE 1 byte tanֿ¹( returns the arctangent of its argument. It is the inverse of tan(, which means that tanֿ¹(n) produces an angle θ such that tan(θ)=n. Like tan(, the result of tanֿ¹( depends on whether the calculator is in Radian or Degree mode. However, unlike tangent, the result is in degrees or radians, not the argument. A full rotation around a circle is 2π radians, which is equal to 360°. The conversion of θ=tanֿ¹(n) from radians to degrees is θ*180/π and from degrees to radians is θ*π/180. The tanֿ¹( command also works on a list. tanֿ¹( will always return a value between -π/2 and π/2 (or -90° and 90°). In radians: :tanֿ¹(1) .7853981634  In degrees: :tanֿ¹(1) 45  # Optimization Expressions of the form tanֿ¹(y/x) are usually better recast as R►Pθ(x,y); the latter will not fail even if x should happen to be equal to zero. # Error Conditions • ERR:DATA TYPE is thrown if you input a complex value or a matrix. # Related Commands Command Summary Flips the truth value of its argument. Command Syntax not(value) Menu Location Press: 1. 2nd TEST to access the test menu. 2. RIGHT to access the LOGIC submenu. 3. 4 to select not(, or use arrows and ENTER. TI-83/84/+/SE 1 byte The last logical operator available on the 83 series takes only one value as input. not( comes with its own parentheses to make up for this loss. Quite simply, it negates the input: False becomes True (1) and True returns False (0). not( can be nested; one use is to make any True value into a 1. :not(0) 1 :not(-20 and 14) 0 :not(not(2)) 1  # Advanced Uses not(not(X)) will make any value X into 1 if it's not 0, and will keep it 0 if it is. # Optimization not(X) and X=0 have the same truth value, but not( is shorter if the closing parenthesis is omitted: :If A=0 can be :If not(A  # Related Commands Command Summary Returns the truth value of value1 or value2, but not both, being true. Command Syntax value1 xor value2 Menu Location Press: 1. 2nd TEST to access the test menu. 2. RIGHT to access the LOGIC submenu. 3. 3 to select xor, or use arrows and ENTER. TI-83/84/+/SE 1 byte The third and final binary operator is a little trickier, but it has the coolest name. xor takes two numbers of expressions and checks to see if exactly one is True. If both are True or both are False, it returns 0. 1 xor 0 1 :2 xor (3 xor 0) (after evaluating 3 xor 0, it simplifies into True xor True.) 0 :0 xor (1-1)^2 0  ## Table of Results For reference, the following true/false table shows what gets returned when you use different combinations of 1 (true) and 0 (false): xor 1 (true) 0 (false) 1 (true) 0 (false) 1 (true) 0 (false) 1 (true) 0 (false) # Related Commands Command Summary Returns the truth value of value1 or value2 being true. Command Syntax value1 or value2 Menu Location Press: 1. 2nd TEST to access the test menu. 2. RIGHT to access the LOGIC submenu. 3. 2 to select or, or use arrows and ENTER. TI-83/84/+/SE 1 byte or takes two numbers or expressions, and checks to see if either one is True. If both are False, it returns 0. If at least one is True, it returns 1. or is commutative (i.e. the order of arguments does not matter). As with and, you can use variables and expressions, and use multiple or's together. :0 or 1-1 0 :0 or -1 1 :2 or 6*4 1 :0 or 1 or 0 1  # Related Commands Command Summary Returns the logical value of value1 and value2 being true. Command Syntax value1 and value2 Menu Location Press: 1. 2nd TEST to access the test menu. 2. RIGHT to access the LOGIC submenu. 3. ENTER to select and. TI-83/84/+/SE 1 byte and takes two numbers, variables, or expressions and tests to see if they are both True (not equal to 0). If they are, it returns 1. If either input is False (0), it returns 0. Note that the order of the operators doesn't matter (i.e. and is commutative), and that multiple and's can be used together :0 and 0 0 :0 and 1 0 :1 and 2 (2 counts as True, just like one) 1 :1→X :X and 2+2 (you can use variables and expressions) 1 :1 and 1 and 2-2 (the last input evaluates to 0, or false) 0  # Optimization Multiplying two values has the same truth value as and; thus, and can sometimes be replaced by multiplication. Because the calculator does implicit multiplication, meaning it automatically recognises when you want to multiply, you don't need to use the * sign. :If A and B can be :If AB  However, do not use this optimization if A and B might be expected to take on large values, as an overflow error might occur. # Related Commands The term "radian" is ambiguous and may refer to: • r (the radian symbol), used for converting an angle to radians. • Radian, the mode command for making radian angle measures the default. If an internal link led you here, you may wish to change the link to point directly to the intended article. The term "degree" is ambiguous and may refer to: • ° (the degree symbol), used to convert an angle to degrees. • Degree, the mode command used to switch to degree mode. If an internal link led you here, you may wish to change the link to point directly to the intended article. The term "" is ambiguous and may refer to: • page1, a brief description • page2, another brief description If an internal link led you here, you may wish to change the link to point directly to the intended article. Command Summary If the calculator is in degree mode, the r (radian) symbol converts a radian angle to degrees. Command Syntax angler Menu Location Press: 1. 2nd ANGLE to access the angle menu. 2. 3 to select r, or use arrows and ENTER. TI-83/84/+/SE 1 byte NOTE: Due to the limitations of the wiki markup language, the r command on this page does not appear as it would on the calculator. See Wiki Markup Limitations for more information. Normally, when the calculator is in degree mode, the trigonometric functions only return values calculated in degrees. With the r symbol you can have the angle evaluated as if in radian mode because it converts the angle into degrees. One full rotation around a circle is 2π radians, which is equal to 360°. To convert an angle in radians to degrees you multiply by 180/π, and to convert from degrees to radians multiply by π/180. In degree mode: sin(π) \\sine of Pi degrees .0548036651 sin(π^^r) 0  In radian mode: sin(π) 0 sin(π^^r) 0 \\There's no difference when in radians  # Optimization When you only call the trig function once in a program and want it calculated in radians, instead of changing the mode you can just use ° to save one-byte (the newline from using the command Radian) :Radian :sin(X) can be :sin(X^^r)  # Related Commands • ° (degree symbol) The term "real" is ambiguous and may refer to: • real(, the complex number command returning the real part of a number. • Real, the mode command that selects Real number mode. If an internal link led you here, you may wish to change the link to point directly to the intended article. The TI-83 series of calculators has many options to select from that influence either the effect of commands or the way numbers or graphs are displayed. Outside a program, these can be changed by accessing the Mode, Format, or TblSet screens (shown above), and selecting the correct options. When editing a program, going to these screens and choosing an option will instead paste a command that sets that option for you. These commands are given below, divided by the screen where it is found: # Mode Settings (MODE) # Graph Format Settings (2nd FORMAT) • RectGC and PolarGC determine how coordinates of the cursor are displayed and stored. • CoordOn and CoordOff determine whether the coordinates of the cursor are displayed at all. • GridOn and GridOff determine whether the grid is displayed. • AxesOn and AxesOff determine whether the X and Y axes are displayed. • LabelOn and LabelOff determine whether the X and Y axes are labeled (if they are displayed) • ExprOn and ExprOff determine whether the equation graphed or traced is displayed. • Time, Web, uvAxes, uwAxes, and vwAxes (visible in Seq mode) determine the way sequences are graphed, the default being Time. # Table Settings (2nd TBLSET) • IndpntAuto and IndpntAsk determine whether values of the independent variable in the table are calculated automatically. • DependAuto and DependAsk determine whether the values in the table are calculated automatically for all equations. # Miscellaneous Settings (2nd CATALOG) # Using these settings in a program A fair amount of these settings are important to programmers because, if set to the wrong value, they can easily mess up the program. At the beginning of the program, therefore, it's a good idea to set these settings to the correct value. At the very minimum, programs that use the graph screen should set AxesOff if necessary, since AxesOn is the default and a very common setting. This is a part of program setup. However, another important consideration is that it's somewhat rude to change the user's settings without permission, so your program should change as little as possible. How to reconcile these diametrically opposite goals? There are several ways that work for different settings: Use GDBs (Graph DataBases) The graph screen settings can be backed up in (and retrieved from) a GDB file by the StoreGDB and RecallGDB commands. If you store to a GDB at the beginning of the program, and recall from it at the end, you will have preserved all settings that deal with the graph screen. Change math settings implicitly Instead of changing settings like the Degree/Radian or the Real/a+bi setting, you can use certain commands that will force calculations to be done with that setting regardless of the mode. For example, you can use the degree symbol or radian symbol to make ambiguous calculations like sin(30) into unambiguous ones like sin(30o). Similarly, by adding 0i to a number, you force it to be complex, so that calculations done with it will never cause an ERR:NONREAL ANS (even if you're in Real mode). Ignore uncommon settings You might ignore settings that are too uncommon to matter. For example, setting the Full command is unnecessary, because very few people would ever use a split screen, and people that do probably will also figure out why your program breaks when they do so. Be rude when you must For something like Float, there's no way to avoid changing the user's settings in a way you can't restore. If you have to change a setting so your program works, do it, and mention the issue in the readme. If you changed a setting to an uncommon value, change it back to "Float" (in general, to the default value) when you're done. Command Summary Adds a multiple of one row of a matrix to another. Command Syntax *row+(factor,matrix,row1,row2) Menu Location Press: 1. MATRX (on a TI-83) or 2nd MATRX (TI-83+ or higher) to access the matrix menu. 2. RIGHT to access the MATH submenu. 3. ALPHA F to select *row+(, or use arrows and ENTER. TI-83/84/+/SE 1 byte The *row+( adds a multiple of one row to another row and returns the result. It is an elementary row operation used in Gaussian Elimination. [[1,2][3,4]] [[1 2] [3 4]] *row+(10,Ans,1,2) [[3 4 ] [31 42]]  # Advanced Uses You can add columns instead of rows with the aid of the T (transpose) command. # Error Conditions • ERR:INVALID DIM is thrown if one of the row arguments isn't a valid row (larger than the matrix size, or otherwise bad) # Related Commands Command Summary Multiplies a row by a scalar. Command Syntax *row(factor,matrix,row) Menu Location Press: 1. MATRX (on a TI-83) or 2nd MATRX (TI-83+ or higher) to access the matrix menu. 2. RIGHT to access the MATH submenu. 3. ALPHA E to select *row(, or use arrows and ENTER. TI-83/84/+/SE 1 byte The *row( command multiplies a row of a matrix by a scalar factor and returns the result. It is an elementary row operation used in Gaussian Elimination. [[1,2][3,4]] [[1 2] [3 4]] *row(10,Ans,1) [[10 20] [3 4 ]]  # Advanced Uses You can multiply columns instead of rows with the aid of the T (transpose) command. # Error Conditions • ERR:INVALID DIM is thrown if the row argument isn't a valid row (is larger than the size of the matrix, or otherwise bad) # Related Commands Command Summary Adds one row of a matrix to another. Command Syntax row+(matrix,row1,row2) Menu Location Press: 1. MATRX (on a TI-83) or 2nd MATRX (TI-83+ or higher) to access the matrix menu. 2. RIGHT to access the MATH submenu. 3. ALPHA D to select row+(, or use arrows and ENTER. TI-83/84/+/SE 1 byte The row+( command adds one row of a matrix to the second, and returns the result. It is an elementary row operation used in Gaussian Elimination. [[1,2][3,4]] [[1 2] [3 4]] row+(Ans,1,2) [[1 2] [4 6]]  # Advanced Uses You can add columns instead of rows with the aid of the T (transpose) command. # Error Conditions • ERR:INVALID DIM is thrown if one of the row arguments isn't a valid row (larger than the matrix size, or otherwise bad) # Related Commands Command Summary Swaps two rows of a matrix. Command Syntax rowSwap(matrix,row1,row2) Menu Location Press: 1. MATRX (on a TI-83) or 2nd MATRX (TI-83+ or higher) to access the matrix menu. 2. RIGHT to access the MATH submenu. 3. ALPHA C to select rowSwap(, or use arrows and ENTER. TI-83/84/+/SE 1 byte The rowSwap( command swaps two rows of a matrix and returns the result. It is an elementary row operation used in Gaussian Elimination. [[1,2][3,4]] [[1 2] [3 4]] rowSwap(Ans,1,2) [[3 4] [1 2]]  # Advanced Uses You can swap columns instead of rows with the aid of the T (transpose) command. # Error Conditions • ERR:INVALID DIM is thrown if one of the row arguments isn't a valid row (larger than the matrix size, or otherwise bad) # Related Commands Command Summary Recalls graph settings from a GDB (Graph DataBase) variable Command Syntax RecallGDB number Menu Location Press: 1. 2nd DRAW to access the draw menu. 2. LEFT to access the STO menu. 3. 4 to select RecallGDB, or use arrows and ENTER. TI-83/84/+/SE 1 byte The RecallGDB command recalls graph settings a GDB (Graph DataBase) variable, one of GDB1, GDB2, …, GDB0 (as indicated by the argument). These settings can be stored to a GDB using the StoreGDB command. The settings stored in a GDB include: • The graphing mode currently enabled. • All equations in the current graphing mode, but NOT other graphing modes. • All window variables applicable to the current graphing mode. This does not include zoom variables, table settings, or irrelevant variables such as Tmin when in function mode. • The menu settings relevant to graphing (everything in the 2nd FORMAT menu, as well as Connected/Dot and Sequential/Simul settings in the MODE menu) The number passed to RecallGDB must be one of 0 through 9. It has to be a number: RecallGDB X will not work, even if X contains a value 0 through 9. # Advanced Uses The StoreGDB and RecallGDB variables are useful in cleaning up after a program finishes running, preserving the user's settings. If your program heavily relies on the graph screen, it may end up editing window size or other graph settings, which the user might want to be saved. This is easily done: Add StoreGDB 1 (or any other number) to the beginning of your program. Then, feel free to edit any graph settings you like. At the end of your program, add RecallGDB 1, followed by DelVar GDB1, to recall the graph settings stored at the beginning. GDBs can also be useful in adding extra string storage. You can store strings to the Yn variables, and back them up in a GDB; to retrieve them later, recall the GDB and use Equ►String( to store the equations to the strings again. # Error Conditions • ERR:DATA TYPE is thrown if the argument is not a number 0 through 9. • ERR:UNDEFINED is thrown if the requested GDB does not exist. # Related Commands # See Also Routine Summary Solves for the complex roots of a quadratic equation. Inputs A, B, C - the constants in Ax2+Bx+C=0 Outputs Ans - a 2-element list of the two roots (or the one repeated root) Variables Used A, B, C Calculator Compatibility TI-83/84/+/SE Author thornahawk URL: United TI Download quadraticformula.zip -2C/(B+{-1,1}√(B²+4ACi²  For optimization purposes, an alternate form of the quadratic formula is used (see below for the formulas). The {-1,1} list is used to replace the ± symbol — lists can be used just as well as numbers in expressions, making the result a list as well. By using i² in the expression in place of subtraction, the routine avoids having to activate a+bi mode to allow complex roots. The output is a complex list in Ans of the two roots. If there is only one root, it will be returned twice. If both roots are real, they will still be returned correctly, but stored internally as complex numbers — so use the real( command on them if you want to pass them to commands that don't accept complex arguments. # Advanced The ordinary formula above can give poor results if B is much larger than A and/or C. In that case, an alternate routine can be used: √(B²+4ACi² If 0>real(Ansconj(B -Ans -.5(B+Ans {Ans/A,C/Ans  # Formulas The ordinary quadratic formula, and its alternate form are used: (1) \begin{align} \mathrm{For} \hspace{5pt} ax^2+bx+c = 0, \\ \\ x = \frac{-b\pm\sqrt{b^2-4ac}}{2a} \\ \\ x = \frac{2c}{-b\pm\sqrt{b^2-4ac}} \end{align} Routine Summary Performs a chi-square goodness-of-fit test, to determine if an observation fits a distribution. The TI-84+ and TI-84+ SE have a command, χ²GOF-Test(, that does the same thing. Inputs L₁ - observed counts of the outcomes L₂ - expected counts of their outcomes, or their distribution Outputs X - the χ² statistic for the data. F - the df (degrees of freedom) statistic. P - the probability value of the test. Variables Used L₁, L₂, X, F, P Calculator Compatibility TI-83/84/+/SE Download gof-test.zip :L₂sum(L₁)/sum(L₂→L₂ :sum((L₁-L₂)²/L₂→X :dim(L₁)-1→F :χ²cdf(X,E99,F→P  This routine tests the null hypothesis that the variation between the observed and expected distributions is due to random chance alone. The value of P is the probability that such variation would occur, assuming the null hypothesis. You would reject this null hypothesis if this value is too low, and conclude that the variable you're measuring doesn't vary according to the expected distribution. First, we must normalize L₂, the expected distribution, to have the same sum as L₁. We do this by multiplying by the sum of L₁, and dividing by the original sum of L₂. You can omit this line if L₂ already has the same sum, or optimize it to L₂sum(L₁→L₂ if it's a probability distribution (and hence has a sum of 1). Then, we calculate the χ² statistic (according to the formula given at the bottom of the page). The number of degrees of freedom is just defined to be one less than the number of outcomes. Then, we calculate the probability that χ² would have a value this high by chance alone, by using the χ²cdf( command to calculate the probability mass between this value and infinity (we can't actually put in infinity, but we use the value E99, which is close enough for our purposes — the error introduced by this is too small for the calculator to evaluate). An example: suppose you want to test if your six-sided die is fair. You threw the die 60 times, and recorded the results: a 1 came up 13 times, a 2 came up 10 times, a 3 came up 6 times, a 4 came up 9 times, a 5 came up 8 times, and a 6 came up 14 times. This is the observed frequency. The expected frequency is that the results would be even: each side would come up 10 times. Therefore, we set L₁ to {13,10,6,9,8,14} and L₂ to {10,10,10,10,10,10}. The output is the following: χ²=4.6 p=.4666162743 df=5  Because the value of p is high, it's perfectly plausible that the null hypothesis is true: p>0.05, so the data is not significant on a 5% level. We don't have enough evidence to reject the null hypothesis, so we conclude that the die is fair. # Formulas The formula for calculating the χ² statistic: (Oi is the observed count of the ith outcome, and Ei is the expected count) (1) \begin{align} \chi_{n-1}^2 = \sum_{i=1}^n \frac{(O_i-E_i)^2}{E_i} \end{align} # Error Conditions Command Summary P►Rx( calculates the x-value (in Cartesian coordinates) given Polar coordinates. Command Syntax P►Rx(r,θ) Menu Location Press: 1. 2nd ANGLE to access the angle menu. 2. 7 to select P►Rx(, or use arrows and ENTER. TI-83/84/+/SE 1 byte P►Rx( (polar►rectangular x-coordinate) calculates the x-coordinate of a polar point. Polar coordinates are of the form (r,θ), where θ is the counterclockwise angle made with the positive x-axis, and r is the distance away from the origin (the point (0,0)). The conversion identity x=r*cos(θ) is used to calculate P►Rx(. The value returned depends on whether the calculator is in radian or degree mode. A full rotation around a circle is 2π radians, which is equal to 360°. The conversion from radians to degrees is angle*180/π and from degrees to radians is angle*π/180. The P►Rx( command also accepts a list of points. P►Rx(5,π/4) 3.535533906 5*cos(π/4) 3.535533906 P►Rx({1,2},{π/4,π/3}) {.7071067812 1}  # Advanced Uses You can bypass the mode setting by using the ° (degree) and r (radian) symbols. This next command will return the same values no matter if your calculator is in degrees or radians: P►Rx(1,{π/4^^r,60°}) {.7071067812 .5}  # Optimization In most cases P►Rx(r,θ) can be replaced by r*cos(θ) to save a byte: :P►Rx(5,π/12) can be :5cos(π/12)  Conversely, complicated expressions multiplied by a cosine factor can be simplified by using P►Rx(r,θ) instead. :(A+BX)cos(π/5) can be :P►Rx(A+BX,π/5)  # Error Conditions # Related Commands Polar is a graphing mode on TI-83 series calculators. It may also refer to: • Polar, the mode command that enables Polar graphing mode. • ►Polar, the format command that displays complex numbers in polar form. • PolarGC, the mode command to store graph coordinates as (R,θ). If an internal link led you here, you may wish to change the link to point directly to the intended article. Although the wiki markup language provides a rich set of features and functionality for designing and laying out a page, one major limitation that it has is it does not allow formatting inside a link or code block. Specifically, you cannot display text or numbers as superscript (text is smaller and displayed at the top of the line) or subscript (text is smaller and displayed at the bottom of the line) respectively. These particular command pages are the primary pages that this limitation impacts, and subsequently the commands are not able to be displayed like they would be on the calculator. Any page containing one or more of these commands will have a disclaimer, and links to more information on the individual commands affected. Here is a listing of each command affected, along with how it will appear in this wiki, the command's proper name, and how to access it on a calculator:  Table of Contents # ^^r • Radian Symbol • Appears as r on a calculator • To type, press: 1. [2nd] 2. [Angle] 3. [2] or use arrows to select r # T • Transpose • Appears as T on a calculator • To type, press: 1. [2nd] 2. [Matrix] 3. [Right] to access MATH submenu 4. [2] or use arrow keys to select T # E • Base 10 exponent symbol • Appears as E on a calculator • To type, press: 1. [2nd] 2. [EE] # Related Pages Command Summary If the calculator is in radian mode, the ° (degree) symbol converts an angle to radians. Command Syntax angle° Menu Location Press: 1. [2nd] 2. [Angle] 3. [Enter] or [1] TI-83/84/+/SE 1 byte Normally, when the calculator is in radian mode, the trigonometric functions only return values calculated in radians. With the ° symbol you can have the angle evaluated as if in degree mode because it converts the angle into radians. One full rotation around a circle is 2π radians, which is equal to 360°. To convert an angle in radians to degrees you multiply by 180/π, and to convert from degrees to radians multiply by π/180. In radian mode: sin(45) \\ actually calculating sin(2578.31) .8509035245 sin(45°) .7071067812  In degree mode: sin(45) .7071067812 sin(45°) .7071067812 \\ There's no difference when in degrees  # Optimization When you only call the trig function once in a program and want it calculated in degrees, instead of changing the mode you can just use ° to save one-byte (the newline from using the command Degree) :Degree :sin(X) can be :sin(X°)  # Related Commands • r (radian symbol) Command Summary Returns the inverse cosine (also called arccosine) Command Syntax cosֿ¹(number) Menu Location Press: 1. [2nd] 2. [cosֿ¹] TI-83/84/+/SE 1 byte cosֿ¹( returns the arccosine of its argument. It is the inverse of cos(, which means that cosֿ¹(n) produces an angle θ such that cos(θ)=n. Like cos(, the result of cosֿ¹( depends on whether the calculator is in Radian or Degree mode. However, unlike cosine, the result is in degrees or radians, not the argument. A full rotation around a circle is 2π radians, which is equal to 360°. The conversion of θ=cosֿ¹(n) from radians to degrees is θ*180/π and from degrees to radians is θ*π/180. The cosֿ¹( command also works on a list. The cosֿ¹( function can be defined for all real and complex numbers, but assumes real values only in the closed interval [-1,1]. Because Z80 calculators have their trigonometric functions and inverses restricted only to real values, the calculator will throw ERR:DOMAIN if the argument is outside of this interval, no matter what the mode setting may be. In radians: :cosֿ¹(-1) 3.141592654  In degrees: :cosֿ¹(-1) 180  # Advanced Uses Since the function cosine itself doesn't have the restrictions that arccosine does, and since arccosine is the inverse of cosine, you can use cosֿ¹(cos( to keep a variable within a certain range (most useful for the home screen). Here is an example for a game like pong. The ball travels between 0 and 12. You could use a flag like this: :If X=12 or not(X \\ X is the position :-D→D \\ D is the direction :X+D→X \\ new position :Output(8,X,"=  An easier way to do this, without needing a flag or even an If statement, is using cosֿ¹(cos( :X+1→X \\ Note: the calculator is in Degree mode :Output(8,cosֿ¹(cos(15X))/15,"=") \\ I used 15 because cosֿ¹ ranges from [0,180] and X from [0,12], so 180/12=15  # Error Conditions • ERR:DOMAIN is thrown if you supplied an argument outside the interval [-1,1] • ERR:DATA TYPE is thrown if you input a complex value or a matrix. # Related Commands Command Summary Returns the inverse sine (also called arcsine) Command Syntax sinֿ¹(number) Menu Location Press: 1. [2nd] 2. [sinֿ¹] TI-83/84/+/SE 1 byte sinֿ¹( returns the arcsine of its argument. It is the inverse of sin(, which means that sinֿ¹(z) produces an angle θ such that sin(θ)=z. Like sin(, the result of sinֿ¹( depends on whether the calculator is in Radian or Degree mode. However, unlike sine, the result is in degrees or radians, not the argument. A full rotation around a circle is 2π radians, which is equal to 360°. The conversion of θ=sinֿ¹(n) from radians to degrees is θ*180/π and from degrees to radians is θ*π/180. The sinֿ¹( command also works on lists. The sinֿ¹( function can be defined for all real and complex numbers; however, the function assumes real values only in the closed interval [-1,1]. Because the trigonometric functions and their inverses in the Z80 calculators are restricted only to real values, the calculator will throw ERR:DOMAIN if the argument is outside of this interval, no matter what the mode setting may be. In radians: :sinֿ¹(1) 1.570796327  In degrees: :sinֿ¹(1) 90  # Advanced Uses Since the function sine itself doesn't have the restrictions that arcsine does, and since arcsine is the inverse of sine, you can use sinֿ¹(sin( to keep a variable within a certain range (most useful on the graph screen). Here is an example for a game like pong. The ball travels between -6 and 6. You could use a flag like this: :If 6=abs(X \\ X is the position :-D→D \\ D is the direction :X+D→X \\ new position :Pt-On(-54,X,"=")  An easier way to do this, without needing a flag or even an If statement, is using sinֿ¹(sin( :X+1→X \\ Note: the calculator is in degree mode :Pt-On(-54,sinֿ¹(sin(15X))/15,"=") \\ 15 is used because sinֿ¹ ranges from [-90,90] and X from [-6,6], so 90/6=15  # Error Conditions • ERR:DATA TYPE is thrown if you input a complex value or a matrix. • ERR:DOMAIN is thrown if you supplied an argument outside the interval [-1,1] # Related Commands Command Summary Returns the tangent of a real number. Command Syntax tan(angle) Menu Location Press TAN TI-83/84/+/SE 1 byte tan(θ) calculates the tangent of the angle θ, which is defined by\tan \theta=\frac{\sin \theta}{\cos \theta}$The value returned depends on whether the calculator is in Radian or Degree mode. A full rotation around a circle is 2π radians, which is equal to 360°. The conversion from radians to degrees is angle*180/π and from degrees to radians is angle*π/180. The tan( command also works on a list of real numbers. Since tangent is defined as the quotient of sine divided by cosine, it is undefined for any angle such that cos(θ)=0. In radians: tan(π/4) 1  In degrees: tan(45) 1  # Advanced Uses You can bypass the mode setting by using the ° (degree) and r (radian) symbols. These next two commands will return the same values no matter if your calculator is in degrees or radians: tan(45°) 1  tan(π/4^^r) 1  # Error Conditions • ERR:DATA TYPE is thrown if you supply a matrix or a complex argument. • ERR:DOMAIN is thrown if you supply an angle of π/2±nπ (in radians, where n is an integer) or 90±180n (in degrees, where n is an integer) # Related Commands Command Summary Returns the cosine of a real number. Command Syntax cos(angle) Menu Location Press [COS] TI-83/84/+/SE 1 byte cos(θ) returns the cosine of θ, which is defined as the x-value of the point of intersection of the unit circle and a line containing the origin that makes an angle θ with the positive x-axis The value returned depends on whether the calculator is in Radian or Degree mode. A full rotation around a circle is 2π radians, which is equal to 360°. The conversion from radians to degrees is angle*180/π and from degrees to radians is angle*π/180. The cos( command also works on a list of real numbers. In radians: cos(π/3) .5  In degrees: cos(60) .5  # Advanced Uses You can bypass the mode setting by using the ° (degree) and r (radian) symbols. These next two commands will return the same values no matter if your calculator is in degrees or radians: cos(60°) .5  cos(π/3^r) .5  # Error Conditions • ERR:DATA TYPE is thrown if you supply a matrix or a complex argument. • ERR:ARGUMENT is thrown if you use more than one number. # Related Commands # See Also Command Summary Returns the sine of a real number. Command Syntax sin(angle) Menu Location Press the SIN key to paste sin(. TI-83/84/+/SE 1 byte NOTE: Due to the limitations of the wiki markup language, the r command on this page does not appear as it would on the calculator. See Wiki Markup Limitations for more information. sin(θ) returns the sine of θ, which is defined as the y-value of the point of intersection of the unit circle and a line containing the origin that makes an angle θ with the positive x-axis The value returned depends on whether the calculator is in Radian or Degree mode. A full rotation around a circle is 2π radians, which is equal to 360°. The conversion from radians to degrees is angle*180/π and from degrees to radians is angle*π/180. The sin( command also works on a list of real numbers. In radians: sin(π/6) .5  In degrees: sin(30) .5  # Advanced Uses You can bypass the mode setting by using the ° (degree) and r (radian) symbols. These next two commands will return the same values no matter if your calculator is in degrees or radians: sin(30°) .5  sin(π/6^^r) .5  # Error Conditions • ERR:DATA TYPE is thrown if you supply a matrix or a complex argument. # Related Commands # See Also Command Summary Stores graph setting to a GDB (Graph DataBase) to be recalled later with RecallGDB. Command Syntax StoreGDB GDB# StoreGDB number Menu Location Press: 1. 2nd DRAW to access the draw menu. 2. LEFT to access the STO menu. 3. 3 to select StoreGDB, or use arrows and ENTER. TI-83/84/+/SE/CSE/CE 1 byte The StoreGDB command stores all graph settings needed to reconstruct the current graph to a GDB (Graph DataBase) variable, one of GDB1, GDB2, …, GDB0 (as indicated by the argument). These settings can then be recalled using the RecallGDB command. The settings stored in a GDB include: • The graphing mode currently enabled. • All equations in the current graphing mode, but NOT other graphing modes. • All window variables applicable to the current graphing mode. This does not include zoom variables, table settings, or irrelevant variables such as Tmin when in function mode. • The menu settings relevant to graphing (everything in the 2nd FORMAT menu, as well as Connected/Dot and Sequential/Simul settings in the MODE menu) The number passed to StoreGDB must be one of 0 through 9. It has to be a number: StoreGDB X will not work, even if X contains a value 0 through 9. # Advanced Uses The StoreGDB and RecallGDB variables are useful in cleaning up after a program finishes running, preserving the user's settings. If your program heavily relies on the graph screen, it may end up editing window size or other graph settings, which the user might want to be saved. This is easily done: Add StoreGDB 1 (or any other number) to the beginning of your program. Then, feel free to edit any graph settings you like. At the end of your program, add RecallGDB 1, followed by DelVar GDB1, to recall the graph settings stored at the beginning. GDBs can also be useful in adding extra string storage. You can store strings to the Yn variables, and back them up in a GDB; to retrieve them later, recall the GDB and use Equ►String( to store the equations to the strings again. # Error Conditions • ERR:DATA TYPE is thrown if the argument is not a number 0 through 9. # Related Commands # See Also Command Summary Stores the graph screen to a picture (one of Pic1, Pic2, …, Pic0) Command Syntax StorePic number Menu Location Press: 1. 2nd DRAW to access the draw menu. 2. LEFT to access the STO submenu. 3. ENTER to select StorePic TI-83/84/+/SE 1 byte StorePic saves the graph screen to a picture (to recall it later, use RecallPic). Every detail of the graph screen will be stored as it appears, with the sole exception of X and Y labels on the axes (if they are shown). The number passed to StorePic must be one of 0 through 9. It has to be a number: StorePic X will not work, even if X contains a value 0 through 9. # Advanced Uses A combination of StorePic and RecallPic can be used to maintain a background over which another sprite moves: First, draw the background, and save it to a picture file with StorePic. Next, draw the sprite to the screen. When you want to move the sprite, erase it, then use RecallPic to draw the background again. Then draw the sprite to its new location on the screen again (this can be done before or after using RecallPic). Also, if a screen in your program takes more than a second to draw, and is displayed several times, you might want to consider storing it to a picture the first time it's drawn, and then recalling it every next time you want to draw it. # Error Conditions • ERR:DATA TYPE is thrown if the argument is not a number 0 through 9. # Related Commands Command Summary Recalls a saved picture (one of Pic1, Pic2, …, Pic0) to the graph screen. Command Syntax RecallPic number Menu Location Press: 1. 2nd DRAW to access the draw menu. 2. LEFT to access the STO submenu. 3. 2 to select RecallPic, or use arrows and ENTER. TI-83/84/+/SE 1 byte RecallPic draws a saved picture to the graph screen (to save a picture, draw it on the graph screen, then save it with StorePic). If something is already drawn on the graph screen, RecallPic will draw new pixels where needed, but it will not erase anything. As a result, you often want to ClrDraw before recalling a picture. The number passed to RecallPic must be one of 0 through 9. It has to be a number: RecallPic X will not work, even if X contains a value 0 through 9. # Advanced Uses A combination of StorePic and RecallPic can be used to maintain a background over which another sprite moves: 1. Draw the background, and save it to a picture file with StorePic. 2. Next, draw the sprite to the screen. 3. When you want to move the sprite, erase it, then use RecallPic to draw the background again. 4. Then draw the sprite to its new location on the screen again (this can be done before or after using RecallPic). Also, if a screen in your program takes more than a second to draw, and is displayed several times, you might want to consider storing it to a picture the first time it's drawn, and then recalling it every next time you want to draw it. # Error Conditions • ERR:DATA TYPE is thrown if the argument is not a number 0 through 9. • ERR:UNDEFINED is thrown if the requested picture does not exist. # Related Commands Command Summary Puts a matrix into reduced row-echelon form. Command Syntax rref(matrix) Menu Location Press: 1. MATRX (on the TI-83) or 2nd MATRX (TI-83+ or higher) to access the matrix menu. 2. RIGHT to access the math menu. 3. ALPHA B to select rref(, or use arrows and ENTER. TI-83/84/+/SE 2 bytes Given a matrix with at least as many columns as rows, the rref( command puts a matrix into reduced row-echelon form using Gaussian elimination. This means that as many columns of the result as possible will contain a pivot entry of 1, with all entries in the same column, or to the left of the pivot, being 0. [[1,2,5,0][2,2,1,2][3,4,6,2]] [[1 2 5 0] [2 2 1 2] [3 4 7 3]] rref(Ans) [[1 0 0 6 ] [0 1 0 -5.5] [0 0 1 1 ]]  # Advanced Uses The rref( command can be used to solve a system of linear equations. First, take each equation, in the standard form of$a_1x_1+\dots + a_nx_n = b$, and put the coefficients into a row of the matrix. Then, use rref( on the matrix. There are three possibilities now: • If the system is solvable, the left part of the result will look like the identity matrix. Then, the final column of the matrix will contain the values of the variables. • If the system is inconsistent, and has no solution, then it will end with rows that are all 0 except for the last entry. • If the system has infinitely many solutions, it will end with rows that are all 0, including the last entry. This process can be done by a program fairly easily. However, unless you're certain that the system will always have a unique solution, you should check that the result is in the correct form, before taking the values in the last column as your solution. The Matr►list( command can be used to store this column to a list. # Error Conditions # Related Commands Command Summary Puts a matrix into row-echelon form. Command Syntax ref(matrix) Menu Location Press: 1. MATRX (on the TI-83) or 2nd MATRX (TI-83+ or higher) to access the matrix menu. 2. RIGHT to access the MATH submenu. 3. ALPHA A to select ref(, or use arrows. TI-83/84/+/SE 2 bytes Given a matrix with at least as many columns as it has rows, the ref( command uses a technique called Gaussian elimination to put the matrix into row-echelon form. This means that the leftmost N columns (if the matrix has N rows) of the matrix are upper triangular - all entries below the main diagonal are zero. What's more, every entry on the main diagonal is either 0 or 1. [[1,2,5,0][2,2,1,2][3,4,6,2]] [[1 2 5 0] [2 2 1 2] [3 4 6 2] ref(Ans)►Frac [[1 4/3 2 2/3] [0 1 9/2 -1 ] [0 0 0 0 ]]  # Advanced Uses In theory, a system of linear equations in N variables can be solved using the ref( command - an equation of the form$a_1x_1+\dots + a_nx_n = b$becomes a row$a_1, \dots, a_n, b$, and is put into the matrix. If there is a sufficient number of conditions, the last row of the reduced matrix will give you the value of the last variable, and back-substitution will give you the others. In practice, it's easier to use rref( instead for the same purpose. # Error Conditions # Related Commands Routine Summary Converts a string to a list of numbers. Inputs Str1 - The string you want to convert Outputs L₁ - The list that the numbers are stored to Variables Used L₁, A, Str1 Calculator Compatibility TI-83/84/+/SE Download stringtolist.zip :1+seq(inString("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ ",sub(Str1,A,1)),A,1,length(Str1→L₁  With our characters stored in Str1, we loop through each character and store its position in our reference string (the uppercase alphabet) to the respective element of L₁. This routine only allows for values from 1 to 26 in the list, since our string of characters is the uppercase alphabet, and each list value must match up to one of the string positions. If you add more characters to the string, however, you can increase the range of values in the list. This routine uses Str1, so you should clean it up at the end of your program. # Advanced Routine Since a list element can store up to 14 digits, you can use int(, fPart(, and exponents to compress an additional 7 letters per element (2 digits for each letter), thus increasing your total number of characters to 6993. " ABCDEFGHIJKLMNOPQRSTUVWXYZ->Str0 DelVar L1 For(A,0,dim(L1 0 For(B,1,min(7,length(Str1)-7A Ans+.1^(2B)inString(Str0,sub(Str1,B+7A,1 End Ans->L1(A+1 End "  # Related Routines Routine Summary Converts a matrix to a string. Inputs [A] - The matrix you want to convert Outputs Str1 - The string that the text is stored to Variables Used [A], L₁, A, B, Ans, Str1 Calculator Compatibility TI-83/84/+/SE Download matrixtostring.zip Note: If you have a TI-84+ CE with OS 5.2 or higher, you can ignore this entire routine and just use the toString( command. :dim([A]→L₁:"? :For(A,1,L₁(1 :For(B,1,L₁(2 :Ans+sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ",[A](A,B),1 :End:End :sub(Ans,2,length(Ans)-1→Str1  With our values stored in [A], we get the dimensions (row x column) of the matrix, which are stored in a list. We then loop through each row and column, and store the character at the respective element to our string that is at the matching position in our substring. In order to construct a string with all of the characters from [A], we first need to create a dummy string. This is what the "? is used for. Each time through the For( loops, we concatenate the string from before (which is still stored in the Ans variable) to the next character that is found in the matrix. Using Ans allows us to not have to use another string variable, since Ans can act like a string and it gets updated accordingly, and Ans is also faster than a string variable. By the time we are done with the For( loops, all of our characters are put together in Ans. However, because we stored the dummy character as the first character at the beginning of the string, we now need to remove it, which we do by simply getting the substring from the second character to the end of the string. Finally, we store the string to a more permanent variable (in this case, Str1) for future use. This routine only allows for values from 1 to 26 in the matrix, since our string of characters is the uppercase alphabet, and each matrix value must match up to one of the string positions. If you add more characters to the string, however, you can increase the range of values in the matrix. This routine uses [A] and L₁, so you should clean them up at the end of your program. # Related Routines Command Summary Turns stat plots (all of them, or only those specified) off. Command Syntax PlotsOff numbers// Menu Location Press: 1. 2nd PLOT to access the stat plot menu. 2. 4 to select PlotsOff, or use arrows and ENTER. TI-83/84/+/SE 1 byte By itself, the command will turn off all three stat plots. If it is given arguments, there can be any number of them (actually, no more than 255, but this won't stop most people), but they must all be numbers 1 to 3. Then, the command will only turn off the specified plots. Unlike some commands, it is okay to give PlotsOff an expression as an argument (for example, PlotsOff X), as long as it has a value of 1, 2, or 3. # Error Conditions • ERR:DOMAIN is thrown if a plot that is not 1, 2, or 3 is specified. # Related Commands Command Summary Turns stat plots (all of them, or only those specified) on. Command Syntax PlotsOn numbers// Menu Location Press: 1. 2nd PLOT to access the stat plot menu. 2. 5 to select PlotsOn, or use arrows and ENTER. TI-83/84/+/SE 1 byte By itself, the command will turn on all three stat plots. If it is given arguments, there can be any number of them (actually, no more than 255, but this won't stop most people), but they must all be numbers 1 to 3. Then, the command will only turn on the specified plots. Unlike some commands, it is okay to give PlotsOn an expression as an argument (for example, PlotsOn X), as long as it has a value of 1, 2, or 3. # Error Conditions • ERR:DOMAIN is thrown if a plot that is not 1, 2, or 3 is specified. # Related Commands Command Summary Displays a statistical plot of one of six types. Command Syntax Plot#(type,… The syntax varies based on the type of plot: Plot#(Scatter, x-list, y-list, mark) Plot#(xyLine, x-list, y-list, mark) Plot#(Histogram, x-list, freq list) Plot#(Boxplot, x-list, freq list) Plot#(ModBoxplot, x-list, freq list, mark) Plot#(NormProbPlot, data list, data axis, mark) Menu Location While editing a program, press: 1. 2nd PLOT to access the stat plot menu. 2. 1, 2, or 3 (or use arrows) to select Plot1(, Plot2(, Plot3( respectively. (outside a program, this brings you to the plot editor screen) TI-83/84/+/SE 1 byte The commands Plot1(, Plot2(, and Plot3(, which are identical except for which stat plot (1, 2, or 3) they affect, define their corresponding stat plot. When the stat plot is defined, it is also turned on so no PlotsOn command is necessary. The first argument of the commands is always the type of plot, and is one of Scatter, xyLine, Histogram, Boxplot, ModBoxplot, and NormProbPlot - these types are found in the TYPE submenu of the stat plot menu. The other arguments vary. For all but Histogram and Boxplot, there is a mark argument - this is a dot, a cross, or a box, symbols that can be found in the MARK submenu of the stat plot menu. ## Scatter plot Plot#(Scatter, x-list, y-list, mark) defines a scatter plot. The points defined by x-list and y-list are plotted using mark on the graph screen. x-list and y-list must be the same length. ## xyLine plot Plot#(xyLine, x-list, y-list, mark) defines an xyLine plot. Similarly to a scatter plot, the points defined by x-list and y-list are plotted using mark on the graph screen, but with an xyLine plot they are also connected by a line, in the order that they occur in the lists. x-list and y-list must be the same length. ## Histogram plot Plot#(Histogram, x-list, freq list) defines a Histogram plot. The x-axis is divided into intervals that are Xscl wide. A bar is drawn in in each interval whose height corresponds to the number of points in the interval. Points that are not between Xmin and Xmax are not tallied. Xscl must not be too small - it can divide the screen into no more than 47 different bars. ## Box plot Plot#(Boxplot, x-list, freq list) defines a box plot. A rectangular box is drawn whose left edge is Q1 (the first quartile) of the data, and whose right edge is Q3 (the third quartile). A vertical segment is drawn within the box at the median, and 'whiskers' are drawn from the box to the minimum and maximum data points. The box plot ignores the Ymax and Ymin dimensions of the screen, and any plots that aren't box plots or modified box plots. Each box plot takes approximately 1/3 of the screen in height, and if more than one are plotted, they will take up different areas of the screen. ## Modified box plot Plot#(ModBoxplot, x-list, freq list, mark) defines a modified box plot. This is almost entirely like the normal box plot, except that it also draws outliers. Whiskers are only drawn to the furthers point within 1.5 times the interquartile range (Q3-Q1) of the box. Beyond this point, data points are drawn individually, using mark. The box plot ignores the Ymax and Ymin dimensions of the screen, and any plots that aren't box plots or modified box plots. Each box plot takes approximately 1/3 of the screen in height, and if more than one are plotted, they will take up different areas of the screen. ## Normal probability plot Plot#(NormProbPlot, data list, data axis, mark) defines a normal probability plot. The mean and standard deviation of the data are calculated. Then for each point, the number of standard deviations it is from the mean is calculated, and the point is plotted against this number using mark. data axis can be either X or Y: it determines whether the value of a point determines it's x-coordinate or y-coordinate. The point behind this rather convoluted process is to test the extent to which the data is normally distributed. If it follows the normal distribution closely, then the result will be close to a straight line - otherwise it will be curved. # Advanced Uses After doing a regression, a scatter plot of ∟RESID against the x-list is a useful measure of the effectiveness of the regression. If the plot appears random, this is a good sign; if there is a pattern to the plot, this means it's likely that a better regression model exists. # Optimization The ∟ symbol at the beginning of list names can be omitted everywhere in this command. In addition, every element except the plot type and the data list or data lists are optional, and take on the following default values: • freq list is 1 by default, meaning that all frequencies are 1. • mark is the box by default. • data axis is X by default. # Error Conditions • ERR:DIM MISMATCH is thrown if the x and y lists, or the data and frequency lists, have different dimensions. • ERR:STAT is thrown if Xscl is too small in the case of a Histogram. All errors are thrown when plotting the stat plot, as opposed to when the command is executed, and do not provide a 2:Goto option. # Related Commands Command Summary Allows the user to select a subinterval of any enabled Scatter or xyLine plots. Command Syntax Select(x-list name, y-list name) Menu Location Press: 1. 2nd LIST to access the list menu. 2. RIGHT to access the OPS submenu. 3. 8 to select Select(, or use arrows and ENTER. TI-83/84/+/SE 2 bytes When Select( is called, if it has any Scatter or xyLine plots to work with, it displays the graph screen and allows the user to pick a left bound and then a right bound on one of the plots (the left and right keys move from point to point, while the up and down keys switch plots). Then, it stores all the points between those bounds to x-list name and y-list name. Finally, it sets the chosen plot to use x-list name and y-list name as its X and Y lists. # Optimization It isn't necessary to add the ∟ symbol before list names: :Select(∟X,∟Y) can be :Select(X,Y)  # Error Conditions • ERR:INVALID is thrown if there are no enabled Scatter or xyLine plots for the command to work with. # Related Commands Command Summary Calculates the product of all or part of a list. Command Syntax prod(list[,start,[end]]) Menu Location Press: 1. 2nd LIST to access the list menu. 2. LEFT to access the MATH submenu. 3. 6 to select prod(, or use arrows and ENTER. TI-83/84/+/SE 1 byte The prod( command calculates the product of all or part of a list. When you use it with only one argument, the list, it multiplies all the elements of the list. You can also give it a bound of start and end and it will only multiply the elements starting and ending at those indices (inclusive). prod({1,2,3,4,5}) 120 prod({1,2,3,4,5},2,4) 24 prod({1,2,3,4,5},3) 60  # Optimization If the value of end is the last element of the list, it can be omitted: prod({1,2,3,4,5},3,5) can be prod({1,2,3,4,5},3)  # Error Conditions • ERR:DOMAIN if the starting or ending value aren't positive integers. • ERR:INVALID DIM if the starting or ending value exceed the size of the list, or are in the wrong order. # Related Commands Command Summary Sorts a list in descending order. For more than one list, sorts the first, and reorders other lists accordingly. Command Syntax SortD(list1 [,list2, …]) Menu Location Press: 1. 2nd LIST to access the list menu. 2. RIGHT to access the OPS submenu. 3. 2 to select SortD(, or use arrows and ENTER. TI-83/84/+/SE 1 byte The SortD( command sorts a list in descending order. It does not return it, but instead edits the original list variable (so it takes only list variables as arguments). SortD( can also be passed multiple lists. In this case, it will sort the first list, and reorder the others so that elements which had the same indices initially will continue having the same indices. For example, suppose the X and Y coordinates of some points were stored in ∟X and ∟Y, so that the Nth point had coordinates ∟X(N) and ∟Y(N). Then SortD(∟X,∟Y) would sort the points by their x-coordinates, still preserving the same points. However, SortD( is not stable: if several elements in the first list are equal, then the corresponding elements in the subsequent lists may still end up being in a different order than they were initially. # Algorithm The algorithm used by SortD( and SortA( appears to be a modified selection sort. It is still O(n2) on all inputs, but for some reason takes twice as long on a list with all equal elements. It is not stable. # Related Commands Command Summary Sorts a list in ascending order. For more than one list, sorts the first, and reorders other lists accordingly. Command Syntax SortA(list1 [,list2, …]) Menu Location Press: 1. 2nd LIST to access the list menu. 2. RIGHT to access the OPS submenu. 3. ENTER to select SortA(. TI-83/84/+/SE 1 byte The SortA( command sorts a list in ascending order. It does not return it, but instead edits the original list variable (so it takes only list variables as arguments). SortA( can also be passed multiple lists. In this case, it will sort the first list, and reorder the others so that elements which had the same indices initially will continue having the same indices. For example, suppose the X and Y coordinates of some points were stored in ∟X and ∟Y, so that the Nth point had coordinates ∟X(N) and ∟Y(N). Then SortA(∟X,∟Y) would sort the points by their x-coordinates, still preserving the same points. However, SortA( is not stable: if several elements in the first list are equal, then the corresponding elements in the subsequent lists may still end up being in a different order than they were initially. # Algorithm The algorithm used by SortA( and SortD( appears to be a modified selection sort. It is still O(n2) on all inputs, but for some reason takes twice as long on a list with all equal elements. It is not stable. # Related Commands Command Summary Calculates the sum of all or part of a list. Command Syntax sum(list[,start,[end]]) Menu Location Press: 1. 2nd LIST to access the list menu. 2. LEFT to access the MATH submenu. 3. 5 to select sum(, or use arrows and ENTER. TI-83/84/+/SE 1 byte The sum( command calculates the sum of all or part of a list. When you use it with only one argument, the list, it sums up all the elements of the list. You can also give it a bound of start and end and it will only sum up the elements starting and ending at those indices (inclusive). sum({1,2,3,4,5}) 15 sum({1,2,3,4,5},2,4) 9 sum({1,2,3,4,5},3) 12  # Optimization If the value of end is the last element of the list, it can be omitted: sum({1,2,3,4,5},3,5) can be sum({1,2,3,4,5},3)  # Error Conditions • ERR:DOMAIN is thrown if the starting or ending value aren't positive integers. • ERR:INVALID DIM is thrown if the starting or ending value exceed the size of the list, or are in the wrong order. # Related Commands Command Summary Creates a matrix of specified size with the entries random integers from -9 to 9. Command Syntax randM(# rows, # columns) Menu Location Press: 1. MATRX (TI-83) or 2nd MATRX (TI-83+ or higher) to access the matrix menu 2. RIGHT to access the MATH submenu. 3. 6 to select randM(, or use arrows. TI-83/84/+/SE 1 byte randM(M, N) generates an M by N matrix whose entries are pseudorandom integers between -9 and 9 inclusive. seed→rand affects the output of randM(. 0→rand 0 randM(3,3) [[9 -3 -9] [4 -2 0 ] [-7 8 8 ]]  If you actually cared about the bounds of the random numbers, this command would not be very useful, since it's hard to manipulate the matrix to yield uniformly spread random numbers in a different range. # Formulas The entries of randM( are actually the outputs of successive calls to randInt(-9,9), filled in starting at the bottom right and moving left across each row from the last row to the first. # Error Conditions • ERR:INVALID DIM is thrown if the number of rows or columns of the matrix isn't an integer 1-99. # Related Commands A friendly graphing window is some configuration of window variables that's most useful for your program — most commonly, because it makes the coordinate value of a pixel come out to a round value, such as an integer, or .1 of an integer. # Setting up a square window The most basic type of friendly window is one in which a vertical distance in pixels is equal, coordinate-wise, to the same horizontal distance in pixels. This means that the ratio between (Xmax-Xmin) and (Ymax-Ymin) is 47:31. Such a setup has the useful effect that drawing a circle (for example, with the Circle( command) actually results in a circle, and not an ellipse. This can be accomplished simply with the ZSquare command, which will alter the values of the screen so that: • the coordinate of the center remains the same • the ratio (Xmax-Xmin) : (Ymax-Ymin) is 47:31 (approximately 1.516 : 1) • the resulting window is larger rather than smaller than the original. A common technique is to run the ZStandard command first, so that the center of the screen is at (0,0). # Setting up an integer square window However, it's possible to take friendliness even further, by adding the condition that coordinate values of a pixel come out to round values without long decimals. This can be done in several ways: ### Using the ZDecimal command This is by far the simplest — the ZDecimal command will set Xmin to -4.7, Xmax to 4.7, Ymin to -3.1, and Ymax to 3.1. As you can see, this satisfies the condition for a square window. Also, the coordinates of pixels have at most one decimal place: pixels that are next to each other differ by 0.1 in the appropriate coordinate. Zdecimal is useful if you only need to do a few point/line commands, like if you were drawing a border around the screen using Horizontal and Vertical. However, it has the drawback of still having a decimal point. Your drawing commands may look like Line(-3.1, -1.7, 3.1, -1.7) — if you didn't have to have that decimal point there, you'd save a considerable amount of space. This is possible, using the following three methods: ##### An integer window with (0,0) in the center These methods are basically divided over where the point (0,0) should be. Putting it in the center ensures that drawing things in the middle of the screen takes up little space; also, you can achieve symmetry easily by appropriately negating numbers. On the other hand, the negative sign (you'll be using one 3/4 of the time, and 1/4 of the time you'll need two) can be annoying. The following code sets up an integer square window with (0,0) in the center: :ZStandard :ZInteger  ##### An integer window with (0,0) in the bottom left corner This approach is optimal in terms of saving space on coordinates: they are all positive numbers with at most two digits. For this reason, it is the most widely used. The following code sets up such a window: :ZStandard :84→Xmin :72→Ymax :ZInteger  ##### An integer window with (0,0) in the top left corner This approach is useful for when point and pixel commands need to be used together. Although putting (0,0) in the top left makes every Y-coordinate negative, the window has the useful property that it's very easy to go from point commands to pixel commands: the pixel (R,C) corresponds to the point (C,-R), and equivalently, the point (X,Y) corresponds to the pixel (-Y,X). It's somewhat trickier to set up, though: :ZStandard :84→Xmin :-72→Ymin :ZInteger  # Why friendly windows are useful Throughout this article, we've only made glancing comments as to why you'd want to use friendly windows. Here is a more exhaustive explanation: ### Graphs come out nicer Even with a square window, graphs become more accurate, because they reflect the actual proportions of the equation being graphed. For example, try drawing a circle in the standard graphing window — you'll get some stretched out oval. Now ZSquare and try again. The result is much better, right? With an integer square window, certain other imperfections of the calculator's graphing go away. For example, try graphing Y=1/(X+1) in the standard graphing window. Pretty accurate, but instead of the asymptote there's a slightly diagonal line. That's because the asymptote doesn't end up corresponding to a pixel of the graph: one pixel, the curve is a very negative number, the next it's a very positive number, so the calculator tries to connect them. Now ZDecimal and graph 1/(X+1) again. The nearly vertical line at the asymptote disappears: because the value X=-1 matches a pixel on the graph, so the calculator realizes that something is undefined there. Another similar problem occurs with graphing Y={-1,1}√(9-X²). In most graphing windows, this graph, which should come out to a circle, has some gaps near the sides. In an integer square window, such as with ZDecimal, the gaps disappear, and you're left with a perfect circle. ### Coordinates are round numbers This is a more programming-related application. If you happen to need to draw something on the screen, in a program, you're likely to need a lot of Line( or Pt-On( commands at fairly specific locations. On a normal window, such a "specific location" might end up being (2.553,0.645) or something equally ugly, with unpredictable results if you try to round it to the nearest nice value (since you don't know exactly the point at which pixels change). With a friendly window (for this purpose, an integer window with (0,0) in the bottom left is the friendliest), every single pixel has a round coordinate value. If each value is no more than a 2-digit number, you can even compress all the coordinates of a line into a single number — this technique was used, for example, in Bryan Thomas' Contra game. ### Point and pixel commands are compatible In the case of an arbitrary window, it's fairly difficult to convert from a pixel coordinate to a point coordinate and back: the exact formula is X=Xmin+CΔX, Y=Ymax-RΔY if (X,Y) is the point and (R,C) is the pixel (going from pixel to point is even more painful). However, there are many cases in which you do need to go back and forth — for example, if you need to draw both text and lines at a coordinate. With friendly windows, this formula becomes much simpler — such as (X,Y)=(C,-R) for the last integer window we discussed. Command Summary Enables sequence graphing mode. Command Syntax Seq Menu Location While editing a program, press: 1. MODE to access the mode menu. 2. Use arrows to select Seq. TI-83/84/+/SE 1 byte The Seq command enables sequence graphing mode. Sequential mode is used for graphing sequences, which can be thought of as functions from the positive (or non-negative) integers. The TI-83 calculators let n be the independent variable in this situation, and the three sequences, instead of using subscripts, use the letters u, v, and w. One of the main advantages of sequential mode is that it allows recursive definitions: u(n) can be defined in terms of u(n-1) and u(n-2). For recursive definitions to work, an initial case must be defined: this is done using the variables u(nMin), v(nMin), and w(nMin). The constant nMin is the initial case, for which the calculator will use a specific value rather than the formula. For example, say a bunny population starts out at 100 and doubles each year. We can describe this situation using the recursive definition u(n)=2u(n-1) (this just says that the nth year population is twice the population of the previous year); then we set u(nMin)=100. Note that without u(nMin), the equation would be meaningless - without the initial population, we have no way to calculate any other population. When you're using more than one previous value — both u(n-1) and u(n-2)) — you need more than one initial value, and then u(nMin) becomes a list. # Advanced Uses Sequence graphing mode has several submodes that can be selected from the 2nd FORMAT screen. They are Time, Web, uvAxes, uwAxes, and vwAxes. Sequences are still defined in the same way, but these modes control the way that they're graphed. The window variables that apply to sequence mode are: • nMin — Determines the minimum n-value calculated for equations. • nMax — Determines the maximum n-value calculated for equations. • PlotStart — Determines the first value of n that is actually graphed. • PlotStep — Determines the difference between consecutive graphed values of n. • Xmin — Determines the minimum X-value shown on the screen. • Xmax — Determines the maximum X-value shown on the screen. • Xscl — Determines the horizontal space between marks on the X-axis in AxesOn mode or dots in GridOn mode. • Ymin — Determines the minimum Y-value shown on the screen. • Ymax — Determines the maximum Y-value shown on the screen. • Yscl — Determines the vertical space between marks on the Y-axis in AxesOn mode or dots in GridOn mode. # Related Commands Command Summary Enables polar graphing mode. Command Syntax Polar Menu Location While editing a program, press: 1. MODE to access the mode menu. 2. Use arrows to select Pol. TI-83/84/+/SE 1 byte The Polar command enables the polar graphing mode. Unlike the previous modes, polar mode doesn't use the more common (x,y) coordinates. Instead, the coordinates (r,θ) are used, where θ is the counterclockwise angle made with the positive x-axis, and r is the distance away from the origin (the point (0,0)). Although it's possible to translate from one system to the other, polar coordinates are more useful for some expressions (and, of course, less useful for others). In particular, they're very good at graphing anything circle-related. The equation for a circle in polar mode is just r=1 (or any other number, for a circle of different radius). Like in parametric mode, the parameter θ uses the window variables θmin, θmax, and θstep to determine which points are graphed. A common situation is θmin=0, θmax=2π: in Radian mode, this corresponds to going all the way around the circle. Of course, you could use Degree mode and set θmax to be 360, but this is uncommon in mathematics. # Advanced Uses The window variables that apply to polar mode are: • θmin — Determines the minimum θ-value graphed for equations. • θmax — Determines the maximum θ-value graphed for equations. • θstep — Determines the difference between consecutive θ-values. • Xmin — Determines the minimum X-value shown on the screen. • Xmax — Determines the maximum X-value shown on the screen. • Xscl — Determines the horizontal space between marks on the X-axis in AxesOn mode or dots in GridOn mode. • Ymin — Determines the minimum Y-value shown on the screen. • Ymax — Determines the maximum Y-value shown on the screen. • Yscl — Determines the vertical space between marks on the Y-axis in AxesOn mode or dots in GridOn mode. # Related Commands Command Summary Enables parametric graphing mode. Command Syntax Param Menu Location While editing a program, press: 1. MODE to access the mode menu. 2. Use arrows to select Par. TI-83/84/+/SE 1 byte The Param command enables parametric graphing mode. Parametric mode is in many ways a generalization of function mode. Instead of writing y as a function of x, both x and y are written as a function of a parameter t (hence the name, parametric mode). You can easily see that equations in function mode are just a special case of equations in parametric mode: if you set x equal to t, then writing y=f(t) is equivalent to writing y=f(x). Of course, graphing a function this way on a calculator will be slightly slower than doing it in function mode directly, because of the overhead. Parametric mode allows you the greatest freedom of all the possible graphing modes - nearly every curve you could encounter can be expressed in parametric form. In mathematics, the parameter t is commonly allowed to take on all values from negative to positive infinity. However, this would be impossible to do on a calculator, since the equation would never stop graphing (unlike function mode, there's no easy way to check for which values of t the equation will go off the screen and there's no need to graph it). Instead, the calculator has window variables Tmin, Tmax, and Tstep: it will evaluate the parameter at every value from Tmin to Tmax, increasing by Tstep each time, and 'connect the dots'. Polar mode, which you'll read about in the next section, is also a special case of parametric mode: To graph r=f(θ), you can instead graph x=f(t)cos(t) and y=f(t)sin(t), with t graphed over the same interval as θ. # Advanced Uses The window variables that apply to parametric mode are: • Tmin — Determines the minimum T-value graphed for equations. • Tmax — Determines the maximum T-value graphed for equations. • Tstep — Determines the difference between consecutive T-values. • Xmin — Determines the minimum X-value shown on the screen. • Xmax — Determines the maximum X-value shown on the screen. • Xscl — Determines the horizontal space between marks on the X-axis in AxesOn mode or dots in GridOn mode. • Ymin — Determines the minimum Y-value shown on the screen. • Ymax — Determines the maximum Y-value shown on the screen. • Yscl — Determines the vertical space between marks on the Y-axis in AxesOn mode or dots in GridOn mode. # Related Commands Command Summary Enables function graphing mode. Command Syntax Func Menu Location While editing a program, press: 1. MODE to access the mode menu. 2. Use arrows to select Func. TI-83/84/+/SE 1 byte The Func command enables function graphing mode. This is usually unnecessary in a program, but if you want to graph a Y# equation, you'd want to make sure the calculator is in function mode first. In function mode, you can graph equations where y (the vertical coordinate) is a function of x (the horizontal coordinate). This mode is most commonly discussed in algebra and single-variable calculus courses. Many curves, such as a parabola, have simple expressions when written in the form y=f(x). However, in function mode, many expressions cannot be graphed at all. For example, a circle can't be easily graphed in function mode, since for some x-values, there are two y-values. Using two functions, you can achieve a circle, but it will still require a friendly graphing window to display perfectly. Many calculator features are specifically targeted at function mode graphing. For example, two graphing styles (see GraphStyle() can be only used with function mode. The DrawF command draws a function in graphing mode. # Advanced Uses The window variables that apply to function mode are: • Xmin — Determines the minimum X-value shown on the screen. • Xmax — Determines the maximum X-value shown on the screen. • Xscl — Determines the horizontal space between marks on the X-axis in AxesOn mode or dots in GridOn mode. • Ymin — Determines the minimum Y-value shown on the screen. • Ymax — Determines the maximum Y-value shown on the screen. • Yscl — Determines the vertical space between marks on the Y-axis in AxesOn mode or dots in GridOn mode. • Xres — Determines the pixel distance between points used for graphing. This is a value 1-8: 1 for best quality, 8 for best speed. # Related Commands The TI-83 series of graphing calculators can graph equations in four modes: function mode, parametric mode, polar mode, and sequential mode. Since this website is primarily aimed at calculator programmers, rather than all calculator users, this information may not have many immediate applications, since graphing equations isn't often useful in programs. However, math programs may require information such as this, and in general, the better you understand all the features of your calculator, the better you'll be able to program it. The four graphing modes are enabled with the Func, Param, Polar, and Seq commands. # Function Mode In function mode, you can graph equations where y (the vertical coordinate) is a function of x (the horizontal coordinate). This mode is most commonly discussed in algebra and single-variable calculus courses. Many curves, such as a parabola, have simple expressions when written in the form y=f(x). However, in function mode, many expressions cannot be graphed at all. For example, a circle can't be easily graphed in function mode, since for some x-values, there are two y-values. Using two functions, you can achieve a circle, but it will still require a friendly graphing window to display perfectly. Many calculator features are specifically targeted at function mode graphing. For example, two graphing styles (see GraphStyle() can be only used with function mode. The DrawF command draws a function on the graph screen. # Parametric Mode Parametric mode is in many ways a generalization of function mode. Instead of writing y as a function of x, both x and y are written as a function of a parameter t (hence the name, parametric mode). You can easily see that equations in function mode are just a special case of equations in parametric mode: if you set x equal to t, then writing y=f(t) is equivalent to writing y=f(x). Of course, graphing a function this way on a calculator will be slightly slower than doing it in function mode directly, because of the overhead. Parametric mode allows you the greatest freedom of all the possible graphing modes - nearly every curve you could encounter can be expressed in parametric form. In mathematics, the parameter t is commonly allowed to take on all values from negative to positive infinity. However, this would be impossible to do on a calculator, since the equation would never stop graphing (unlike function mode, there's no easy way to check for which values of t the equation will go off the screen and there's no need to graph it). Instead, the calculator has window variables Tmin, Tmax, and Tstep: it will evaluate the parameter at every value from Tmin to Tmax, increasing by Tstep each time, and 'connect the dots'. Polar mode, which you'll read about in the next section, is also a special case of parametric mode: To graph r=f(θ), you can instead graph x=f(t)cos(t) and y=f(t)sin(t), with t graphed over the same interval as θ. # Polar Mode Unlike the previous modes, polar mode doesn't use the more common (x,y) coordinates. Instead, the coordinates (r,θ) are used, where θ is the counterclockwise angle made with the positive x-axis, and r is the distance away from the origin (the point (0,0)). Although it's possible to translate from one system to the other, polar coordinates are more useful for some expressions (and, of course, less useful for others). In particular, they're very good at graphing anything circle-related. The equation for a circle in polar mode is just r=1 (or any other number, for a circle of different radius). Like in parametric mode, the parameter θ uses the window variables θmin, θmax, and θstep to determine which points are graphed. A common situation is θmin=0, θmax=2π: in Radian mode, this corresponds to going all the way around the circle. Of course, you could use Degree mode and set θmax to be 360, but this is uncommon in mathematics. # Sequential Mode Sequential mode is used for graphing sequences, which can be thought of as functions from the positive (or non-negative) integers. The TI-83 calculators let n be the independent variable in this situation, and the three sequences, instead of using subscripts, use the letters u, v, and w. One of the main advantages of sequential mode is that it allows recursive definitions: u(n) can be defined in terms of u(n-1) and more generally in terms of u(n-k) for any k. For recursive definitions to work, an initial case must be defined: this is done using the variables u(nMin), v(nMin), and w(nMin). The constant nMin is the initial case, for which the calculator will use a specific value rather than the formula. For example, say a bunny population starts out at 100 and doubles each year. We can describe this situation using the recursive definition u(n)=2u(n-1) (this just says that the nth year population is twice the population of the previous year); then we set u(nMin)=100. Note that without u(nMin), the equation would be meaningless - without the initial population, we have no way to calculate any other population. When you're using more than one previous value (for example, u(n-1) and u(n-2)) you need more than one initial value, and then u(nMin) becomes a list. The abbreviation "seq" is ambiguous and may refer to: • seq(, the list command evaluating an expression at several values. • Seq, the mode command that selects sequential graphing mode. • Sequential, the mode command that sets equations to graph one after the other. If an internal link led you here, you may wish to change the link to point directly to the intended article. Command Summary Sets the graphing style of a graphing equation in the current mode. Command Syntax GraphStyle(equation #, style #) Menu Location While editing a program, press: 1. PRGM to access the programming menu. 2. ALPHA H to select GraphStyle(, or use arrows. TI-83/84/+/SE 2 bytes The GraphStyle( command allows you to set the graphing style of an equation (line, thick line, dotted line, etc.) from within a program. Its first argument, equation #, is the number of the equation whose graphing style you want to change - this depends on the mode you're in. For example, if you wanted to change the graphing style of Y1, you would need to be in function mode and use the value 1 for this argument. If you wanted to change the graphing style of r4, you would need to be in polar mode and use the value 4. The second argument is a number from 1 to 7, which translates to a graphing style as follows: • 1 - a normal line, usually the default graph style. • 2 - a thick line (three pixels wide). • 3 - a line, with everything above it shaded (only valid in function mode). • 4 - a line, with everything below it shaded (only valid in function mode). • 5 - a path: a line, with a ball moving along it as it is graphed (not valid in sequential mode). • 6 - animated: a ball moving along the graph (not valid in sequential mode). • 7 - a dotted line. Compare this to the effect of Connected or Dot mode. When either of these modes is set, all equations, from all graphing modes, are reverted to line style or dotted line style respectively; furthermore, it becomes the default graph style and clearing an equation will revert it to this graph style. The GraphStyle( command simply overrides these modes temporarily. # Advanced In shading modes (3 and 4), the shading style cycles as follows: • The first function graphed shades using vertical lines one pixel apart • The second function shades using horizontal lines one pixel apart • The third function shades using negatively sloping diagonal lines, two pixels apart. • The fourth function shades using positively sloping diagonal lines, two pixels apart. • After that, functions will cycle through these four styles in that order. # Error Conditions • ERR:DOMAIN if the equation # is not a valid equation number in this mode, or if style # is not an integer 1-7. • ERR:INVALID if the graphing style chosen is not valid for the current graphing mode. # Related Commands Command Summary Calculates the differences between consecutive terms of a list. Command Syntax ΔList(list) Menu Location Press: 1. 2nd LIST to access the list menu. 2. RIGHT to access the OPS submenu. 3. 7 to select ΔList(, or use arrows. TI-83/84/+/SE 2 bytes ΔList( calculates the differences between consecutive terms of a list, and returns them in a new list. ΔList({0,1,4,9,16,25,36}) {1 3 5 7 9 11}  # Advanced Uses The ΔList( command is very nearly the inverse of the cumSum( command, which calculates the cumulative sums of a list. For any list, ΔList(cumSum(list)) will return the same list, but without its first element: ΔList(cumSum({1,2,3,4,5,6,7})) {2 3 4 5 6 7}  Removing the first element would otherwise be a difficult procedure involving the seq( command, so this is a useful trick to know. If a list is sorted in ascending order, min(ΔList(list)) will return 0 (false) if there are repeating values in the list, and a value corresponding to true if they are all distinct. # Error Conditions # Related Commands Command Summary Calculates cumulative sums of a list or of the columns of a matrix. Command Syntax cumSum(list or matrix) Menu Location Press: 1. 2nd LIST to access the list menu. 2. RIGHT to access the OPS submenu. 3. 6 to select cumSum(, or use arrows. Alternatively, press: 1. MATRIX (TI-83) or 2nd MATRIX (TI-83+ or higher) to access the matrix menu. 2. RIGHT to access the MATH submenu. 3. 0 to select cumSum(, or use arrows. TI-83/84/+/SE 2 bytes cumSum( calculates the cumulative sums of a list, or of the columns of a matrix, and outputs them in a new list or matrix variable. For a list, this means that the Nth element of the result is the sum of the first N elements of the list: cumSum({1,3,5,7,9}) {1 4 9 16 25}  For a matrix, cumSum( is applied to each column in the same way as it would be for a list (but numbers in different columns are never added): [[0,1,1][0,1,3][0,1,5][0,1,7]] [[0 1 1] [0 1 3] [0 1 5] [0 1 7]] cumSum(Ans) [[0 1 1] [0 2 4] [0 3 9] [0 4 16]]  # Advanced Uses The ΔList( command is very nearly the inverse of the cumSum( command - it calculates the differences between consecutive elements. For any list, ΔList(cumSum(list)) will return the same list, but without its first element: ΔList(cumSum({1,2,3,4,5,6,7})) {2 3 4 5 6 7}  Removing the first element would otherwise be a difficult procedure involving the seq( command, so this is a useful trick to know. For a matrix, if you want to sum up the rows instead of the columns, use the T (transpose) command. # Related Commands System variables are, for the purposes of this guide, variables that certain commands will use or modify without asking (i.e. without supplying them in the command's arguments). This is a somewhat ill-defined category, and in fact the system variables we'll discuss are of a somewhat miscellaneous nature. They include equation and plot variables, window and table parameters, statistical variables, and finance variables. # Equation variables and plot variables The equation variables include Y0 through Y9 (function variables), X1T and Y1T through X6T and Y6T (parametric variables), r1 through r6 (polar variables), and u, v, w (sequential variables). They are used when graphing an equation on the graph screen. From the point of view of a programmer, it's important to realize that these variables are actually strings in disguise. That is to say, they are stored internally as strings, though the string operations and commands won't work on them. Instead, the following operations are valid for equations: • Evaluating them, by using the equation variable in an expression. • Evaluating them at a point, using the syntax EqVar(value) - for example, Y1(5). This will plug value in for the independent variable - X, T, θ, or n for function, parametric, polar, and sequential variables respectively. • Storing a string to them. • Using the Equ►String( or String►Equ( command to go back and forth from string to equation form. In addition to their string contents, an equation variable contains two other pieces of information - the graphing style, set with the GraphStyle( command, and the state (enabled or disabled), set with the FnOn and FnOff commands. There is unfortunately, no way to find out which graphing style or state a variable is in, you can only set these to a value. Plot variables are used for displaying data graphically, in one of six styles: scatter plot, line plot, histogram, box plot, modified box plot, and normal plot. What the variables actually store varies with the plot type, but includes one or more data lists, and settings. All of this can be set with the PlotN( command. All or some plots can be turned on and off with the PlotsOn and PlotsOff commands. The Select( command is also useful for dealing with plots. # Window and table parameters These store auxiliary information about the graphing window and include: • Xmin, Xmax, Ymin, Ymax — determine the lower and upper X and Y bounds of the graph screen itself. • ΔX, ΔY — defined to be (Xmax-Xmin)/94 and (Ymax-Ymin)/62 respectively; storing to them will change Xmax and Ymax to arrange this. • Xscl, Yscl — determine how wide the marks on the axes (and, with GridOn, the grid marks) are spaced. • Xres — determines the quality of Function graphing (how many pixels apart points are calculated), and must be an integer 1-8. • Tmin, Tmax, Tstep — determine the values at which T is evaluated in Parametric graphing (as though it were a For( loop). • θmin, θmax, θstep — the same idea, but for the θ variable in Polar graphing. • nMin, nMax — bounds for the n variable to evaluate (the step is always 1; also, these must be integers). • u(nMin), v(nMin), w(nMin) - override the value of u, v, and w at nMin, for the purposes of recursively defining them. • PlotStart, PlotStep — actually have nothing to do with plots, but determine which values of n are graphed. • all of the above have a Z equivalent (ZXmin, Zθstep, etc.) that's used by ZoomSto and ZoomRcl. • XFact, YFact — the scaling factors for Zoom In and Zoom Out. • TblStart, ΔTbl — the starting value and step for the independent variable in the table screen. • TblInput — a 7-element list of the values of a variable in the table. When transferring variables between calculators, or grouping variables, these variables are grouped in Window, rclWindow, and TblSet. You can store to each of the window variables directly, or use the zoom commands, which affect multiple variables at once to achieve some effect. You can use these to some extent as real variables to store values in a program, but their use is limited to the home screen (because they affect the graph screen) and there are limits to their ranges. For example, Xmax must be greater than Xmin. # Statistical Variables These cannot be stored to, although their values can be used - instead they are modified by statistical commands, which use them as output. See the statistics pages for more information. Notably, the list |LRESID is taken up on the CE. # Finance Variables The seven finance variables are N, I%, PV, PMT, FV, P/Y, and C/Y. They are used by the finance solver tool; to use the solver in a program, set these variables to the values you want, choose one of the options Pmt_End or Pmt_Bgn, and then use the value tmv_VAR (where VAR is the variable you want to solve for). Another use of the finance variables is in speed-critical sections of code: they are faster to access even than Ans. Somewhat off-setting this advantage is the fact that they are two byte tokens, and that they don't work as the variables of a seq( command or a For( loop (they will actually throw a ERR:SYNTAX error) or IS>( and DS>(. In addition the value of C/Y is altered when P/Y is altered. Command Summary Fills a list or matrix with one number. Command Syntax Fill(value,matrix) Menu Location Press: 1. 2nd LIST to access the list menu. 2. RIGHT to access the OPS submenu. 3. 4 to select Fill(, or use arrows. Alternatively, press: 1. MATRX (83) or 2nd MATRX (83+ or higher) to access the matrix menu. 2. RIGHT to access the MATH submenu. 3. 4 to select Fill(, or use arrows. TI-83/84/+/SE 1 byte The Fill( command takes an existing list or matrix variable and sets all its elements to a single number. It doesn't return anything and only works on already defined variables. {5}→dim(L1) Fill(2,L1) L1 {2 2 2 2 2} {3,4}→dim([A]) Fill(1,[A]) [A] [[1 1 1 1] [1 1 1 1] [1 1 1 1]]  Fill( is very fast: on a twenty-element real list, it takes only about 3.5 ms, much less than any vectorized list operation. When Fill( is called on a list, the datatype of the list becomes the datatype of the number. That is, Fill(1,L1) makes L1 a real list, and Fill(i,L1) makes L1 a complex list. # Optimization When creating a new list or matrix you want to fill with zeroes, it's better to delete it then create it with dim(, which will set all entries to 0, than to set its dimensions with dim( (which may not clear what was there before) then use Fill(. # Errors On a TI-84+CSE, using Fill(List,List) will cause a RAM clear. For example: Fill({1,2,3},{1,2,3} will cause a RAM Clear. This does not apply on any other models, as they only give you argument and data type errors. # Related Commands Command Summary This command calculates the transpose of a matrix. Command Syntax matrixT Menu Location Press: 1. MATRX (on the 83) or 2nd MATRX (83+ or higher) to access the Matrix menu. 2. LEFT to access the MATH submenu 3. 2 to select T, or use arrows Calculator Compatibility TI-83/84/+/SE Token Size 1 byte The T command is used to calculate the transpose of a matrix: it flips a matrix along its main diagonal. This means that the (i,j)th element becomes the (j,i)th element, and vice versa. As a result, the transpose of an M by N matrix is an N by M matrix. [[1,2,3][4,5,6]] ………… [[1 2 3] …………. [4 5 6]] AnsT ………… [[1 4] …………. [2 5] …………. [3 6]] # Advanced Uses In addition to its many uses in linear algebra, the T operation is useful to programmers: with operations such as Matr►list( and augment(, which normally deal with columns, T allows you to use rows instead. See the "Related Commands" section for the commands that this is useful for. # Related Commands Command Summary Generates a random number with the binomial distribution. Command Syntax randBin(n,p,# simulations) Menu Location Press: 1. MATH to access the math menu. 2. LEFT to access the PRB submenu. 3. 7 to select randBin(, or use arrows. TI-83/84/+/SE 2 bytes randBin(n,p) generates a pseudorandom integer between 0 and n inclusive according to the binomial distribution B(n,p) - that is, n trials of an event with probability of success p are performed, and the number of successes is returned. randBin(n,p,simulations) performs the above calculation simulations times, and returns a list of the results. The expected (average) result is n*p. n should be an integer greater than or equal to 1, while p should be a real number between 0 and 1 inclusive. seed→rand affects the output of randBin( 0→rand 0 randBin(5,1/2 2 randBin(5,1/2,10 {3 3 2 4 3 2 2 2 4 3}  # Formulas The value of randBin( for a given seed can be expressed in terms of rand: randBin(N,P)=sum(P>rand(N  This is identical to the output of randBin( in the sense that for the same seed, both expressions will generate the same random numbers. # Error Conditions • ERR:DOMAIN is triggered if the probability is not on the interval from 0 to 1. # Related Commands Command Summary Generates a random normally-distributed number with specified mean and standard deviation. Command Syntax randNorm(µ,σ,[n]) Menu Location Press: 1. MATH to access the math menu. 2. LEFT to access the PRB submenu. 3. 6 to select randNorm(, or use arrows. TI-83/84/+/SE 2 bytes randNorm(µ,σ) generates a normally-distributed pseudorandom number with mean µ and standard deviation σ. The result returned will most probably be within the range µ±3σ. randNorm(µ,σ,n) generates a list of n normally-distributed pseudorandom numbers with mean µ and standard deviation σ. seed→rand affects the output of randNorm(. 0→rand 0 randNorm(0,1) -1.585709623 randNorm(0,1,3) {-1.330473604 1.05074514 -.0368606663}  Although a theoretical normally distributed variable could take on any real value, numbers on a calculator have a limited precision, which leads to a maximum range of approximately µ±7.02σ for values of randNorm(. # Optimization When the mean is 0 and the standard deviation 1, invNorm(rand) and invNorm(rand(N)) save space over randNorm(0,1) and randNorm(0,1,N) respectively. # Formulas The value of randNorm( for a given seed can be expressed in terms of rand: randNorm(µ,σ)=µ-σinvNorm(rand  This is identical to the output of randNorm( in the sense that for the same seed, both expressions will generate the same random numbers. The following formula can be used to get a target interval where A and B are two real intervals. µ=(A+B)/2 σ=(-A+B)/6  # Related Commands Command Summary Generates a random integer between min and max, inclusive, or a list of such numbers. Command Syntax randInt(min,max[,# of numbers]) Menu Location Press: 1. MATH to access the math menu. 2. LEFT to access the PRB submenu. 3. 5 to select randInt(, or use arrows. TI-83/84/+/SE 2 bytes randInt(min,max) generates a uniformly-distributed pseudorandom integer between min and max inclusive. randInt(min,max,n) generates a list of n uniformly-distributed pseudorandom integers between min and max. seed→rand affects the output of randInt(. 0→rand 0 randInt(1,10) 10 randInt(1,10,5) {10 2 6 5 8}  # Optimization When the lower bound of randInt( is 0, you can replace it with int(#rand to save space. For example: :randInt(0,12 can be :int(13rand  Similarly, if you don't want to include zero in the range, you can use a variant of 1-#int(#rand: :1-2int(2rand  In this particular example, the only values that you will ever get are -1 or 1. # Formulas The value of randInt( for a given seed can be expressed in terms of rand: randInt(A,B)= • when A<B, A+int((B-A+1)rand • otherwise, B+int((A-B+1)rand This is identical to the output of randInt( in the sense that for the same seed, both expressions will generate the same random numbers. # Error Conditions • ERR:DOMAIN is thrown if any of the arguments is a decimal. • ERR: DATA TYPE is given if you use imaginary numbers like 6i or something like Matrices or Lists. This error is used instead of ERR:DOMAIN for "i". # Related Commands Command Summary Calculates the factorial of a number or list. Command Syntax value! Menu Location Press: 1. MATH to access the math menu. 2. LEFT to access the PRB submenu. 3. 4 to select !, or use arrows. TI-83/84/+/SE 1 byte ! is the factorial function, where n! = n*(n-1)! and 0! = 1, n an nonnegative integer. The function also works for arguments that are half an odd integer and greater than -1/2:$(-\frac1{2})!$is defined as$\sqrt{\pi}$and the rest are defined recursively. 3! 6 (‾.5)! 1.772453851 Ans² 3.141592654  The combinatorial interpretation of factorials is the number of ways to arrange n objects in order. # Error Conditions • ERR:DOMAIN for any numbers except the ones mentioned above. # Related Commands Command Summary Calculates the combinatorial number of combinations. Command Syntax a nCr b Menu Location Press: 1. MATH to access the math menu. 2. LEFT to access the PRB submenu. 3. 3 to select nCr, or use arrows. TI-83/84/+/SE 1 byte nCr is the number of combinations function (or binomial coefficient), defined as a nCr b = a!/(b!*(a-b)!), where a and b are nonnegative integers. The function also works on lists. Tip: nCr has a higher priority in evaluation than operators such as + or *: for example, 5X nCr 10 will be interpreted as 5(X nCr 10) and not as (5X) nCr 10. You might wish to use parentheses around complex expressions that you will give to nCr as arguments. 6 nCr 4 15  The combinatorial interpretation of a nCr b is the number of ways to choose b objects, out of a total of a, if order doesn't matter. For example, if there 10 possible pizza toppings, there are 10 nCr 3 ways to choose a 3-topping pizza. # Error Conditions • ERR:DIM MISMATCH is thrown when applying nCr to two lists that have different dimensions. • ERR:DOMAIN is thrown for negative integers or decimals. # Related Commands Command Summary Calculates the combinatorial number of permutations. Command Syntax a nPr b Menu Location Press: 1. MATH to access the math menu. 2. LEFT to access the PRB submenu. 3. 2 to select nPr, or use arrows. TI-83/84/+/SE 1 byte nPr is the number of permutations function, defined as a nPr b = a!/(a-b)!, where a and b are nonnegative integers. The function also works on lists. Tip: nPr has a higher priority in evaluation than operators such as + or *: for example, 5X nPr 10 will be interpreted as 5(X nPr 10) and not as (5X) nPr 10. You might wish to use parentheses around complex expressions that you will give to nPr as arguments. 6 nPr 4 360  The combinatorial interpretation of a nPr b is the number of ways to choose b objects in order, when there are a objects in total. For example, when giving 1st, 2nd, and 3rd place awards in a competition between 10 teams, there are 10 nPr 3 different ways to assign the awards. # Error Conditions • ERR:DIM MISMATCH is thrown when applying nPr to two lists that have different dimensions. • ERR:DOMAIN is thrown for negative integers or decimals. # Related Commands Command Summary Generates a random number between 0 and 1, or a list of such numbers. Can also be used to set the random number seed. Command Syntax rand rand(# of numbers) seed→rand Menu Location Press: 1. MATH to access the math menu. 2. LEFT to access the PRB submenu. 3. ENTER to select rand. TI-83/84/+/SE 1 byte rand generates a uniformly-distributed pseudorandom number (this page and others will sometimes drop the pseudo- prefix for simplicity) between 0 and 1. rand(n) generates a list of n uniformly-distributed pseudorandom numbers between 0 and 1. seed→rand seeds (initializes) the built-in pseudorandom number generator. The factory default seed is 0. L'Ecuyer's algorithm is used by TI calculators to generate pseudorandom numbers. 0→rand 0 rand .9435974025 rand(2) {.908318861 .1466878292}  Note: Due to specifics of the random number generating algorithm, the smallest number possible to generate is slightly greater than 0. The largest number possible is actually 1, but since returning a result of 1 would mess up the output of randBin( and randNorm(, the actual value returned in such cases is 1-1.11e-12 (which is displayed as 1, and is "equal" to 1 for the purposes of the = command). To see 1, store 196164532 to rand and then run the random number generator. # Advanced Uses To seed the random number generator, store a positive integer to rand (the command will ignore any decimals, and the sign of the number). Seeding the random number generator has several uses: When writing a program that uses random numbers, you may add a 0→rand instruction to the beginning of the program — this ensures that the program's actions will be repeatable, making it easier to fix a bug. Just don't forget to take it out when you've finished writing the program. Seeding the random number generator can also be used to create fairly secure (unbreakable without a computer) encryption. Pick a secret key, and store it to rand as a seed. Then, perform some randomly generated manipulations on the data you want to encode — for example, shifting each character of a string by a random number. Decoding the message is simple: store the secret key to rand and perform the opposite of those random operations. However, this is impossible to do if you don't know the secret key. When seeding the random number generator, as above, you make every random number generated afterwards predictable. This may be problematic even if your program doesn't need random numbers, because other programs might. To prevent this, use the following code to save and restore "randomness": :randInt(1,E9)→N (code that involves seeding the RNG here) :N→rand Since generating random numbers is a fairly time-consuming operation, the rand(# of numbers) syntax is very effective at generating a delay in your program — just add the line: :rand(N)  The bigger N is, the longer the delay. In relation to the commonly used For( loop delay, the number used in the rand( delay is about 10 times smaller. However, this code has a side effect of storing a list of random numbers to Ans, which may be undesirable. To avoid this, use this somewhat longer line: :If dim(rand(N))  Despite the presence of an If statement, you don't have to worry about the next line being skipped, since dim(rand(N)) will always be true. # Error Conditions • ERR:DOMAIN if you try to generate a list of random numbers and the list length isn't an integer 1-999. # Related Commands Command Summary Returns the imaginary part of a complex number. Command Syntax imag(value) Menu Location Press: 1. MATH to access the math menu. 2. RIGHT, RIGHT to access the CPX (complex) submenu. 3. 3 to select imag(, or use arrows. TI-83/84/+/SE 2 bytes imag(z) returns the imaginary part of the complex number z. If z is represented as x+iy where x and y are both real, imag(z) returns y. Also works on a list of complex numbers. imag(3+4i) 4 imag({3+4i,-2i,17}) {4,-2,0}  # Related Commands Command Summary Returns the real part of a complex value. Command Syntax real(value) Menu Location Press: 1. MATH to access the math menu. 2. RIGHT, RIGHT to access the CPX (complex) submenu. 3. 2 to select real(, or use arrows. TI-83/84/+/SE 2 bytes real(z) returns the real part of the complex number z. If z is represented as x+iy where x and y are both real, real(z) returns x. Also works on a list of complex numbers. real(3+4i) 3  # Advanced Uses The real( command is expanded by several assembly libraries (such as xLIB and Omnicalc) to call their own routines. If xLib is installed, then real( will no longer work as intended even in programs that want to use it for its intended purpose. If you actually want to take the real part of a complex number, and want the program to work with one of these assembly libraries, you could use the imag( command instead - real(Z) is equivalent to imag(Zi). Alternatively, you could tell people using your program to uninstall xLIB or Omnicalc first. If a program you downloaded has an error and 2:Goto takes you to a line with real( and a bunch of arguments, this is probably because the program uses Omnicalc or xLIB which you don't have installed. # Related Commands # See Also Command Summary Returns the complex argument of a complex number. Command Syntax angle(z) Menu Location Press: 1. MATH to access the math menu. 2. RIGHT, RIGHT to access the CPX (complex) submenu 3. 4 to select angle(, or use arrows. TI-83/84/+/SE 2 bytes angle(z) returns the complex argument (also known as the polar angle) of the complex number z. If z is represented as x+iy where x and y are both real, angle(z) returns R►Pθ(x,y) (which is equivalent to tanֿ¹(y/x) if x is nonzero). Also works on a list of complex numbers. angle(3+4i) .927295218 R►Pθ(3,4) .927295218  When writing a complex number z in the form$re^{i\theta}$(or, equivalently,$r(\cos\theta+i\sin\theta)$), then$\theta$is equal to the value of angle(z), suitably reduced so that the result returned is in the interval$-\pi<\theta\leq\pi$. The angle( command also works on matrices, though not in any useful way: angle([A] will return a matrix of the same size as [A], but with all elements 0. If you plan to use this, don't: 0[A] does the same thing, but is smaller and not as questionable (because this behavior is clearly unintentional on TI's part, and may be changed in an OS update). # Related Commands Command Summary Calculates the complex conjugate of a complex number. Command Syntax conj(value) Menu Location Press: 1. MATH to access the math menu. 2. RIGHT, RIGHT to access the CPX (complex) submenu 3. ENTER to select conj(. TI-83/84/+/SE 2 bytes conj(z) returns the complex conjugate of the complex number z. If z is represented as x+iy where x and y are both real, conj(z) returns x-iy. Also works on a list of complex numbers. conj(3+4i) 3-4i  The conjugate of a number$z$is often written$\overline{z}$, and is useful because it has the property that$z\overline{z}$and$z+\overline{z}are real numbers. # Related Commands Command Summary Finds the greatest common divisor of two values. Command Syntax gcd(value1, value2) Menu Location Press: 1. MATH to access the math menu. 2. RIGHT to access the NUM submenu. 3. 9 to select gcd(, or use arrows. TI-83/84/+/SE 2 bytes The gcd( command returns the greatest common divisor (GCD) of two nonnegative integers. It also works on lists. gcd(8,6) 2 gcd({9,12},6) {3 6} gcd({14,12},{6,8}) {2 4}  # Advanced Uses A gcd( command can be nested inside another gcd( command to compare up to four numbers. # Error Conditions • ERR:DIM MISMATCH is thrown if the arguments are two lists that don't have the same number of elements. • ERR:DOMAIN is thrown if the arguments aren't positive integers (or lists of positive integers) less than 1e12. # Related Commands Command Summary Finds the least common multiple of two values. Command Syntax lcm(value1, value2) Menu Location Press: 1. MATH to access the math menu. 2. RIGHT to access the NUM submenu. 3. 8 to select lcm(, or use arrows. TI-83/84/+/SE 2 bytes Returns the least common multiple (LCM) of two nonnegative integers; lcm(a,b) is equivalent to ab/gcd(a,b). Also works on lists. lcm(8,6) 24 lcm({9,12},6) {18 12} lcm({14,12},{6,8}) {42 24}  # Error Conditions • ERR:DIM MISMATCH is thrown if the arguments are two lists that don't have the same number of elements. • ERR:DOMAIN is thrown if the arguments aren't positive integers (or lists of positive integers) less than 1e12. # Related Commands Command Summary Returns the fractional part of a value. Command Syntax fPart(value) Menu Location Press: 1. MATH to access the math menu. 2. RIGHT to access the NUM submenu. 3. 4 to select fPart(, or use arrows. TI-83/84/+/SE 1 byte fPart(value) returns the fractional part of value. Also works on complex numbers, lists and matrices. fPart(5.32) .32 fPart(4/5) .8 fPart(‾5.32) ‾.32 fPart(‾4/5) ‾.8  # Advanced Uses fPart(, along with int( or iPart(, can be used for integer compression. Also, fPart( is an easy way to find A mod B (the positive remainder when A is divided by B). :B(A<0)+iPart(BfPart(A/B))  If A is guaranteed to be positive, the following shorter code can be used, omitting B(A<0): :iPart(BfPart(A/B))  Finally, the easiest way to check if a number is a whole number is not(fPart(X: :If not(fPart(X:Then : // X is an integer :Else : // X is not an integer :End  You can use this, for example, to check if a number is divisible by another: if X is divisible by N, then X/N is a whole number. This is useful when you want to find the factors of a number. Warning: when storing values with repeating decimals and later multiplying them to see if a number makes it an integer it can return a value of 1 or -1 instead of 0 even if it is an integer. Example: if you store 1/3 as X and then do fpart(3x) it will return 1 instead of 0. This is because fpart(.999…) results in .999… and then rounds to 1 when displaying rather than rounding to 1.0 and then displaying the fpart( as 0. # Optimization Often you want to find the value of a-1 mod b — this occurs, for example, in movement routines with wraparound. However, the problem is that if a=0, a-1 will be negative. Rather than use the longer version of the modulo routine, you might replace subtracting 1 with adding (b-1). This will have the same result, but without sign problems. # Related Commands # See Also Command Summary Rounds a value down to the nearest integer. Command Syntax int(value) Menu Location Press: 1. MATH to access the math menu. 2. RIGHT to access the NUM submenu. 3. 5 to select int(, or use arrows. TI-83/84/+/SE 1 byte int(value) is the floor function. It returns the greatest integer less than or equal to value. Also works on complex numbers, lists and matrices. int(5.32) 5 int(4/5) 0 int(‾5.32) ‾6 int(‾4/5) ‾1  The difference between iPart( and int( is subtle, and many people aren't even aware of it, but it exists. Whereas iPart( always truncates its parameters, simply removing the integer part, int( always rounds down. This means that they return the same answers for positive numbers, but int( will return an answer 1 less than iPart( for (non-integer) negative numbers. For example, iPart(-5.32) is -5, while int(-5.32) is -6. Most of the time, however, you're dealing with only positive numbers anyway. In this case, the decision to use iPart( or int( is mostly a matter of preference - some people only use int( because it is shorter, some people use iPart( when there is a corresponding fPart( taken. However, see the Command Timings section. # Advanced Uses int(, along with iPart( and fPart(, can be used for integer compression. # Command Timings The following table compares the speeds of int and iPart(. Each command was timed over 2000 iterations to find a noticeable difference. Format Bars Pixels Total iPart(1 10 1 81 iPart(1.643759 10 1 81 int(1 8 7 71 int(1.643759 10 2 82 Conclusion: Unless there are 6 or more decimals, you should consider using int( because of its speed, but with a lot of decimals, iPart( stays the same so it goes faster. # Related Commands # See Also Command Summary Returns the integer part of a value. Command Syntax iPart(value) Menu Location Press: 1. MATH to access the math menu. 2. RIGHT to access the NUM submenu 3. 3 to select iPart(, or use arrows. TI-83/84/+/SE 1 byte iPart(value) returns the integer part of value. Also works on complex numbers, lists and matrices. iPart(5.32) 5 iPart(4/5) 0 iPart(‾5.32) ‾5 iPart(‾4/5) 0  The difference between iPart( and int( is subtle, and many people aren't even aware of it, but it exists. Whereas iPart( always truncates its parameters, simply removing the integer part, int( always rounds down. This means that they return the same answers for positive numbers, but int( will return an answer 1 less than iPart( for (non-integer) negative numbers. For example, iPart(-5.32) is -5, while int(-5.32) is -6. Most of the time, however, you're dealing with only positive numbers anyway. In this case, the decision to use iPart( or int( is mostly a matter of preference - some people only use int( because it is shorter, some people use iPart( when there is a corresponding fPart( taken. However, see the Command Timings section. # Advanced Uses iPart(, along with fPart( and int(, can be used for integer compression. # Command Timings The following table compares the speeds of int( and iPart(. Each command was timed over 2000 iterations to find a noticeable difference. Format Bars Pixels Total iPart(1 10 1 81 iPart(1.643759 10 1 81 int(1 8 7 71 int(1.643759 10 2 82 Conclusion: Unless there are 6 or more decimals, you should consider using int( because of its speed, but with a lot of decimals, iPart( stays the same so it goes faster. # Related Commands # See Also Command Summary Truncates a number to a specified number of decimal places. Command Syntax round(value[,#decimals]) Menu Location Press: 1. MATH to select the math menu. 2. RIGHT to select the NUM submenu. 3. 2 to select round(, or use arrows. TI-83/84/+/SE 1 byte round(value[,#decimals]) returns value rounded to #decimals decimal places. #decimals must be < 10. The default value for #decimals is 9. Also works on complex numbers, lists and matrices. round(5.45,0) 5 round(5.65,0) 6 round(‾5.65,0) ‾6 round(π)-π 4.102e-10 round(π,4) 3.1416 round({1.5,2.4,3.8},0) {2,2,4} round([[1.8,3.5,120.3][3,‾1,0.2]],0) [[2 4 120] [3 ‾1 0 ]]  # Advanced Uses Sometimes, round-off error will cause the result of an expression to be slightly off of the correct integer value — for example, a result may be 5.0000000013 instead of 5. If the error is small enough, it will not even be visible if you recall the variable on the home screen. However, this is enough to cause a ERR:DOMAIN error with commands such as sub( and Output(, which require their arguments to be integers. The easiest way to fix this problem is by wrapping the different arguments in a round( instruction. For example, you may replace Output(X,1,">") with Output(round(X),1,">"). The int( command will not work here because the round-off error may be negative, such as 4.9999999986 instead of 5, in which case the number will be rounded down to 4. # Error Conditions • ERR:DOMAIN if the number of places to round to is not an integer 0 through 9. # Related Commands Command Summary Returns the absolute value of a real number, and the complex absolute value of a complex number. Command Syntax abs(value) Menu Location Press: 1. MATH to access the math menu. 2. RIGHT to access the NUM submenu. 3. ENTER to select abs(. Alternatively, press: 1. MATH to access the math menu. 2. RIGHT twice to access the CPX (complex) submenu. 3. 5 to select abs(, or use arrows. TI-83/84/+/SE 1 byte abs(x) returns the absolute value of the real number x. Also works on a list or matrix of real numbers. abs(3) 3 abs(‾3) 3  For complex numbers, abs(z) returns the absolute value (also known as the complex modulus, norm, or a hundred other terms) of the complex number z. If z is represented as x+iy where x and y are both real, abs(z) returns √(x²+y²). Also works on a list of complex numbers. abs(3+4i) 5  # Optimization The abs( command, used properly, may be a smaller method of testing if a variable is in some range. For example: :If 10<X and X<20 can be :If 5>abs(X-15  In general, the first number, A, in the expression A>abs(X-B) should be half the length of the range, half of 10 in this case, and the second number, B, should be the midpoint of the range (here, 15). This can be taken to extreme degrees. For example, the following code uses abs( three times to test if X is the getKey keycode of one of the keys 1, 2, 3, 4, 5, 6, 7, 8, or 9: :If 2>abs(5-abs(5-abs(X-83  For complex numbers given by a separate real and complex part, abs(X+iY) can be optimized to R►Pr(X,Y). # Related Commands Command Summary Returns the minimum of two elements or of a list. Command Syntax • for two numbers: min(x,y) • for a list: min(list) • comparing a number to each element of a list: min(x,list) or min(list,x) • pairwise comparing two lists: min(list1,list2) Menu Location Press: 1. MATH to access the math menu. 2. RIGHT to access the NUM submenu. 3. 6 to select min(, or use arrows. Alternatively, press: 1. 2nd LIST to access the list menu. 2. LEFT to access the MATH submenu. 3. ENTER to select min(. TI-83/84/+/SE 1 byte min(x,y) returns the smallest of the two numbers x and y. min(list) returns the smallest element of list. min(list1,list2) returns the pairwise minima of the two lists. min(list1,x) (equivalently, min(x,list1)) returns a list whose elements are the smaller of x or the corresponding element of the original list. min(2,3) 2 min({2,3,4}) 2 min({1,3},{4,2}) {1 2} min({1,3},2) {1 2}  Unlike relational operators, such as < and >, min( can also compare complex numbers. To do this, both arguments must be complex — either complex numbers or complex lists: min(2,i) will throw a ERR:DATA TYPE error even though min(2+0i,i) won't. In the case of complex numbers, the number with the smallest absolute value will be returned. When the two numbers have the same absolute value, the second one will be returned: min(i,-i) returns -i and min(-i,i) returns i. # Advanced Uses min( can be used in Boolean comparisons to see if every value of a list is 1 (true) — useful because commands like If or While only deal with numbers, and not lists, but comparisons like L1=L2 return a list of values. In general, the behavior you want varies, and you will use the min( or max( functions accordingly. Using min( will give you a strict test — only if every single value of a list is true will min( return true. For example, the following code will test if two lists are identical — they have the same exact elements — and print EQUAL in that case: :If dim(L1)=dim(L2 :Then :If min(L1=L2 :Disp "EQUAL :End  The first check, to see if the sizes are identical, is necessary because otherwise comparing the lists will return a ERR:DIM MISMATCH error. # Error Conditions • ERR:DATA TYPE is thrown when comparing a real and a complex number. This can be avoided by adding 0i to the real number. • ERR:DIM MISMATCH is thrown, when using min( with two lists, if they have different dimensions. # Related Commands Do you have a friend who you think would be interested in TI-Basic? Invite them!  if you already have a Wikidot.com account or it is worth it and is free Command Summary Approximately computes a definite integral. Command Syntax fnInt(f(var),var,a,b[,tol]) Menu Location Press 1. Press MATH to access the math menu. 2. 9 to select fnInt(, or use arrows. TI-83/84/+/SE 1 byte fnInt(f(var),var,a,b[,tol]) computes an approximation to the definite integral of f with respect to var from a to b. tol controls the accuracy of the integral computed. The default value of tol is 10-5. fnInt( returns exact results for functions that are polynomials of small degree. fnInt( only works for real numbers and expressions. The Gauss-Kronrod method is used for approximating the integral. Tip: Sometimes, to get an answer of acceptable accuracy out of fnInt(, substitution of variables and analytic manipulation may be needed. fnInt(1/X,X,1,2) .6931471806 fnInt(ln(X),X,0,1) <a difficult example> -.999998347 fnInt(ln(X),X,0,1,e-11) -1  # Error Conditions # Related Commands Command Summary Calculates the approximate numerical derivative of a function, at a point. Command Syntax nDeriv(f(variable),variable,value[,h]) Menu Location Press: 1. MATH to access the math menu. 2. 8 to select nDeriv(, or use arrows. TI-83/84/+/SE 1 byte nDeriv(f(var),var,value[,h]) computes an approximation to the value of the derivative of f(var) with respect to var at var=value. h is the step size used in the approximation of the derivative. The default value of h is 0.001. nDeriv( only works for real numbers and expressions. nDeriv( can be used only once inside another instance of nDeriv(. π→X 3.141592654 nDeriv(sin(T),T,X) -.9999998333 nDeriv(sin(T),T,X,(abs(X)+e-6)e-6) -1.000000015 nDeriv(nDeriv(cos(U),U,T),T,X) .999999665  # Advanced If the default setting for h doesn't produce a good enough result, it can be difficult to choose a correct substitute. Although larger values of h naturally produce a larger margin of error, it's not always helpful to make h very small. If the difference between f(x+h) and f(x-h) is much smaller than the actual values of f(x+h) or f(x-h), then it will only be recorded in the last few significant digits, and therefore be imprecise. A suitable compromise is to choose a tolerance h that's based on X. As suggested here, (abs(X)+E-6)E-6 is a reasonably good value that often gives better results than the default. # Formulas The exact formula that the calculator uses to evaluate this function is: (1) \begin{align} \operatorname{nDeriv}(f(t),t,x,h)=\frac{f(x+h)-f(x-h)}{2h} \end{align} (.001 is substituted for h when the argument is omitted) # Error Conditions • ERR:DOMAIN is thrown if h is 0 (since this would yield division by 0 in the formula) • ERR:ILLEGAL NEST is thrown if nDeriv( commands are nested more than one level deep. Just having one nDeriv( command inside another is okay, though. # Related Commands Command Summary Calculates the local maximum of a function. Command Syntax fMax(f(var),var,lo,hi[,tol]) Menu Location While editing a program, press: 1. MATH to open the math menu 2. 7 or use arrow keys to select TI-83/84/+/SE 1 byte fMax(f(var),var,lo,hi[,tol]) finds the value of var between lo and hi at which the maximum of f(var) occurs. tol controls the accuracy of the maximum value computed. The default value of tol is 10-5. fMax( only works for real numbers and expressions. Brent's method for optimization is used for approximating the maximum value. fMax(sin(X)cos(X),X,0,3) .7853995667  Keep in mind that the result is the value of var, and not the value of f(var). In this example, .7853995667 is not the highest possible value of sin(X)cos(X), but rather the X-value at which sin(X)cos(X) is the highest. # Error Conditions • ERR:BOUND is thrown if the lower bound is greater than the upper bound. • ERR:DOMAIN is thrown if tol is 0. • ERR:TOL NOT MET is thrown if the tolerance is too small for this specific function. # Related Commands Equation Variables Function Y0-Y9 Parametric X/Y1T-X/Y6T Polar r1-r6 Sequence u, v, w Self-modifying code (SMC) is code that changes itself while it is executing. While TI-Basic does not provide support for SMC like it is found in other programming languages, TI-Basic does allow you to implement a primitive form of SMC using the equation variables that are used when graphing an equation on the graph screen. The function, parametric, and polar graphing variables are accessible in the VARS menu (options 1, 2, and 3 respectively), while the sequence graphing variables are accessible on the keypad by pressing 2nd 7, 8, and 9 respectively. Each of these variables is the same size, so there is no real difference between which variable you use. However, since sequence graphing is the least used graphing mode, the sequence variables are probably the best variables to use when using SMC. # How does it Work? While the equation variables are primarily used for graphing, they are actually stored internally as strings by the calculator. The string operations and commands do not work on them, however, but you can store a string to them and evaluate them in an expression. Just like how you can evaluate an expression stored in a string using the expr( command, the equation variables can be used the same way implicitly. The expression can contain whatever combination of numbers, variables, and functions that you want, just as long as they evaluate to a number or list of numbers. For a simple example, let's initialize X with a value of 2 and store the expression "50X" to u: :2→X :"50X→u  When you access u, it will have a value of 100. But what would happen to the value of u if you changed the value of X to 5? Well, because the value of u depends on the value of X, u would change accordingly, and it would now have a value of 250. This is the basic premise of SMC: You can modify a variable elsewhere, and it will automatically update the respective equation variable. Hence, a program can change how it runs. As it turns out, finding an occasion to use this technique is usually rare, so here is a made-up example. This program will count up and down with the arrow keys until you press ENTER. If you press 2ND, however, it will switch the order of the keys: :5→A :"(Ans=25)-(Ans=34→u // initial expression for u :Repeat Ans=105 :A+u→A :Disp Ans :Repeat Ans:getKey:End // wait for a keypress :If Ans=21 :"(Ans=34)-(Ans=25→u // switch the arrow keys :End  # Advanced Uses While just using SMC for simple expressions doesn't really add any additional value to your programs, you can use it for more complicated purposes. One common situation is optimization. If you have a lengthy command or formula that you use multiple times throughout your program, you can simply store the statement to an equation variable, and then use the equation variable whenever you want to call the statement. This eliminates duplicate code, which makes your program smaller. For example, if you want to generate a random integer from 1 to 9, here is what you would use: :"randInt(1,9→u  Then each time you wanted to create a random integer, just use u. # Limitations of SMC There are a few limitations you need to be aware of when using SMC: • It complicates your code, making it difficult to understand and maintain. This is why you should primarily stick to implementing SMC when you are done with your program. • The equation variables will affect the graph settings, and likewise the graph screen will be affected if the respective graph mode is enabled. • You can't store the equation variable to itself, or other variables, if they don't have a matching type (i.e., trying to store a string to a real will result in an ERR:DATA TYPE error). • Don't abuse SMC; the extra step of reading and executing through variables may slow down your code slightly and even cost a number of bytes if used improperly, so wield it wisely (i.e., only for the benefits it provides over other methods). is a term that is loosely thrown around in the TI-Basic community on forums, sites, and even in tutorials/guides, but what does it really mean? The term advanced basic was first used by SiCoDe Software when they were active from 1998-2001, and they used it to describe quality TI-Basic programming that is not only efficient in terms of size and speed, but is used to make genuinely fun games. At that time, SiCoDe was the premier TI-Basic programming group, releasing high-quality games such as Nibbles Arcade, War, Orion, and Connect 4. If you actually try out any of their games, you will probably find that they are in fact fun games, but they aren't considerably optimized by today's standards. That optimization level is actually reflective of the majority of the TI-Basic games released during that time period. While it is somewhat ironic that SiCoDe referred to their games as advanced basic even though they weren't optimized particularly well, the primary reason for the poor quality of optimization is that TI-Basic knowledge was in its infancy at that time. Since then, the TI-Basic community has really matured in terms of understanding the TI-Basic language (including optimization, development, and techniques) and the internals of the TI graphing calculators, and the quality of TI-Basic games has increased accordingly. ## Hype vs. Substance As a result of this increase in TI-Basic knowledge, the primary issue you see today with people referring to their games as utilizing advanced basic is that a lot of it is really just hype. The optimizations and techniques that were once considered advanced basic are now just part of the standard collection of basic optimizations and techniques that everyone uses. For example, when comparing a value to multiple variables, here is how it is done today: :If min(5={A,B,C  While this is how it used to be done: :If 5=A and 5=B and 5=C  This change is ultimately inevitable because the TI-Basic community constantly changes, and the future TI-Basic community will probably have the same kind of progression over the current TI-Basic community's knowledge of TI-Basic. As a result, calling something advanced basic is really pretty pointless, so I think we should stop using the term, and simply let our games and programs speak for themselves. Routine Summary Repeats a string however many times you want. Inputs Ans - The string you want to repeat 2N - How many times you want the string repeated Outputs Str1 - The repeated string Variables Used X, N, Ans, Str1 Calculator Compatibility TI-83/84/+/SE Download repeatstring.zip :For(X,1,N :Ans+Ans→Str1 :End  With our string stored in Ans, we concatenate (add) another copy to the end of the string, and store the new string to Str1. At the same time, the new string is also stored to Ans, which is what we use next time through the loop. The loop gets repeated over and over again until we have added however many copies we wanted. If you want to add more than one copy of the string each time through the loop, edit the second line accordingly. Using Ans allows us to not have to use another string variable, since Ans can act like a string and it gets updated accordingly, and Ans is also faster than a string variable. In addition, by storing the string to Str1 inside the loop, we avoid having to add an additional storage to the routine. We store the string to a more permanent variable (in this case, Str1) for future use. When you are done using Str1, you should clean it up at the end of your program. # Related Routines Routine Summary Strip a string of its spaces on the left and right. Inputs Ans - The string you want to strip Outputs Str1 - The stripped string Variables Used Ans, Str1 Calculator Compatibility TI-83/84/+/SE Download stripstring.zip :While " "=sub(Ans,1,1) or " "=sub(Ans,length(Ans),1 :sub(Ans,1+(" "=sub(Ans,1,1)),length(Ans)-1→Str1 :End  With our string stored in Ans, we check to see if there is a space at the beginning or end of the string. If there is a space, then we remove it by storing the substring of the string that doesn't include the first character (for a space at the beginning) or the last character (for a space at the ending), and store the new string to Str1. At the same time, the new string is stored to Ans, which is what we use next time through the While loop. The loop gets repeated over and over again until we have stripped all of the spaces from the beginning and end of the string. If you only want to remove spaces on one side of the string, edit the first and second lines accordingly. Using Ans allows us to not have to use another string variable, since Ans can act like a string and it gets updated accordingly, and Ans is also faster than a string variable. In addition, by storing the string to Str1 inside the loop, we avoid having to add an additional storage to the routine. We store the string to a more permanent variable (in this case, Str1) for future use. When you are done using Str1, you should clean it up at the end of your program. # Related Routines Routine Summary Pad a string with spaces on the left and right. Inputs Ans - The string you want to pad N - How many spaces you want Outputs Str1 - The padded string Variables Used X, N, Ans, Str1 Calculator Compatibility TI-83/84/+/SE Download padstring.zip :For(X,1,N :" "+Ans+" :End :Ans→Str1  With our string stored in Ans, we concatenate (add) a space to the beginning and end of the string. At the same time, the new string is stored to Ans, which is what we use next time through the For( loop. The loop gets repeated over and over again until we have added however many spaces we wanted. If you only want spaces on one side of the string, edit the second line accordingly. Using Ans allows us to not have to use another string variable, since Ans can act like a string and it gets updated accordingly, and Ans is also faster than a string variable. We store the string to a more permanent variable (in this case, Str1) for future use. When you are done using Str1, you should clean it up at the end of your program. # Related Routines Routine Summary Reverses the characters in a string. Inputs Str1 - The string you want to reverse Outputs Str1 - The reversed string Variables Used Str1, I, Ans Calculator Compatibility TI-83/84/+/SE Download reversestring.zip :Str1 :For(I,1,length(Ans)-1 :sub(Ans,2I,1)+Ans :End :sub(Ans,1,I→Str1  With our string stored in Str1 and Ans, we loop through each character, starting from the beginning to the end, and add it to the beginning of the string, building the reversed string up at the beginning as we go: 12345 (original string - the first character is the first reversed character) 212345 (add then second character before the first, reversing the string) 3212345 (continue adding characters in reverse) 543212345 (this is what the end result looks like)  Since adding to the beginning of the string alters the indices, we must take that into account — this is where the 2I in the formula comes from. It adds the 2nd character the first time, the 4th character (which was originally the 3rd) next, the 6th character (originally the 4th) after that, and so on. Using Ans allows us to not have to use another string variable, since Ans can act like a string and it gets updated accordingly, and Ans is also faster than a string variable. By the time we are done with the For( loop, all of our characters are put together in Ans in reverse order, before the original string. To finish, we take the first (reversed) half as a substring and store it back in Str1 for further use. We can use I for this purpose because it looped from 1 to length(Str1)-1, so its value will be length(Str1) when exiting. If you want to preserve the original string, store it to a different string variable in the first line of the code. When you are done using Str1, you should clean it up at the end of your program.  When contributing routines, please follow these guidelines: A routine should be self-contained, and relatively short in length. Exclude the input and output, unless the routine is specifically meant to do that. A routine should be thoroughly tested to make sure it works correctly. Use the Routine Template as the starting point for routine pages. When the routine page is finished, link to it from here. Routine Summary Converts a list of numbers to a string. Inputs L₁ - The list you want to convert Outputs Str1 - The string that the text is stored to Variables Used L₁, A, Ans, Str1 Calculator Compatibility TI-83/84/+/SE Download listtostring.zip Note: If you have a TI-84+ CE with OS 5.2 or higher, you can ignore this entire routine and just use the toString( command. :"? :For(A,1,dim(L₁ :Ans+sub("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ ",1+L₁(A),1 :End :sub(Ans,2,length(Ans)-1→Str1  With our list of values stored in L₁, we loop through each element of L₁ and store the character to our string that is at the matching position in our substring. In order to construct a string with all of the characters from L₁, we first need to create a dummy string. This is what the "? is used for. Each time through the For( loop, we concatenate the string from before (which is still stored in the Ans variable) to the next character that is found in the list. Using Ans allows us to not have to use another string variable, since Ans can act like a string and it gets updated accordingly, and Ans is also faster than a string variable. By the time we are done with the For( loop, all of our characters are put together in Ans. However, because we stored the dummy character as the first character at the beginning of the string, we now need to remove it, which we do by simply getting the substring from the second character to the end of the string. Finally, we store the string to a more permanent variable (in this case, Str1) for future use. This routine allows for values from 0 to 36 in the list, since our string of characters is the ten digits and 26 uppercase letters, plus a space, and each list value must match up to one of the string positions. If you add more characters to the string, such as lowercase letters, however, you can increase the range of values in the list; if you need fewer characters you can simply remove them. This routine uses L₁, so you should clean it up at the end of your program. # Related Routines This page is a guide to both format and content for pages describing a particular routine. Make sure that you follow it when adding a new routine, and also remember to add 3-5 page tags describing the routine content. It may be useful to copy the code for this page and edit it as necessary, when creating a new routine page. If a section (such as Error Conditions) does not contain any information, feel free to omit it. Routine Summary A short description of what the routine does. Inputs The variable(s) that you need to setup to to use the routine. Variable 1 - What it is used for Variable 2 - What it is used for Outputs The variable(s) that the routine stores to at the end. Variable 1 - What it contains Variable 2 - What it contains Variables Used The variables used in the routine. List the variables one after another, separating each with a comma. Calculator Compatibility The calculator(s) that the routine works on. Separate each calculator with a slash when displaying the calculators. For example, the following line means the routine works on every calculator. TI-83/84/+/SE/CSE/CE Author The person who wrote the routine. Only include this if you aren't the author of the routine. Authors The persons who wrote the routine. URL: Google Download routine.zip :The code of the routine :should be included here  An explanation of the routine, including how it works, how you can modify it, what variables it uses, and anything else that is important to know when using the routine. The explanation should be thorough enough so that a person can use the routine without requiring help from somebody else. # Error Conditions For the non-generic errors that might occur when using this command (that is, syntax-type errors shouldn't be included). In a format similar to the following: • ERR:DIM MISMATCH is thrown if the two list arguments have different dimensions. • ERR:RESERVED is thrown if ∟RESID is supplied as an argument. # Related Routines There are several routines that are similar in functionality or are used in a similar context. Make a bulleted list of them, with links to the other routines' pages. It will often be the case that several routines all link to each other. • Routine 1 • Routine 2 • Routine 3 Command Summary Calculates the local minimum of a function. Command Syntax fMin(f(var),var,lo,hi[,tol]) Menu Location While editing a program, press: 1. MATH to open the math menu 2. 6 or use arrow keys to select TI-83/84/+/SE 1 byte fMin(f(var),var,lo,hi[,tol]) finds the value of var between lo and hi at which the minimum of f(var) occurs. tol controls the accuracy of the minimum value computed. The default value of tol is 10-5. fMin( only works for real numbers and expressions. Brent's method for optimization is used for approximating the minimum value. fMin(cos(sin(X)+Xcos(X)),X,0,2) 1.076873875  Keep in mind that the result is the value of var, and not the value of f(var). In this example, 1.076873875 is not the lowest possible value of cos(sin(X)+Xcos(X)), but rather the X-value at which cos(sin(X)+Xcos(X)) is the lowest. # Advanced Uses fMin( is sometimes useful in finding so-called "multiple roots" of a function. If the graph of your function appears "flat" near the root, fMin( might be able to find the value of the root more accurately than solve(. # Error Conditions • ERR:BOUND is thrown if the lower bound is greater than the upper bound. • ERR:DOMAIN is thrown if tol is 0. • ERR:TOL NOT MET is thrown if the tolerance is too small for this specific function. # Related Commands Command Summary Takes the xth root of an input. Command Syntax A xB Menu Location While editing a program, press: 1. MATH to open the math menu 2. 5 or use the arrow keys to select TI-83/84/+/SE 1 byte This command takes the xth root of a number. If used on a list, it will return a list with the xth root of each element. Also valid are the forms list×x and list1×list2. :2×√4 2 :5×√2 1.148698355 :3×√{1,‾8,27} {1 ‾2 3} :{3,2}×√{8,9} {2 3} Real mode: :4×√‾1 <returns error> a+bi mode: :4×√‾1 .7071067812+.7071067812i  See the notes on the ^ command for an explanation on how ×√ behaves depending on whether its input is real or complex. # Optimization If you want to take the second or third root of a number, use √( or ³√( instead. :2×√X can be :√(X  # Error Conditions • ERR:NONREAL ANS if you try to take an even root of a negative number or list element in Real mode. # Related Commands Command Summary Take the cube root of a number. Command Syntax ³√(input) Menu Location While editing a program, press: 1. MATH to open the math menu 2. 4 or use the arrow keys to select. TI-83/84/+/SE 1 byte Takes the cube root of a positive or negative number. It works exactly the same as 3×√ or ^(1/3) but is smaller and uses an ending parenthesis. If used on a list, it will return a list with the cube root of each element. ³√(8) 2 ³√(2) 1.25992105 ³√({1,‾8,27}) {1 ‾2 3}  For complex numbers, the principal cube root is returned, which may be different from the cube root you'd get for the same real number: ³√(-8) -2 ³√(-8+0i) 1+1.732050808i  # Optimization Never raise something to the one-third power explicitly; use this command instead. :X^(1/3)→X can be :³√(X→X  # Related Commands Command Summary Raises the input to the third power. Command Syntax value³ Menu Location While editing a program, press: 1. MATH to enter the MATH menu 2. 3 or use the arrow keys to select. TI-83/84/+/SE 1 byte The ³ command raises an input to the third power. It has exactly the same function as "^3", but is one byte smaller. If used on a list, it will return a list with all of the elements cubed. If used on a matrix, it will return the third matrix power of the input matrix. 2³ 8 {1,‾2,3}³ {1 ‾8 27} [[2,‾1][‾3,0]]³ [[20 ‾7] [‾21 6]]  # Advanced Uses One trick with ³ is to use it to save space (at the cost of speed) when using hard-coded values. For instance, use 5³ instead of 125 to save one byte. # Optimization Use this command instead of ^3 in all instances. :X^3 can be :X³  # Related Commands Command Summary Displays the decimal form of a fraction. Command Syntax <fraction>►Dec Menu Location While editing a program, press: 1. MATH to enter the MATH menu 2. 2 or use the arrow keys to select TI-83/84/+/SE 1 byte This command is generally useless. Its supposed use is to convert numbers into decimal form, but any typed fractions are displayed as decimals anyway. 1/3 .3333333333 1/3►Dec .3333333333  In 2.53 MP or higher, typed fractions are displayed in fraction form. Therefore, the ►Dec command is useful in this case. # Related Commands Command Summary Displays the fractional value of a number Command Syntax Decimal►Frac Menu Location While editing a program, press: 1. MATH to open the math menu 2. ENTER or 1 to select. TI-83/84/+/SE 1 byte ►Frac attempts to display the input in fraction form. It only works on the home screen outside a program, or with the Disp and Pause commands in a program. It takes up to 12 decimal places of a non-terminating decimal to find the corresponding fraction. The decimal input is returned if ►Frac fails to find the fraction form. For a better algorithm for finding fractions, see the Decimal to Fraction routine. .333►Frac .333 .333333333333►Frac 1/3  # Related Commands # See Also 1. Why did the 82 fall on the annual TI calc mountain climbing contest? It has no hooks. 2. What do you call an error that lives at 13 Error Alley? ERR:BAD ADDRESS 3. What do you call an error that's uneducated and wears mismatched clothes? ERR: DIM MISMATCH 4. What do you call a 15-year-old error that tries to buy a beer? ERR: ID NOT FOUND 5. What do you call an error that illegally owns a bird? ERR: ILLEGAL NEST 6. What do you call an error that doesn't own two mats? ERR: SINGULAR MAT 7. What do you call an error that drove by at 90 mph? ERR: ZOOM 8. What do you call an error that tried to climb in a window and got stuck? ERR: WINDOW RANGE 9. What do you call an error that forgot to take off the "on sale" sign? ERR: NO SIGN CHNG 10. What do you call an error that forgets? ERR: MEMORY 11. What do you call a stupid error in a wheelchair? ERR: INVALID DIM 12. What do you call an error with a name tag? ERR: LABEL 13. What do you call any other error? ERR: UNDEFINED 14. Why did Pxl-On(, Pxl-Off(, and Pxl-Change( not go to the party? They're not interactive. 15. Why did the buyers not know how much the calculator cost? The salesman took the LabelOff. 16. Why do or and xor have more free time? Because and gets evaluated first. 17. What do you call a dead error? ERR: EXPIRED 18. What do you call an error that always contradicts you? ERR: ARGUMENT 19. What do you call an error that says you can't park here? ERR: RESERVED 20. What did the calculator say to the inconsiderate user? F(n)Off!!! 21. What did the calculator say to the drowning user? Float! 22. What did the calculator ask the eating user? Full? 23. What do you call a calculator that's always on time? Prompt 24. What do you call a calc that's taking out the trash? Garbage Collecting… 25. What's black and blue and crying? An 83+ in lcd test mode. 26. What's black and blue and dead? Same 83+, an hour later. # References These jokes were taken from DarkerLine's posts in the Calculator Jokes topic. Command Summary Returns the last answer. Command Syntax Ans[→Variable] Menu Location While editing a program, press [2nd] then [(-)] TI-83/84/+/SE 1 byte The Ans variable holds the last answer that was stored in the calculator. Because Ans is stored in a special storage area built-in to the calculator, and it is extensively used by the calculator, you cannot delete it. Ans is also useful; it can make your programs both smaller and faster: • Unlike other variables which have a value type hard-coded in (i.e., a string can only hold text, and lists and matrices can only hold numbers), Ans can take on whatever value you want: a real or complex, list, matrix, or string are all acceptable. • Along with the finance variables, Ans is faster than the real, complex, list, matrix, and string variables; and subsequently, you should try to use it as much as possible. One of the most common places to use Ans is in place of storing a value to a variable. Just paste the Ans variable to the location where the variable was called, and then when the expression is evaluated, the calculator will use the current value of Ans. Using the Ans variable allows you to eliminate the variable, which helps save a little or a lot of memory (depending on the type of variable and its size). 30+5A→B Disp 25A,30+5A ;can be 30+5A Disp 25A,Ans  The one major drawback to using Ans is that its current value is only temporary. Whenever you store a value to a variable, place an expression or string on a line by itself, or use the optional argument of the Pause command, Ans is updated to the new value. This restriction essentially limits your use of Ans to only a single variable. If you are manipulating two or more variables, it's best to just use the variables. There are several cases in which changing the value of a variable does not modify Ans, thus preserving its current value for later use: • storing to an equation variable • using the DelVar command to delete a variable (i.e., set its value to zero, if it's a real variable) • changing the value with IS>( or DS<(. • initializing or changing the value in a For( loop. These cases can be very useful, allowing you to use Ans to store an expression rather than create a temporary variable for it. # Timing Storing a real value into Ans takes approximately 1.0 ms. This does not include the time needed to compute or retrieve the value, which may be significant. This article is currently in development. You can help TI-Basic Developer by . This article seems to lack info. Needs attending. Map making is a key part of making many types of games. Most maps are created using pre-drawn images on the graph screen, while a select few make use of the home screen. The graph screen is more versatile with its larger size and compatibility. pxl-test( is often used to keep a character on or within the boundaries of a map. ## pxl-Test( pxl-Test( is what the whole programs runs off of. The command returns either 1 or 0, indicating whether a pixel is activated or not. Using this, you can use a movement loop where the character will not move onto a designated area. For example: :pxl-Test(5,2  This would check to see if there is a pixel at 5,2; if so then a 1 will be returned, if not, a 0 is returned. ## Code Type in this code into your calculator: ClrDraw RecallPic 1 55→X 60→Y Repeat A=45 Pxl-On(Y,X Repeat Ans getKey→A End Pxl-Off(Y,X X-(Ans=24 and not(pxlTest(Y,X-1)))+(Ans=26 and not(pxl-Test(Y,X+1→X Y-(A=25 and not(pxlTest(Y-1,X)))+(A=34 and not(pxl-Test(Y+1,X→Y End  ## Instructions Make any random map that pleases you and press [2ND] + [DRAW] + [LEFT] + [ENTER] + [1] + [ENTER] (StorePic 1). This will override Pic1 with whatever map you created. The movement loop will need to be customized for your map though. A simple maze game is easier to make then a platformer that requires jumping, shooting, moving, etc. ## Things to make sure of 1) Make sure that the pixel at (55,2) is not activated (black) 2) Remember that Pxl-On( follows the syntax of Output where it is Pxl-On(Row, Column). Command Summary Returns the maximum of two elements or of a list. Command Syntax • for two numbers: max(x,y) • for a list: max(list) • comparing a number to each element of a list: max(x,list) or max(list,x) • pairwise comparing two lists: max(list1,list2) Menu Location Press: 1. MATH to access the math menu. 2. RIGHT to access the NUM submenu. 3. 7 to select max(, or use arrows. Alternatively, press: 1. 2nd LIST to access the list menu. 2. LEFT to access the MATH submenu. 3. 2 to select max(, or use arrows. TI-83/84/+/SE 1 byte max(x,y) returns the largest of the two numbers x and y. max(list) returns the largest element of list. max(list1,list2) returns the pairwise maxima of the two lists. max(list1,x) (equivalently, max(x,list1)) returns a list whose elements are the larger of x or the corresponding element of the original list. max(2,3) 3 max({2,3,4}) 4 max({1,3},{4,2}) {4 3} max({1,3},2) {2 3}  Unlike comparison operators such as < and >, max( can also compare complex numbers. To do this, both arguments must be complex — either complex numbers or complex lists: max(2,i) will throw an error even though max(2+0i,i) won't. In the case of complex numbers, the number with the largest absolute value will be returned. When the two numbers have the same absolute value, the first one will be returned: max(i,-i) returns i and max(-i,i) returns -i. # Advanced Uses max( can be used in Boolean comparisons to see if at least one of a list is 1 (true) — useful because commands like If or While only deal with numbers, and not lists, but comparisons like L1=L2 return a list of values. In general, the behavior you want varies, and you will use the min( function or the max( function accordingly. Using max( will give you a lenient test — if any one element of the list is 1 (true), then the max( of the list is true — this is equivalent to putting an 'or' in between every element. For example, this tests if K is equal to any of 24, 25, 26, or 34 (the getKey arrow key values): :If max(K={24,25,26,34 :Disp "ARROW KEY  To get the element of a real list with the greatest absolute value, use imag(max(iAns. # Error Conditions • ERR:DATA TYPE is thrown when comparing a real and a complex number. This can be avoided by adding +0i to the real number (or i^4 right after it, for those who are familiar with complex numbers) • ERR:DIM MISMATCH is thrown, when using max( with two lists, if they have different dimensions. # Related Commands Command Summary Moves a variable from RAM to the archive. Command Syntax Archive variable Menu Location Press: 1. 2nd MEM to access the memory menu 2. 5 to select Archive, or use arrows TI-83+/84+/SE (not available on the regular TI-83) 2 bytes The Archive command moves a variable from RAM to the archive (also known as ROM). A quick synopsis of the difference between the two: • Data in the archive cannot be accessed, but it's protected from RAM clears (which may occur during battery removal if not done carefully); also, the archive can hold much more data. • Data in RAM can be accessed for calculations, but it can also be deleted during a RAM clear or accidentally overwritten by another program. Nothing happens if the variable in question is already archived. You might want to use this command to protect data such as saved games from being accidentally deleted. It's not, in general, a good idea to archive commonly used variables, such as the real variables A-Z, since programs usually expect to be able to access these variables without problems, and won't check if they're archived. Also, some variables cannot be archived. These include: • The real variables R, T, X, Y, θ, and n (due to their use in graphing) • The equation variables Yn, XnT, YnT, rn, u, v, and w • The stat plots Plot# • Window, table, and zoom variables such as TblInput or Xmin • Statistical variables and the list ∟RESID • Finance variables Finally, the Archive command does not work on programs when using it from a program (it does, however, archive programs from the home screen). However, an assembly program can be executed as a subroutine so that Archive and UnArchive can be used within a program. The program should however be run again afterwards. # Advanced Uses As archived variables (and programs) can not be accessed by the calculator's inbuilt OS, archiving programs can be quite problematic when trying to execute them. However; by enabling your programs to be viewable in assembly shells, you can execute your programs without needing to unarchive them first. This is because the assembly shell copies the program to the RAM automatically, and is then executed. Closing the program will automatically remove the copy from the RAM, so no RAM is lost in the end. # Error Conditions • ERR:ARCHIVE FULL is thrown when there isn't enough space in the archive for the variable. • ERR:INVALID is thrown when trying to archive a program from within a program. • ERR:VARIABLE is thrown when trying to archive a variable that cannot be archived. # Related Commands Command Summary Moves a variable from the archive to RAM. Command Syntax UnArchive variable Menu Location Press: 1. 2nd MEM to access the memory menu 2. 6 to select UnArchive, or use arrows. TI-83+/84+/SE (not available on the regular TI-83) 2 bytes The UnArchive command moves a variable from the archive (also known as ROM) to RAM. A quick synopsis of the difference between the two: • Data in the archive cannot be accessed, but it's protected from RAM clears (which may occur during battery removal if not done carefully); also, the archive can hold much more data. • Data in RAM can be accessed for calculations, but it can also be deleted during a RAM clear or accidentally overwritten by another program. It is, in general, not recommended to place real variables in the archive (since so many programs use them); also, some variables cannot be archived (see the Archive command for details). Although programs can be archived and unarchived, the Archive and UnArchive commands will not archive or unarchive programs from within a program. For the most part, lists are the only type of variable it makes sense to archive and unarchive in a program. The UnArchive command doesn't do anything if the variable in question is already in RAM. However, there is no way to test if a variable is in RAM or archive, short of trying to access it and potentially getting an error. # Advanced Uses The Archive and UnArchive commands can be used in conjunction for saving data as a program exits. # Optimization The SetUpEditor command is often used in place of the UnArchive command when dealing with lists, for several reasons: • using SetUpEditor will not prevent the program from working on a TI-83, like UnArchive will • SetUpEditor will create a list with length 0 if it doesn't exist; UnArchive will throw an error • SetUpEditor saves space in the program, since it can unarchive more than one list at a time, and doesn't require the little L in front # Error Conditions • ERR:MEMORY is thrown if there isn't enough memory available in RAM for the variable. • ERR:VARIABLE is thrown when unarchiving a system variable or a application even if there is enough space. # Related Commands # See Also Command Summary Sets the size of all defined lists to 0 (equivalent to applying the ClrList command to all defined lists). Command Syntax ClrAllLists Menu Location Press: 1. 2nd MEM to access the Memory menu 2. 4 to select ClrAllLists, or use arrows TI-83/84/+/SE 2 bytes The ClrAllLists command sets the dimension (length) of all lists to zero. This is virtually equivalent to deleting the lists, except for two differences: • The lists still exist and will show up in the list menu and the memory management menu. • The dim( command will return 0 for a cleared list, rather than an error. However, accessing a cleared list in any other way will return an error, just as for a deleted list. The ClrAllLists command should never be used in a program you give to someone else or upload - unless the user is aware of this effect, they might lose important data stored in one of their lists. There is no way to limit the effect of ClrAllLists, so a program should use ClrList instead to avoid affecting unrelated lists (this is assuming you already want to use this questionably-useful effect). Outside a program (or in a program for personal use), you might use this command to clear the contents of your lists to free up memory, while still not deleting the lists. This might possibly be convenient. Maybe. # Related Commands Command Summary Sets the dimension of a list or lists to 0. Command Syntax ClrList list1, [list2, list3, …] Menu Location Press: 1. STAT to access the statistics menu 2. 4 to select ClrList, or use arrows. TI-83/84/+/SE 1 byte ClrList sets the length of a list (or several lists) to 0. This is virtually equivalent to deleting the list, except for several differences: • The list still exists — it will be shown in the memory management menu and the list menu • Calling the dim( command on it will return 0, rather than an error. • ClrList can clear multiple lists at the same time # Advanced Uses You might use ClrList when building up a list element by element and using dim( in the process: :ClrList L1 :While 10>dim(L1 :Input X :X→L1(1+dim(L1 :End  # Optimization Using DelVar instead of ClrList allows you to save a tiny bit of memory (between 12 and 16 bytes) that ClrList doesn't delete, while keeping almost every aspect of the list clearing the same. If you are clearing several lists, you can separate them with commas as the arguments to ClrList, which can save space. Using ClrList is also substantially faster than DelVar if the list is going to be cleared many times. # Error Conditions • ERR:SYNTAX is thrown if you leave off the symbol when referring to a custom list (i.e., ClrList B will not work; you have to use ClrList ∟B). # Related Commands Command Summary Combines two lists or matrices into one. In the case of matrices, this is done horizontally rather than vertically. Command Syntax augment(list1,list2 augment(matrix1,matrix2 Menu Location Press: 1. 2nd LIST to access the List menu 2. RIGHT to access the OPS submenu 3. 9 to select augment(, or use arrows Alternatively, press: 1. MATRX (on the TI-83) or 2nd MATRX (TI-83+ or higher) to access the Matrix menu 2. RIGHT to access the MATH submenu 3. 7 to select augment(, or use arrows TI-83/84/+/SE 1 byte The augment( command is used to combine two lists or two matrices into one. For lists, this is done the obvious way: adding the elements of the second on to the elements of the first. For example: augment({1,2,3,4},{5,6,7 {1 2 3 4 5 6 7}  For matrices, the columns of the second matrix are added after the columns of the first matrix: an R by C matrix augmented with an R by D matrix will result in an R by (C+D) matrix. For example: augment([[1][2]],[[3][4] [[1 3] [2 4]]  # Advanced Uses Use the T (transpose) command if you want to combine two matrices vertically, rather than horizontally. For example: augment([[1,2]]T,[[3,4]]T)T [[1 2] [3 4]]  # Optimization You may be tempted to use augment( to add one element to the end of a list: :augment(L1,{X→L1  However, the following way is faster and more memory-efficient while the program is running (although it increases the program's size): :X→L1(1+dim(L1  # Error Conditions • ERR:DATA TYPE is thrown if you try to augment a single number to a list, a common error — use {X instead of X. • ERR:DIM MISMATCH is thrown if you try to augment two matrices with a different number of rows. • ERR:INVALID DIM is thrown if one of the arguments is a list with dimension 0, or if the result would have dimension over 999 (for lists) or 99x99 (for matrices). # Related Commands This page is a guide to both format and content for pages describing a particular command. Make sure that you follow it when adding a new command, and also remember to add 3-5 page tags describing the command content. It may be useful to copy the code for this page and edit it as necessary, when creating a new command page. If a section (such as Command Timings) does not contain any information, feel free to omit it. Screenshots are available for almost all commands (click here). Command Summary A short description of what the command does. Command Syntax The generic syntax calling the command, complete with arguments; similar to what you see in Appendix A of the TI-83+ manual. Menu Location Numbered steps of what keys, specifically, one has to press to choose the command. Unless the command is found only in the Catalog, don't list the Catalog as one of the ways to access it. The calculator(s) that the command works on. Separate each calculator with a slash when displaying the calculators. For example, the following line means the command works on every calculator. TI-83/84/+/SE 1 byte or 2 bytes (This disclaimer is usually not present. See T for an example) NOTE: Due to the limitations of the wiki markup language, the xxxxx command on this page does not appear as it would on the calculator. See Wiki Markup Limitations for more information. A complete description of the basic uses of the command. All commonly used and documented ways of calling the command should be listed here; inputs, outputs, and anything else important should be mentioned. :At least one piece of example code :should be included here.  # Advanced Uses Advanced uses include rarely used or undocumented ways of calling the command in question. If there's an unusual but effective way of using the command, that too should be listed. Another type of advanced use is a programming technique to which the command is critical. With each advanced use, you should have a piece of example code to show how it works, as well as an explanation. If there is already a page on the advanced use of the command, give a short synopsis, then link to that page — you shouldn't include the entirety of that page here. # Optimization This section includes both ways to optimize use of the command, and other common pieces of code that this command can replace in an optimization. Make sure to mention if the optimization improves speed of the program, size, or both. Sample code should be included too, preferably in the following format: :unoptimized code can be :optimized code  # Command Timings (this section is usually not present) Command timings can be absolute (such as run indicator pixels), or relative (compare it to another command that performs a similar function). If you are giving time in seconds (or milliseconds), make sure to include the calculator model the test was done on, since different models will be faster or slower. Some of the command timings are already available on the timings page. # Formulas (this section is usually not present) This section is unnecessary for most commands. The only ones that would require it are the ones on the high end of mathematical complexity, such as the statistics commands. Use [$]...[$] tags to type in a LaTeX formula. # Error Conditions (this section is new, and might not be present on older pages - also, some commands may not throw non-generic errors) For the non-generic errors that might occur when using this command (that is, syntax-type errors shouldn't be included). In a format similar to the following: • ERR:DIM MISMATCH is thrown if the two list arguments have different dimensions. • ERR:RESERVED is thrown if ∟RESID is supplied as an argument. # Related Commands Several (around 3) commands have a similar function or are used in a similar context to this command. Make a bulleted list of them, with links to the other commands' pages. It will often be the case that several commands all link to each other. • Command 1 • Command 2 • Command 3 # See Also (this section is usually not present) If a command can be used in a particular design concept or technique, you should mention it and provide a link to its respective page. This section should come at the end of the page, and be a bulleted list that contains all of the design or technique related links mentioned throughout the page. • Design Concept 1 • Design Concept 2 • Technique 1 This FAQ is an attempt to answer the common TI-Basic related questions that people ask. Many of the questions are related to each other, so it is recommended that you read through the whole list. If you have any questions that aren't mentioned on the list, please post them in the forum or leave a comment at the bottom of the page. ## General Q: Is TI-Basic easy to learn? A: Yes! TI-Basic has the majority of the standard features and functionality that you find in other BASIC programming language variants (i.e., things like user input and variables are very similar), so if you can learn those languages, TI-Basic should be no problem. If TI-Basic is your first exposure to programming, it will require some work to learn, but it is definitely worth it because TI-Basic is a fun language to use. Q: How do I learn TI-Basic? A: The best way to learn TI-Basic is to download a copy of the manual, and start making small, sample programs to try out the different TI-Basic commands. Once you feel comfortable with the commands, you can start putting them together to create larger programs. After that, you should move on to learning the more advanced design concepts and techniques that are part of TI-Basic. Q: Where can I get information on TI-Basic? A: The wiki you are currently on has the largest collection of TI-Basic information available, including commands, design concepts, techniques, and experimentation. The downloads page has a comprehensive list of TI-Basic tutorials from elsewhere on the Internet, as well as some of the different tools and utilities. Q: Do you have a tutorial about [subject]? A: The best way to find out is to use the search box. If you don't find what you are looking for, leave a comment in the forum and one of us will try to help you. We won't guarantee that you will find everything on this wiki that you are looking for, since it is a constant work in progress and there are simply too many topics to cover. If you would like to make a suggestion for a new tutorial, you can add it to the wiki to-do list. Q: Some of the tutorials appear to be unfinished. Why is this? A: Since this is a wiki, and anyone can contribute, our policy is that we will post any legitimate tutorial that contains some useful information. Even if the person who started the tutorial doesn't finish it, there is a good likelihood that someone else will stumble upon it, and can improve or add on to it until it is finished. If you ever see a tutorial that could be improved in some way, we encourage you to just go ahead and change it. Q: Where did the TI-Basic name come from? A: Back when the language was growing in popularity and use, people wanted a simple name to refer to it that was easy to remember and told you what it was. Because it is the built-in programming language of the TI graphing calculators, and it is a variant of BASIC, TI-Basic is what they called it. This remained the unofficial name for some time, until TI became more involved with Calculator Programming with the arrival of the TI-84 Plus CE. Q: I've seen TI-Basic spelled with all uppercase (TI-BASIC) and with mixed case (TI-Basic), but what is the correct way to spell it? A: Truthfully, there is no one correct way to spell it. It is just a personal preference. On this wiki, however, you will probably notice that we spell TI-Basic with mixed case. The primary reason for that decision is because it is easier to read (all caps aren't very reader-friendly). Q: What languages do the TI calculators support? A: The TI-83+ and TI-84+ support several different languages, including: French, German, Italian, Spanish, Portuguese, Dutch, Danish, Finnish, Norwegian, Swedish, Hungarian, and Polish. You just need to download a language localization application to install the respective language on your calculator. The applications can be found on the application page on TI's site. Q: What calculators support TI-Basic? A: All of the TI graphing calculators have TI-Basic support built-in. Of course, the calculators each have their own TI-Basic variant (see next question). Q: What's the difference between TI-83 Basic and 68K TI-Basic? A: Simply put, a whole lot. TI-83 Basic lacks all sorts of things that 68K TI-Basic has, including indirection, local variables and functions, advanced picture manipulation, text in matrices, and so on. It's a shame, too, because these things are extremely useful, and make TI-Basic that much richer of a language. Q: Is there a place where I can interact with other TI-Basic programmers? A: Yes. There is a fairly active forum available on this site where you can ask questions, get program feedback, share ideas, or whatever else you want to talk about. Some other active forums are CodeWalrus, Omnimaga, and Cemetech. ## Games Q: Where can I find TI-Basic games and programs to download? A: While ticalc.org has the largest collection of TI-Basic programs, most of the TI-Basic programs are of subpar quality, featuring crappy coding, gameplay, and graphics. If you are looking for quality TI-Basic programs, your best bet is to check out the programs on the showcases page. Q: I don't want to buy the Graph Link cable. Can't I just type in the games by hand? A: Yes, you can type in the games. All you need to do is download the Graph Link or TI-Connect software created by TI. You then start up the program, and open your game in the editor. If you don't like the idea of downloading an application, an alternative option is to view the games online using the SourceCoder application. Q: I have a Graph Link cable, and want to send a game to my calculator. How do I do that? A: Assuming you already have either the Graph Link or TI-Connect software (see previous question), you simply start up the software, click send to open the send menu, find your desired game, and then click transfer to send the game to your calculator. Note that if a game has several files that go with it (such as pictures and subprograms), you need to send those files with the game in order for it to work correctly. Q: What is an emulator? A: An emulator allows you to run a virtual form of your calculator on your computer, which is very convenient when you want to make quick changes to programs, or do any debugging or optimizing. There are several emulators available for you to use, so you should just experiment to see which one you prefer. Q: I downloaded an emulator for my calculator, but it won't work because it says it needs a ROM image. What is that? A: A ROM image is simply an instance of your calculator, which tells the emulator that you own your calculator. It is primarily used as a safeguard because only one person is supposed to be using any one ROM image. To download the ROM image to your computer, you just link your calculator to your computer, and then the emulator should be able to download the ROM image off of it. Q: I have an awesome idea for a game, but I don't know how to program. Can you program it for me? A: While we would like to help you program your game, we each have our own projects that we're working on and other real-world things (like school and a job) that occupy our time, so we aren't able to program your game for you. At the same time, if you have a specific TI-Basic programming question that you need help with, we'd be happy to help you. Even better than us programming your game, though, is you programming it yourself (see next question). Q: What do I need to make games? A: The main things you need to make games are your TI calculator and calculator manual. Before you actually implement a game, however, you should plan it out. This involves coming up with the idea for the game, and working out the many details of the game: graphics, gameplay, menus, and so on. Once you have all of those things figured out, you just need to put them into action. Q: What is a good tutorial for making games? A: Unfortunately, there really is no comprehensive game tutorial available. There are several game techniques covered on this wiki, however, such as animation, custom menus, saving, highscores, maps, and movement. Q: Can I use a routine from this wiki in my game? A: Yes! In fact, we encourage it. All of the routines on this site are designed to be as optimized and efficient as possible, so that readers learn the best way to program. Q: Can I use sprites from other games in my own game? A: The general consensus among the calculator programming community is that using somebody else's graphics in your game is fine, as long as you get their permission to do so. However, if you don't plan on releasing your game to the community, but instead just keeping it to yourself and your friends, then it doesn't really matter. ## Programming Q: How do I draw graphics? A: You need to use the graph screen commands to draw graphics. There are several commands available, including points, pixels, lines, circles, and text. The one caveat you need to be aware of when drawing graphics is that the graph screen settings affect how some of the commands show up. See the respective command pages for more information. Q: I've tried using the graphics commands, but they are too slow for my game. Is there a way to get better graphics? A: In fact, there is. You can use one of the assembly libraries that is available. In particular, the best two assembly libraries for graphics are Omnicalc and xLIB. You can use them to create complex sprites, or any of the other advanced graphics that you see in TI-Basic programs. Q: Can I do [task] in TI-Basic? A: While it's possible to do almost anything in TI-Basic, whether it looks nice and runs at a decent speed is a different matter. If you have thoroughly planned your program and made it as optimized as possible, and your program still takes a minute to load and there's a five second lag after each key press, that's a good indicator that you should probably use Assembly instead. At the same time, you should always strive to push the boundaries of TI-Basic. Q: How do I convert a number to a string and vice versa? A: Converting a string to a number is actually very easy, and involves simply using the expr( command. Going the other way, however, is much more complicated because there is no built-in command to do it. What you need to use instead is a small number-to-string routine that involves using the LinReg(ax+b) command in an unorthodox way. Unless you are running a CE with a recent OS, in that case you have toString(), which is superior in speed and size. Q: What's the difference between setting a variable to zero and using the DelVar command? A: When you set a variable to zero, you simply make its value zero. When you use the DelVar command on a variable, you actually delete the variable from memory. For letter variables, the next time the variable is used it is set to zero. DelVar also has some optimization capabilities associated with using it. Q: How do I un/archive programs from within a program? A: While the Archive and UnArchive commands would seem like the right commands to use, they actually don't work with programs from inside the program editor — interestingly enough, though, they do work with programs on the home screen outside of the program editor. What you need to use instead is an assembly program, such as Celtic. Q: I want my program to be run when a person turns on their calculator. Is there a way to do that? A: Not in TI-Basic, but you can use a Flash application to do that. TI created a Start-Up Customization application which will allow you to run a specific program, application or show a picture on the calculator screen each time the calculator is turned on. Q: My program is extremely large. Is there a way to manage/condense the code better? A: Subprograms and optimization are your friends :D Q: Are there any undocumented features (Easter eggs) in TI-Basic? A: Of course. Probably the most well-known undocumented feature is large text on the graph screen, which is achieved by placing a -1 at the beginning of the Text( command. Another cool undocumented feature which was recently discovered is the ability to draw circles significantly faster by placing a list with an imaginary i after the last argument. Besides those two Easter eggs, the TI-Basic community has made great strides in understanding TI-Basic and its many different facets. Q: How do you disable the ON key? A: Unfortunately, you can't. You need to use assembly to disable the ON key. Q: How do I hide the code of my TI-Basic program? A: While you can edit-lock a program and employ some other protection mechanisms, that only really prevents novice calculator users from getting access to your code. Anybody who knows what they are doing will have no problem bypassing your program protection. Another good method is to speed your program up using lots and lots of optimizations. Generally, well-optimized code gets difficult to understand at first glance, and it has the added bonus of making your program smaller and faster. Q: Where do you get the lowercase letters? A: Lowercase letters aren't available by default, so you need to use an assembly program to turn on the lowercase flag that the calculator uses for enabling lowercase letters. You then just press Alpha twice to switch to lowercase mode. You can also transfer lowercase letters over with software like TI-Connect. A good substitute for lowercase letters is the statistics variables, accessible by pressing VARS and then scrolling down to Statistics. Please note that while lowercase letters look nice, they each take up two bytes of memory, instead of the one byte that uppercase letters use. ## Troubleshooting Q: I think some of the routines on this wiki have errors in them, because they didn't work for me. Could you please correct them? A: We have strived to make sure that all of the routines on this site work correctly and without problems. However, if you are 100% sure that you entered the routine correctly into your calculator, please leave a comment on the page using the comment function at the bottom of the page. Somebody will then be able to correct the routine so that it won't cause anybody else any problems. Q: I downloaded a program from the Internet, but it has a .8xg extension instead of the typical .8xp extension. What is that, and how do I get it work? A: The .8xg means that it is a group file (compared to the .8xp for programs), which you must ungroup in order to use. A group file contains one or more files, which can consist of whatever you want (programs, pictures, variables, or whatever else). The main reason that people group their programs is so that all of the program files are in one file, rather than having to remember lots of separate files; it's a matter of convenience. Q: I found a TI-Basic program on the Internet, and typed it into my calculator. Why does the program not work? A: While TI-Basic commands and functions look like they are made up of individual characters that you can type in, they are actually tokens that must be obtained by going to the relevant menu or pressing a key. Depending on the size of the program, it might be better to simply download the entire program to your calculator, instead of manually entering it in. Q: I was playing a TI-Basic game and my calculator suddenly shut off. When I turned it back on, my memory was erased. What happened? A: Your game had a glitch of some kind, and it caused the calculator to crash. This is usually caused by Assembly programs, as the majority of TI-Basic errors are caught by the calculator. You don't have to worry very much about TI-Basic crashes because they don't do any real permanent damage to the calculator, but because it is very annoying to have to replace all of your programs after your RAM is cleared, you should always store any important files in the archive. Q: When I tried to run my TI-Basic program, I got this error message. What does it mean? A: TI-Basic has a built-in error menu, which displays a respective error message based on the error that occurred. If the program is not edit-locked, then it will have a Goto option, which will take you to the point in the code where the error is. There's actually a whole list of error messages that you can receive at any one time, so you should just go down the list and try to see what you did to cause the error. Q: I downloaded a TI-83 TI-Basic program, and tried to run it on my TI-84+SE calculator. It looked like it should work, but it doesn't. How come? A: The majority of TI-83 TI-Basic programs will work on the TI-83+ and TI-84+ calculators, and likewise the majority of TI-83+ and TI-84+ TI-Basic programs will work on the TI-83. However, if a program uses either Assembly (Assembly must be compiled for the specific calculator in order to work) or any of the new TI-Basic commands/functions that TI added, then the program will not work on another calculator. See program portability for more information. Q: After I finished running a TI-Basic game, my screen was split in two between the home screen and the graph screen. On top of that, the axes on the graph screen were gone. How do I get my calculator back to normal? A: Unfortunately for you, the person who programmed the game didn't do a good job of cleaning up after their program, so you have to do that yourself. The calculator has several different settings that you can change to make it look however you want. In this case, you want the screen to just show the full home screen, so the appropriate command would be Full. Turning the axes back on can be accomplished by using the AxesOn command. Q: The transferring program, TI Connect, does not work for me. How do I fix it? A: TI Connectivity issues can be a problem on both the Mac and Windows platforms. Here are some listed solutions for the Windows and Mac platforms. • Mac: • Uninstall and reinstall TI Connect • Kill the process "TI Connect Manager X". • This can be done using Activity Monitor. Start Activity Monitor in /Applications/Utilities, then find "TI Connect Manager X" in the list of processes (if you can't find it, just type "ti" on your keyboard). Select it, then click the X icon in the top left corner of Activity Monitor. Click Force Quit. Then you can restart the device manager, and it should detect your calculator. In some cases, disconnecting your calculator or turning it off will always cause TI Connect Manager X to crash, and you will need to kill it every time you need to connect it to your computer. • To make this process easier, there is a script here that you can use to automate this process. • Use a different USB port. • Windows: • Reinstallation should fix most problems. • Check to make sure the plug (on both ends) are firmly in the port. ## Assembly Q: What is assembly? A: Assembly is the other primary programming language available for the TI-83 series of calculators, and it is a low-level language programmed in the calculator's own machine language. Q: How does TI-Basic compare to assembly? A: TI-Basic is much easier to learn and program in, but it is rather slow because it is an interpreted language. This not only affects getting user input, but also displaying text and graphics on the screen. Assembly on the other hand, is much harder to learn, but allows you to make all sorts of complex games and programs that look nice and run at a decent speed. Q: Is it possible to convert TI-Basic to assembly? A: No, it is not. There are currently no working programs available that will convert TI-Basic to assembly (note: I say working because people have tried creating TI-Basic to assembly converters, but nobody has completed one yet), so the only way you can convert a TI-Basic program to assembly is by learning assembly and porting the program yourself. You could also try asking an assembly programmer to port it for you, but most people won't do that unless the program is pretty small. Q: I want to use an assembly program with my TI-Basic program, but I can't figure out how to use it. Can you help me? A: Unfortunately, we really can't do much for you. What we recommend is that you contact the author of the assembly program and ask them for help. They wrote the program, so naturally they should be able to answer any questions that you have. Q: When I tried to run a program from the program menu, it gave me a ERR:SYNTAX error with no Goto option. Why would it do that? A: This means that you tried to run an assembly program. Most assembly programs are run from an assembly shell, such as MirageOS or Ion, but there are some assembly programs that you can run just using the Asm( command. These are commonly called nostub. Q: Why would I want to run my TI-Basic program from an assembly shell? A: Most people have assembly games on their calculator, which require an assembly shell to run, so they get accustomed to running their programs through a shell. In addition, they like being able to run all their games in a shell, including their TI-Basic games, so they don't have to exit the shell. Truthfully, though, there is really no advantage to running a TI-Basic program from a shell. It's just a personal preference. Q: How do I run my TI-Basic program from an assembly shell? A: The standard way to get a TI-Basic program to appear in an assembly shell is to add a special header to the beginning of the program. This header consists of a colon (:), and then you you can add an optional program description that will be displayed together with your program in the shell. PROGRAM:SAMPLE ::"Program name // note the two colons : // program code  DoorsCS also has support for a custom icon, which needs to be stored in hexadecimal format. You should look at the documentation for DoorsCS to see how to use it. This sitemap is a list of the pages in the TI-83 section of the site, organized in a hierarchical fashion for easy viewing. Please note that this does not include all of the pages in the TI-83 section, because some of the pages are part of a larger page, and thus do not make sense by themselves. # General # Preparation # Commands # Development # Techniques # References # Experiment # Miscellaneous When you are coding, there are several different pitfalls that you have to be aware of. A pitfall is simply code that is syntactically correct, but does not produce the correct or desired results. This list is not meant to be exhaustive, but rather a general collection of things to look out for. ## Arrow Keys One of the most simplest pitfalls that people make is forgetting to use the proper values for the arrow keys. This is especially prevalent with beginners, since they are still learning the ins and outs of the calculator. For example, when the user is making movement, and wants to update the player position on the board, you will see something like this: :A+(K=25)-(K=34→A // Y coordinate :B+(K=24)-(K=26→B // X coordinate  While this code looks right, it actually has the arrow directions flipped around (25 should be swapped with 34, and vice versa for 24 and 26). This code will not generate any errors by the calculator, since it is syntactically correct, but figuring out the logic problem can be challenging if you don't recognize the mistake. ## Boolean Expressions Another common pitfall that people make is messing up their Boolean expressions. A big part of this is simply people not taking the time to learn and understand how the calculator reads Boolean expressions and deals with operator precedence. A Boolean expression is based on Boolean Logic, the principle that something can be either true or false. A true value is represented as 1 or any nonzero value, while a false value is represented as 0. In addition to the four math operators (*,/,+,-), there are six conditional operators (=,≠,>,<,≥,≤) and four logic operators (and,or,xor,not). The operator precedence that the calculator follows is math operators are executed first, then the conditional operators and finally the logic operators. Of course, if there are parentheses, the calculator executes what's inside the parentheses first, which can include any one of the three different kinds of operators. Here is an example to illustrate: :If B=A and CD:Disp "B=A and C*D≠0 :If 5X=2Y+(Y/X≠5:Output(2,2,"Hello  ## Memory Leaks Another pitfall to avoid is causing memory leaks with branching out of loops and conditionals and overusing subprograms. This is especially important because memory leaks not only take up more and more memory, but also slow the calculator down (depending on the size of the memory leak, it can be to a halt). To prevent memory leaks from occurring, you should always make sure that any loops and conditionals (anything with an End command) are executed to their completion. The reason is that the calculator keeps track of the End commands for loops and conditionals, so if one of them isn't completed, the calculator isn't able to remove it from its list. While it is possible to correct a memory leak problem in your pre-existing code, the best time to make those changes is when you are actually planning a program. This is because a properly planned program can be made to not only have no memory leaks, but also be as fast and small as possible. Of course, if you don't feel like rewriting your code again, a simple fix will suffice. :If A=5:Then :Disp "A=5 :Goto A :End should be :If A=5:Disp "A=5 :If A=5:Goto A  ## Portability One of the most common pitfalls that people make is forgetting about program portability. With all of the Assembly libraries available, and there being several different TI-83 based calculators available, it is easy to see how portability becomes an issue. In addition to the Assembly libraries, there are also several new commands that TI has added to the TI-Basic language for the newer TI-84+/SE calculators. While you can use these commands in your programs, they will crash your programs if somebody tries to execute the program on a TI-83/+/SE calculator. Unfortunately, the only thing you can do if you want your program to be TI-83/+/SE compatible is to not use these libraries and commands. This means you won't be able to include that functionality in your program, which can be a big selling point of your program. If you don't care about your program working on the TI-83/+/SE calculators, then portability isn't an issue for you and you don't have to worry about it. However, you should still tell the user at the beginning of the program that the program is designed to work on the TI-84+/SE, and in fact will crash if used on a TI-83/+/SE. The same goes for using Archive/UnArchive if you care about portability to the TI-83 calculator. Additionally, while programs with lowercase letters will work on the TI-83, they can't be sent from a TI-83+ or higher to a TI-83 via the link cable. ## Math Errors Because of the way the calculator is designed, it has limited precision when doing math. Any math calculations that involve extremely small or large numbers (ranging from -E99 to E99) will produce rounding errors that don't return the right number. There are a couple different ways you can deal with this problem. The round( command will round a floating-point number so that it has the specified number of decimal digits. While you can hypothetically set it so that it has 25 digits, the calculator only allows a number to have up to 14 digits, which means the range is 0-14 digits. Another way to deal with the problem is by multiplying the number by a smaller number. The calculator will automatically treat the number in a similar fashion to the smaller number, which allows it to make the math expression work. Truthfully, neither of these methods is fool-proof, so you should just be aware of the problem. Command Summary Builds a matrix from one or more lists. Command Syntax List►matr(list1, [list2, …], matrix Menu Location Press: 1. MATRX (on the 83) or 2nd MATRX (83+ or higher) to access the matrix menu 2. LEFT to access the MATH submenu 3. 9 to select List►matr(, or use arrows. Alternatively, press: 1. 2nd LIST to access the list menu 2. LEFT to access the OPS submenu 3. 0 to select List►matr(, or use arrows TI-83/84/+/SE 2 bytes The List►matr( builds a matrix by combining several list expressions, and stores it to the specified variable ([A] through [J]). Each list specifies a column of the matrix: the first list will be stored down the first (leftmost) column, the second list down the second column, and so on. For example: List►matr({1,2,3},{10,20,30},{100,200,300},[A] Done [A] [[1 10 100] [2 20 200] [3 30 300]]  # Advanced Uses The calculator can actually handle lists that are not the same size. It will pad zeroes to the shorter lists, until they have the same length as the longest list. List►matr({1,2,3},{10},{100,200},[A] Done [A] [[1 10 100] [2 0 200] [3 0 0]]  # Error Conditions • ERR:ARGUMENT is thrown if there are more than 99 lists (since a matrix can be at most 99x99) • ERR:INVALID DIM is thrown if one of the lists is longer than 99 elements (since a matrix can be at most 99x99) # Related Commands Note: Computer setup is only necessary if you want to program on a computer. If you are just interested in programming on your calculator, please skip this page and move on to the Downloading Programs page. While the calculator itself is the predominant place to program TI-Basic, another viable option is programming on a computer. There are several computer tools available, including editors and emulators, which provide a very rich programming environment. In addition, some people don't like using the calculator because it has a small screen that doesn't fit much code, and using its keys to type can be rather cumbersome for writing large programs. # Connectivity Software In order to transfer data between your calculator and your computer, you will need some form of connectivity software. This software often allows you to create backups, transfer variables, and even edit variables. A cable is needed to transfer the data. Here are the three common connectivity software. The first two (TI-Connect and TI-Connect CE) are developed by TI-Education. TI-Connect is the original linking software TI released. It support the entire TI-83/84 line as well as others. TI-Connect CE was released when the TI-84+CE was released. This update retains the same features as TI-Connect while including a modernized UI and a limited TI-Basic editor. While the first two software are compatible on Windows and Mac, they do not work on Unix platforms. TiLP is a free software was created and is maintained by developers not affiliated with TI-Education. The software supports a multitude of calculators ranging from the TI-73 to the TI-Nspire CX CAS. # TI-Basic Editors The first thing you want to get setup is a TI-Basic editor. An editor allows you to make and edit programs and data on the computer, which you can then transfer from your computer to your calculator with a link cable. There is an editor available for each calculator model, so you should download and use the appropriate model: If you are using Windows, you probably want to download both TI Connect to transfer programs to and from your calculator and Tokens IDE (which is probably the best TI-83/84 Basic editor out there as of present). Extract the .zip file you download at the link below and you will be able to run Tokens. The first three editors come with automatic installation, so you just follow the on-screen instructions and check boxes to configure them however you want. In addition, the first two editors are made by Texas Instruments, so if you have any problems or questions, you can just go on their ti.com website or contact moc.it|serac-it#moc.it|serac-it for support. TI-Basic Compiler is an .exe file and doesn't need installing. If you have problems with figuring out what stands for what, go to SourceForge.net and scroll down some. There you can find every command you would need. ("Horizontal" is buggy when compiling because of "Horiz") When using an editor, there will be a calculator keypad displayed to the left of a program edit box (TI-Basic Compiler lets you write the program in NotePad, which gives a little more freedom, but means you have to know exactly how to type everything). Pressing one of the keys on the keypad will bring up the same menus that are on the actual physical calculator, so it is extremely easy to use. If you try typing in some text in the edit box, you will probably note that there is no command syntax checker. This allows you to type in whatever text you want, including commands, functions, and lowercase and other ASCII characters (such as © or Greek). You just need to be aware that the calculator may not translate a typed command into the actual command when sending the program to your calculator, which will cause the program to crash when you try to run it. So, you should always get the commands and functions from the calculator keypad. # Calculator Emulators Once you have installed an editor, now you should install a calculator emulator. An emulator allows you to run a virtual form of your calculator on your computer, which is very convenient when you want to make quick changes to programs, or do any debugging or optimizing. For example, instead of having to send the program to your calculator, make the changes, and then send the updated program back, you can simply start up your emulator and do everything on your computer. There are several different emulators available for you to use: Except for the Flash Debugger emulator, which doesn't need a ROM image, the rest of the emulators need a ROM image before you can use them. A ROM image is simply an instance of your calculator, which tells the emulator that you own your calculator. You just link your calculator to your computer, and then the emulator should be able to download the ROM image off of it. We just need to mention that you should not give your calculator's ROM image to other people to use, because only one person is supposed to use any one ROM image. If somebody asks you for your ROM image, please do the right thing and tell them no. They should buy their own calculator if they want a ROM image. # Online Tools While downloading an editor or emulator is rather simple and easy to do, it is not very useful when you are using someone else's computer, and they don't want you downloading anything. What you can do instead is use one of the online tools that are freely available: SourceCoder 3 and Online TI File Converter. In addition, jsTIfied is an online emulator. SourceCoder 3 is an online editor that parses TI-Basic code and presents it with the appropriate calculator tokens. What makes it especially nice is that it will output the code in several different formats, upon your choosing. Programs, AppVars, lists, strings, images, assembly programs, and projects are just some of the several features included. In addition, SourceCoder 3 is implemented with jsTIfied, which makes it easy to test your code in an emulator. Like its name says, TI File Converter can create and convert several different types of files (includes data, variables, and programs) from the TI-83 series of calculators. After you have created a file, you can download it to your computer to use with an editor or emulator. You should bookmark both websites, so that you can have them right at your fingertips whenever you need to access them. Command Summary Stores one or more columns of a given matrix to list variables Command Syntax Matr►list(matrix, list-var1, [list-var2, …]) Matr►list(matrix, column#, list-var) Menu Location Press: 1. MATRX (on the 83) or 2nd MATRX (83+ or higher) to access the matrix menu 2. LEFT to access the MATH submenu 3. 8 to select Matr►list(, or use arrows. TI-83/84/+/SE 2 bytes The Matr►list( command stores one or more columns of a matrix (or expression resulting in a matrix) to list variables. The syntax is simple: first enter the matrix, then enter the list or lists you want to store columns to. The first (leftmost) column will be stored to the first list entered, the second column will be stored to the second list, and so on. For example: [[11,12,13,14][21,22,23,24][31,32,33,34 [[11 12 13 14] [21 22 23 24] [31 32 33 34]] Matr►list(Ans,L1,L2 Done L1 {11 21 31} L2 {12 22 32}  If there are more lists than columns in the matrix when doing Matr►list(, the extra lists will be ignored. Matr►list( can also be used to extract a specific column of a matrix to a list. The order of the arguments is: matrix, column number, list name. [[11,12,13,14][21,22,23,24][31,32,33,34 [[11 12 13 14] [21 22 23 24] [31 32 33 34]] Matr►list(Ans,4,L1 Done L1 {14 24 34}  # Advanced Uses While the command deals with columns, occasionally you might want to store the matrix to lists by rows. The T (transpose) command is your friend here: applying it to the matrix will flip it diagonally, so that all rows will become columns and vice-versa. For example: [[11,12,13,14][21,22,23,24][31,32,33,34 [[11 12 13 14] [21 22 23 24] [31 32 33 34]] Matr►list(AnsT,L1,L2 Done L1 {11 12 13 14} L2 {21 22 23 24} # Optimizations When using Matr►list( to store to named lists, only the first list must have an ∟ in front of its name — it can be omitted for the rest. For example: :Matr►list([A],∟COL1,∟COL2,∟COL3 can be :Matr►list([A],∟COL1,COL2,COL3  On the other hand, when storing a specific column of a matrix to a named list, the list does not need to be preceded by an ∟. :Matr►list([A],N,∟COL1 can be :Matr►list([A],N,COL1  # Related Commands Picture variables and GDBs (short for Graph DataBase) are used to save two different elements of the current graph display. A picture variable is used to store the exact appearance of the graph screen. A GDB is used to store system variables relevant to the graph screen - equations, window settings, and the like. 10 built-in variables of each type exist: Pic0 through Pic9 for pictures and GDB0 through GDB9 for GDBs. A picture variable stores the on-or-off state of each pixel in the first 63 rows of the screen (the 64th row is only available for assembly programs). The right-most, 96th column is stored with the picture, although it can't be drawn to by TI-Basic commands). The screen is stored to the picture exactly as it appears, with the exception of axes labels (even if they are shown). A GDB stores the following elements of a graph: Note that stat plots and functions entered in another graphing mode are not saved. Neither is the output of any drawing command such as those in the 2nd DRAW menu. # Commands Only 4 commands exist for dealing with pictures and GDBs: They pretty much do what you expect them to. # Advanced It's possible, using an assembly program such as Picture Manager v1.0, to access extra picture variables available due to a shortcut in the TIOS. There are 256 pictures available total; the first ten are Pic1, Pic2, …, Pic9, Pic0, and the rest are only accessible through an assembly program. The same shortcut exists, in theory, for the GDB variables, but since most programmers don't even use the ones that are available, no assembly program for the purpose has been written. Routine Summary Converts a real number to a string. Inputs N - the number you want to convert Outputs Str1 - the number N in string form Variables Used L₁, L₂, Y₁, Str1, N Calculator Compatibility TI-83/84/+/SE Download numbertostring.zip Note: If you have a TI-84+ CE with OS 5.2 or higher, you can ignore this entire routine and just use the toString( command. :{0,1→L₁ :NL₁→L₂ :LinReg(ax+b) Y₁ :Equ►String(Y₁,Str1 :sub(Str1,1,length(Str1)-3→Str1  This code works because it creates two points with a known best fit line: the best fit line through (0,0) and (1,N) is y=Nx+0. LinReg(ax+b) calculates this best fit line, and stores its equation to Y₁. Then, we use Equ►String( to store this equation to Str1, which now contains "NX+0" with N replaced by the numerical value of N. After that, the sub( command get rids of the "X+0" at the end, leaving only the string representation of N. This routine uses L₁, L₂, and Y₁, so you should clean up those variables at the end of your program. If you're working with the graph screen in function mode, storing to Y₁ can be a problem since it will draw an unwanted line through your graphics. Use r₁ instead but make sure the calculator isn't in polar mode. Note: This only works for real numbers. With complex numbers, such as imaginary numbers, you can use this code at the end of the first to get the same effect with i in it. This routine will also only work for N<10^50. To convert larger N, see the alternate below. :Str1+"i→Str1  # Alternate Routine The following routine will perform the same function for converting N to a string as shown above. This routine, however, allows N to be as large as the TI-84+ overflow limit (10^100) by utilizing Med-Med regression. :{0,.5,1→L₁ :NL₁→L₂ :Med-Med Y₁ :Equ►String(Y₁,Str1 :sub(Str1,1,length(Str1)-3→Str1  # Related Routines Command Summary Creates an n by n identity matrix. Command Syntax identity(n) Menu Location Press: 1. MATRX (on the 83) or 2ND MATRX (83+ or higher) to access the matrix menu. 2. LEFT to access the MATH submenu. 3. 5 to select identity(, or use arrows. TI-83/84/+/SE 1 byte The identity( command generates an identity matrix: that is, a matrix [B] such that for any other matrix [A], [A]*[B]=[A] (if [A] is the right size to make the multiplication valid). The identity matrix is square (that is, the row dimension equals the column dimension); all of its elements are 0 except for the elements along the main diagonal (the diagonal going from top left to bottom right). The command itself takes one argument: the size of the matrix, used for both row and column size, that is, identity(n creates an n by n matrix. :dim([A] :identity(Ans(2→[B] :[A][B]=[A] // should always return 1, meaning 'true'  # Optimization The identity( command can be used as a quick way to create an empty square matrix: 0identity(n will create an n by n matrix containing only 0 as an element. This is faster and smaller than the dim( and Fill( commands used for the same purpose: :{5,5→dim([A] :Fill(0,[A] can be :0identity(5→[A]  # Error Conditions • ERR:INVALID DIM occurs if the size is not an integer 1-99. In practice, however, even identity(37 requires more free RAM than the calculator ever has. # Related Commands When people visit and contribute to the wiki, we want to make sure that they find this wiki useful and an enjoyable place to be. To ensure that this happens, we have created a simple code of conduct. Please read through it, and if you have any additional things to add, please go ahead and add them. Thank you for your continued commitment to this code of conduct. • Always try to be respectful of other contributors, including their opinions, values, point-of-view, etc. This means no personal attacks, profanity, and especially no threatening or harassing behavior. • Don't advertise your programs or websites, unless they are TI-Basic related and have some unique value to them. This wiki is not a catch-all for your programs and websites; there are other websites available for that purpose, so use them instead. • Be kind to new contributors, since they are still learning the ropes and figuring out how to use the wiki. If you see that they need some help, go out of your way to help them. This also applies when they make contributions to the wiki. • Compliment others on their work. When somebody puts a considerable amount of time and energy into writing an awesome tutorial, show them that you appreciate their effort and dedication. A simple compliment goes a long way. • Always try to work with other contributors, instead of against them. When somebody suggests an improvement to your work, take it for what it's worth and not a personal attack on you. • Don't post any illegal or unlawful information, unless you are willing to face the consequences. This wiki is not responsible for your actions; you alone will be the one getting in trouble. This is just a warning for your future knowledge. • Whenever you reference another website or tutorial, always remember to cite it as a reference. Other people have taken their time to make those things, so you should do the right thing and cite them. • Always be who you are. Everybody has something to contribute to the wiki, and we don't want to make you feel like your contributions don't matter. If you have a particular writing style, use that instead of trying to imitate someone else's writing style. • If you downgrade someone's program, you must give a valid reason by adding a comment to the page. It is rude to not do so, and it goes against other guidelines of helping others learn. • Refrain from double posting. This means posting two times in a row over the course of 24 hours without another person posting in between. If you have something to add, use the edit button (only applicable to your post for regular users) found under the options menu of your post. By doing this, you are not only following the rules, but you are also making the thread cleaner to read. • Do not rate your own programs on the archive. This can give a false rating, and can be misleading as to what the community actually thinks of your program. Command Summary Calculates the determinant of a square matrix. Command Syntax det(matrix) Menu Location Press: 1. MATRX (83) or 2nd MATRX (83+ or higher) to access the matrix menu 2. LEFT to access the MATH submenu 3. ENTER to select det(. TI-83/84/+/SE 1 byte The det( command calculates the determinant of a square matrix. If its argument is not a square matrix, ERR:INVALID DIM will be thrown. # Advanced Uses If [A] is an N×N matrix, then the roots of det([A]-X identity(N)) are the eigenvalues of [A]. # Formulas For 2×2 matrices, the determinant is simply (1) \begin{align} \det\left( \begin{bmatrix} a & b\\c & d \end{bmatrix} \right) = \begin{vmatrix} a & b\\c & d \end{vmatrix} = ad-bc \end{align} For larger matrices, the determinant can be computed using the Laplace expansion, which allows you to express the determinant of an n×n matrix in terms of the determinants of (n-1)×(n-1) matrices. However, since the Laplace expansion takesO\left( n! \right)$operations, the method usually used in calculators is Gaussian elimination, which only needs$O\left( n^3 \right)operations. The matrix is first decomposed into a unit lower-triangular matrix and an upper-triangular matrix using elementary row operations: (2) \begin{pmatrix} {1}&{}&{}\\ {\vdots}&{\ddots}&{}\\ {\times}&{\cdots}&{1}\end{pmatrix} \begin{pmatrix}{\times}&{\cdots}&{\times}\\ {}&{\ddots}&{\vdots}\\ {}&{}&{\times} \end{pmatrix} The determinant is then calculated as the product of the diagonal elements of the upper-triangular matrix. # Error Conditions # Related Commands Command Summary Stores the contents of a string to an equation variable. Command Syntax String►Equ(string, equation Menu Location This command is found only in the catalog. Press: 1. 2nd CATALOG to access the catalog 2. T to skip to commands starting with T 3. Scroll up to String►Equ( and select it. TI-83/84/+/SE 2 bytes This command stores the contents of a string to an equation variable (such as Y1 or X1T). This command can, in theory, be used whenever you need to set any equation variable. In practice, however, this command is useless. This is because the (store) operation can be used for the same purpose: :String►Equ(Str1,Y1 can be :Str1→Y1  This replacement is universal, takes the same time to run (because it actually uses the same routines), is more convenient to type since you don't have to go through the command catalog, and is two bytes smaller. # Advanced Unlike any normal use of the → (store) operation, this situation is different because it doesn't modify Ans. For example: :125 :"sin(X→Y1 :Disp Ans  Because this use of → does not modify Ans, '125' will be displayed rather than 'sin(X'. However, if we were to replace Y1 with Str1, then the → operation would work normally, and 'sin(X' would be displayed. It's also important to realize the difference between the String►Equ( command and the related Equ►String(, aside from the fact that the latter is actually useful. The main difference is that while Equ►String('s arguments both have to be variables, String►Equ('s first argument can either be a variable (Str0 through Str9), a constant string (e.g., "sin(X)"), or an expression that returns a string (e.g., sub(Str1,1,5)). This applies to the → operation as well. # Related Commands Command Summary Stores the contents of an equation variable to a string. Command Syntax Equ►String(equation,string Menu Location This command is found only in the catalog. Press: 1. 2nd CATALOG to access the catalog 2. F to skip to commands starting with F 3. Scroll up to Equ►String( and select it. TI-83/84/+/SE 2 bytes This command stores the contents of an equation variable (such as Y1 or X1T) to a string (one of Str0, Str1, … Str9). This can be used when you want to display the equation as text (either using the Text( command on the graph screen, or the Output( or Disp commands on the home screen). For example: :Equ►String(Y1,Str1 :Text(0,0,"Y1(X)=",Str1  Apart from cases in which the user has already stored to the equation variable prior to running the program, about the only situation in which you would use Equ►String( is for the output of a regression. # Advanced You can use Equ►String( (outside a program) to get the or " symbols in a string: 1. Type them on the home screen and press [ENTER] 2. Select 2:Quit when the ERR:SYNTAX comes up. 3. Press [Y=] to go to the equation editor. 4. Press [2nd] [ENTRY] to recall the symbols to Y1 5. Now, use Equ►String(Y1,Str1) to store the symbols to a string. # Related Commands # See Also # | A | B | C | D | E | F | G | H | I | K | L | M | N | O | P | R | S | T | U | V ## # 68K Motorola 68000 is the microprocessor that the TI-89, TI-92, and Voyage 200 graphing calculators use. Zilog makes the microprocessor for the TI-83 series of graphing calculators. ## A Advanced Basic Quality TI-Basic programming that is not only efficient in terms of size and speed, but is used to make genuinely fun games. AI An abbreviation for artificial intelligence. Commonly used when referring to an opponent in a game that is not another player. Ans The last answer that was stored in the calculator. The calculator also keeps a history of the last few statements entered in on the home screen where general usage of the calculator occurs. Application (App) A specialized assembly program that is stored in Flash ROM and is run through the APPS menu. There are ten 16KB pages available for Flash Applications on the TI-83+, while there are ninety-four 16KB pages available for Flash Applications on the TI-83+SE. Archive (Arc) Moving a variable or program from RAM to Flash ROM (or just ROM). Archive is the permanent memory (also known as ROM) on the TI calculator. If your calculator crashes, all of your files in RAM will be lost, while everything in the archive will still be intact. Argument (Arg) One of the values that a command acts on, or an expression that is supplied as input to a program, function, or command. Array A collection of numeric variables arranged in a list or matrix for processing by the calculator. Each element in an array is referenced by its index - position in the array. ASCII The American Standard Code of Information Interchange. It uses 1 byte (8 bits) to hold a character, and thus is limited to 256 different characters. The calculator uses a modified version of ASCII internally to store characters, but the TI-Basic interpreter deals with tokens instead. Assembly (Asm) The other programming language built-in to the TI graphing calculators, apart from TI-Basic. It is much more difficult to learn and program in, but at the same time it is much more powerful, and can be used to create very sophisticated games and programs. ## B Backup Copying files from the calculator to a computer, or creating a second copy of the files on the calculator. It is usually done to prevent the person from losing the files through an inadvertent RAM clear. Benchmark A reference point or standard against which speed and/or size can be compared. It is useful when optimizing a program. Binary The two-digit (bit) number system based on 0 and 1, similar to the way the normal decimal system is based on the numbers 0-9. For example the number 101 in binary represents 1*22+0*2+1, or 5 in decimal. Bit A binary digit (0 or 1). Boolean A logic system in which conditions evaluate to either true or false. Branch A departure from the sequential performance of program statements. An unconditional branch causes the calculator to jump to a specified place in the program each time the branching statement is encountered. A conditional branch transfers program control based on the result of some logical condition. Breakpoint A point in a program where program execution can be suspended, used when debugging the program. In TI-Basic, such breakpoints can be created with the Pause command. Bug An error in a program (see also Debugging). Byte A string of eight binary bits. The calculator uses one byte of information to encode the letter "A", as well as most tokens. Bytes (or kilobytes - one kilobyte is 1024 bytes) are used to measure the amount of memory a program or variable takes up on the calculator. ## C Computer Algebra System (CAS) A feature available on some of the Ti-Nspire calculators. It can symbolically solve equations, factor and expand variable expressions, complete the square, find antiderivatives, compute limits and exact solutions in irrational forms, and more. Calculator Based Laboratory (CBL) A device that you connect to the calculator through the link port, and it collects real-time data from various sensors that you can connect to it, and allows you to view and analyze the results. Calculator Based Ranger (CBR) A device that you connect to the calculator through the link port, and it collects real-time data from various sensors that you can connect to it, and allows you to view and analyze the results. Cascading Style Sheet (CSS) A type of code that changes how a website looks based upon an element's class, id, name, or type. Certificate A certificate is a file that is generated by TI, and when loaded on the calculator provides needed information to Flash applications on the calculator. Character (Char) A letter, number, punctuation symbol, or special graphics symbol. They are encoded in ASCII format internally, but the TI-Basic interpreter uses tokens instead. Clock cycle The unit of time in a CPU. It is so small that even the most primitive assembly instructions take around 10 clock cycles to run; the amount of clock cycles it takes for a single TI-Basic command can be in the millions. Command (Cmd) A word or token that tells the calculator to do something. Examples: ClrHome, Output(, While, etc. They are sometimes subdivided into functions and instructions Complex Any expression or number which has an imaginary component (see i). For example, 3 + 2i is a complex number, where i=sqrt(−1). Concatenation Joining two or more strings together to make a longer string. The "+" is the concatenation operator. For example, "TI-"+"BASIC"="TI-BASIC". Condition (Cond) A logical expression that the calculator can evaluate to be true or false (represented as 1 and 0). Constant A specific number, list, matrix, or string that is given as a fixed value in the program (such as 9.024 or "Hello"), rather than contained in a variable. Central Processing Unit (CPU) The "brain" of the calculator, where the calculator controls the processing and execution of everything. Crash A sudden failure of the calculator that is usually caused by a faulty assembly program. Although TI-Basic programs can crash, the majority of TI-Basic errors are caught by the calculator. Cursor A small, flashing square showing where a typed character will appear. A cursor (in the form of a crosshair) is also used on the graph screen to input a point from the user. ## D Data Information, often numerical in form. When data is used by a calculator program, it can be hardcoded or softcoded. Debugging (Debug) Fixing a program to remove bugs, or mistakes. There are many techniques for debugging, some universal, some specific to calculator programming. Decimal (Dec) A base 10 number system using the symbols 0-9. It is the only number system natively supported by the calculator. Default A standard characteristic or value which the calculator assumes without specification. For example, the round( command has a default of rounding 9 digits past the first digit, so round(X) will round X to 9 digits. This can be overwritten with a second argument to specify the digits to round to — round(X,3), for example, rounds to 3 digits. Display The home screen or graph screen on the calculator. ## E Emulator A computer program that simulates a calculator's hardware, allowing you to run TI-Basic and assembly programs on your computer. Equation Operating System (EOS) The Equation Operating System (EOSTM) is the routine in the calculator that determines order of operations. Equation (Equ) An equation is a mathematical expression involving variables and/or functions. Error (Err) An error is when an unexpected condition occurs, and the calculator displays a message to attempt to tell you what went wrong. Errors run the gamut from serious to stupid, meaning it might be time to buy a new calculator or you might have simply misused a command. Execute Another name for running a program or command. Exponent A number indicating the power to which a number or expression is to be raised, usually written at the right and above the number. For example, 26 = 2x2x2x2x2x2. In scientific notation, the power of ten which the mantissa is multiplied by to calculate the actual number. Expression (Expr) A combination of numbers, variables, operators, and functions. For example, 5+3, sin(cos(X)), and X are all expressions. ## F Flash The ROM/archive memory on the TI-83+/84+/SE calculators where applications are stored. It is also used to describe the technology employed in the calculator enabling increased storage, upgradeability, and expandability. Floating Point A method used to represent numbers with non-zero fractional components, where a number is represented as a signed mantissa implicitly multiplied by a signed exponent. Flow Chart A diagram of geometric shapes connected by arrows that show the progression of a program. Flow charts are handy for developing complicated programs and illustrating how programs work. Fraction (Frac) A fraction is the the result of division of two numbers (i.e., 5/7 or 1/3), including integers or even other fractions. Friendly Window A configuration of window variables that's most useful for your program — most commonly, because it makes the coordinate value of a pixel come out to a round value, such as an integer, or .1 of an integer. Function (Func) Although the word has many meanings, in the context of TI-83 series calculator programming, it's a type of command that returns a value — such as gcd( or sin(. FX Graphical or sound effects used in a game to make it stand out. ## G Garbage Collection A process that the calculator automatically performs to reorganize the contents of Flash ROM. When you delete a file from Flash ROM, it is not deleted at that time, it is just marked as 'not used'. When the Flash ROM is full, the variables marked as deleted are actually erased. Graphics Any sort of visual display on the screen, such as graphs, patterns, and drawings, both stationary and animated. Graph Link The link cable that is used together with TI-Connect or the Graph Link software to send programs, variables, Flash applications, and operating systems. Graph Screen The display screen on which graphs and plots are shown. Group A collection of files that have been combined into one file, stored in Flash ROM. Graphical User Interface (GUI) A type of user interface which allows people to interact with the calculator. ## H Hardcode Hardcoded data is information used by the program that results from the logic of its commands. It is very easy for the program to read, but can be impossible to change. Hardware The circuit boards and other electronic parts which make up a calculator. Hexadecimal A base 16 number system using 16 symbols, 0-9 and A-F. It is used as a convenient shorthand way to express binary code, because every four bits of binary have a corresponding hexadecimal symbol. Home Screen The default display screen on which calculations and commands are entered. ## I Integrated Development Environment (IDE) An IDE is a software application that provides utilities for program development, usually including an editor and debugger. Image (Img) An image is a visual depiction of something. Input/Output (I/O) Input is what you provide to the calculator when you press a key or select a menu, while the output is how the calculator responds. The two are interdependent of each other. Index A position in an array. In TI-Basic, arrays are indexed starting with 1 (so that the first element in a list is numbered 1, the second 2, and so on). In some other languages, they are indexed starting with 0. Input The means by which data is entered into the calculator by the user, primarily through the calculator's keys (though the link port is also a form of input). Instruction In the case of TI-83 series programming, this is often used to indicate a type of command that does not return a value, but stands alone: for example, Line(, or Input. It is also sometimes used to describe commands in general. Integer (Int) A whole number, either positive, negative, or zero. Interpreter The algorithm stored inside the calculator that runs a TI-Basic program by executing the appropriate system routines. Iteration One repetition of a loop. For certain commands, the calculator has an internal loop for which the total number of iterations is relevant, and affects accuracy. ## K Keypad The panel of keys used to enter programs and data into the calculator. ## L Library (Lib) A library is a program (usually made in Assembly) that is designed to be an auxiliary utility for another program. Libraries provide functions that are not supported or not practical in TI-Basic (such as inverting the screen). List A sequence of numerical variables which can be accessed and modified by their position. Loop A group of one or more consecutive program lines which are performed repeatedly, either a specific number of times or until a condition is met. Lua A programming language other than Ti-Basic which can be used on the Ti-Nspire calculators ## M Mantissa The basic numeric portion of a number expressed in scientific notation. In 3.264E + 4, the mantissa is 3.264. Matrix (Matr) A two-dimensional grid of numerical variables which can be accessed and modified by their position. Memory The two different places (RAM and ROM) where calculator programs and data are stored. All variables and programs take up part of memory to store, which makes the size of a program or variable very important. Memory Leak A type of bug in which the program wastefully uses memory, often culminating with an error. In TI-Basic, this type of bug is often due to exiting a loop or If-Then-End block with a Goto. MHz The speed the calculator CPU runs at. For the TI-83, it is 6MHz, while for the TI-83+ it is 8MHz, and for the TI-83+SE and TI-84+/SE calculators, it is 15MHz. It's measured in millions of clock cycles per second. ## N Number system A way of writing down a number. Two common systems used by people are the decimal (Arabic) system, and the Roman numeral system. The calculator uses the binary system internally, but the usual decimal system is all that it shows or accepts as input. ## O Operator (Op) A symbol used in calculations (numeric operators) or in relationship comparisons (related operations). The math operators are +, -, *, /, ^. The relational operators are >, <, =, ≥, ≤, ≠. The logic operators are and, or, xor, not(. Optimization The process of improving the running time, length, or memory usage of a program. Order of Operations When evaluating an expression, the operators are calculated in a specific order defined by the OS. Output Information sent from the calculator, e.g. graphics on the screen. Also, the means by which data leaves the calculator, through either the link cable, graph link, or USB cable. Operating System (OS) The internal program that runs the calculator and includes all the functionality needed to use the calculator. ## P Port Convert; Remake, especially onto another device. Program (Prgm) The list of instructions that tells the calculator what to do to perform a task. Programmer A person who writes programs. Programming Language Numeric or alphabetic commands which the calculator can understand, and execute. Prompt A command that requests input from the user. Pt On the monochrome calculators, a point is a specific 1x1 space on the calculator's graph screen. You can use the Pt commands to manipulate a point. The primary difference between a pixel and a point is that a pixel is not affected by the graph screen settings, while a point is. Pxl A pixel is a specific 1x1 space on the calculator's graph screen. You can use the Pxl commands to manipulate a pixel. ## R Random Access Memory (RAM) A temporary memory, i.e. one in which data is stored so long as electrical power is applied. Data in RAM can be accessed or changed and is lost if the batteries are removed from the calculator. Rand A command used to generate a uniformly-distributed pseudo-random number between 0 and 1. Recursion A program that calls itself as a subroutine (or a function that's defined in terms of itself). If not done carefully, this can result in a memory-leak See recursion. Read Only Memory (ROM) ( Certain instructions for the calculator are permanently stored in ROM and can be accessed but cannot be changed. Data in ROM is not lost if batteries are removed. Routine A small section of code intended to perform a specific function. Typically the most optimized form of the code, and used quite often. ## S Scientific Notation A method of expressing very large or very small numbers by using a base number (mantissa) times ten raised to some power (exponent). Scroll Shifting part of the screen to give the illusion of seeing only part of an image larger than the screen. SE Silver Edition is the more powerful version of the TI-83+ and TI-84+ calculators, with more memory and a faster processor. Shareware Application An application that is signed shareware is one that can be loaded and executed on all calculators for which the application was developed. Shell A program, typically programmed in assembly, that is used to run other programs. The majority of assembly programs require that they be run from a shell. Signing Signing is a process whereby a file (*.hex on the TI-83+ and *.cer on the TI-89/TI-92+/V200) is made into either a shareware or a secured application by TI. Softcode Softcoded data is information stored in an array at the beginning of the program, and read from it later. It is usually slower to read than hardcoded data, but the advantage is that the same code can often be used for different data stored in the same way. Software Development Kit (SDK) A Software Development Kit (SDK) enables software developers to write applications (apps) using a variety of the calculator's internal functions: simulator/debugger, freeware private key (gives the ability to digitally sign a Flash Application for use on any TI-83+/SE calculator), and digital signature utilities (all the utilities needed to sign a Flash Application). Spaghetti Code The unofficial name given to code that heavily relies on Goto/Lbl for its structure and organization. Sprite A small image which is moved around the screen using code and/or repeated multiple times on the screen. Stack A data structure much like a list but with limited access: only the top element at a given time can be accessed or changed. The OS uses two stacks internally for running TI-Basic programs: one for evaluating expressions, and one for keeping track of Ends and program calls. Statement A single line of a program containing a single instruction such as ClrHome, Output(, Stop, etc. Usually synonymous with command. String (Str) A variable type that stores text as a series of symbols or tokens. Subprogram A program segment which can be used more than once during the execution of a program, such as a complex set of calculations or a print routine. You can make subprograms using the prgm command. Syntax The rules that the TI calculator follows when typing in a command. You need to type in the command exactly as specified, otherwise, you will get a ERR:SYNTAX error. ## T Texas Instruments (TI) The makers of the TI graphing calculators. In addition to graphing calculators, they also make a large assortment of other electronic devices. TI-83/84/+/SE Shorthand way to refer to the five graphing calculators in the TI-83 series: TI-83, TI-83+, TI-83+SE, TI-84+, and TI-84+SE. TI-Basic The official name of the programming language found on TI calculators. TI-OS The built-in operating system that controls the operation of the calculator. Token A single instruction or symbol in TI-Basic. Anything you type into a program is made up of tokens. The more common tokens take up one byte each, but others can take up two. Some tokens are not accessible through menus, and require assembly to gain access to, but can then be used in Basic programs. ## U Unarchive Moving a program from Flash ROM (or just ROM) to RAM. User When talking about the effect of a program or command, it is the person running the program or command on his/her calculator. ## V Variable (Var) A name given to a value which may vary during program execution. A variable is a memory location where values can be replaced by new values during program execution. There are several different variables available in TI-Basic, including reals, lists, matrices, and strings. ## Y Y= The built-in editor which is used to enter and edit the Y# functions. ## Z Z80 Zilog Z80 is the microprocessor that the TI-83 series of graphing calculators use. Motorola makes the microprocessor for the TI-89, TI-92, and Voyage 200 graphing calculators.  This article is part of the coding stage of the development cycle. When you are in the process of writing a program, everything about the program (i.e., variables, program structure, branching labels, etc.) is fresh in your mind and it's easy to remember. But what would happen if you stopped working on the program for a year, and then decided to start working on it again? All or most of your previous knowledge of the program would be gone, and you would have to spend some time (or lots of time, depending on the program) to figure out how the program works again. While this is only a hypothetical example, this problem is a real concern for lots of people who have multiple projects going at any one time. Thankfully, this problem can be easily prevented by simply adding comments to your code. A comment is a brief note that describes some functionality or feature of your code. You don't need to comment everything, but the two main things that you should comment are: • Program Structure — Loops and branching with appropriate label names • Variables — What their purpose is and any possible values The amount of free RAM is the only limit on comment size, but you should generally try to keep your comments clear and concise. In addition, if your comment is more than a couple lines in length, you should split it up into multiple lines. This makes it easier to read and update, if needed. # Text Comments There are a couple different ways that you can add text comments to your code, with each having their own advantages and disadvantages. The first way is to make the comment a string literal (i.e., place a quote before the comment text), and then just place it on its own line. :"Comment here  The advantage of this comment method is that it is extremely simple to use and update. You can make your comment almost anything you want (the two characters you can't use are the store command and a quote), and the calculator just reads it as a string. The disadvantage of this method is that it prevents you from using the Ans variable, since the comment will be stored to Ans when the calculator reads it. The comment also slows the program down because the calculator has to execute it each time. The second way to add a text comment to your code is by placing the comment in a conditional or loop, and using zero as the condition. Based on Boolean logic, the condition will always be false, which causes the calculator to not execute the conditional or loop, and subsequently skip right over the comment nested inside of it. :While 0 :Comment here :End  The advantage of this comment method is that it doesn't mess with any of the variables, and you can use the store command and quote character. The disadvantage is that it takes up some additional memory to use the conditional or loop, and this problem only worsens the more comments you use. # Indenting Code Another way to comment code is by indenting it, which allows you to easily identify control structures and blocks of code. Just like how there is a built-in colon that denotes the beginning of each new line, you can place your own colons before any statements on a line. :While 1 ::Disp "Hello ::Disp "Goodbye :End  Although there is no restriction on how many colons you can place at the beginning of a line, one colon is generally sufficient. However, if adding two or three colons helps you better visualize the code, then that's what you should go with. It is usually discouraged to use this method. Not only does it take up additional memory by adding bytes to the program, it also affects some commands. For example, the following method will not work. The intention of the code is to display only "FALSE". :2→A :If A=1 ::Disp "TRUE" :Disp "FALSE"  By adding the extra colon, an extra line is added. This specific line is skipped due to the If statement being false. However, Disp "TRUE" is run as well as Disp "FALSE". # Descriptive Variables Yet another way to comment code is by using descriptive variables that reflect where and how they are used. This is primarily related to using the real variables (A-Z and θ), since they are the most commonly used variables, and are much smaller and faster than other variables. Of the real variables, the standard variables and situations are: • I and J for the looping variable in For( loops • X and Y for the X and Y screen coordinates respectively. • K for storing the keypress with the getKey command. Each of these variables is mnemonic — for example, K is the first letter in keypress — making them fairly easy to remember. # Advanced Uses You can modify the text comments so that you can turn them on or off. You just use a conditional with a variable as the condition, and then change its value from false (i.e., the comments are off) to true (i.e., the comments are on). Based on Boolean logic, the easiest system for the variable value is one for true and zero for false. You also need to display the comments on the screen, so that you can read them during program execution. If you are using the home screen, you should use the Pause command and its optional argument. While program execution is halted until the user presses ENTER, the Pause command allows you to display the entire comment on one line, and you can even scroll the comment left or right to read it, if necessary. :If A:Pause "Comment here  You should use the same variable for all of the comments, so that the comments work in unison. The variable can be whatever you want, but the simplest variable to use is a real variable (A-Z and θ). You just need to remember to set the variable to zero at the beginning of the program, so that the comments are turned off by default. Command Summary Returns a specific part of a given string, or divides by 100. Command Syntax sub(string, start, length) sub(value) Menu Location This command can only be found in the catalog. Press: 1. 2nd CATALOG to enter the command catalog 2. T to skip to command starting with T 3. Scroll up to sub( and select it TI-83/84/+/SE 2 bytes The sub( command is used to get a substring, or a specific part of a string. It takes three arguments: string is the source string to get the substring from, start is the index of the token to start from, and length is the length of the substring you want. For example: :sub("TI-BASIC",4,5 "BASIC" :sub("TI-BASIC",5,2 "AS"  Keep in mind that you can't have an empty string, so the length argument can't be equal to 0. When the length argument is 1, sub(string,N,1 returns the Nth token in the string. # Advanced Uses If only one argument is given, and it contains an expression that evaluates to a real or complex number or list of numbers, the sub( command will divide the result by 100. :sub(225 2.25 :sub({3+5i,-4i►Frac {3/100+1/20i,-1/25i}  Much like the use of the % symbol, this is an undocumented feature that was introduced in OS version 1.15. Thus, care should be taken when using sub( in this way, as older versions will not support it. Together with the inString( command, sub( can be used to store a "list of strings" in a string, that you can then get each individual string from. To do this, think of a delimiter, such as a comma, to separate each individual string in the "list" (the delimiter must never occur in an individual string). The code will be simpler if the delimiter also occurs at the end of the string, as in "CAT,DOG,RAT,FISH,". This routine will display each string in a "list of strings". You can adapt it to your own needs. :1→I :inString(Str1,",→J :While Ans :Disp sub(Str1,I,J-I :J+1→I :inString(Str1,",",Ans→J :End  Alternatively, instead of using inString, you can start each individual string at the length of the longest string length, plus 1. If there are smaller strings that are not the same length, use spaces. For example, if you wanted to display the suits for a card game, do the following: :"SPADES--DIAMONDSHEARTS--CLUB----→Str1 :sub(Str1,1+8A,8  (Spaces have been replaced with dashes for visual clarity.) Broken down, by manipulating A, different portions of the string can be displayed without the hassle of searching for characters. Setting A as 0 would display "SPADES—", but thanks to the spaces, the extra two characters would not be seen. A may be replaced with (A-1) if the 1st name would like to be displayed by setting A to 1. This method is more preferable when using the Home Screen, as the spaces would wipe the last end characters of any previous strings displayed. # Error Conditions • ERR:ARCHIVED is thrown if you try to take the substring of an archived string. • ERR:DOMAIN is thrown if the starting and/or length value is less than 1, or if it is not an integer. • ERR:INVALID DIM is thrown if the starting and/or length value is beyond the length of the string. • ERR:UNDEFINED is thrown if you try to take the substring of a non-existent string. # Related Commands Command Summary Returns the length of a string. Command Syntax length(string) Menu Location This command can only be found in the catalog. Press: 1. 2nd CATALOG to access the command catalog 2. L to skip to commands starting with L 3. scroll down to length( and select it TI-83/84/+/SE 2 bytes This command is used to determine the length of a string. Unlike the dim( command for lists and matrices, it cannot be used to change this length, as there is no null character for strings (the null value is 0 for lists and matrices). :length("HELLO 5  Keep in mind that the length is measured in the number of tokens, and not the number of letters in the string. For example, although the sin( command contains 4 characters ("s", "i", "n", and "("), it will only add 1 to the total length of a string it's in. The execution time for length( is directly proportional to the length of the string. # Advanced Uses The code for looping over each character (technically, each token) of a string involves length(: :For(N,1,length(Str1 ... use sub(Str1,N,1 for the Nth character ... :End  # Related Commands Command Summary Finds the first occurrence of a search string in a larger string. Command Syntax inString(haystack, needle, starting point) Menu Location This command can only be found in the Catalog. Press: 1. 2nd CATALOG to access the command catalog 2. I to skip to command starting with I 3. scroll down to find inString( and select it TI-83/84/+/SE 2 bytes The inString( command searches a string for occurrences of a smaller string (similar to the Find feature on a computer), and returns the first such occurrence. The source string is the string you want to search through; the search string is the substring you want to find. inString( will return the index of the first letter of the first occurrence of the search string found, or 0 if the search string is not present. For example: :inString("TI-BASIC","BASIC 4 :inString("TI-BASIC","TI 1 :inString("TI-BASIC","I 2 :inString("TI-BASIC","ELEPHANT 0  You can also provide the optional starting point argument, 1 by default, that will tell the command where it should start looking. If you provide a value higher than 1 here, the command will skip the beginning of the string. This can be used to find where the search string occurs past the first occurrence. For example: :inString("TI-BASIC","I 2 :inString("TI-BASIC","I",2 2 :inString("TI-BASIC","I",3 7  # Advanced Uses You can use inString( to convert a character to a number. For example: :inString("ABCDEFGHIJKLMNOPQRSTUVWXYZ",Str1→N  Assuming Str1 is one character long and contains a capital letter, N will hold a value of 1-26 that corresponds to that letter. This value can then be stored in a real number, list, or matrix, where a character of a string couldn't be stored. To get the character value of the number, you can use the sub( command: :sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ",N,1→Str1  Using the starting point argument of inString(, you can write a routine to return all occurrences of the search string in the source string: :0→dim(L1 :inString(Str0,Str1 :Repeat not(Ans :Ans→L1(1+dim(L1 :inString(Str0,Str1,Ans+1 :End  If the search string is not found, this routine will return {0} in L1. If it is found, the result will be a list of all the places the string was found. # Optimization The inString( command can replace checking if a string is one of a number of values. Just put all the values in a string, one after the other, and try to find the string to be checked in the string of those values: :If Str1="." or Str1=", can be :If inString(".,",Str1  Be careful, because if Str1 were ".," in the above example, this would also be treated like "." or ",". If this is a problem, you can separate the values you want to check for by a character you know can't be in the string: :If Str1="HELLO" or Str1="HI can be :If inString("HELLO,HI",Str1  (assuming a comma would never be in Str1, and words like "HELL" or "I" are also impossible) # Error Conditions • ERR:DOMAIN is thrown if starting point is not a positive integer (it's okay, though, if it's bigger than the length of the string). # Related Commands Command Summary Returns the size of a list or matrix. Can also be used to change the size. Command Syntax dim(list dim(matrix length→dim(list {rows,columns→dim(matrix Menu Location Press: 1. 2nd LIST to access the list menu 2. RIGHT to access the OPS submenu 3. 3 to choose dim(, or use arrows Alternatively, press: 1. MATRIX (83) or 2nd MATRIX (83+ or higher) to access the matrix menu 2. RIGHT to access the MATH submenu 3. 3 to choose dim(, or use arrows TI-83/84/+/SE 1 byte The dim( command is used to find the size of an existing list or matrix. It takes only one argument - the list or matrix you want the size of. For a list, it returns the number of elements; for a matrix, it returns a two-element list of the number of rows and the number of columns. :dim(L1 5 :dim([A] {2,3}  The dim( command can also be used to change the size of a list or matrix; this is perhaps its most important use. To do this, just store the desired size to the list or matrix (the dim( command is the only one you can store in as though it were a variable). :7→dim(L1 :{2,2→dim([A]  For a list, if this increases the size, zero elements will be added to the end of the list; if this decreases the size, elements will be removed starting from the end. For a matrix, if this increases the number of rows or columns, new rows or columns filled with zeros will be added to the bottom and right respectively. If this decreases the number of rows and columns, those rows and columns will be removed starting from the bottom (for rows) and right (for columns). If a list or matrix doesn't exist before its size is changed, the dim( command will actually create it with the correct size. All the elements, in this case, will be set to 0. # Advanced Uses In the case of lists, the dim( command is used in adding an element to the end of a list. Although augment( can be used for the same task, dim( is faster - but takes more memory. For example, to add the element 5 to the end of L1: :5→L1(1+dim(L1  It's also possible, using the dim( command, to set the size of a list to 0. In this case, the list exists, but doesn't take up any memory, and cannot be used in expressions (similar to the output of ClrList). This is not really useful. # Optimization When creating a list or matrix using dim(, all the elements are preset to 0; this can be used in place of the Fill( command to set a list or matrix to a bunch of zeros in a program. Since we don't usually know for sure that the list or matrix doesn't exist, we must first delete it with DelVar. :{5,5→dim([A] :Fill(0,[A] can be :DelVar [A]{5,5→dim([A]  # Error Conditions • ERR:INVALID DIM is thrown if you try to make a list or matrix bigger than 999 or 99x99 elements respectively, or if you try to create a matrix that isn't 2-dimensional. # Related Commands Strings are used for storing a sequence of characters, that is, text. Although a common use for strings is to manipulate text to be displayed in a program, they have many different purposes: highscores, level and map data, and whatever else is desired. Although there are only ten built-in string variables (Str0 through Str9) available to use, strings can hold many different kinds of characters, including letters (both uppercase and lowercase), numbers, functions, and even other commands. The amount of free RAM is the only limit on the number of characters in a string. Each function and command is counted as one character, though, which can cause problems when displaying strings. The two characters that you can't put in a string (using a TI-Basic program; advanced users see below) are quotation marks (") and the store command (→). However, you can mimic these respectively by using two apostrophes (''), and a subtract sign with a greater than sign (->). When entering a string, you need to put a quote at the beginning and ending of the string to enclose the characters inside the string (the quotes do not count as string characters). This also indicates that it is a string. Inside the string, you then enter whatever characters you want. If you want to store the string to a string variable for later use in a program, you just select which string variable you want to use and then store the string to it with the [STO►] key. :"Text"→string  To access the string variables, press VARS and then scroll down to Strings (or press 7). You then scroll down to whichever string variable you want to use and press ENTER. # Commands Strings make special use of the = (equal), (not equal), and + (add) operations. While = and ≠ behave pretty much as you would expect — two strings are equal only if they contain the same exact text — the + operation may be a surprise. The TI-83 series calculators use it to "concatenate" two strings — that is, put them together one after the other. For example: :"HELLO"+"WORLD returns the string "HELLOWORLD"  There are also several commands made specifically for strings. They can only be found in the command catalog ([2nd][0]). This is a shame, because programmers use most of them quite often, and scrolling to them in the catalog is annoying. They are: # Advanced While you can't store " and → into a string through a program, you may do it nonetheless from the home screen using the following trick (note, however, that plugging the actual content of the string into a program will revert it to its "unstable" state, making it prone to syntax error again): 1. At the home screen, type the quotation marks, followed by the store arrow 2. Press [ENTER] to generate a syntax error, and back out of it by choosing 1:Quit 3. At the [Y=] editor, press [2nd] and [ENTER] to recall the last stored ENTRY into Y1 4. Return to the home screen, and then select Equ>String( from the CATALOG 5. Select Y1 from the [VARS] Y-VARS 1:Function menu 6. Follow it up with a comma and then select Str1 from the [VARS] 7:String menu 7. Press [ENTER] to activate it, and you should now have the string ""→" stored to Str1 Note that if you use Str1 in a program, you should include Str1 as an additional variable when distributing it. Additionally, you can store quotation marks (but not →) in a string by using the Input command in a program, and type in quotation marks. Also, if you use the expr( command on a string such as ""HELLO"", it will not return the product of H, E, L, L, and O, rather it returns the string "HELLO". It's known that attaching formulas to lists stores them internally in a way similar to strings, and in fact, "HELLO→L1 will store the formula HELLO to L1. If these formulas could then be accessed arbitrarily (rather than just evaluated), this would provide programmers with an unlimited supply of nameable strings. However, no such way is currently known. Matrices are two-dimensional lists (row by column). They are used for holding lots of information. Matrices are often used for storing a map of the screen, which is necessary for collision detection in movement. There are only ten built-in matrices (from [A] to [J]). A matrix may have up to 99 rows and 99 columns, however the memory on a TI-83 calculator limits this: a 99x99 matrix would hold 9801 elements, and take up 88220 bytes! A matrix is like a grid. To access the matrix variables you need to press [MATRX] on a TI-83, or [2nd] [x-1] on a TI-83+ or higher. You can then scroll down to whatever matrix you want to use or press the corresponding number. Entering [, A, and ] for the matrix [A] will not work. The square brackets, [ and ], are used when manually entering a matrix variable. The syntax is fairly complicated, and goes as follows: • The matrix must start off with an opening bracket - [. • After that comes the data in the matrix, row by row (left to right, and top to bottom). • Each row begins with another opening bracket - [. • Then come the elements in the row. Numbers or expressions, they must be separated by commas. • A row ends with a closing bracket - ]. There is no comma between two rows. • The matrix ends with another closing bracket - ]. Thus, a matrix will start with two opening brackets, [[, and end with two closing brackets, ]]. If all you're doing is storing the matrix, the last two brackets can be omitted. Fortunately for you, you don't have to memorize this syntax — in fact, it's probably best if you don't, since there's good odds of making a mistake even if you know it well. The easiest way to store to a matrix variable in a program is first, to create the matrix you want in the matrix editor, and second, to paste it into the program by recalling the matrix's value. # Commands Some basic arithmetic commands can be used by matrices as well as real numbers. However, they don't all do what you would expect (unless of course you've taken an advanced algebra class): • Plus(+) and minus(-) add or subtract the matching elements of two matrices with the same size (no surprise there). The negating (-) will negate each element of the matrix. • Multiplication (*) for matrices exists, but it does not work like adding and subtracting. For details, see Matrix Multiplication at MathWorld. • The inverse (-1) operator finds the inverse matrix, the NxN matrix such that [A]-1[A]=[A][A]-1=identity(N). This function only works for square matrices. • The ^ operator raises a square matrix to a power, multiplying it by itself 0 to 255 times. The ² and ³ commands are valid substitutes for ^2 and ^3. • The = operator tests if two matrices are exactly identical, and returns 1 if they are and 0 otherwise; works similarly. • Some commands also work on matrices, by being applied to every element. They are: There are also, of course, special commands for dealing with matrices. They are: These can be found in the MATH submenu of the matrix menu. # Optimizations Even if you need to store a fixed matrix in a program, doing it in the standard fashion is usually inefficient memory-wise: consider that if each element is one digit, then over half the memory used is spent on commas and brackets. You may want to use a modified version of a routine on the compressions techniques page. If most of your matrix's elements are 0, consider deleting the matrix (so that any old data in it doesn't interfere), creating it using the dim( command with all elements 0, then storing to the elements that are not. For example: :DelVar [A]{5,5→dim([A] :1→[A](1,2 :2→[A](3,4 :3→[A](5,5  A list is a collection of elements (made up of numbers, variables, or expressions). Although lists can have up to 999 elements (the only exception is the TI-83, which can only have 99 elements), they are limited by the amount of free RAM. Besides the six built-in lists (from L1 to L6), which can be accessed by pressing [2nd] and [1] to [6] (for whichever list you want), you can also create custom lists. A custom list name can be one to five characters, comprised of any combination of capital letters and numbers and theta, but it must begin with a letter or theta. Lists are very versatile variables. They are used for storing highscores and map information, and just about anything else. Lists are also important because they are the only variable that can be assigned a name. This adds a certain security to using them. Other programs can still access your lists (and change or corrupt them), however, but there is a smaller likelihood of this happening simply because there are millions of possible names available. To use lists, you must become familiar with some specifics of their syntax: • The little command, which belongs at the beginning of any list name, except the default lists L1…L6. Almost always, when using a list, you must include this: e.g., to access the list SCORE, you would enter ∟SCORE. When you choose a list from the [2nd][LIST] menu, this is added by default so you don't have to worry about it. • The curly brackets: { and }. These allow you to manually enter a list. When manually writing a list, you begin with putting a single opening curly brace ({) that will enclose the list. You then type a number or variable or expression, and put a comma after it. You repeat this for however many elements you want. You then put a single closing curly brace (}) that will close the list. • Parentheses: ( and ). These access a specific element of a list: for example, ∟NAME(5) would be the 5th element of ∟NAME. You can also use this to store to an individual element of the list. # Commands List variables stand out from other advanced variable types because most commands you can use for numbers can be used for lists as well. In such a case, the command will be applied to each element of the list individually, and a list of the results will be returned. If two lists are used like this in the same command, their elements are "paired up" and the command will be applied to each pair. For example: :cos({30,60,90 will be evaluated like :{cos(30),cos(60),cos(90  :{3,4,5}={6,7,5 will return :{0,0,1  Before doing any list comparison operations, you should first check that both list dimensions are the same size using the dim( command. This check is necessary because if the lists are not the same size, it will cause an ERR:DIM MISMATCH error. Of course, if you can guarantee their sizes will be identical, you can leave off the size check. :If dim(L1)=dim(L2 :Then :If min(L1=L2 :Disp "EQUAL :End  There are some special commands for lists; some can be used for normal commands as well, but have a special meaning when used for a list. These are typically accessed through the [2nd][LIST] menu, and include: Some statistical commands are used with lists as well: see the Statistics page for details. # Optimization Some optimization tricks are used specifically with lists. For example, you may sometimes omit the little ∟ symbol at the beginning of a list. The most common situation where this applies is when using the → (store) command to store to a list. For example: :{1,2,3→∟NUMS can be :{1,2,3→NUMS  This is even possible with a single-letter name, such as ∟X: the calculator will realize that you did not intend to store to the real variable X because lists cannot be stored to a real variable. Certain commands, such as SetUpEditor, also allow for this optimization. Another optimization that is possible is storing to the element just past the end of the list. For example, if ∟X has 5 elements, storing to ∟X(6) is also allowed. This increases the size of ∟X to 6 elements, and then sets its 6th element as usual. The following is a standard construction to add an element to the end of a list: :(value)→∟X(1+dim(∟X  You can even store to the first element of a list that doesn't exist. Because there are no elements in the list, the calculator will first create a new element at the beginning of the list, and then assign it the value. This optimization works especially well when looping with a For( loop, since you can use the loop variable as the list index. # Advanced Uses Lists can be linked together in a way similar to an Excel spreadsheet using a quotation mark: :"2L₁→L₂  After running this code, modifying a value in L1 will cause the corresponding element in L2 to be updated accordingly. Modifying a value in L2 will break the link. Connected lists are indicated by a ♦ symbol in the list editor on the TI-84+, and by a small lock on the TI-84+CE. There is a computer application for the purpose of turning a BASIC program(s) into a Flash application. It is known as Basic Builder (BB for short). There are several pros and cons, so in the end, it is just a personal choice, and dependent on how large the programs are.  Pros: Your programs are compressed, allowing more programs in an app than regular archived programs It will be run from the archive People can't edit it (sometimes is a con) Apps look more professional Cons: If your program takes up very little space, it is a waste of archive to turn it into an app BB can only make single page applications (16384 bytes), so there is a limit to the size of your program(s). For games including programs that always remains in the archive memory and that are only copied into the RAM when needed (such as with Resource or xLIB app), you still need to keep these programs separate from the BasicBuilder app, which partially defeats its purpose. Picture files must be separate from the app if they are going to be used by Omnicalc, xLIB or Celtic III commands. Else, you will need to create installation code that is only ran the first time you run your program that will copy all pictures from BasicBuilder to the picture slots you want. You can't GOTO an error (sometimes good) You can't delete variables inside the app, although there is a workaround. # Using Basic Builder TO-DO: Add some screenshots of the steps to go along with the word instructions. These are step-by-step instructions on using Basic Builder. ## Obtaining Basic Builder and Other Equipment The most recent version of Basic Builder can be found here. You will need Wappsign to sign the app you create, which can be found with the 83+ Flash Debugger, which can be found here. ## Installation All you need to install is the Flash Debugger, so open that file and follow the installation instructions. ## Building the Application Hex The instructions for generating the hex are in the BB readme, steps 1~8, but I have the instructions below. 1. Ensure that all needed files (programs, subprograms, and pictures) are available. It is easier if they are in the same directory 2. Start up the BB executable 3. There are four fields on the right. Change 'Application name' to the name of your app, and 'Outputfile' to '<app name>.hex'. Leave the other two fields alone for now 4. Press the upper left button, the one with a sheet of paper and a green '+' To understand the next few things, you have to understand what BB actually does. It creates an app, that when started, will normally just execute the main program. However, if you want the user to be able to execute multiple things from the beginning, you can create multiple menu items. These will be shown in the format of the Menu( command. An example of this is a pack with several games that you want the user to choose from. You have several menu options and the user is free to decide which one. 1. After you pressed that button, you should have seen a field appear in the left. That is the menu entry for the horde of files you will now turn into some hex 2. Change that field from program name to the text that you want shown for that menu option when BB is started 3. Click 'Add program' on the right. Find your program. Do this over and over until you have all the necessary programs. Do the same for 'Add picture' 4. If you want more menu options, click the paper-and-plus button in the upper-left and repeat 5. Click 'Generate' in the lower-right You should now have a .hex file in the BB directory.=, along with a small pop-up giving how much space was saved/how much space is left. But you can't do anything with this hex file… Yet. ## Signing the Hexfile 1. Click on Start -> All programs -> TI-83 Plus Flash Debugger -> Wappsign 2. You should have a small program running, called Wappsign. There should be four check boxes on the right. Check the upper two and un-check the lower two. 3. On the right of the 'Application' field, there should be a '…' button. Click it. 4. Browse for your hexfile. 5. Click 'Sign'. Congratz! You should now have an application in the same directory as the hexfile! Assembly shells are programs that can be loaded onto your calculator and act as an interface for running other programs. They also provide extra functionality like giving access to key-hooks. This page provides you with code you can embed into TI-Basic programs to make them compatible with assembly shells.  Table of Contents # MirageOS MirageOS is currently the most common assembly shell. To make a TI-Basic program appear in the MirageOS menu, put a colon (":") as the first line of the program: :: :<program code...>  Optionally, you may include a description for the program: ::"<program description> :<program code...>  As a warning, there have been cases of MirageOS not running TI-Basic programs correctly; after the program finishes, the calculator will crash. # Doors CS Doors CS by Kerm Martian is the most recent assembly shell released. It offers the same functionality as MirageOS along with several other features, although it utilizes a mouse cursor and a different user interface. You can have Doors CS display a custom icon by adding one of the following to your programs: ::DCS :"<16 character hex code for 8x8 icon> or ::DCS6 :"<64 character hex code for 16x16 icon> or ::"<program description> ::DCS :"<16 character hex code for 8x8 icon> or ::"<program description> ::DCS6 :"<64 character hex code for 16x16 icon>  You can also have Doors CS not display your program (for small subroutines that you don't want users playing with): :Ans :<program code>  Kerm Martian has also released a version of Doors CS that is compatible with the TI-84+CSE. This shell operates in much the same way and has the same arguments for creating icons and preventing the display of programs. Doors CSE comes with the Celtic and EXLIBC. This shell can be found at cemetech.net or ticalc.org Doors CE is currently undergoing development. The last official update places Doors CE under the debugging stage. It will be similar to Doors CSE, but for the TI-84 CE. You can follow the development thread here. # Noshell Noshell (pronounced 'nosh-ell') is a flash application for running any program that appears in the program menu like you would a TI-Basic program. It will automatically run all programs. # CrunchyOS CrunchyOS is another common assembly shell. To make your TI-Basic program compatible with CrunchyOS, add a colon as its first line: :: :<program code>  # Other Shells The other assembly shells, especially the older ones, don't have an option to run TI-Basic programs; you just have to use the program menu instead. Ion is probably the most notable shell that doesn't run TI-Basic programs.  This article is part of the coding stage of the development cycle. At the beginning of a program, you typically setup everything that the program will use while it's running. Of course, there are lots of things that you may decide to include in your individual program setup, but the three main things that you should include are: the home screen, graph screen, and initializing variables. There are also some general, but crucial mode settings that should be taken care of. # General Settings There are some general mode setting that you'll want to pay attention to. Most of those should be what you want, but there is always a chance that a program forgot to switch back to the standards, or that the user was playing around with the calculator. In the mode menu, there are probably four different modes you need to worry about. These are numeric notation, decimal, real/complex mode, and screen display. ### Numeric Notation How numbers are displayed/returned: Normal, Scientific, and Engineering. Scientific will have one digit on the integer side, and Engineering will have two digits. The standard is Normal. ### Decimal In programs that use pinpoint precision numbers or require complex formulas or calculations, the number of decimals returned can greatly affect the program. Float will automatically adjust to the number of digits the calculator considers significant. Fix 1-9 will fix the calculator to display 1-9 digits, no matter what. This means that the calculator may sometimes give weird results such as 3.100000, or pi=3. ### Real/Complex Mode The default mode, Real, will give ERR:NONREAL ANS whenever a complex number is obtained as a result. If you want to use complex numbers, you should change this setting to a+bi or re^θi (the distinction between these two is only a display one). If you're going to be using complex numbers, you should switch away from Real mode. Otherwise, it's an inessential setting. Switching to Real mode doesn't have any real (he he) purpose to it, since it doesn't provide any extra functionality - unless of course you like it when your calculator throws errors. ### Screen Display This affects the screen display. Full is probably the one of the only ones you have ever seen. Horiz displays a horizontal split-screen, with the graph on top and home screen on bottom. G-T displays a vertical split-screen, with graph on left and table on right. The standard is Full. # Home Screen Since the home screen that your program uses is the same home screen that the rest of the calculator uses, the previous program call(s) and any other text is typically still displayed on the screen. Obviously, you don't want to be displaying text and have it interrupted by other text, so you need to clear the home screen. The ClrHome command is what you use. When using the ClrHome command, you simply place it on a line. The whole home screen will be cleared of any text; there's no way to clear a smaller portion of the ClrHome because it takes no arguments. :ClrHome  # Graph Screen The typical TI calculator user uses the graph screen to graph, which means they use axes, stat plots, Y= equations, and sometimes the grid. They might also like drawing things with the drawing commands or the Pen. However, while working in a game in use of the graph screen, you really do not want these functions to appear, which would completely mess up your program. First, you need to disable all these annoying thing by the following code: :ClrDraw // Clears the graph screen of all its contents :AxesOff // Disables X and Y axis scaling view :FnOff // Disable Y= equations :PlotsOff // Disables stat plots from appearing :GridOff // Disables grid from appearing  After that, you setup the window dimensions to use a friendly window. This not only makes drawing much easier, but it is faster and smaller. One way to do this is shown below: :0→Xmin:1→ΔX :0→Ymin:1→ΔY  # Initialize Variables If you have any important variables that you use in the main program loop, you should initialize them here, so the program will be able to use them and not have a delay. This is especially important with large variables (such as lists, matrices, and strings), since initializing those variables inside the main program loop will definitely have an impact on its speed. :{1,2,3,4→A :[[1,2][3,4→[A] :"1234→Str1  # Putting It All Together Putting all the parts of program setup together, here is a typical way to start a program: PROGRAM:SETUP :ClrHome :ClrDraw :AxesOff :FnOff :PlotsOff :GridOff :0→Xmin:1→ΔX :0→Ymin:1→ΔY :{1,2,3,4→A :[[1,2][3,4→[A] :"1234→Str1  Of course, you only have to include the things that you actually use. If you don't have any important variables to initialize, then simply leave that off. In the same fashion, you don't have to clear the clear the home screen if your program just runs on the graph screen. Command Summary Performs a z-test to compare two proportions. Command Syntax 2-PropZTest(x1, n1, x2, n2, //draw?// Menu Location While editing a program, press: 1. STAT to access the statistics menu 2. LEFT to access the TESTS submenu 3. 6 to select 2-PropZTest, or use arrows (outside the program editor, this will select the 2-PropZTest… interactive solver) TI-83/84/+/SE 2 bytes 2-PropZTest performs an z-test to compare two population proportions. This test is valid for sufficiently large samples: only when the number of successes (x in the command syntax) and the number of failures (n-x) are both >5, for both populations. The logic behind the test is as follows: we want to test the hypothesis that the proportions are equal (the null hypothesis). To do this, we assume that this "null hypothesis" is true, and calculate the probability that the differences between the two proportions occurred, under this assumption. If this probability is sufficiently low (usually, 5% is the cutoff point), we conclude that since it's so unlikely that the data could have occurred under the null hypothesis, the null hypothesis must be false, and therefore the proportions are not equal. If, on the other hand, the probability is not too low, we conclude that the data may well have occurred under the null hypothesis, and therefore there's no reason to reject it. Commonly used notation has the letters π1 and π2 being used for the true population proportions (making the null hypothesis be π12). TI must have been afraid that this would be confused with the real number π, so on the calculator, "p1" and "p2" are used everywhere instead. In addition to the null hypothesis, we must have an alternative hypothesis as well - usually this is simply that the proportions are not equal. However, in certain cases, our alternative hypothesis may be that one proportion is greater or less than the other. The arguments to 1-PropZTest( are as follows: • x1 - the success count in the first sample • n1 - the total size of the first sample (so the sample proportion would be x1/n1) • x2 - the success count in the second sample • n2 - the total size of the second sample (so the sample proportion would be x2/n2) • alternative (optional if you don't include draw?) - determines the alternative hypothesis • 0 (default value) - p1≠p2 • -1 (or any negative value) - p1<p2 • 1 (or any positive value) - p1>p2 • draw? (optional) set this to 1 if you want a graphical rather than numeric result Although you can access the 1-PropZTest command on the home screen, via the catalog, there's no need: the 1-PropZTest… interactive solver, found in the statistics menu, is much more intuitive to use - you don't have to memorize the syntax. In either case, it's important to understand the output of 1-PropZTest. Here are the meanings of each line: • The first line, involving p1 and p2, is the alternative hypothesis. • z is the test statistic. If the null hypothesis is true, it should be close to 0. • p is the probability that the difference between the two proportions would occur if the null hypothesis is true. When the value is sufficiently small, we reject the null hypothesis and conclude that the alternative hypothesis is true. You should have a cutoff value ready, such as 5% or 1%. If p is lower, you "reject the null hypothesis on a 5% (or 1%) level" in technical terms. • p-hat1 is the sample proportion x1/n1. • p-hat2 is the sample proportion x2/n2. • p-hat is the total sample proportion • n1 is the first sample size. • n2 is the second sample size. # Advanced Uses The final optional argument of 2-PropZTest, draw?, will display the results in a graphical manner if you put in "1" for it. The calculator will draw the standard normal distribution, and shade the area of the graph that corresponds to the probability p. In addition, the value of z and the value of p will be displayed. You would make your conclusions in the same way as for the regular output. # Optimization Some of the arguments of the 2-PropZTest command have default values, and the argument can be omitted if this value is used. • The draw? argument can be omitted if you don't want graphical output, although you could put "0" in as well. • If the above argument is omitted, and you're doing a two sided test, you may omit the alternative argument. Example: :2-PropZTest(22,50,48,100,0,0 can be :2-PropZTest(22,50,48,100  # Related Commands Command Summary Performs a z-test on a proportion. Command Syntax 1-PropZTest(p0, x, n[, alternative, draw?] ) Menu Location While editing a program, press: 1. STAT to access the statistics menu 2. LEFT to access the TESTS submenu 3. 5 to select 1-PropZTest, or use arrows (outside the program editor, this will select the 1-PropZTest… interactive solver) TI-83/84/+/SE 2 bytes 1-PropZTest performs an z-test to compare a population proportion to a hypothesis value. This test is valid for sufficiently large samples: only when the number of successes (x in the command syntax) and the number of failures (n-x) are both >5. The logic behind the test is as follows: we want to test the hypothesis that the true proportion is equal to some value p0 (the null hypothesis). To do this, we assume that this "null hypothesis" is true, and calculate the probability that the (usually, somewhat different) actual proportion occurred, under this assumption. If this probability is sufficiently low (usually, 5% is the cutoff point), we conclude that since it's so unlikely that the data could have occurred under the null hypothesis, the null hypothesis must be false, and therefore the true proportion is not equal to p0. If, on the other hand, the probability is not too low, we conclude that the data may well have occurred under the null hypothesis, and therefore there's no reason to reject it. Commonly used notation has the letter π being used for the true population proportion (making the null hypothesis be π=p0). TI must have been afraid that this would be confused with the real number π, so on the calculator, "prop" is used everywhere instead. In addition to the null hypothesis, we must have an alternative hypothesis as well - usually this is simply that the proportion is not equal to p0. However, in certain cases, our alternative hypothesis may be that the proportion is greater or less than p0. The arguments to 1-PropZTest( are as follows: • p0 - the value for the null hypothesis (the proportion you're testing for) • x - the success count in the sample • n - the total size of the sample (so the sample proportion would be x/n) • alternative (optional if you don't include draw?) - determines the alternative hypothesis • 0 (default value) - prop≠p0 • -1 (or any negative value) - prop<p0 • 1 (or any positive value) - prop>p0 • draw? (optional) set this to 1 if you want a graphical rather than numeric result Although you can access the 1-PropZTest command on the home screen, via the catalog, there's no need: the 1-PropZTest… interactive solver, found in the statistics menu, is much more intuitive to use - you don't have to memorize the syntax. In either case, it's important to understand the output of 1-PropZTest. Here are the meanings of each line: • The first line, involving "prop" and p0, is the alternative hypothesis. • z is the test statistic. If the null hypothesis is true, it should be close to 0. • p is the probability that the difference between the proportion and p0 would occur if the null hypothesis is true. When the value is sufficiently small, we reject the null hypothesis and conclude that the alternative hypothesis is true. You should have a cutoff value ready, such as 5% or 1%. If p is lower, you "reject the null hypothesis on a 5% (or 1%) level" in technical terms. • p-hat is the sample proportion, x/n. • n is the sample size. # Advanced Uses The final optional argument of 1-PropZTest, draw?, will display the results in a graphical manner if you put in "1" for it. The calculator will draw the standard normal distribution, and shade the area of the graph that corresponds to the probability p. In addition, the value of z and the value of p will be displayed. You would make your conclusions in the same way as for the regular output. # Optimization Some of the arguments of the 1-PropZTest command have default values, and the argument can be omitted if this value is used. • The draw? argument can be omitted if you don't want graphical output, although you could put "0" in as well. • If the above argument is omitted, and you're doing a two sided test, you may omit the alternative argument. Example: :1-PropZTest(.5,22,50,0,0 can be :1-PropZTest(.5,22,50  # Error Conditions • ERR:DOMAIN is thrown if p0 or x/n are not between 0 and 1, or x is negative or greater than n (however, any real value for alternative and draw? will work) # Related Commands Command Summary Performs a F-test to compare the standard deviations of two populations. Command Syntax 2-SampFTest [list1, list2, frequency1, frequency2, alternative,draw?] (data list input) 2-SampFTest s1, n1, s2, n2, [alternative,draw?] (summary stats input) Menu Location While editing a program, press: 1. STAT to access the statistics menu 2. LEFT to access the TESTS submenu 3. ALPHA D to select 2-SampFTest, or use arrows Outside the program editor, this will select the 2-SampFTest… interactive solver. Change the last keypress to ALPHA E on a TI-84+/SE with OS 2.30 or higher. TI-83/84/+/SE 2 bytes 2-SampFTest performs an F-test to compare the standard deviations of two populations. This test is valid for two normally distributed populations, but is extremely sensitive to non-normality, so it should not be used unless you are certain that the populations are normal. The logic behind the test is as follows: we want to test the hypothesis that the standard deviations of the two populations are equal (the null hypothesis). The letter σ is used for a standard deviation, so this is usually written as σ12. To do this, we assume that this "null hypothesis" is true, and calculate the probability that the difference between the two standard deviations occurred, under this assumption. If this probability is sufficiently low (usually, 5% is the cutoff point), we conclude that since it's so unlikely that the data could have occurred under the null hypothesis, the null hypothesis must be false, and therefore the deviations are not equal. If, on the other hand, the probability is not too low, we conclude that the data may well have occurred under the null hypothesis, and therefore there's no reason to reject it. In addition to the null hypothesis, we must have an alternative hypothesis as well - usually this is simply that the two standard deviations are not equal. However, in certain cases when we have reason to suspect that one deviation is greater than the other (such as when we are trying to verify a claim that one standard deviation is greater), our alternative hypothesis may be that the first standard deviation is greater than the second (σ12) or less (σ12). As for the 2-SampFTest command itself, there are two ways of calling it: you may give it a list of all the sample data, or the necessary statistics about the list (s1 and s2 the sample standard deviations, and n1 and n2 the sample sizes). In either case, you can indicate what the alternate hypothesis is, by a value of 0, -1, or 1 for the alternative argument. 0 indicates a two-sided hypothesis of σ1σ2, -1 indicates σ1<σ2, and 1 indicates μ1>μ2. (In fact, the calculator will treat any negative value as -1, and any positive value as 1). Although you can access the 2-SampFTest command on the home screen, via the catalog, there's no need: the 2-SampFTest… interactive solver, found in the statistics menu, is much more intuitive to use - you don't have to memorize the syntax. In either case, it's important to understand the output of 2-SampFTest. Here are the meanings of each line: • The first line, involving σ1 and σ2, is the alternative hypothesis. • F is the test statistic, the ratio of the standard deviations. If the null hypothesis is true, it should be close to 1. • p is the probability that the difference between σ1 and σ2 (the two standard deviations) would occur if the null hypothesis is true. When the value is sufficiently small, we reject the null hypothesis and conclude that the alternative hypothesis is true. You should have a cutoff value ready, such as 5% or 1%. If p is lower, you "reject the null hypothesis on a 5% (or 1%) level" in technical terms. • Sx1 and Sx2 are the two sample standard deviations. • x-bar1 and x-bar2 are the two sample means. They aren't used in the calculation, and will only be shown with the data list syntax. • n1 and n2 are the sample sizes. # Advanced Uses The final optional argument of 2-SampFTest, draw?, will display the results in a graphical manner if you put in "1" for it. The calculator will draw the distribution, and shade the area of the graph that corresponds to the probability p. In addition, the value of F and the value of p will be displayed. You would make your conclusions in the same way as for the regular output. As with most other statistical commands, you may use frequency lists in your input (when using the data list syntax). If you do, then both lists must have frequencies, and the order of the arguments would be list1, list2, frequency1, frequency2. # Optimization Some of the arguments of the 2-SampFTest command have default values, and the argument can be omitted if this value is accepted. • The draw? argument can be omitted if you don't want graphical output, although you could put "0" in as well. • If the above argument is omitted, and you're doing a two sided test, you may omit the alternative argument. • With data list input, you can always omit the frequency lists if you won't be using them. • With data list input, if the flags that go at the end are omitted, and you're using the default lists L1 and L2, you may omit those as well. Example: :2-SampFTest L1,L2,0 can be :2-SampFTest  # Related Commands Command Summary Performs a t significance test to compare the means of two populations. Command Syntax 2-SampTTest [list1, list2, frequency1, frequency2, alternative, pooled? draw?] (data list input) 2-SampTTest x1, s1, n1, x2, s2, n2, [alternative, pooled?, draw?] (summary stats input) Menu Location While editing a program, press: 1. STAT to access the statistics menu 2. LEFT to access the TESTS submenu 3. 4 to select 2-SampTTest, or use arrows (outside the program editor, this will select the 2-SampTTest… interactive solver) TI-83/84/+/SE 2 bytes 2-SampTTest performs a t significance test to compare the means of two populations. This test is valid for simple random samples from populations with unknown standard deviations. In addition, either the populations must be normally distributed, or the sample sizes have to be sufficiently large (usually, greater than 10). The logic behind the test is as follows: we want to test the hypothesis that the true means of the two populations are equal (the null hypothesis). The letter μ is used for a population mean, so this is usually written as μ12. To do this, we assume that this "null hypothesis" is true, and calculate the probability that the difference between the two means occurred, under this assumption. If this probability is sufficiently low (usually, 5% is the cutoff point), we conclude that since it's so unlikely that the data could have occurred under the null hypothesis, the null hypothesis must be false, and therefore the means are not equal. If, on the other hand, the probability is not too low, we conclude that the data may well have occurred under the null hypothesis, and therefore there's no reason to reject it. In addition to the null hypothesis, we must have an alternative hypothesis as well - usually this is simply that the two means are not equal. However, in certain cases when we have reason to suspect that one mean is greater than the other (such as when we are trying to verify a claim that one mean is greater), our alternative hypothesis may be that the first mean is greater than the second (μ12) or less (μ12). As for the 2-SampTTest command itself, there are two ways of calling it: you may give it a list of all the sample data, or the necessary statistics about the list (x1 and x2 are the sample means, s1 and s2 the sample standard deviations, and n1 and n2 the sample sizes). In either case, you can indicate what the alternate hypothesis is, by a value of 0, -1, or 1 for the alternative argument. 0 indicates a two-sided hypothesis of μ1μ2, -1 indicates μ1<μ2, and 1 indicates μ1>μ2. (In fact, the calculator will treat any negative value as -1, and any positive value as 1). Although you can access the 2-SampTTest command on the home screen, via the catalog, there's no need: the 2-SampTTest… interactive solver, found in the statistics menu, is much more intuitive to use - you don't have to memorize the syntax. In either case, it's important to understand the output of 2-SampTTest. Here are the meanings of each line: • The first line, involving μ1 and μ2, is the alternative hypothesis. • t is the test statistic, the standardized difference between the means. If the null hypothesis is true, it should be close to 0. • p is the probability that the difference between μ1 and μ2 (the two means) would occur if the null hypothesis is true. When the value is sufficiently small, we reject the null hypothesis and conclude that the alternative hypothesis is true. You should have a cutoff value ready, such as 5% or 1%. If p is lower, you "reject the null hypothesis on a 5% (or 1%) level" in technical terms. • x-bar1 and x-bar2 are the two sample means. • Sx1 and Sx2 are the two sample standard deviations. • n1 and n2 are the sample sizes. # Sample Problem Your school claims that the average SAT score of students at the school is higher than at a rival school. You took samples of SAT scores from students at both schools (and stored them to L1 and L2). Since the school's claim is that your school's score is higher, that will be your alternative hypothesis (μ1>μ2), which corresponds to a value of 1. The code you'd use is: :2-SampTTest L1,L2,1  Alternatively, you could calculate the mean, standard deviation, and size of your samples, and put those into the command instead. Suppose you obtained SAT scores from 60 students at your school and 40 students at the rival school, the means were 1737 and 1623, and the standard deviation 211 and 218. Then your code is: :2-SampTTest 1737,211,60,1623,218,40,1  You will see the following output: 2-SampTTest μ1>μ2 z=2.594854858 p=.0056059824 x1=1737 x2=1623 Sx1=211 Sx2=218 n1=60 n2=40  The most important part of this output is "p=.0056059824". This value of p is smaller than 1% or 0.01. This is significant on the 1% level, so we reject the null hypothesis and conclude that the alternative hypothesis is true: μ12, that is, your school's average SAT score is indeed higher. # Advanced Uses The final optional argument of 2-SampTTest, draw?, will display the results in a graphical manner if you put in "1" for it. The calculator will draw the distribution, and shade the area of the graph beyound the t statistic. In addition, the value of t and the value of p will be displayed (the value of p corresponds to the shaded area). You would make your conclusions in the same way as for the regular output. The optional argument pooled?, if given a nonzero value, will pool the standard deviations to find a combined value which will then be used for both populations. Use this feature if you have reason to believe that the two populations have the same standard deviation. As with most other statistical commands, you may use a frequency list in your input (when using the data list syntax). If you do, then both lists must have frequencies, and the order of the arguments would be list1, list2, frequency1, frequency2. # Optimization Some of the arguments of the 2-SampTTest command have default values, and the argument can be omitted if this value is accepted. • The draw? argument can be omitted if you don't want graphical output, although you could put "0" in as well. • If the draw? argument is omitted, you can omit the pooled? argument if you do not want your standard deviations pooled. • If both the above arguments are omitted, and you're doing a two sided test, you may omit the alternative argument. • With data list input, you can always omit the frequency lists if you won't be using them. • With data list input, if the flags that go at the end are omitted, and you're using the default lists L1 and L2, you may omit those as well. The code in the sample problem above can't be optimized, because the alternative argument is 1: :2-SampTTest L1,L2,1  However, if we were doing a two-sided test, we could omit the alternative argument as well as the lists: :2-SampTTest L1,L2,0 can be just :2-SampTTest  # Related Commands Command Summary Performs a z significance test to compare the means of two populations. Command Syntax 2-SampZTest(σ1, σ2 //list2//, //frequency1//, //frequency2//, //alternative//, //draw?// (data list input) 2-SampZTest(σ1, σ2 x1, n1, x2, n2, //draw?// (summary stats input) Menu Location While editing a program, press: 1. STAT to access the statistics menu 2. LEFT to access the TESTS submenu 3. 3 to select 2-SampZTest(, or use arrows (outside the program editor, this will select the 2-SampZTest… interactive solver) TI-83/84/+/SE 2 bytes 2-SampZTest( performs a z significance test to compare the means of two populations. This test is valid for simple random samples from populations with known standard deviations. In addition, either the populations must be normally distributed, or the sample sizes have to be sufficiently large (usually, greater than 10). The logic behind the test is as follows: we want to test the hypothesis that the true means of the two populations are equal (the null hypothesis). The letter μ is used for a population mean, so this is usually written as μ12. To do this, we assume that this "null hypothesis" is true, and calculate the probability that the difference between the two means occurred, under this assumption. If this probability is sufficiently low (usually, 5% is the cutoff point), we conclude that since it's so unlikely that the data could have occurred under the null hypothesis, the null hypothesis must be false, and therefore the means are not equal. If, on the other hand, the probability is not too low, we conclude that the data may well have occurred under the null hypothesis, and therefore there's no reason to reject it. In addition to the null hypothesis, we must have an alternative hypothesis as well - usually this is simply that the two means are not equal. However, in certain cases when we have reason to suspect that one mean is greater than the other (such as when we are trying to verify a claim that one mean is greater), our alternative hypothesis may be that the first mean is greater than the second (μ12) or less (μ12). As for the 2-SampZTest( command itself, there are two ways of calling it: after giving the two standard deviations, you may give it a list of all the sample data, or the necessary statistics about the list (x1 and x2 are the sample means, and n1 and n2 are the sample sizes). In either case, you can indicate what the alternate hypothesis is, by a value of 0, -1, or 1 for the alternative argument. 0 indicates a two-sided hypothesis of μ1μ2, -1 indicates μ1<μ2, and 1 indicates μ1>μ2. (In fact, the calculator will treat any negative value as -1, and any positive value as 1). Although you can access the 2-SampZTest( command on the home screen, via the catalog, there's no need: the 2-SampZTest… interactive solver, found in the statistics menu, is much more intuitive to use - you don't have to memorize the syntax. In either case, it's important to understand the output of 2-SampZTest. Here are the meanings of each line: • The first line, involving μ1 and μ2, is the alternative hypothesis. • z is the test statistic, the standardized difference between the means. If the null hypothesis is true, it should be close to 0. • p is the probability that the difference between μ1 and μ2 (the two means) would occur if the null hypothesis is true. When the value is sufficiently small, we reject the null hypothesis and conclude that the alternative hypothesis is true. You should have a cutoff value ready, such as 5% or 1%. If p is lower, you "reject the null hypothesis on a 5% (or 1%) level" in technical terms. • x-bar1 and x-bar2 are the two sample means. • n1 and n2 are the sample sizes. # Sample Problem Your school claims that the average SAT score of students at the school is higher than at a rival school. You took samples of SAT scores from students at both schools (and stored them to L1 and L2). Although you didn't know the standard deviations, you decided to use the value 200 that you found online as an estimate. You now have all the data. You're assuming σ1 and σ2 are both 200; the two data lists are L1 and L2. Since the school's claim is that your school's score is higher, that will be your alternative hypothesis (μ1>μ2), which corresponds to a value of 1. The code you'd use is: :2-SampZTest(200,200,L1,L2,1  Alternatively, you could calculate the mean and sample size of your sample, and put those into the command instead. Suppose you obtained SAT scores from 60 students at your school and 40 students at the rival school, and that the means were 1737 and 1623. Then your code is: :2-SampZTest(200,200,1737,60,1623,40,1  You will see the following output: Z-Test μ1>μ2 z=2.792418307 p=.0026158434 x1=1737 x2=1623 n1=60 n2=40  The most important part of this output is "p=.0026158434". This value of p is much smaller than 1% or 0.01. This is significant on the 1% level, so we reject the null hypothesis and conclude that the alternative hypothesis is true: μ12, that is, your school's average SAT score is indeed higher. # Advanced Uses The final argument of 2-SampZTest(, draw?, will display the results in a graphical manner if you put in "1" for it. The calculator will draw the standard normal curve, and shade the area of the graph beyond the z statistic. In addition, the value of z and the value of p will be displayed (the value of p corresponds to the shaded area). You would make your conclusions in the same way as for the regular output. As with most other statistical commands, you may use a frequency list in your input (when using the data list syntax). If you do, then both lists must have frequencies, and the order of the arguments would be list1, list2, frequency1, frequency2. # Optimization Most of the arguments of the 2-SampZTest( command have default values, and the argument can be omitted if this value is accepted. • The draw? argument can be omitted if you don't want graphical output, although you could put "0" in as well. • If the draw? argument is omitted, you can omit the alternative argument to use a two-sided test (μ1μ2). If you include the draw? argument, you have to include this - otherwise there will be confusion as to what the 5th argument means. • With data list input, you can always omit the frequency lists if you won't be using them. • With data list input, if the draw? and alternative arguments are omitted, and your data is in L1 and L2 (and you're not using frequency lists), you may omit L1 and L2 - those are default parameters. However, if alternative or draw? is present, you have to include it, or else the syntax may be confused with the syntax for summary stats input. The code in the sample problem above can't be optimized, because the alternative argument is 1: :2-SampZTest(200,200,L1,L2,1  However, if we were doing a two-sided test, we could omit the alternative argument as well as the lists: :2-SampZTest(200,200,L1,L2,0 can be :2-SampZTest(200,200  # Related Commands Command Summary Computes a Z confidence interval of the difference between two proportions. Command Syntax 2-PropZInt(x1, n1, x2, n2, level// Menu Location When editing a program, press: 1. STAT to access the statistics menu 2. LEFT to access the TESTS submenu 3. ALPHA B to select 2-PropZInt(, or use arrows (this key sequence will give you the 2-PropZInt… screen outside a program) TI-83/84/+/SE 2 bytes The 2-PropZInt( command calculates a confidence interval for the difference between two proportions, at a specific confidence level: for example, if the confidence level is 95%, you are 95% certain that the difference lies within the interval you get. The command assumes that the sample is large enough that the normal approximation to binomial distributions is valid: this is true if, in both samples involved, the positive and negative counts are both >5. The 1-PropZInt( command takes 5 arguments. The first two, x1 and n1 are the positive count and total count in the first sample (so the estimated value of the first proportion is x1 out of n1. The next two arguments, x2 and n2, are the positive count and total count in the second sample. The output gives you a confidence interval of the form (a,b), which is the range of values for the difference π12 (where π1 and π2 are the first and second proportions respectively). If you were looking for the difference π21 all you have to do is switch two sides and negate the numbers in the interval. # Sample Problem You want to compare the proportion of students at your school and at a friend's school. that support a particular political candidate. You take a random sample of 50 students, and find that 22 of them support that candidate. Your friend took a random sample of 75 students at his school, and found that 28 supported the candidate. The first proportion is the proportion of supporters at your school. 22 out of 50 students support the candidate, so x1=22 and n1=50. The second proportion is the proportion of supporters at your friend's school. 28 out of 75 students support the candidate, so x2=28 and n2=75. If you decided to do a 95% confidence interval, you would add the argument 95 after all these, so the syntax would be as follows: :2-PropZInt(22,50,28,75,95 which can also be :2-PropZInt(22,50,28,75,.95  The output if you run the above code will look approximately like this: 1-PropZInt (-.1092,.24249) p1=.44 p2=.3733333333 n1=50 n2=75  This tells you that between about the difference betwen the proportions is between about -0.11 (your school's proportion being about 0.11 less than your friend's school's proportion) to about 0.24 (your school's proportion being about 0.24 greater than your friend's school's proportion). # Optimization If the confidence level is 95%, you can omit the final 95, since that is the default value: :2-PropZInt(22,50,28,75,95 can be :2-PropZInt(22,50,28,75  # Error Conditions • ERR:DOMAIN is thrown if either proportion is not between 0 and 1, or xi is negative or greater than ni, or the confidence level is negative or at least 100. # Related Commands Command Summary Computes a Z confidence interval of a proportion. Command Syntax 1-PropZInt(x, n[, confidence level]) Menu Location When editing a program, press: 1. STAT to access the statistics menu 2. LEFT to access the TESTS submenu 3. ALPHA A to select 1-PropZInt(, or use arrows (this key sequence will give you the 1-PropZInt… screen outside a program) TI-83/84/+/SE 2 bytes The 1-PropZInt( command calculates a confidence interval for a proportion, at a specific confidence level: for example, if the confidence level is 95%, you are 95% certain that the proportion lies within the interval you get. The command assumes that the sample is large enough that the normal approximation to binomial distributions is valid: this is true if, in the sample you take, the positive and negative counts are both >5. The 1-PropZInt( command takes 3 arguments. The first, x, is the positive count in the sample. The second, n, is the total size of the sample. (So the sample proportion is equal to x out of n). The third argument is the confidence level, which defaults to 95. The output gives you a confidence interval of the form (a,b), meaning that the true proportion π is most likely in the range a<π<b, and the value of x/n. # Sample Problem You want to know the proportion of students at your school that support a particular political candidate. You take a random sample of 50 students, and find that 22 of them support that candidate. 22, the positive count, and 50-22=28, the negative count, are both >5, so the assumption is satisfied. Using 22 for x, and 50 for n, you decide to find a 95% confidence interval. The syntax for that is: :1-PropZInt(22,50,95 which can also be :1-PropZInt(22,50,.95  The output if you run the above code will look approximately like this: 1-PropZInt (.30241,.57759) p=.44 n=50  This tells you that between about 30.2% and about 57.8% of the students at your school are in support of the political candidate. # Optimization If the confidence level is 95%, you can omit the final 95, since that is the default value: :1-PropZInt(22,50,95 can be :1-PropZInt(22,50  # Error Conditions • ERR:DOMAIN is thrown if the sample proportion is not between 0 and 1, any argument is negative, or the confidence level is 100 or more. # Related Commands Command Summary Using either already-calculated statistics, or two data sets, computes a T confidence interval for the difference between two sample means. Command Syntax 2-SampTInt list1, list2, [frequency1], [frequency2], [confidence level, pooled] (data list input) 2-SampTInt x1, s1, n1, x2, s2, n2, [confidence level, pooled] (summary stats input) Menu Location When editing a program, press: 1. STAT to access the statistics menu 2. LEFT to access the TESTS submenu 3. 0 to select 2-SampTInt, or use arrows (this key sequence will give you the 2-SampTInt… screen outside a program) TI-83/84/+/SE 2 bytes The 2-SampTInt command uses the techniques of T Intervals to compute an interval for the difference between the means of two independent populations, at a specified confidence level. Use 2-SampTInt( when you have two independent variables to compare, and you don't know their standard deviations. The 2-SampTInt command assumes that both your variables are normally distributed, but it will work for other distributions if the sample size is large enough. There are two ways to call this command: by supplying it with needed sample statistics (mean, standard deviation, and sample size, for both data sets), or by entering two lists and letting the calculator work the statistics out. In either case, you will need to enter the desired confidence level as well. In the summary stats syntax, x1 and x2 the two sample means, s1 and s2 are the two sample standard deviations, and n1 and n2 the two sample sizes. The output will contain an open interval (a, b) that is your answer: the difference between the two means will lie in this interval. Specifically, it is the second mean subtracted from the first - μ12. If you're interested in the reverse difference, just flip the signs on the interval. Tip: don't use this command in a matched-pairs setting when you can match the two samples up by units or subjects. Instead, take the difference between the two samples in each matched pair, and use a regular TInterval. # Sample Problem You want to compare the average height of a freshman and a senior at your school. You haven't asked everyone, but you took a random sample of 40 people from each class and found out their heights (and stored them to L1 and L2). You've decided to use a 95% confidence interval. Based on the data list syntax for a 2-SampTInt, here is your code: :2-SampTInt L1,L2,95 you can also use :2-SampTInt L1,L2,.95  Alternatively, you could calculate the mean and sample size and enter those instead. The sample size in this case is 40 for both data sets; let's say the means were 57 inches and 67 inches and the standard deviations 5.2 and 7.1 inches. You now have all the needed statistics: • x1 is the mean height of freshmen: 57 inches • s1 is the sample standard deviation for freshmen: 5.2 inches • n1 is the number of freshmen in the sample: 40 • x2 is the mean height of seniors: 67 inches • s2 is the sample standard deviation for seniors: 7.1 inches • n2 is the number of seniors in the sample: 40 This means that the code is: :2-SampTInt 57,5.2,40,67,7.1,40,95 you can also use :2-SampTInt 57,5.2,40,67,7.1,40,.95  Of course, the main use of the 2-SampTInt command is in a program. While you can enter the command on the home screen as well (just look in the catalog for it), it would probably be easier to select 2-SampTInt… from the STAT>TEST menu (see the sidebar), since you don't have to remember the syntax. # Advanced Uses As with most other statistical commands, you can add frequencies to the lists (only with the data list syntax, of course); if you do, both lists must have frequencies, and the arguments go in the order first data list, second data list, first freq. list, second freq. list. Each frequency list must contain non-negative real numbers, which can't be all 0. There is a final argument to 2-SampTInt: pooled. It can be either 0 or 1 (although any argument that isn't 0 will get treated as a 1); the default value is 0. If the value is 1, then then the variances will be pooled: that is, the calculator will assume that the variances of the two populations are equal, and use a combined form of the two standard deviations in place of each population's individual standard deviation. Set this flag if you have reason to believe that the standard deviations are equal. # Optimization Using the data list syntax, all items are optional: the calculator will assume you want to use L1 and L2 for your data unless other lists are supplied, and that the confidence level you want is 95% unless you give another one. Using the summary stats syntax, the confidence level is also optional - again, the calculator will assume 95%. This means we can rewrite our code above in a simpler manner: :2-SampTInt L1,L2,95 can be :2-SampTInt  :2-SampTInt 57,5.2,40,67,7.1,40,95 can be :2-SampTInt 57,5.2,40,67,7.1,40  # Related Commands Command Summary Calculates the best fit line through a set of points, then uses a significance test on the slope of the line. Command Syntax LinRegTTest [x-list, y-list, [frequency], [alternative], [equation] Menu Location Press: 1. STAT to access the statistics menu 2. RIGHT to access the TESTS submenu 3. ALPHA E to select LinRegTTest, or use arrows Change the last keypress to ALPHA F on a TI-84+/SE with OS 2.30 or higher. TI-83/84/+/SE 2 bytes Like LinReg(ax+b) and similar commands, LinRegTTest finds the best fit line through a set of points. However, LinRegTTest adds another method of checking the quality of the fit, by performing a t-test on the slope, testing the null hypothesis that the slope of the true best fit line is 0 (which implies the absence of correlation between the two variables, since a relation with a slope of zero means the x-variable does not affect the y-variable at all). If the p-value of the test is not low enough, then there is not enough data to assume a linear relation between the variables. To use LinRegTTest, you must first store the points to two lists: one of the x-coordinates and one of the y-coordinates, ordered so that the nth element of one list matches up with the nth element of the other list. L₁ and L₂ are the default lists to use, and the List Editor (STAT > Edit…) is a useful window for entering the points. In its simplest form, LinRegTTest takes no arguments, and calculates a best fit line through the points in L₁ and L₂: :{9,13,21,30,31,31,34→L₁ :{260,320,420,530,560,550,590→L₂ :LinRegTTest  The output will look as follows: LinRegTTest y=a+bx β≠0 and ρ≠0 t=53.71561274 p=4.2285344e-8 df=5 a=145.3808831 b=13.09073265 s=5.913823968 r²=.9982701159 r=.9991346836  (the last two lines will only appear if diagnostics have been turned on - see DiagnosticOn) • β and ρ: this line represents the alternative hypothesis. β is the true value of the statistic b (it is what we would get if the regression was done on the entire population, rather than a sample); ρ is the true value of the statistic r. • t is the test statistic, used to calculate p. • p is the probability that we'd get a correlation this strong by chance, assuming the null hypothesis that there is no actual correlation. When it's low, as here, this is evidence against the null hypothesis. Since p<.01, the data is significant on a 1% level, so we reject the null hypothesis and conclude that there is a correlation. • df is the degrees of freedom, equal to the number of points minus two • a and b are the parameters of the equation y=a+bx, the regression line we've calculated • s is the standard error about the line, a measure of the typical size of a residual (the numbers stored in ∟RESID). It is the square root of the sum of squares of the residuals divided by the degrees of freedom. Smaller values indicate that the points tend to be close to the fitted line, while large values indicate scattering. • r² and r are respectively the coefficients of determination and correlation: a value near 1 or -1 for the former, and near 1 for the latter, indicates a good fit. You do not have to do the regression on L₁ and L₂, but if you don't you'll have to enter the names of the lists after the command. For example: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :LinRegTTest ∟FAT,∟CALS  You can attach frequencies to points, for when a point occurs more than once, by supplying an additional argument - the frequency list. This list does not have to contain integer frequencies. If you add a frequency list, you must supply the names of the x-list and y-list as well, even when they are L₁ and L₂. You can add the alternative argument to change the alternative hypothesis from the default (β≠0 and ρ≠0). This is used when you have prior knowledge either that a negative relation is impossible, or that a positive one is impossible. The values of the alternative argument are as follows: • negative: the alternative hypothesis is β<0 and ρ<0 (we have prior knowledge that there can be no positive relation) • 0: the alternative hypothesis is β≠0 and ρ≠0 (we have no prior knowledge) • positive: the alternative hypothesis is β>0 and ρ>0 (we have prior knowledge that there can be no negative relation) Obviously, if you want the alternative hypothesis to be β≠0 and ρ≠0, the default, you don't need to supply this argument. However, if you do, you must enter the names of the lists as well, even if they're L₁ and L₂. Finally, you can enter an equation variable (such as Y₁) after the command, so that the line of best fit is stored to this equation automatically. This doesn't require you to supply the names of the lists, but if you do, the equation variable must come last. You can use polar, parametric, or sequential variables as well, but since the line of best fit will be in terms of X anyway, this doesn't make much sense. An example of LinRegTTest with all the optional arguments: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :{2,1,1,1,2,1,1→FREQ :LinRegTTest ∟FAT,∟CALS,∟FREQ,1,Y₁  # Related Commands Command Summary Using either already-calculated statistics, or two data sets, computes a Z confidence interval for the difference between two sample means. Command Syntax 2-SampZInt(σ1, σ2, [list1, list2, [frequency1], [frequency2], [confidence level] (data list input) 2-SampZInt(σ1, σ2, x1, n1, x2, n2, level// (summary stats input) Menu Location When editing a program, press: 1. STAT to access the statistics menu 2. LEFT to access the TESTS submenu 3. 9 to select 2-SampZInt(, or use arrows (this key sequence will give you the 2-SampZInt… screen outside a program) TI-83/84/+/SE 2 bytes The 2-SampZInt( command uses the techniques of Z Intervals to compute an interval for the difference between the means of two independent populations, at a specified confidence level. Use 2-SampZInt( when you have two independent variables to compare, and you already know their standard deviations. The 2-SampZInt( command assumes that both variables are distributed normally, but it will work for other distributions if the sample size is large enough. There are two ways to call this command: by supplying it with needed sample statistics (mean and sample size, for both data sets), or by entering two lists and letting the calculator work the statistics out. In either case, you will need to enter the standard deviation and desired confidence level as well. In the data list syntax, σ1 and σ2 are the two standard deviations. In the summary stats syntax, σ1 and σ2 are the two standard deviations, x1 and x2 the two sample means, and n1 and n2 the two sample sizes. The output will contain an open interval (a, b) that is your answer: the difference between the two means will lie in this interval. Specifically, it is the second mean subtracted from the first - μ12. If you're interested in the reverse difference, just flip the signs on the interval. Tip: don't use this command in a matched-pairs setting when you can match the two samples up by units or subjects. Instead, take the difference between the two samples in each matched pair, and use a regular ZInterval. # Sample Problem You want to compare the average height of a freshman and a senior at your school. You haven't asked everyone, but you took a random sample of 40 people from each class and found out their heights (and stored them to L1 and L2). You've read in your textbook that the standard deviation of teenagers' heights is usually 6 inches. You've decided to use a 95% confidence interval. Based on the data list syntax for a 2-SampZInt(, here is your code: :2-SampZInt(6,6,L1,L2,95 you can also use :2-SampZInt(6,6,L1,L2,.95  Alternatively, you could calculate the mean and sample size and enter those instead. The sample size in this case is 40 for both data sets; let's say the means were 57 inches and 67 inches. You now have all the needed statistics: • σ1 is the standard deviation for freshmen: 6 inches • σ2 is the standard deviation for seniors: also 6 inches • x1 is the mean height of freshmen: 57 inches • n1 is the number of freshmen in the sample: 40 • x2 is the mean height of seniors: 67 inches • n2 is the number of seniors in the sample: 40 This means that the code is: :2-SampZInt(6,6,57,40,67,40,95 you can also use :2-SampZInt(6,6,57,40,67,40,.95  Of course, the main use of the 2-SampZInt( command is in a program. While you can enter the command on the home screen as well (just look in the catalog for it), it would probably be easier to select 2-SampZInt… from the STAT>TEST menu (see the sidebar), since you don't have to remember the syntax. # Advanced Uses As with most other statistical commands, you can add frequencies to the lists (only with the data list syntax, of course); if you do, both lists must have frequencies, and the arguments go in the order first data list, second data list, first freq. list, second freq. list. Each frequency list must contain non-negative real numbers, which can't be all 0. # Optimization Using the data list syntax, all items but the standard deviations are optional: the calculator will assume you want to use L1 and L2 for your data unless other lists are supplied, and that the confidence level you want is 95% unless you give another one. Using the summary stats syntax, the confidence level is also optional - again, the calculator will assume 95%. This means we can rewrite our code above in a simpler manner: :2-SampZInt(6,6,L1,L2,95 can be :2-SampZInt(6,6  :2-SampZInt(6,6,57,40,67,40,95 can be :2-SampZInt(6,6,57,40,67,40  # Related Commands Command Summary Finds the probability of an interval of the F-distribution, and graphs the distribution with the interval's area shaded. Command Syntax ShadeF(lower, upper, numerator df, denominator df) Menu Location Press: 1. 2ND DISTR to access the distribution menu 2. RIGHT to select the DRAW submenu 3. 4 to select ShadeF(, or use arrows TI-83/84/+/SE 2 bytes ShadeF( is equivalent to Fcdf( in terms of the probability it calculates: if a random variable follows the F-distribution, you can use it to calculate the probability that the variable's value falls in a certain interval. However, in addition to calculating the probability, this command also draws the distribution, and shades the interval whose area represents the probability you want. Note that this command does not actually return the value it calculates in Ans or anywhere else: it's merely displayed on the graph. If you're going to use the value in further calculations, you'll have to use Fcdf( as well. Like Fcdf(, ShadeF( takes four arguments: the lower bound, the upper bound, and the numerator and denominator degrees of freedom. # Advanced Often, you want to find a "tail probability" - a special case for which the interval has no lower or no upper bound. For example, "what is the probability x is greater than 2?". The TI-83+ has no special symbol for infinity, but you can use E99 to get a very large number that will work equally well in this case (E is the decimal exponent obtained by pressing [2nd] [EE]). Use E99 for positive infinity, and -E99 for negative infinity. The ShadeF( command's output is affected by the graphing window, and on many windows you won't be able to get a good idea of what the graph looks like. The entire graph is in the first quadrant, so unless you want to see bits of the axes, Ymin and Xmin should be 0. Ymax should probably be around .5 - this would depend on the specific F-distribution of course, as would Xmax. Keep in mind that ShadeF( is a drawing command and not the graph of an equation, so changing graph settings, the ClrDraw command, and a great deal of other things will erase its output. # Related Commands Command Summary Calculates the F-distribution probability betwen lower and upper for specified numerator and denominator degrees of freedom. Command Syntax Fcdf(lower, upper, numerator df, denominator df Menu Location Press: 1. 2ND DISTR to access the distribution menu 2. 9 to select Fcdf(, or use arrows. Press 0 instead of 9 on a TI-84+/SE with OS 2.30 or higher. TI-83/84/+/SE 2 bytes Fcdf( is the F-distribution cumulative density function. If some random variable follows this distribution, you can use this command to find the probability that this variable will fall in the interval you supply. The arguments lower and upper express the interval you're interested in. The arguments numerator df and denominator df, often written d1 and d2, specify the F-distribution, written as F(d1,d2). # Advanced Often, you want to find a "tail probability" - a special case for which the interval has no lower or no upper bound. For example, "what is the probability x is greater than 2?". The TI-83+ has no special symbol for infinity, but you can use E99 to get a very large number that will work equally well in this case (E is the decimal exponent obtained by pressing [2nd] [EE]). Use E99 for positive infinity, and -E99 for negative infinity. # Formulas As with other continuous distributions, Fcdf( can be expressed in terms of the probability density function: (1) \begin{align} \operatorname{Fcdf}(a,b,d_1,d_2) = \int_a^b \operatorname{Fpdf}(x,d_1,d_2) \, dx \end{align} # Related Commands Command Summary Evaluates the F-distribution probability density function at a point. Command Syntax Fpdf(x, numerator df, denominator df) Menu Location Press: 1. 2ND DISTR to access the distribution menu 2. 8 to select Fpdf(, or use arrows. Press 9 instead of 8 on a TI-84+/SE with OS 2.30 or higher. TI-83/84/+/SE 2 bytes Fpdf( is the F-distribution probability density function. Since the F-distribution is continuous, the value of Fpdf( doesn't represent an actual probability - in fact, one of the only uses for this command is to draw a graph of the distribution. You could also use it for various calculus purposes, such as finding inflection points. The command takes 3 arguments: x is the point at which to evaluate the function (when graphing, use X for this argument), numerator df and denominator df are the numerator degrees of freedom and denominator degrees of freedom respectively (these specify a single Fpdf( curve out of an infinite family). The F-distribution is used mainly in significance tests of variance. # Formulas The value of the Fpdf( is given by (1) \begin{align} \definecolor{darkgreen}{rgb}{0.90,0.91,0.859}\pagecolor{darkgreen} \operatorname{Fpdf}(x,d_1,d_2) = \frac{\left( \frac{d_1x}{d_1x+d_2} \right)^{d_1/2} \left(1-\frac{d_1x}{d_1x+d_2}\right)^{d_2/2}}{x \operatorname{B}(d_1/2,d_2/2)} \end{align} Here, B is the Beta function. # Related Commands Command Summary Performs a χ² test of independence. Command Syntax χ²-Test(observed matrix, expected matrix, draw? Menu Location While editing a program, press: 1. STAT to access the statistics menu 2. LEFT to access the TESTS submenu 3. ALPHA C to select χ²-Test(, or use arrows (outside the program editor, this will select the χ²-Test… interactive solver) TI-83/84/+/SE 2 bytes This command performs a χ² test of independence. This test is used to assess the independence of two categorical variables with known frequencies. The test is only valid for a simple random sample from the population, and only if all the frequencies are sufficiently large (greater than 5). Note: this test is different from the χ² goodness of fit test, which the TI-83 calculators don't have a command for. For a program that will perform the χ² goodness-of-fit test, see the goodness-of-fit test routine. To use this test, you need a matrix containing a contingency table. This is a table in which every row corresponds to a value of the first variable, and every column to a value of the second. The number in each cell represents the frequency with which the corresponding values of the two variables occur together. For example: suppose that the two variables are sex (male and female) and eye color (blue, brown, and green). The contingency table would have two rows and three columns. The cell in the first row and column would be the number of blue-eyed men in the sample, the cell in the second row and first column would be the number of blue-eyed women, and so on. The χ²-Test( command takes two arguments: the observed matrix and expected matrix. The first of these should be the contingency table you've already completed, presumably in the Matrix editor. The expected matrix does not need to already exist: the χ²-Test( command will calculate and store the expected frequencies (under the assumption that the variables are independent) to this matrix. The command is primarily for use in a program. Although you can access the χ²-Test( command on the home screen, via the catalog, there's no need: you can use the χ²-Test… interactive solver found in the menu instead. In either case, it's important to understand the output of χ²-Test(. Here are the meanings of each line: • χ² is the test statistic, calculated from the differences between the observed and the expected matrices. • p is the probability associated with the test statistic. We use p to test the null hypothesis that the two variables are independent. If p is low (usually, if it's <0.05) this means there's little chance that two independent variables would have a contingency table so different from the expected, and we reject the null hypothesis (so we'd conclude that the two variables are not independent). • df is the degrees of freedom, defined as (# of rows - 1)*(# of columns - 1), important for calculating p. # Sample Problem You want to compare the effectiveness of three treatments in curing a terminal disease. You have obtained data for 100 patients who had the disease, which contained information on the treatment used, and whether the patient lived or died. You put this information in a contingency table: Lived Died Treatment A 40 10 Treatment B 27 6 Treatment C 11 6 To perform the test, you store this information to a matrix such as [A], either through the matrix editor or by hand: :[[40,10],[27,6],[11,6→[A]  You submit this matrix as the first argument, and some other matrix (such as [B]) for the second: :χ²-Test([A],[B]  The output looks something like this: χ²-Test χ²=2.14776311 p=.3416796916 df=2  The most important part of this output is the line p=.3416796916 - the probability of getting such results under the hypothesis that the treatments and survival rate are independent. This value is greater than .05, so the data is not significant on a 5% level. There is not enough evidence to reject the null hypothesis, so treatment and survival rate may very well be independent. In non-mathematical language, this means that there's no reason to believe the treatments vary in effectiveness. # Advanced Uses The final argument of χ²-Test(, draw?, will display the results in a graphical manner if you put in "1" for it. The calculator will draw the χ² distribution with the correct degrees of freedom, and shade the area of the graph beyond the χ² statistic. In addition, the same values as usually will be calculated and displayed. You would make your conclusions in the same way as for the regular output. # Related Commands # See Also Command Summary Finds the probability of an interval of the χ² distribution, and graphs this distribution with the interval's area shaded. Command Syntax Shadeχ²(lower, upper, df) Menu Location Press: 1. 2ND DISTR to access the distribution menu 2. RIGHT to select the DRAW submenu 3. 3 to select Shadeχ²(, or use arrows TI-83/84/+/SE 2 bytes Shadeχ²( is equivalent to χ²cdf( in terms of the probability it calculates: if a random variable follows the χ² distribution, you can use it to calculate the probability that the variable's value falls in a certain interval. However, in addition to calculating the probability, this command also draws the χ² curve, and shades the interval whose area represents the probability you want. Note that this command does not actually return the value it calculates in Ans or anywhere else: it's merely displayed on the graph. If you're going to use the value in further calculations, you'll have to use χ²cdf( as well. The Shadeχ²( command takes three arguments. lower and upper identify the interval you're interested in. df specifies the degrees of freedom (selecting from an infinite family of χ² distributions). Thus, the following code would find the probability of χ² between 0 and 1 on a χ² distribution with 2 degrees of freedom, and shade this interval: :Shadeχ²(0,1,2  # Advanced Often, you want to find a "tail probability" - a special case for which the interval has no lower or no upper bound. For example, "what is the probability x is greater than 2?". The TI-83+ has no special symbol for infinity, but you can use E99 to get a very large number that will work equally well in this case (E is the decimal exponent obtained by pressing [2nd] [EE]). Use E99 for positive infinity, and -E99 for negative infinity. It can be hard to find the best window for Shadeχ²( to work in, since it doesn't automatically zoom for you. For any number of degrees of freedom (except for 1), the graph doesn't go above y=.5 (a good value for Ymax); Ymin should probably be something small and negative. Xmin should be around 0 (possibly slightly less if you like seeing axes), while Xmax probably shouldn't go above 5. Keep in mind that Shadeχ²( is just a drawing command and not an actual graphed function, so resizing the window, ClrDraw, and other commands that refresh the graphscreen will remove it. # Related Commands Command Summary Draws a circle. Command Syntax Circle(X,Y,r) (83+ and higher only) Circle(X,Y,r,{i}) (84+ CSE only) Circle(X,Y,r Menu Location Press: 1. Press [2ND] [PRGM] to enter the DRAW menu 2. Press [9] to insert Circle( TI-83/84/+/SE 1 byte Circle(X,Y,r) will draw a circle at (X,Y) with radius r. X and Y will be affected by the window settings. The radius will also be affected by the window settings. :Circle(5,5,5)  # Advanced Uses The radius of a circle is affected by the window settings. This means that if the x- and y-increment is two, the radius will be two pixels. However, there is another way to take advantage of this to draw ellipses. If the x- and y-increment are different, then the shape will not be a circle. For instance, with Xmin=0, Xmax=20, Ymin=0, and Ymax=31, Circle(10,10,2) will draw an ellipse, where the width is greater than the height. # Optimization If a complex list such as {i} is passed to Circle( as the fourth argument, the "fast circle" routine is used instead, which uses the symmetries of the circle to only do 1/8 of the trig calculations. For example: :Circle(0,0,5 can be :Circle(0,0,5,{i  Any list of complex numbers will work as the fourth argument in the same way, but there's no benefit to using any other list. Note: The "fast circle" routine is not available on the TI-84+CSE or TI-84+CE calculators. # Command Timings The ordinary Circle( is extremely slow. The fast circle trick discussed above cuts the time down to only about 30% of the "slow Circle(" time! While still not instant, this is faster than any replacement routine that can be written in TI-Basic. For small radii, replace Circle( with Pt-On( instead. # Related Commands Command Summary Finds the probability for an interval of the χ² distribution. Command Syntax χ²(lower, upper, df Menu Location Press: 1. 2ND DISTR to access the distribution menu 2. 7 to select χ²cdf(, or use arrows. Press 8 instead of 7 on a TI-84+/SE with OS 2.30 or higher. TI-83/84/+/SE 2 bytes χ²cdf( is the χ² cumulative density function. If some random variable follows a χ² distribution, you can use this command to find the probability that this variable will fall in the interval you supply. The command takes three arguments. lower and upper define the interval in which you're interested. df specifies the degrees of freedom (choosing one of a family of χ² distributions). # Advanced Uses Often, you want to find a "tail probability" - a special case for which the interval has no lower or no upper bound. For example, "what is the probability x is greater than 2?". The TI-83+ has no special symbol for infinity, but you can use E99 to get a very large number that will work equally well in this case (E is the decimal exponent obtained by pressing [2nd] [EE]). Use E99 for positive infinity, and -E99 for negative infinity. The χ²cdf( command is crucial to performing a χ² goodness of fit test, which the early TI-83 series calculators do not have a command for (the χ²-Test( command performs the χ² test of independence, which is not the same thing, although the manual always just refers to it as the "χ² Test"). This test is used to test if an observed frequency distribution differs from the expected, and can be used, for example, to tell if a coin or die is fair. The Goodness-of-Fit Test routine on the routines page will perform a χ² goodness of fit test for you. Or, if you have a TI-84+/SE with OS version 2.30 or higher, you can use the χ²GOF-Test( command. # Formulas As with other continuous distributions, we can define χ²cdf( in forms of the probability density function: (1) \begin{align} \operatorname{\chi^2cdf}(a,b,k) = \int_a^b \operatorname{\chi^2pdf}(x,k)\,dx \end{align} # Related Commands # See Also Command Summary Evaluates the χ² probability density function at a point. Command Syntax χ²pdf(x, df Menu Location Press: 1. 2ND DISTR to access the distribution menu 2. 6 to select χ²pdf(, or use arrows. Press 7 instead of 6 on a TI-84+/SE with OS 2.30 or higher. TI-83/84/+/SE 2 bytes χ²pdf( is the χ² probability density function. Since the χ² distribution is continuous, the value of χ²pdf( doesn't represent an actual probability — in fact, one of the only uses for this command is to draw a graph of the χ² curve. You could also use it for various calculus purposes, such as finding inflection points. The command takes two arguments: the value at which to evaluate the p.d.f., and df, the number of 'degrees of freedom'. # Formulas The value of χ²pdf( is given by (1) \begin{align} \operatorname{\chi^2pdf}(x,k)=\frac{(1/2)^{k/2}}{(k/2-1)!}\,x^{k/2-1}e^{-x/2} \end{align} # Related Commands Command Summary Returns the value of a string that contains an expression. Command Syntax expr(string) Menu Location This command is found only in the Catalog. Press: 1. 2ND CATALOG to enter the catalog 2. F to go to commands starting with F 3. Scroll up a bit to expr(. TI-83/84/+/SE 2 bytes The expr( command is used to evaluate an expression that's stored in a string (an expression is merely anything that returns a value - of any type). Expressions are occasionally stored to strings, rather than evaluated outright, so that their value has the capacity to change when the variables stored inside them change. The expr( command's result depends on the kind of expression that's in the string you pass it — it may return a number, a list, a matrix, or even another string. As a special case of an expression, the expr( command can also be used to convert a string like "123" to the number 123. Going in the reverse direction (123 to "123") is more complicated. The expr( command has limitations. Here are the situations in which expr( will not work: • When the code in the string does not return an answer, and thus is not an expression: e.g. expr("Line(0,0,1,1" or expr("prgmHELLO" is invalid • When the expression in the string contains an expr( command itself, e.g. expr("expr(Str1" — this will throw an ERR:ILLEGAL NEST error. • In place of a variable (rather than an expression), e.g. 5→expr("X" isn't a substitute for 5→X because expr("X" evaluates to the value of X and not to X itself. # Advanced Uses expr( is often used in conjunction with the Input command to prompt the user to enter a list. Although the Input command can already handle lists, it requires the user to enter the opening bracket that signifies a list. With expr(, this can be avoided. Instead of: :Input L1  Use this: :Input Str1 :expr("{"+Str1→L1  # Optimization Evaluating an expression inside a string is more complicated than evaluating a normal expression; you should therefore try to take as much out of an expr( statement as possible to speed up your code. For example: :expr("sum({"+Str1 can be :sum(expr("{"+Str1  # Error Conditions • ERR:ILLEGAL NEST is thrown when the string to be evaluated contains an expr( itself. • ERR:INVALID is thrown when trying to evaluate the empty string. • ERR:SYNTAX is thrown when trying to evaluate a command that doesn't return a value. # Related Commands Command Summary Calculates the Poisson cumulative probability for a single value Command Syntax poissoncdf(mean, value) Menu Location Press: 1. 2ND DISTR to access the distribution menu 2. ALPHA C to select poissoncdf(, or use arrows. Press ALPHA D instead of ALPHA C on a TI-84+/SE with OS 2.30 or higher. TI-83/84/+/SE 2 bytes This command is used to calculate Poisson distribution cumulative probability. In plainer language, it solves a specific type of often-encountered probability problem, that occurs under the following conditions: 1. A specific event happens at a known average rate (X occurrences per time interval) 2. Each occurrence is independent of the time since the last occurrence 3. We're interested in the probability that the event occurs at most a specific number of times in a given time interval. The poissoncdf( command takes two arguments: The mean is the average number of times the event will happen during the time interval we're interested in. The value is the number of times we're interested in the event happening (so the output is the probability that the event happens at most value times in the interval). Note that you may need to convert the mean so that the time intervals in both cases match up. This is done by a simple proportion: if the event happens 10 times per minute, it happens 20 times per two minutes. For example, consider point on a city street where an average of 5 cars pass by each minute. What is the probability that in a given minute, no more than 3 cars will drive by? 1. The event is a car passing by, which happens at an average rate of 5 occurences per time interval (a minute) 2. Each occurrence is independent of the time since the last occurrence (we'll assume this is true, though traffic might imply a correlation here) 3. We're interested in the probability that the event occurs at most 3 times in the time interval. The syntax in this case is: :poissoncdf(5,3  This will give about .265 when you run it, so there's a .265 probability that in a given minute, no more than 3 cars will drive by. # Formulas The poissoncdf( command can be seen as a sum of poissonpdf( commands: (1) \begin{align} \definecolor{darkgreen}{rgb}{0.90,0.91,0.859}\pagecolor{darkgreen} \operatorname{poissoncdf}(\lambda,k)=\sum_{i=0}^k \operatorname{poissonpdf}(\lambda,i) = \sum_{i=0}^k \frac {e^{-\lambda} \lambda^i}{i!} \end{align} We can also write the poissoncdf( command in terms of the incomplete gamma function: (2) \begin{align} \definecolor{darkgreen}{rgb}{0.90,0.91,0.859}\pagecolor{darkgreen} \operatorname{poissoncdf}(\lambda,k)=\frac{\Gamma(k+1,\lambda)}{k!} \end{align} # Related Commands Command Summary Calculates the Poisson probability for a single value Command Syntax poissonpdf(mean, value) Menu Location Press: 1. 2ND DISTR to access the distribution menu 2. ALPHA B to select poissonpdf(, or use arrows. Press ALPHA C instead of ALPHA B on a TI-84+/SE with OS 2.30 or higher. TI-83/84/+/SE 2 bytes This command is used to calculate Poisson distribution probability. In plainer language, it solves a specific type of often-encountered probability problem, that occurs under the following conditions: 1. A specific event happens at a known average rate (X occurrences per time interval) 2. Each occurrence is independent of the time since the last occurrence 3. We're interested in the probability that the event occurs a specific number of times in a given time. The poissonpdf( command takes two arguments: The mean is the average number of times the event will happen during the time interval we're interested in. The value is the number of times we're interested in the event happening (so the output is the probability that the event happens value times in the interval). For example, consider point on a city street where an average of 5 cars pass by each minute. What is the probability that in a given minute, 8 cars will drive by? 1. The event is a car passing by, which happens at an average rate of 5 occurrences per time interval (a minute) 2. Each occurrence is independent of the time since the last occurrence (we'll assume this is true, though traffic might imply a correlation here) 3. We're interested in the probability that the event occurs 8 times in the time interval The syntax in this case is: :poissonpdf(5,8  This will give about .065 when you run it, so there's a .065 probability that in a given minute, 8 cars will drive by. # Formulas The value of poissonpdf( is given by the formula (1) \begin{align} \definecolor{darkgreen}{rgb}{0.90,0.91,0.859}\pagecolor{darkgreen} \operatorname{poissonpdf}(\lambda,k) = \frac{e^{-\lambda}\lambda^k}{k!} \end{align} # Related Commands Command Summary Calculates the least-squares best fit sinusoidal curve through a set of points. Command Syntax SinReg [iterations, x-list, y-list, period, equation] Menu Location Press: 1. STAT to access the statistics menu 2. LEFT to access the CALC submenu 3. ALPHA C to select SinReg, or use arrows TI-83/84/+/SE 1 byte SinReg tries to fit a sine wave to a given list of points. To use it, you must first store the points to two lists: one of the x-coordinates and one of the y-coordinates, ordered so that the ith element of one list matches up with the ith element of the other list (i.e. the first element of the x-list and the first element of the y-list make up an ordered pair). L₁ and L₂ are the default lists used, and the List Editor (STAT > Edit…) is a useful window for entering the points. SinReg requires that the lists contain at least 4 points. Also, if you do not provide two data points per cycle, the calculator may return a wrong answer. These conditions are an absolute minimum, and the command may fail to work even when they are met, and throw a ERR:SINGULAR MAT error. This is also likely to happen if the data are not actually periodic in nature. In addition, to use SinReg in its simplest form, the x-coordinates must be sorted in increasing order, and the difference between consecutive x-coordinates must be the same throughout (i.e., xi+1-xi should be the same for all i). You can then call SinReg with no arguments, and it will attempt to fit a sine wave to the data in L₁ and L₂: :{1,2,3,4,5,6,7,8,9,10,11,12→L₁ :{21,24,34,46,58,67,72,70,61,50,40,27→L₂ :SinReg  On the home screen, or as the last line of a program, this will display the equation of the curve: you'll be shown the format, y=a*sin(bx+c)+d, and the values of a, b, c and d. It will also be stored in the RegEQ variable, but you will not be able to use this variable in a program - accessing it just pastes the equation wherever your cursor was. Finally, the statistical variables a, b, c, and d will be set to the values computed as well. There are no correlation statistics available for SinReg even if Diagnostic Mode is turned on (see DiagnosticOn and DiagnosticOff). A word of caution: the calculator assumes that Radian mode is enabled. If the calculator is set to Degree mode, the equation will still be in terms of radians: it will be correct, but values plugged in will give wrong answers. You will have to either switch to Radian mode, or multiply the values of b and c by 180/π. You do not have to do the regression on L₁ and L₂, in which case you'll have to enter the names of the lists after the command. For example: :{1,2,3,4,5,6,7,8,9,10,11,12→MONTH :{21,24,34,46,58,67,72,70,61,50,40,27→TEMP :SinReg ∟MONTH,∟TEMP  Unlike the other regression commands, SinReg does not allow you to use a frequency list for data. You can get around this by adding repeating coordinates multiple times. The optional argument iterations should come before the data lists, and if provided will change the amount of time and effort the calculator spends on the problem. The value should be an integer 1 to 16; larger numbers mean greater precision, but a longer calculation time. The default value is 3, and for good reason: with a high precision value, the calculation may take a minute to complete, or longer, depending on the complexity of the problem. The optional argument period should be given after the data lists - this is the length of a complete cycle in the data, if known. You might know the exact value of the period, for example, when the calculation involves time - a complete cycle could be a day, a month, or a year. Providing this argument is strongly recommended whenever it is available: this removes conditions on the x-coordinates' order and increment, and makes the calculation much faster and more accurate. If you have previously done a SinReg fit and desire a refined estimate, the value 2π/b can be given as the period. Finally, you can enter an equation variable (such as Y₁) after the command, so that the curve's equation is stored to this variable automatically. This does not require you to supply the names of the lists, but if you do, the equation variable must come last. You can use polar, parametric, or sequential variables as well, but since the equation will be in terms of X anyway, this does not make much sense. An example of SinReg with all the optional arguments: :{1,2,3,4,5,6,7,8,9,10,11,12→MONTH :{21,24,34,46,58,67,72,70,61,50,40,27→TEMP :SinReg 16,∟MONTH,∟TEMP,12,Y₁  The Levenberg-Marquardt nonlinear least-squares algorithm is used by SinReg. # Error Conditions • ERR:SINGULAR MAT is thrown if you don't provide the calculator at least 4 points, or two data points per cycle. # Related Commands Command Summary Performs a Student's t significance test. Command Syntax T-Test μ0, //frequency//, //alternative//, //draw?// (data list input) T-Test μ0, sample mean, sample std. dev., sample size, //draw?// (summary stats input) Menu Location While editing a program, press: 1. STAT to access the statistics menu 2. LEFT to access the TESTS submenu 3. 2 to select T-Test, or use arrows (outside the program editor, this will select the T-Test… interactive solver) TI-83/84/+/SE 2 bytes T-Test performs a t significance test of a null hypothesis you supply. This test is valid for simple random samples from a population with an unknown standard deviation. In addition, either the population must be normally distributed, or the sample size has to be sufficiently large. The logic behind a T-Test is as follows: we want to test the hypothesis that the true mean of a population is a certain value (μ0). To do this, we assume that this "null hypothesis" is true, and calculate the probability that the variation from this mean occurred, under this assumption. If this probability is sufficiently low (usually, 5% is the cutoff point), we conclude that since it's so unlikely that the data could have occurred under the null hypothesis, the null hypothesis must be false, and therefore the true mean μ is not equal to μ0. If, on the other hand, the probability is not too low, we conclude that the data may well have occurred under the null hypothesis, and therefore there's no reason to reject it. In addition to the null hypothesis, we must have an alternative hypothesis as well - usually this is simply that the true mean is not μ0. However, in certain cases when we have reason to suspect the true mean is less than or greater than μ0, we might use a "one-sided" alternative hypothesis, which will state that the true mean μ<μ0 or that μ>μ0. As for the T-Test command itself, there are two ways of calling it: you may give it a list of all the sample data, or the necessary statistics about the list - its size, the mean, and the standard deviation. In either case, you can indicate what the alternate hypothesis is, by a value of 0, -1, or 1 for the alternative argument. 0 indicates a two-sided hypothesis of μμ0, -1 indicates μ<μ0, and 1 indicates μ>μ0. (in fact, any negative argument will be treated as -1, and any positive argument as 1) Although you can access the T-Test command on the home screen, via the catalog, there's no need: the T-Test… interactive solver, found in the statistics menu, is much more intuitive to use - you don't have to memorize the syntax. In either case, it's important to understand the output of T-Test. Here are the meanings of each line: • The first line, involving μ, is the alternative hypothesis. • t is the test statistic, the standardized difference between the sample mean and μ0. If the null hypothesis is true, it should be close to 0. • p is the probability that the difference between the sample mean and μ0 would occur if the null hypothesis is true. When the value is sufficiently small, we reject the null hypothesis and conclude that the alternative hypothesis is true. You should have a cutoff value ready, such as 5% or 1%. If p is lower, you "reject the null hypothesis on a 5% (or 1%) level" in technical terms. • x-bar is the sample mean. • Sx is the sample standard deviation. • n is the sample size (not included, but also important, is df, the degrees of freedom, defined as n-1) # Sample Problem According to M&M's advertising, each standard-size bag of M&M's contains an average of 10 blue M&M's. You think that this estimate is low, and that the true average is higher. You decide to test this hypothesis by buying thirty bags of M&M's. You count the number of blue M&M's in each, and store this number to L1. The value of μ0 is 10, because you want to test the null hypothesis that there are on average 10 blue M&M's per bag. We want to test the values in L1. Because we want to test if there's actually more than 10 blue M&M's per bag, we have a one-sided alternate hypothesis: μ>μ0, which corresponds to an argument of 1. To solve the problem, you'd use this code: :T-Test 10,L1,1  Alternatively, you could calculate the mean, standard deviation, and size of your sample, and put those into the command instead. The sample size is 30; let's suppose that the mean was 11.2 and the standard deviation 1.3. The code you'd use is: :T-Test 10,11.2,1.3,30,1  You will see the following output: T-Test μ>10 z=5.055900531 p=1.0857768e-5 x=11.2 Sx=1.3 n=30  The most important part of this output is "p=1.0857768e-5". This value of p is much smaller than 1% or 0.01; it's in fact around 0.00001. This is significant on the 1% level, so we reject the null hypothesis and conclude that the alternative hypothesis is true: μ>10, that is, the average number of blue M&M's in a bag is more than 10. # Advanced Uses The final argument of T-Test, draw?, will display the results in a graphical manner if you put in "1" for it. The calculator will draw the Student's t distribution with the correct degrees of freedom, and shade the area of the graph beyond the t statistic. In addition, the value of t and the value of p will be displayed (the value of p corresponds to the shaded area). You would make your conclusions in the same way as for the regular output. As with most other statistical commands, you may use a frequency list in your input (when using the data list syntax). # Optimization Most of the arguments of the T-Test command have default values, and the argument can be omitted if this value is accepted. • The draw? argument can be omitted if you don't want graphical output, although you could put "0" in as well. • If the draw? argument is omitted, you can omit the alternative argument to use a two-sided test (μμ0). If you include the draw? argument, you have to include this - otherwise there will be confusion as to what the 5th argument means. • With data list input, you can always omit the frequency list if you won't be using it. • With data list input, if the draw? and alternative arguments are omitted, and your data is in L1, you may omit L1 as well. However, if alternative or draw? is present, you have to include it, or else the syntax may be confused with the syntax for summary stats input. The code in the sample problem above can't be optimized, because the alternative argument is 1: ::T-Test 10,L1,1  However, if we were doing a two-sided test, we could omit the alternative and the list arguments (since we're testing L1): :T-Test 10,L1,0 can be :T-Test 10  # Related Commands Command Summary Performs a z significance test. Command Syntax Z-Test(μ0, σ, //frequency//, //alternative//, //draw?// (data list input) Z-Test(μ0, σ, sample mean, sample size, //draw?// (summary stats input) Menu Location While editing a program, press: 1. STAT to access the statistics menu 2. LEFT to access the TESTS submenu 3. ENTER to select Z-Test( (outside the program editor, this will select the Z-Test… interactive solver) TI-83/84/+/SE 2 bytes Z-Test( performs a z significance test of a null hypothesis you supply. This test is valid for simple random samples from a population with a known standard deviation. In addition, either the population must be normally distributed, or the sample size has to be sufficiently large. The logic behind a Z-Test is as follows: we want to test the hypothesis that the true mean of a population is a certain value (μ0). To do this, we assume that this "null hypothesis" is true, and calculate the probability that the variation from this mean occurred, under this assumption. If this probability is sufficiently low (usually, 5% is the cutoff point), we conclude that since it's so unlikely that the data could have occurred under the null hypothesis, the null hypothesis must be false, and therefore the true mean μ is not equal to μ0. If, on the other hand, the probability is not too low, we conclude that the data may well have occurred under the null hypothesis, and therefore there's no reason to reject it. In addition to the null hypothesis, we must have an alternative hypothesis as well - usually this is simply that the true mean is not μ0. However, in certain cases when we have reason to suspect the true mean is less than or greater than μ0, we might use a "one-sided" alternative hypothesis, which will state that the true mean μ<μ0 or that μ>μ0. As for the Z-Test( command itself, there are two ways of calling it: you may give it a list of all the sample data, or the necessary statistics about the list - its size, and the mean. In either case, you can indicate what the alternate hypothesis is, by a value of 0, -1, or 1 for the alternative argument. 0 indicates a two-sided hypothesis of μμ0, -1 indicates μ<μ0, and 1 indicates μ>μ0. Although you can access the Z-Test( command on the home screen, via the catalog, there's no need: the Z-Test… interactive solver, found in the statistics menu, is much more intuitive to use - you don't have to memorize the syntax. In either case, it's important to understand the output of Z-Test. Here are the meanings of each line: • The first line, involving μ, is the alternative hypothesis. • z is the test statistic, the standardized difference between the sample mean and μ0. If the null hypothesis is true, it should be close to 0. • p is the probability that the difference between the sample mean and μ0 would occur if the null hypothesis is true. When the value is sufficiently small, we reject the null hypothesis and conclude that the alternative hypothesis is true. You should have a cutoff value ready, such as 5% or 1%. If p is lower, you "reject the null hypothesis on a 5% (or 1%) level" in technical terms. • x-bar is the sample mean. • Sx is the sample standard deviation. This isn't actually used in any calculations, and will only be shown for data list input. • n is the sample size. # Sample Problem According to M&M's advertising, each standard-size bag of M&M's contains an average of 10 blue M&M's with a standard deviation of 2 M&M's. You think that this estimate is low, and that the true average is higher. You decide to test this hypothesis by buying thirty bags of M&M's. You count the number of blue M&M's in each, and store this number to L1. The value of μ0 is 10, because you want to test the null hypothesis that there are on average 10 blue M&M's per bag. The value of σ is 2. We want to test the values in L1. Because we want to test if there's actually more than 10 blue M&M's per bag, we have a one-sided alternate hypothesis: μ>μ0, which corresponds to an argument of 1. To solve the problem, you'd use this code: :Z-Test(10,2,L1,1  Alternatively, you could calculate the mean and sample size of your sample, and put those into the command instead. The sample size is 30; let's suppose that the mean was 11.2. The code you'd use is: :Z-Test(10,2,11.2,30,1  You will see the following output: Z-Test μ>10 z=3.286335345 p=5.0755973e-4 x=11.2 n=30  The most important part of this output is "p=5.0755973e-4". This value of p is much smaller than 1% or 0.01; it's in fact around 0.0005. This is significant on the 1% level, so we reject the null hypothesis and conclude that the alternative hypothesis is true: μ>10, that is, the average number of blue M&M's in a bag is more than 10. # Advanced Uses The final argument of Z-Test(, draw?, will display the results in a graphical manner if you put in "1" for it. The calculator will draw the standard normal curve, and shade the area of the graph beyound the z statistic. In addition, the value of z and the value of p will be displayed (the value of p corresponds to the shaded area). You would make your conclusions in the same way as for the regular output. As with most other statistical commands, you may use a frequency list in your input (when using the data list syntax). # Optimization Most of the arguments of the Z-Test( command have default values, and the argument can be omitted if this value is accepted. • The draw? argument can be omitted if you don't want graphical output, although you could put "0" in as well. • If the draw? argument is omitted, you can omit the alternative argument to use a two-sided test (μμ0). If you include the draw? argument, you have to include this - otherwise there will be confusion as to what the 5th argument means. • With data list input, you can always omit the frequency list if you won't be using it. • With data list input, if the draw? and alternative arguments are omitted, and your data is in L1, you may omit L1 as well. However, if alternative or draw? is present, you have to include it, or else the syntax may be confused with the syntax for summary stats input. The code in the sample problem above can't be optimized, because the alternative argument is 1: ::Z-Test(10,2,L1,1  However, if we were doing a two-sided test, we could omit the alternative and the list arguments (since we're testing L1): :Z-Test(10,2,L1,0 can be :Z-Test(10,2  # Related Commands Command Summary Finds the probability of an interval of the Student's t distribution, and graphs the distribution with the interval's area shaded. Command Syntax Shade_t(lower, upper, df) Menu Location Press: 1. 2ND DISTR to access the distribution menu 2. RIGHT to select the DRAW submenu 3. 2 to select Shade_t(, or use arrows TI-83/84/+/SE 2 bytes Shade_t( is equivalent to tcdf( in terms of the probability it calculates: if a random variable follows the Student's t distribution, you can use it to calculate the probability that the variable's value falls in a certain interval. However, in addition to calculating the probability, this command also draws the distribution, and shades the interval whose area represents the probability you want. Note that this command does not actually return the value it calculates in Ans or anywhere else: it's merely displayed on the graph. If you're going to use the value in further calculations, you'll have to use tcdf( as well. Like tcdf(, Shade_t( takes three arguments: the lower bound, the upper bound, and the degrees of freedom. # Advanced Often, you want to find a "tail probability" - a special case for which the interval has no lower or no upper bound. For example, "what is the probability x is greater than 2?". The TI-83+ has no special symbol for infinity, but you can use E99 to get a very large number that will work equally well in this case (E is the decimal exponent obtained by pressing [2nd] [EE]). Use E99 for positive infinity, and -E99 for negative infinity. The Shade_t( command's output is affected by the graphing window, and on many windows you won't be able to get a good idea of what the graph looks like. For best results, Ymin should be either 0 or a small negative number, and Ymax should be 0.5 or less. Xmin and Xmax should be opposites of each other (so the middle of the graph is 0), but how large they are depends on the degrees of freedom and on how much of the graph you want to see: -4 and 4 are good starting places. Keep in mind that Shade_t( is a drawing command and not the graph of an equation, so changing graph settings, the ClrDraw command, and a great deal of other things will erase its output. # Related Commands Command Summary Calculates the least-squares best fit logistic curve through a set of points. Command Syntax Logistic [x-list, y-list, [frequency], [equation] Menu Location Press: 1. STAT to access the statistics menu 2. LEFT to access the CALC submenu 3. ALPHA B to select Logistic, or use arrows TI-83/84/+/SE 1 byte Logistic tries to fit a logistic curve (y=c/(1+a*e-b*x)) through a set of points. To use it, you must first store the points to two lists: one of the x-coordinates and one of the y-coordinates, ordered so that the ith element of one list matches up with the ith element of the other list. L₁ and L₂ are the default lists used, and the List Editor (STAT > Edit…) is a useful window for entering the points. The explanation for the odd format of a logistic curve is that it is the solution to a differential equation that models population growth with a limiting factor: a population that grows according to a logistic curve will start out growing exponentially, but will slow down before reaching a carrying capacity and approach this critical value without reaching it. The logistic curve also has applications, for example, in physics. In its simplest form, Logistic takes no arguments, and fits a logistic curve through the points in L₁ and L₂: :{9,13,21,30,31,31,34→L₁ :{260,320,420,530,560,550,590→L₂ :Logistic  On the home screen, or as the last line of a program, this will display the equation of the curve: you'll be shown the format, y=c/(1+ae^(-bx)), and the values of a, b and c. It will also be stored in the RegEQ variable, but you won't be able to use this variable in a program - accessing it just pastes the equation wherever your cursor was. Finally, the statistical variables a, b, and c will be set as well. There are no correlation statistics available for Logistic even if Diagnostic Mode is turned on (see DiagnosticOn and DiagnosticOff). You do not have to do the regression on L₁ and L₂, in which case you will have to enter the names of the lists after the command. For example: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :Logistic ∟FAT,∟CALS  You can attach frequencies to points, for when a point occurs more than once, by supplying an additional argument - the frequency list. This list does not have to contain integer frequencies. If you add a frequency list, you must supply the names of the x-list and y-list as well, even when they're L₁ and L₂. Finally, you can enter an equation variable (such as Y₁) after the command, so that the curve's equation is stored to this variable automatically. This does not require you to supply the names of the lists, but if you do, the equation variable must come last. You can use polar, parametric, or sequential variables as well, but since the equation will be in terms of X anyway, this doesn't make much sense. An example of Logistic with all the optional arguments: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :{2,1,1,1,2,1,1→FREQ :Logistic ∟FAT,∟CALS,∟FREQ,Y₁  Warning: if your data is not even slightly logistic in nature, then the calculator may return an error such as ERR:OVERFLOW. This happens when the calculator tries to calculate a carrying capacity, c, for the data, but since the rate of change in data doesn't seem to be slowing down, it assumes that the carrying capacity is still very far off, and tries large values for it. These values may get so large as to cause an overflow. The Levenberg-Marquardt nonlinear least-squares algorithm is used by Logistic. # Error Conditions • ERR:ARGUMENT is thrown by using only one list. • ERR:DIM MISMATCH is thrown if the dimensions of two lists do not match. • ERR:DOMAIN is thrown if Logistic is left without using lists or enough instructions. • ERR:DATA TYPE is thrown if lists are not used, or a list contains a number like "4i". # Related Commands Command Summary Calculates the best fit power curve through a set of points. Command Syntax PwrReg [x-list, y-list, [frequency], [equation] Menu Location Press: 1. STAT to access the statistics menu 2. LEFT to access the CALC submenu 3. ALPHA A to select PwrReg, or use arrows TI-83/84/+/SE 1 byte PwrReg tries to fit a power curve (y=a*xb) through a set of points. To use it, you must first store the points to two lists: one of the x-coordinates and one of the y-coordinates, ordered so that the nth element of one list matches up with the nth element of the other list. L₁ and L₂ are the default lists to use, and the List Editor (STAT > Edit…) is a useful window for entering the points. The calculator does this regression by taking the natural log ln( of the x- and of the y-coordinates (this isn't stored anywhere) and then doing a linear regression. The result, ln(y)=b*ln(x)+ln(a), is transformed into y=eln(a)*xb, which is a power curve. This algorithm shows that if any coordinates are negative or 0, the calculator will instantly quit with ERR:DOMAIN. In its simplest form, PwrReg takes no arguments, and fits a power curve through the points in L₁ and L₂: :{9,13,21,30,31,31,34→L₁ :{260,320,420,530,560,550,590→L₂ :LnReg  On the home screen, or as the last line of a program, this will display the equation of the curve: you'll be shown the format, y=a*x^b, and the values of a and b. It will also be stored in the RegEQ variable, but you won't be able to use this variable in a program - accessing it just pastes the equation wherever your cursor was. Finally, the statistical variables a, b, r, and r² will be set as well. These latter two variables will be displayed only if "Diagnostic Mode" is turned on (see DiagnosticOn and DiagnosticOff). You don't have to do the regression on L₁ and L₂, but if you don't you'll have to enter the names of the lists after the command. For example: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :PwrReg ∟FAT,∟CALS  You can attach frequencies to points, for when a point occurs more than once, by supplying an additional argument - the frequency list. This list does not have to contain integer frequencies. If you add a frequency list, you must supply the names of the x-list and y-list as well, even when they're L₁ and L₂. Finally, you can enter an equation variable (such as Y₁) after the command, so that the curve's equation is stored to this variable automatically. This doesn't require you to supply the names of the lists, but if you do, the equation variable must come last. You can use polar, parametric, or sequential variables as well, but since the equation will be in terms of X anyway, this doesn't make much sense. An example of PwrReg with all the optional arguments: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :{2,1,1,1,2,1,1→FREQ :PwrReg ∟FAT,∟CALS,∟FREQ,Y1  # Related Commands Command Summary Calculates the best fit exponential curve through a set of points. Command Syntax ExpReg [x-list, y-list, [frequency], [equation] Menu Location Press: 1. STAT to access the statistics menu 2. LEFT to access the CALC submenu 3. 0 to select ExpReg, or use arrows TI-83/84/+/SE 1 byte ExpReg tries to fit an exponential curve (y=a*bx) through a set of points. To use it, you must first store the points to two lists: one of the x-coordinates and one of the y-coordinates ordered so that the Nth element of one list matches up with the Nth element of the other list. L₁ and L₂ are the default lists to use, and the List Editor (STAT > Edit…) is a useful window for entering the points. The calculator does this regression by taking the natural log ln( of the y-coordinates (this isn't stored anywhere) and then doing a linear regression. The result, ln(y)=ln(a)+x*ln(b), is transformed into y=eln(a)(eln(b))x, which is an exponential curve. This algorithm shows that if any y-coordinates are negative or 0, the calculator will instantly quit with ERR:DOMAIN. In its simplest form, ExpReg takes no arguments, and fits an exponential curve through the points in L₁ and L₂: :{9,13,21,30,31,31,34→L₁ :{260,320,420,530,560,550,590→L₂ :LnReg  On the home screen, or as the last line of a program, this will display the equation of the curve: you'll be shown the format, y=a*b^x, and the values of a and b. It will also be stored in the RegEQ variable, but you won't be able to use this variable in a program - accessing it just pastes the equation wherever your cursor was. Finally, the statistical variables a, b, r, and r² will be set as well. These latter two variables will be displayed only if "Diagnostic Mode" is turned on (see DiagnosticOn and DiagnosticOff). You don't have to do the regression on L₁ and L₂, but if you don't you'll have to enter the names of the lists after the command. For example: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :ExpReg ∟FAT,∟CALS  You can attach frequencies to points, for when a point occurs more than once, by supplying an additional argument - the frequency list. This list does not have to contain integer frequencies. If you add a frequency list, you must supply the names of the x-list and y-list as well, even when they're L₁ and L₂. Finally, you can enter an equation variable (such as Y₁) after the command, so that the curve's equation is stored in this variable automatically. This doesn't require you to supply the names of the lists, but if you do, the equation variable must come last. You can use polar, parametric, or sequential variables as well, but since the equation will be in terms of X anyway, this doesn't make much sense. An example of ExpReg with all the optional arguments: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :{2,1,1,1,2,1,1→FREQ :ExpReg ∟FAT,∟CALS,∟FREQ,Y1  # Related Commands Command Summary Calculates the best fit logarithmic curve through a set of points. Command Syntax LnReg [x-list, y-list, [frequency], [equation] Menu Location Press: 1. STAT to access the statistics menu 2. LEFT to access the CALC submenu 3. 9 to select LnReg, or use arrows TI-83/84/+/SE 1 byte LnReg tries to fit a logarithmic curve (y=a+b*lnx) through a set of points. To use it, you must first store the points to two lists: one of the x-coordinates and one of the y-coordinates, ordered so that the nth element of one list matches up with the nth element of the other list. L₁ and L₂ are the default lists to use, and the List Editor (STAT > Edit…) is a useful window for entering the points. The calculator does this regression by taking the natural log ln( of the x-coordinates (this isn't stored anywhere) and then doing a linear regression. This means that if any x-coordinates are negative or 0, the calculator will instantly quit with ERR:DOMAIN. In its simplest form, LnReg takes no arguments, and fits a logarithmic curve through the points in L₁ and L₂: :{9,13,21,30,31,31,34→L₁ :{260,320,420,530,560,550,590→L₂ :LnReg  On the home screen, or as the last line of a program, this will display the equation of the curve: you'll be shown the format, y=a+b*ln(x), and the values of a and b. It will also be stored in the RegEQ variable, but you won't be able to use this variable in a program - accessing it just pastes the equation wherever your cursor was. Finally, the statistical variables a, b, r, and r² will be set as well. These latter two variables will be displayed only if "Diagnostic Mode" is turned on (see DiagnosticOn and DiagnosticOff). You don't have to do the regression on L₁ and L₂, but if you don't you'll have to enter the names of the lists after the command. For example: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :LnReg ∟FAT,∟CALS  You can attach frequencies to points, for when a point occurs more than once, by supplying an additional argument - the frequency list. This list does not have to contain integer frequencies. If you add a frequency list, you must supply the names of the x-list and y-list as well, even when they're L₁ and L₂. Finally, you can enter an equation variable (such as Y₁) after the command, so that the curve's equation is stored to this variable automatically. This doesn't require you to supply the names of the lists, but if you do, the equation variable must come last. You can use polar, parametric, or sequential variables as well, but since the equation will be in terms of X anyway, this doesn't make much sense. An example of LnReg with all the optional arguments: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :{2,1,1,1,2,1,1→FREQ :LnReg ∟FAT,∟CALS,∟FREQ,Y₁  # Error Conditions • ERR:DOMAIN is thrown if any x-coordinates are negative or 0. # Related Commands Command Summary Calculates the best fit quartic equation through a set of points. Command Syntax QuartReg [x-list, y-list, [frequency list], [equation variable] Menu Location Press: 1. STAT to access the statistics menu 2. LEFT to access the CALC submenu 3. 7 to select QuartReg, or use arrows TI-83/84/+/SE 1 byte The QuartReg command can calculate the best fit quartic equation through a set of points. To use it, you must first store the points to two lists: one of the x-coordinates and one of the y-coordinates, ordered so that the Nth element of one list matches up with the Nth element of the other list. L1 and L2 are the default lists to use, and the List Editor (STAT > Edit…) is a useful window for entering the points. You must have at least 5 points, because there's infinitely many quadratics that can go through 4 points or less In its simplest form, QuartReg takes no arguments, and calculates a quartic through the points in L1 and L2: :{9,13,21,30,31,31,34→L1 :{260,320,420,530,560,550,590→L2 :QuartReg  On the home screen, or as the last line of a program, this will display the equation of the quartic: you'll be shown the format, y=ax4+bx3+cx2+dx+e, and the values of a, b, c, d, and e. It will also be stored in the RegEQ variable, but you won't be able to use this variable in a program - accessing it just pastes the equation wherever your cursor was. Finally, the statistical variables a, b, c, d, e, and R2 will be set as well. This latter variable will be displayed only if "Diagnostic Mode" is turned on (see DiagnosticOn and DiagnosticOff). You don't have to do the regression on L1 and L2, but if you don't you'll have to enter the names of the lists after the command. For example: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :QuartReg ∟FAT,∟CALS  You can attach frequencies to points, for when a point occurs more than once, by supplying an additional argument - the frequency list. This list does not have to contain integer frequencies. If you add a frequency list, you must supply the names of the x-list and y-list as well, even when they're L1 and L2. Finally, you can enter an equation variable (such as Y1) after the command, so that the quartic equation is stored to this variable automatically. This doesn't require you to supply the names of the lists, but if you do, the equation variable must come last. You can use polar, parametric, or sequential variables as well, but since the quadratic will be in terms of X anyway, this doesn't make much sense. An example of QuartReg with all the optional arguments: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :{2,1,1,1,2,1,1→FREQ :QuartReg ∟FAT,∟CALS,∟FREQ,Y1  # Advanced Note that even if a relationship is actually linear, since a quartic regression has all the freedom of a linear regression and much more, it will produce a better R2 value, especially if the number of points is small, and may lead you to (falsely) believe that a relationship is quartic when it actually isn't. An extreme example is the case of 5 points which are close to being on a line. The linear regression will be very good, but the quartic will seem even better - it will go through all 5 points and have an R2 value of 1. However, this doesn't make the 5 points special - any 5 (that don't have repeating x-values) will do! Take the correlation constant with a grain of salt, and consider if the fit is really that much better at the expense of much added complexity, and if there's any reason to believe the relationship between the variables may be quartic. # Related Commands Command Summary Calculates the best fit cubic function through a set of points. Command Syntax CubicReg [x-list, y-list, [frequency list], [equation variable] Menu Location Press: 1. [STAT] to access the statistics menu 2. [LEFT] to access the CALC submenu 3. 6 to select CubicReg, or use arrows TI-83/84/+/SE 1 byte The CubicReg command can calculate the best fit cubic function through a set of points. To use it, you must first store the points to two lists: one of the x-coordinates and one of the y-coordinates, ordered so that the nth element of one list matches up with the nth element of the other list. L₁ and L₂ are the default lists to use, and the List Editor (STAT > Edit…) is a useful window for entering the points. You must have at least 4 points because there are infinitely many cubics that can go through 3 points or less. In its simplest form, CubicReg takes no arguments, and calculates a cubic through the points in L₁ and L₂: :{9,13,21,30,31,31,34→L₁ :{260,320,420,530,560,550,590→L₂ :CubicReg  On the home screen, or as the last line of a program, this will display the equation of the quadratic: you'll be shown the format, y=ax³+bx²+cx+d, and the values of a, b, c, and d. It will also be stored in the RegEQ variable, but you won't be able to use this variable in a program — accessing it just pastes the equation wherever your cursor was. Finally, the statistical variables a, b, c, d, and R² will be set as well. This latter variable will be displayed only if "Diagnostic Mode" is turned on (see DiagnosticOn and DiagnosticOff). You don't have to do the regression on L₁ and L₂, but if you don't you'll have to enter the names of the lists after the command. For example: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :CubicReg ∟FAT,∟CALS  You can attach frequencies to points, for when a point occurs more than once, by supplying an additional argument — the frequency list. This list does not have to contain integer frequencies. If you add a frequency list, you must supply the names of the x-list and y-list as well, even when they're L₁ and L₂. Finally, you can enter an equation variable (such as Y₁) after the command, so that the equation is stored in this variable automatically. This doesn't require you to supply the names of the lists, but if you do, the equation variable must come last. You can use polar, parametric, or sequential variables as well, but since the quadratic will be in terms of X anyway, this doesn't make much sense. An example of CubicReg with all the optional arguments: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :{2,1,1,1,2,1,1→FREQ :CubicReg ∟FAT,∟CALS,∟FREQ,Y₁  # Advanced Note that even if a relationship is actually linear or quadratic, since a cubic regression has all the freedom of a linear regression and more, it will produce a better R² value, especially if the number of points is small, and may lead you to (falsely) believe that a relationship is cubic when it actually isn't. Take the correlation constant with a grain of salt, and consider if the fit is really that much better at the expense of doubling the complexity and if there's any reason to believe the relationship between the variables may be cubic. # Related Commands Command Summary Calculates the best fit quadratic through a set of points. Command Syntax QuadReg [x-list, y-list, [frequency list], [equation variable] Menu Location Press: 1. STAT to access the statistics menu 2. LEFT to access the CALC submenu 3. 5 to select QuadReg, or use arrows TI-83/84/+/SE 1 byte The QuadReg command can calculate the best fit quadratic through a set of points. To use it, you must first store the points to two lists: one of the x-coordinates and one of the y-coordinates, ordered so that the nth element of one list matches up with the nth element of the other list. L₁ and L₂ are the default lists to use, and the List Editor (STAT > Edit…) is a useful window for entering the points. You must have at least 3 points, because there are infinitely many quadratics that can go through 2 points or 1 point. In its simplest form, QuadReg takes no arguments, and calculates a quadratic through the points in L₁ and L₂: :{9,13,21,30,31,31,34→L₁ :{260,320,420,530,560,550,590→L₂ :QuadReg  On the home screen, or as the last line of a program, this will display the equation of the quadratic: you'll be shown the format, y=ax²+bx+c, and the values of a, b, and c. It will also be stored in the RegEQ variable, but you won't be able to use this variable in a program - accessing it just pastes the equation wherever your cursor was. Finally, the statistical variables a, b, c, and R² will be set as well. This latter variable will be displayed only if "Diagnostic Mode" is turned on (see DiagnosticOn and DiagnosticOff). You don't have to do the regression on L₁ and L₂, but if you don't you'll have to enter the names of the lists after the command. For example: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :QuadReg ∟FAT,∟CALS  You can attach frequencies to points, for when a point occurs more than once, by supplying an additional argument - the frequency list. This list does not have to contain integer frequencies. If you add a frequency list, you must supply the names of the x-list and y-list as well, even when they're L₁ and L₂. Finally, you can enter an equation variable (such as Y₁) after the command, so that the quadratic is stored to this equation automatically. This doesn't require you to supply the names of the lists, but if you do, the equation variable must come last. You can use polar, parametric, or sequential variables as well, but since the quadratic will be in terms of X anyway, this doesn't make much sense. An example of QuadReg with all the optional arguments: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :{2,1,1,1,2,1,1→FREQ :QuadReg ∟FAT,∟CALS,∟FREQ,Y₁  # Advanced Note that even if a relationship is actually linear, since a quadratic regression has all the freedom of a linear regression and more, it will produce a better R² value, especially if the number of terms is small, and may lead you to (falsely) believe that a relationship is quadratic when it actually isn't. Take the correlation constant with a grain of salt, and consider if the fit is really that much better at the expense of added complexity, and if there's any reason to believe the relationship between the variables may be quadratic. # Related Commands Command Summary Calculates the cumulative geometric probability for a single value Command Syntax geometcdf(probability, trials) Menu Location Press: 1. 2ND DISTR to access the distribution menu 2. ALPHA E to select geometcdf(, or use arrows. Press ALPHA F instead of ALPHA E on a TI-84+/SE with OS 2.30 or higher. TI-83/84/+/SE 2 bytes This command is used to calculate cumulative geometric probability. In plainer language, it solves a specific type of often-encountered probability problem, that occurs under the following conditions: 1. A specific event has only two outcomes, which we will call "success" and "failure" 2. The event is going to keep happening until a success occurs 3. Success or failure is determined randomly with the same probability of success each time the event occurs 4. We're interested in the probability that it takes at most a specific amount of trials to get a success. For example, consider a basketball player that always makes a shot with 1/4 probability. He will keep throwing the ball until he makes a shot. What is the probability that it takes him no more than 4 shots? 1. The event here is throwing the ball. A "success", obviously, is making the shot, and a "failure" is missing. 2. The event is going to happen until he makes the shot: a success. 3. The probability of a success - making a shot - is 1/4 4. We're interested in the probability that it takes at most 4 trials to get a success The syntax here is geometcdf(probability, trials). In this case: :geometcdf(1/4,4  This will give about .684 when you run it, so there's a .684 probability that he'll make a shot within 4 throws. Note the relationship between geometpdf( and geometcdf(. Since geometpdf( is the probability it will take exactly N trials, we can write that geometcdf(1/4,4) = geometpdf(1/4,1) + geometpdf(1/4,2) + geometpdf(1/4,3) + geometpdf(1/4,4). # Formulas Going off of the relationship between geometpdf( and geometcdf(, we can write a formula for geometcdf( in terms of geometpdf(: (1) \begin{align} \operatorname{geometcdf}(p,n) = \sum_{i=1}^{n} \operatorname{geometpdf}(p,i) = \sum_{i=1}^{n} p\,(1-p)^{i-1} \end{align} (If you're unfamiliar with sigma notation,\sum_{i=1}^{n}just means "add up the following for all values of i from 1 to n") However, we can take a shortcut to arrive at a much simpler expression for geometcdf(. Consider the opposite probability to the one we're interested in, the probability that it will not take "at most N trials", that is, the probability that it will take more than N trials. This means that the first N trials are failures. So geometcdf(P,N) = (1 - "probabiity that the first N trials are failures"), or: (2) \begin{align} \operatorname{geometcdf}(p,n) = 1-(1-p)^n \end{align} # Related Commands Command Summary Calculates the geometric probability for a single value Command Syntax geometpdf(probability, trials) Menu Location Press: 1. 2ND DISTR to access the distribution menu 2. ALPHA D to select geometpdf(, or use arrows. Press ALPHA E instead of ALPHA D on a TI-84+/SE with OS 2.30 or higher. TI-83/84/+/SE 2 bytes This command is used to calculate geometric probability. In plainer language, it solves a specific type of often-encountered probability problem, that occurs under the following conditions: 1. A specific event has only two outcomes, which we will call "success" and "failure" 2. The event is going to keep happening until a success occurs 3. Success or failure is determined randomly with the same probability of success each time the event occurs 4. We're interested in the probability that it takes a specific amount of trials to get a success. For example, consider a basketball player that always makes a shot with 1/3 probability. He will keep throwing the ball until he makes a shot. What is the probability that it takes him 3 shots? 1. The event here is throwing the ball. A "success", obviously, is making the shot, and a "failure" is missing. 2. The event is going to happen until he makes the shot: a success. 3. The probability of a success - making a shot - is 1/3 4. We're interested in the probability that it takes 3 trials to get a success The syntax here is geometpdf(probability, trials). In this case: :geometpdf(1/3,3  This will give about .148 when you run it, so there's a .148 probability that it will take him 3 shots until he makes one (he'll make it on the 3rd try). # Formulas The value of geometpdf( is given by the formula (1) \begin{align} \operatorname{geometpdf}(p,n) = p(1-p)^{n-1} \end{align} This formula can be intuitively understood: the probability that the first success is the nth trial is the probability of getting a success -p$- times the probability of missing it the first n-1 times -$(1-p)^{n-1}. For the trivial value of n=0, however, the above formula gives the incorrect value of 1. It should actually be 0, since the first success can never be the 0th trial. However, since you're not likely to ever be interested in this probability, this drawback doesn't really matter. # Related Commands Command Summary Finds the probability of an interval of the normal curve, and graphs the normal curve with the interval's area shaded. Command Syntax ShadeNorm(lower, upper, [μ, σ]) Menu Location Press: 1. 2ND DISTR to access the distribution menu 2. RIGHT to select the DRAW submenu 3. ENTER to select ShadeNorm( TI-83/84/+/SE 2 bytes ShadeNorm( is equivalent to normalcdf( in terms of the probability it calculates: if a random variable follows the normal distribution, you can use it to calculate the probability that the variable's value falls in a certain interval. However, in addition to calculating the probability, this command also draws the normal curve, and shades the interval whose area represents the probability you want. Note that this command does not actually return the value it calculates in Ans or anywhere else: it's merely displayed on the graph. If you're going to use the value in further calculations, you'll have to use normalcdf( as well. There are two ways to use ShadeNorm(. With two arguments (lower bound and upper bound), the calculator will assume you mean the standard normal distribution, and use that to find the probability corresponding to the interval between "lower bound" and "upper bound". You can also supply two additional arguments to use the normal distribution with a specified mean and standard deviation. For example: for the standard normal distribution :ShadeNorm(-1,1 for the normal distribution with mean 10 and std. dev. 2.5 :ShadeNorm(5,15,10,2.5  # Advanced Often, you want to find a "tail probability" - a special case for which the interval has no lower or no upper bound. For example, "what is the probability x is greater than 2?". The TI-83+ has no special symbol for infinity, but you can use E99 to get a very large number that will work equally well in this case (E is the decimal exponent obtained by pressing [2nd] [EE]). Use E99 for positive infinity, and -E99 for negative infinity. It can be hard to find the best window for ShadeNorm( to work in, since it doesn't automatically zoom for you. For the standard curve, the graph doesn't go above y=.5 (a good value for Ymax); Ymin should probably be something small. Xmin and Xmax could be -3 to 3 (3 deviations out); change this around to see more or less of the graph. For nonstandard curves, increasing the standard deviation stretches and flattens the curve; by dividing Ymax and multiplying Xmin and Xmax by the standard deviation, you'll account for this effect. To account for the mean, add it to both Xmin and Xmax. You may also choose to standardize the lower and upper values instead by applying the formula (z-μ)/σ. Keep in mind that ShadeNorm is just a drawing command and not an actual graphed function, so resizing the window, ClrDraw, and a bunch of other things will simply get rid of it. # Related Commands Command Summary Calculates the Student's t probability betwen lower and upper for degrees of freedom ν. Command Syntax tcdf(lower, upper, ν) Menu Location Press: 1. 2ND DISTR to access the distribution menu 2. 5 to select tcdf(, or use arrows. Press 6 instead of 5 on a TI-84+/SE with OS 2.30 or higher. TI-83/84/+/SE 2 bytes tcdf( is the Student's t cumulative density function. If some random variable follows this distribution, you can use this command to find the probability that this variable will fall in the interval you supply. Unlike normalcdf(, this command only works for the standardized distribution with mean 0 and standard deviation 1. To use it for non-standardized values you will have to standardize them by calculating (X-μ)/σ (where μ is the mean and σ the standard deviation). Do this for both lower and upper. # Advanced Often, you want to find a "tail probability" - a special case for which the interval has no lower or no upper bound (the form frequently used in one-tailed tests). For example, "what is the probability x is greater than 2?". The TI-83+ has no special symbol for infinity, but you can use E99 to get a very large number that will work equally well in this case (E is the decimal exponent obtained by pressing [2nd] [EE]). Use E99 for +∞, and -E99 for -∞. Alternatively, you can exploit the identity (1) \begin{align} \operatorname{tcdf}(-\infty,0,\nu)=\frac1{2} \end{align} (similarly for the interval from 0 to ∞) and thus (2) \begin{align} \operatorname{tcdf}(-\infty,x,\nu)=\frac1{2}+\operatorname{tcdf}(0,x,\nu) \end{align} For the form used in two-tailed tests, the following identity may be useful: (3) \begin{align} \operatorname{tcdf}(-x,x,\nu)=2\operatorname{tcdf}(0,x,\nu) \end{align} # Formulas As with any other continuous distribution, tcdf( can be defined in terms of the probability density function, tpdf(: (4) \begin{align} \operatorname{tcdf}(a,b,\nu)=\int_a^b \operatorname{tpdf}(t,\nu)\mathrm{d}t \end{align} The function can also be expressed in terms of an incomplete beta function. For one degree of freedom (ν=1), tcdf( is expressible in terms of simpler functions: (5) \begin{align} \operatorname{tcdf}(a,b,1)=\frac1{\pi}\left(\tan^{-1}\left(b\right)-\tan^{-1}\left(a\right)\right) \end{align} This is the so-called Cauchy distribution. # Related Commands Command Summary Evaluates the Student's t probability density function with degrees of freedom ν. Command Syntax tpdf(t, ν) Menu Location Press: 1. 2ND DISTR to access the distribution menu 2. 4 to select tpdf(, or use arrows. Press 5 instead of 4 on a TI-84+/SE with OS 2.30 or higher. TI-83/84/+/SE 2 bytes tpdf( is the Student's t probability density function. Since the t distribution is continuous, the value of tpdf( doesn't represent an actual probability — in fact, one of the few uses for this command is to draw a graph of the bell curve. You could also use it for various calculus purposes, such as finding inflection points. The command takes two arguments: the first is the value where the PDF is to be evaluated, and the second is the number of degrees of freedom (so the calculator knows which t distribution to use). As the degrees of freedom increases without bound, tpdf( approaches normalpdf(; i.e. (1) \begin{align} \definecolor{darkgreen}{rgb}{0.90,0.91,0.859}\pagecolor{darkgreen} \lim_{\nu\rightarrow\infty}\operatorname{tpdf}(x,\nu)=\operatorname{normalpdf}(x) \end{align} # Formulas The value of tpdf( is given by (2) \begin{align} \operatorname{tpdf}(t,\nu) = \frac{\Gamma((\nu+1)/2)}{\sqrt{\nu\pi}\,\Gamma(\nu/2)}\,\left(1+\frac{t^2}{\nu}\right)^{-\frac1{2}(\nu+1)} \end{align} (where Γ is the gamma function), or alternatively (3) \begin{align} \operatorname{tpdf}(t,\nu) = \frac1{\sqrt{\nu}B(\nu/2,1/2)}\,\left(1+\frac{t^2}{\nu}\right)^{-\frac1{2}(\nu+1)} \end{align} (where B is the beta function) # Related Commands Command Summary Performs a one way ANOVA (analysis of variance) test to compare the means of multiple populations (up to 20). Command Syntax ANOVA(list, list, … Menu Location Press: 1. STAT to access the statistics menu 2. LEFT to access the TESTS submenu 3. ALPHA F to select ANOVA(, or use arrows Change the last keypress to ALPHA H on a TI-84+/SE with OS 2.30 or higher. TI-83/84/+/SE 2 bytes The ANOVA (analysis of variance) command is used to test if there is a significant difference between the means of several populations (this is an extension of the two-sample t-test which compares only two populations). The calculator assumes the null hypothesis, that all means are equal, and returns a probability value, p, of the differences in the data occurring if the null hypothesis were true. If p is small (usually, if it's less than .05), then it's unlikely we'd get such differences just by chance if the null hypothesis were true, so we reject it and conclude that at least one of the means is different. There are two reasons why we don't test the means in pairs using a simpler test. First of all, it would take a long time: there's so many pairs to compare. Second of all, when you're doing many tests, there's a high probability you'll get a low p-value by chance. Imagine that you're doing 10 tests. If the probability of getting a low p-value on one test is .05, then the probability that at least one test will return one is 1-.9510: about 0.4 - this is quite likely to happen. The ANOVA test avoids this by having only one null hypothesis to test. If you're only interested in the result of the test, the only thing you'll need in the output is the second line: "p=…" This is your p-value, and determines whether you should reject the null hypothesis or not. If you need more detail, here are the meanings of the other variables: • F is the test statistic. If the null hypothesis is true, it should follow Snedecor's F distribution, and Fcdf( can be used to determine the p-value. • For both Factor and Error: • MS is the mean squares (SS/df). If the null hypothesis is true, Factor MS should be roughly equal to Error MS • SS is the sum of squares - see the TI-83+ Manual for formulas • df is the number of degrees of freedom - for Factor, it's the df between the categorical variables, and for Error, it's the sum of df between each variable. • Sxp is the pooled variation. # Advanced Uses The statistics F, p, and Sxp will be stored to the appropriate variables after this test. The other six statistics do not have a normal variable associated with them. However, the two-byte tokens 0x6237 through 0x623C are, in fact, used to store the values of Factor MS, Factor SS, Factor df, Error MS, Error SS, and Error df respectively. They can't be accessed through a menu, but if you use a hex editor to paste them into your program, you will be able to use them just like any other variable. However, be careful because the Factor and Error tokens look exactly alike (even though they refer to different variables), and can be confused. Also, there is a chance that future OS versions will change the behavior of ANOVA(, though this is unlikely, and this trick will no longer work. # Error Conditions • ERR:ARGUMENT is thrown if one of the lists is blank, only one list is used, or the function is completely blank. • ERR:SYNTAX is thrown if you do not use lists (Matrixes, numbers,etc) • * ERR:INVALID DIM is thrown if you use a list that has 0 or a negative number. • * ERR:DATA TYPE is thrown by using "l" or a list with a different set of data. # Related Commands Command Summary Using either already-calculated statistics, or a data set, computes a t confidence interval. Command Syntax TInterval [list, [frequency]], [confidence level] (data list input) TInterval mean, std. deviation, sample size, [confidence level] (summary stats input) Menu Location When editing a program, press: 1. STAT to access the statistics menu 2. LEFT to access the TESTS submenu 3. 8 to select TInterval, or use arrows (this key sequence will give you the TInterval… screen outside a program) TI-83/84/+/SE 2 bytes The TInterval command calculates a confidence interval for the mean value of a population, at a specific confidence level: for example, if the confidence level is 95%, you are 95% certain that the mean lies within the interval you get. Use TInterval when you have a single variable to analyze, and don't know the standard deviation. The TInterval assumes that your distribution is normal, but it will work for other distributions if the sample size is large enough. There are two ways to call the TInterval command: by supplying it with needed sample statistics (mean, sample standard deviation, and sample size), or by entering a list and letting the calculator work the statistics out. # Sample Problem You want to know the average height of a student at your school. You haven't asked everyone, but you took a random sample of 30 people and found out their heights (and stored it to L1). You've decided to use a 95% confidence interval. Since the syntax for entering a data list is TInterval list, confidence level, here is your code: :TInterval L1,95 you can also use :TInterval L1,.95  Alternatively, you could calculate the mean, sample size, and standard deviation, and enter those instead. The sample size in this case is 30; let's say the mean was 63 inches and the standard deviation 6.2 inches. The syntax for entering statistics is TInterval mean, std. deviation, sample size, confidence level, so your code would look like: :TInterval 63,6.2,30,95 you can also use :TInterval 63,6.2,30,.95  Of course, the main use of the TInterval command is in a program. While you can enter the TInterval command on the home screen as well (just look in the catalog for it), it would probably be easier to select TInterval… from the STAT>TEST menu (see the sidebar). # Advanced Uses As with most other statistical commands, you can enter a second list after the data list, to add frequencies (only with the data list syntax, of course). The frequency list must contain non-negative integers, and can't be all 0. # Optimization Using the data list syntax, all the arguments are optional: the calculator will assume you want to use L1 for your data unless another list is supplied, and that the confidence level you want is 95% unless you give another one. Using the summary stats syntax, the confidence level is also optional - again, the calculator will assume 95%. This means we can rewrite our code above in a simpler manner: :TInterval L1,95 can be just :TInterval  :TInterval 63,6.2,30,95 can be :TInterval 63,6.2,30  # Error Conditions • ERR:DATA TYPE occurs if complex numbers are used (in some cases, ERR:ARGUMENT is thrown instead). • ERR:DIM MISMATCH occurs if the data and frequency lists aren't the same size. • ERR:DOMAIN occurs in any of the following cases: • The confidence level isn't in the range (0 .. 100). • The standard deviation isn't positive. • The sample size isn't an integer greater than 1. • ERR:STAT occurs if the frequency list's elements aren't integers. # Related Commands Command Summary Using either already-calculated statistics, or a data set, computes a Z confidence interval. Command Syntax ZInterval std. deviation, [list, [frequency]] [,confidence level] (data list input) ZInterval std. deviation, mean, sample size, [confidence level] (summary stats input) Menu Location When editing a program, press: 1. STAT to access the statistics menu 2. LEFT to access the TESTS submenu 3. 7 to select ZInterval, or use arrows (this key sequence will give you the ZInterval… screen outside a program) TI-83/84/+/SE 2 bytes The ZInterval command calculates a confidence interval for the mean value of a population, at a specific confidence level: for example, if the confidence level is 95%, you are 95% certain that the mean lies within the interval you get. Use ZInterval when you have a single variable to analyze, and you already know the standard deviation. The ZInterval assumes that your distribution is normal, but it will work for other distributions if the sample size is large enough. There are two ways to call the ZInterval command: by supplying it with needed sample statistics (mean and sample size), or by entering a list and letting the calculator work the statistics out. In either case, you will need to enter the standard deviation and desired confidence level as well. # Sample Problem You want to know the average height of a student at your school. You haven't asked everyone, but you took a random sample of 30 people and found out their height (and stored it to L1). You've read in your textbook that the standard deviation of teenagers' heights is usually 6 inches. You've decided to use a 95% confidence interval. Since the syntax for entering a data list is ZInterval std. deviation, list, confidence level, the code would look like: :ZInterval 6,L1,95 you can also use :ZInterval 6,L1,.95  Alternatively, you could calculate the mean and sample size and enter those instead. The sample size in this case is 30; let's say the mean was 63 inches. The syntax for entering statistics is ZInterval std. deviation, mean, sample size, confidence level, so your code would look like: :ZInterval 6,63,30,95 you can also use :ZInterval 6,63,30,.95  Of course, the main use of the ZInterval command is in a program. While you can enter the ZInterval command on the home screen as well (just look in the catalog for it), it would probably be easier to select ZInterval… from the STAT>TEST menu (see the sidebar). # Advanced Uses As with most other statistical commands, you can enter a second list after the data list, to add frequencies (only with the data list syntax, of course). The frequency list must contain non-negative real numbers, and can't be all 0. # Optimization Using the data list syntax, all items but the standard deviation are optional: the calculator will assume you want to use L1 for your data unless another list is supplied, and that the confidence level you want is 95% unless you give another one. Using the summary stats syntax, the confidence level is also optional - again, the calculator will assume 95%. This means we can rewrite our code above in a simpler manner: :ZInterval 6,L1,95 can be :ZInterval 6  :ZInterval 6,63,30,95 can be :ZInterval 6,63,30  # Related Commands Command Summary Calculates the binomial cumulative probability, either at a single value or for all values Command Syntax for a single value: binomcdf(trials, probability, value for a list of all values (0 to trials) binomcdf(trials, probability Menu Location Press: 1. 2ND DISTR to access the distribution menu 2. ALPHA A to select binomcdf(, or use arrows. Press ALPHA B instead of ALPHA A on a TI-84+/SE with OS 2.30 or higher. TI-83/84/+/SE 2 bytes This command is used to calculate the binomial cumulative probability function. In plainer language, it solves a specific type of often-encountered probability problem, that occurs under the following conditions: 1. A specific event has only two outcomes, which we will call "success" and "failure" 2. This event is going to repeat a specific number of times, or "trials" 3. Success or failure is determined randomly with the same probability of success each time the event occurs 4. We're interested in the probability that there are at most N successes For example, consider a couple that intends to have 4 children. What is the probability that at most 2 are girls? 1. The event here is a child being born. It has two outcomes "boy" or "girl". In this case, since the question is about girls, it's easier to call "girl" a success. 2. The event is going to repeat 4 times, so we have 4 trials 3. The probability of a girl being born is 50% or 1/2 each time 4. We're interested in the probability that there are at most 2 successes (2 girls) The syntax here is binomcdf(trials, probability, value). In this case: :binomcdf(4,.5,2  This will give .6875 when you run it, so there's a .6875 probability out of 4 children, at most 2 will be girls. An alternate syntax for binomcdf( leaves off the last argument, value. This tells the calculator to compute a list of the results for all values. For example: :binomcdf(4,.5  This will come to {.0625 .3125 .6875 .9375 1} when you run it. These are all the probabilities we get when you replace "at most 2 girls" with "at most 0", "at most 1", etc. Here, .0625 is the probability of "at most 0" girls (or just 0 girls), .3125 is the probability of at most 1 girl (1 or 0 girls), etc. Several other probability problems actually are the same as this one. For example, "less than N" girls, just means "at most N-1" girls. "At least N" girls means "at most (total-N)" boys (here we switch our definition of what a success is). "No more than", of course, means the same as "at most". # Advanced (for programmers) The binompdf( and binomcdf( commands are the only ones apart from seq( that can return a list of a given length, and they do it much more quickly. It therefore makes sense, in some situations, to use these commands as substitutes for seq(. Here's how to do it: 1. cumSum(binomcdf(N,0 gives the list {1 2 … N+1}, and cumSum(not(binompdf(N,0 gives the list {0 1 2 … N}. 2. With seq(, you normally do math inside the list: seq(3I2,I,0,5 3. With these commands, you do the same math outside the list: 3Ans2 where Ans is the list {0 1 … 5}. :seq(2^I,I,1,5 can be :cumSum(binomcdf(4,0 :2^Ans which in turn can be :2^cumSum(binomcdf(4,0  In general (where f() is some operation or even several operations): :seq(f(I),I,1,N can be :cumSum(binomcdf(N-1,0 :f(Ans which can sometimes be :f(cumSum(binomcdf(N-1,0  If the lower bound on I in the seq( statement is 0 and not 1, you can use binompdf( instead: :seq(f(I),I,0,N can be :cumSum(not(binompdf(N,0 :f(Ans which can sometimes be :f(cumSum(not(binompdf(N,0  This will not work if some command inside seq( can take only a number and not a list as an argument. For example, seq(L1(I),I,1,5 cannot be optimized this way. # Formulas Since "at most N" is equivalent to "0 or 1 or 2 or 3 or … N", and since we can combine these probabilities by adding them, we can come up with an expression for binomcdf( by adding up values of binompdf(: (1) \begin{align} \operatorname{binomcdf}(n,p,k) = \sum_{i=0}^{k}\operatorname{binompdf}(n,p,i) = \sum_{i=0}^{k}\binom{n}{i}\,p^i\,(1-p)^{n-i} \end{align} (If you're not familiar with sigma notation,\sum_{i=0}^{k}just means "add the following up for each value of i 0 through k") # Error Conditions • ERR:DATATYPE is thrown if you try to generate a list of probabilities with p equal to 0 or 1, and at least 257 trials. • ERR:DOMAIN is thrown if the number of trials is at least 1 000 000, unless the other arguments make the problem trivial. # Related Commands Command Summary Calculates the binomial probability, either at a single value or for all values Command Syntax for a single value: binompdf(trials, probability, value for a list of all values (0 to trials) binompdf(trials, probability Menu Location Press: 1. 2ND DISTR to access the distribution menu 2. 0 to select binompdf(, or use arrows. Press ALPHA A instead of 0 on a TI-84+/SE with OS 2.30 or higher. TI-83/84/+/SE 2 bytes This command is used to calculate the binomial probability. In plainer language, it solves a specific type of often-encountered probability problem, that occurs under the following conditions: 1. A specific event has only two outcomes, which we will call "success" and "failure" 2. This event is going to repeat a specific number of times, or "trials" 3. Success or failure is determined randomly with the same probability of success each time the event occurs 4. We're interested in the probability that there are exactly N successes For example, consider a couple that intends to have 4 children. What is the probability that 3 of them are girls? 1. The event here is a child being born. It has two outcomes "boy" or "girl". We can call either one a success, but we'll choose to be sexist towards guys and call a girl a success in this problem 2. The event is going to repeat 4 times, so we have 4 trials 3. The probability of a girl being born is 50% or 1/2 each time 4. We're interested in the probability that there are exactly 3 successes (3 girls) The syntax here is binompdf(trials, probability, value). In this case: :binompdf(4,.5,3  This will give .25 when you run it, so there's a .25 (1/4) probability out of 4 children, 3 will be girls. An alternate syntax for binompdf( leaves off the last argument, value. This tells the calculator to compute a list of the results for all values. For example: :binompdf(4,.5  This will come to {.0625 .25 .375 .25 .0625} when you run it. These are the probabilities of all 5 outcomes (0 through 4 girls) for 4 children with an equal probability of being born. There's a .0625 probability of no girls, a .25 probability of 1 girl, etc. # Advanced (for programmers) The binompdf( and binomcdf( commands are the only ones apart from seq( that can return a list of a given length, and they do it much more quickly. It therefore makes sense, in some situations, to use these commands as substitutes for seq(. Here's how to do it: 1. cumSum(binomcdf(N,0 gives the list {1 2 … N+1}, and cumSum(not(binompdf(N,0 gives the list {0 1 2 … N}. 2. With seq(, you normally do math inside the list: for example, seq(3I2,I,0,5 3. With these commands, you do the same math outside the list: 3Ans2 where Ans is the list {0 1 … 5}. An example: :seq(2^I,I,1,5 can be :cumSum(binomcdf(4,0 :2^Ans which in turn can be :2^cumSum(binomcdf(4,0  In general (where f() is some operation or even several operations): :seq(f(I),I,1,N can be :cumSum(binomcdf(N-1,0 :f(Ans which can sometimes be :f(cumSum(binomcdf(N-1,0  If the lower bound on I in the seq( statement is 0 and not 1, you can use binompdf( instead: :seq(f(I),I,0,N can be :cumSum(not(binompdf(N,0 :f(Ans which can sometimes be :f(cumSum(not(binompdf(N,0  This will not work if some command inside seq( can take only a number and not a list as an argument. For example, seq(L1(I),I,1,5 cannot be optimized this way. # Formulas The value of binompdf( is given by the formula (1) \begin{align} \operatorname{binompdf}(n,p,k) = \binom{n}{k}\,p^k\,(1-p)^{n-k} = \frac{n!}{k!\,(n-k)!}\,p^k\,(1-p)^{n-k} \end{align} This formula is fairly intuitive. We want to know the probability that out of n trials, exactly k will be successes, so we take the probability of k successes -p^k$- multiplied by the probability of (n-k) failures -$(1-p)^{n-k}$- multiplied by the number of ways to choose which k trials will be successes -$\binom{n}{k}. # Error Conditions • ERR:DOMAIN is thrown if the number of trials is at least 1 000 000 (unless the other arguments make the problem trivial) # Related Commands Command Summary Calculates the inverse of the cumulative normal distribution function. Command Syntax invNorm(probability[,μ, σ]) Menu Location Press: 1. 2ND DISTR to access the distribution menu 2. 3 to select invNorm(, or use arrows. TI-83/84/+/SE 2 bytes invNorm( is the inverse of the cumulative normal distribution function: given a probability, it will give you a z-score with that tail probability. The probability argument of invNorm( is between 0 and 1; 0 will give -1E99 instead of negative infinity, and 1 will give 1E99 instead of positive infinity There are two ways to use invNorm(. With three arguments, the inverse of the cumulative normal distribution for a probability with specified mean and standard deviation is calculated. With one argument, the standard normal distribution is assumed (zero mean and unit standard deviation). For example: for the standard normal distribution :invNorm(.975 for the normal distribution with mean 10 and std. dev. 2.5 :invNorm(.975,10,2.5  # Advanced This is the only inverse of a probability distribution function available (at least on the TI 83/+/SE calculators), so it makes sense to use it as an approximation for other distributions. Since the normal distribution is a good approximation for a binomial distribution with many trials, we can use invNorm( as an approximation for the nonexistent "invBinom(". The following code gives the number of trials out of N that will succeed with probability X if the probability of any trial succeeding is P (rounded to the nearest whole number): :int(.5+invNorm(X,NP,√(NP(1-P  You can also use invNorm() to approximate the inverse of a t-distribution. Since a normal distribution is a t-distribution with infinite degrees of freedom, this will be an overestimate for probabilities below 1/2, and an underestimate for probabilities above 1/2. # Formulas Unlike the normalpdf( and normalcdf( commands, the invNorm( command does not have a closed-form formula. It can however be expressed in terms of the inverse error function: (1) \begin{align} \operatorname{invNorm}(p) = \sqrt{2}\,\operatorname{erf}^{-1}(2p-1) \end{align} For the arbitrary normal distribution with mean μ and standard deviation σ: (2) \begin{align} \operatorname{invNorm}(p,\mu,\sigma)=\mu+\sigma\operatorname{invNorm}(p) \end{align} # Related Commands Command Summary Finds the probability for an interval of the normal curve. Command Syntax normalcdf(lower, upper [, μ, σ]) Menu Location Press: 1. 2ND DISTR to access the distribution menu 2. 2 to select normalcdf(, or use arrows. TI-83/84/+/SE 2 bytes normalcdf( is the normal (Gaussian) cumulative density function. If some random variable follows a normal distribution, you can use this command to find the probability that this variable will fall in the interval you supply. There are two ways to use normalcdf(. With two arguments (lower bound and upper bound), the calculator will assume you mean the standard normal distribution, and use that to find the probability corresponding to the interval between "lower bound" and "upper bound". You can also supply two additional arguments to use the normal distribution with a specified mean and standard deviation. For example: for the standard normal distribution :normalcdf(-1,1 for the normal distribution with mean 10 and std. dev. 2.5 :normalcdf(5,15,10,2.5  # Advanced Often, you want to find a "tail probability" - a special case for which the interval has no lower or no upper bound. For example, "what is the probability x is greater than 2?". The TI-83+ has no special symbol for infinity, but you can use E99 to get a very large number that will work equally well in this case (E is the decimal exponent obtained by pressing [2nd] [EE]). Use E99 for positive infinity, and -E99 for negative infinity. The normal distribution is often used to approximate the binomial distribution when there are a lot of trials. This isn't really necessary on the TI-83+ because the binompdf( and binomcdf( commands are already very fast - however, the normal distribution can be slightly faster, and the skill can come in handy if you don't have access to a calculator but do have a table of normal distributions (yeah, right). Here is how to convert a binomial distribution to a normal one: :binompdf(N,P,X can be :normalcdf(X-.5,X+.5,NP,√(NP(1-P :binomcdf(N,P,X,Y can be :normalcdf(X-.5,Y+.5,NP,√(NP(1-P  How much faster this is will depend on N and P, since the binomial distribution takes a long time to evaluate for large values of N, but the normal distribution takes about the same time for any mean and standard deviation. Also, this is an approximation that is only valid for some binomial distributions - a common rule of thumb is NP>10. # Formulas As with other continuous distributions, any probability is an integral of the probability density function. Here, too, we can define normalcdf( for the standard normal case in terms of normalpdf(: (1) \begin{align} \operatorname{normalcdf}(a,b)=\int_a^b \operatorname{normalpdf}(x) \, \mathrm{d}x=\frac1{\sqrt{2\pi\,}} \int_a^b e^{-\frac1{2}x^2} \, \mathrm{d}x \end{align} or in terms of the error function: (2) \begin{align} \operatorname{normalcdf}(a,b)=\frac1{2}\left(\operatorname{erf}\left(\frac{b}{\sqrt{2}}\right)-\operatorname{erf}\left(\frac{a}{\sqrt{2}}\right)\right) \end{align} For the arbitrary mean μ and standard deviation σ, normalcdf( is defined in terms of the standard normal distribution, with the bounds of the interval standardized: (3) \begin{align} \operatorname{normalcdf}(a,b,\mu,\sigma)=\operatorname{normalcdf}\left(\frac{a-\mu}{\sigma},\frac{b-\mu}{\sigma} \right) \end{align} # Related Commands Command Summary Evaluates the normal probability density function at a point. Command Syntax normalpdf(x[,μ, σ]) Menu Location Press: 1. 2ND DISTR to access the distribution menu 2. ENTER to select normalpdf(. TI-83/84/+/SE 2 bytes normalpdf( is the normal (Gaussian) probability density function. Since the normal distribution is continuous, the value of normalpdf( doesn't represent an actual probability - in fact, one of the only uses for this command is to draw a graph of the normal curve. You could also use it for various calculus purposes, such as finding inflection points. The command can be used in two ways: normalpdf(x) will evaluate the standard normal p.d.f. (with mean at 0 and a standard deviation of 1) at x, and normalpdf(x,μ,σ) will work for an arbitrary normal curve, with mean μ and standard deviation σ. # Formulas For the standard normal distribution, normalpdf(x) is defined as (1) \begin{align} \operatorname{normalpdf}(x)=\frac1{\sqrt{2\pi\,}} \, e^{-\frac1{2}x^2} \end{align} For other normal distributions, normalpdf( is defined in terms of the standard distribution: (2) \begin{align} \operatorname{normalpdf}(x,\mu,\sigma)=\frac{1}{\sigma} \, \operatorname{normalpdf} \left(\frac{x-\mu}{\sigma}\right) \end{align} # Related Commands Command Summary Calculates the median fit line through a set of points. Command Syntax Med-Med [x-list, y-list, [frequency], [equation] Menu Location Press: 1. STAT to access the statistics menu 2. LEFT to access the CALC submenu 3. 3 to select Med-Med, or use arrows TI-83/84/+/SE 1 byte The Med-Med command is one of several that can calculate a line of best fit through a set of points. However, unlike the LinReg(ax+b) and LinReg(a+bx) commands, which generate the same result in different formats, Med-Med produces a different line entirely, known as the 'median fit line' or the 'median-median model'. This model is more resistant to outliers than the best-fit line produced by LinReg(ax+b)-type commands, in much the same way that the median of a set of data is more resistant to outliers than the mean. The process of calculating a median fit line is roughly as follows (reference): 1. Divide the data into three equal groups by their x-values (the smallest third, the middle third, and the largest third) 2. Find the "median point" for each group by pairing the median x-value in the group with the median y-value (this need not be an actual data point). 3. These points are stored to (x₁,y₁), (x₂,y₂), and (x₃,y₃) on the calculator. 4. Find the line passing through the median point for the first and third group. 5. Shift this line one-third of the way toward the median point of the second group. To use the Med-Med command, you must first store the points to two lists: one of the x-coordinates and one of the y-coordinates, ordered so that the nth element of one list matches up with the nth element of the other list. L₁ and L₂ are the default lists to use, and the List Editor (STAT > Edit…) is a useful window for entering the points. As you can see from the steps shown above, Med-Med requires at least three points with different x-values to work with. In its simplest form, Med-Med takes no arguments, and calculates a regression line through the points in L₁ and L₂: :{9,13,21,30,31,31,34→L₁ :{260,320,420,530,560,550,590→L₂ :Med-Med  On the home screen, or as the last line of a program, this will display the equation of the regression line: you'll be shown the format, y=ax+b, and the values of a and b. It will also be stored in the RegEQ variable, but you won't be able to use this variable in a program - accessing it just pastes the equation wherever your cursor was. Finally, the statistical variables a and b will be set as well. There are no diagnostics available for the Med-Med command, so r and r² will not be calculated or displayed even if you run DiagnosticOn. You don't have to do the regression on L₁ and L₂, but if you don't you'll have to enter the names of the lists after the command. For example: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :Med-Med ∟FAT,∟CALS  You can attach frequencies to points, for when a point occurs more than once, by supplying an additional argument - the frequency list. This list does not have to contain integer frequencies. If you add a frequency list, you must supply the names of the x-list and y-list as well, even when they're L₁ and L₂. Finally, you can enter an equation variable (such as Y₁) after the command, so that the line of best fit is stored to this equation automatically. This doesn't require you to supply the names of the lists, but if you do, the equation variable must come last. You can use polar, parametric, or sequential variables as well, but since the line of best fit will be in terms of X anyway, this doesn't make much sense. An example of Med-Med with all the optional arguments: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :{2,1,1,1,2,1,1→FREQ :Med-Med ∟FAT,∟CALS,∟FREQ,Y₁  # Related Commands Command Summary Calculates the best fit line through a set of points. Command Syntax LinReg(a+bx) [x-list, y-list, [frequency], [equation] Menu Location Press: 1. STAT to access the statistics menu 2. LEFT to access the CALC submenu 3. 8 to select LinReg(a+bx), or use arrows TI-83/84/+/SE 1 byte The LinReg(a+bx) command is one of several that can calculate the line of best fit through a set of points (it differs from LinReg(ax+b) only in the format of its output). To use it, you must first store the points to two lists: one of the x-coordinates and one of the y-coordinates, ordered so that the nth element of one list matches up with the nth element of the other list. L₁ and L₂ are the default lists to use, and the List Editor (STAT > Edit…) is a useful window for entering the points. In its simplest form, LinReg(a+bx) takes no arguments, and calculates a best fit line through the points in L₁ and L₂: :{9,13,21,30,31,31,34→L₁ :{260,320,420,530,560,550,590→L₂ :LinReg(a+bx)  On the home screen, or as the last line of a program, this will display the equation of the line of best fit: you'll be shown the format, y=a+bx, and the values of a and b. It will also be stored in the RegEQ variable, but you won't be able to use this variable in a program - accessing it just pastes the equation wherever your cursor was. Finally, the statistical variables a, b, r, and r² will be set as well. These latter two variables will be displayed only if "Diagnostic Mode" is turned on (see DiagnosticOn and DiagnosticOff). You don't have to do the regression on L₁ and L₂, but if you don't you'll have to enter the names of the lists after the command. For example: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :LinReg(a+bx) ∟FAT,∟CALS  You can attach frequencies to points, for when a point occurs more than once, by supplying an additional argument - the frequency list. This list does not have to contain integer frequencies. If you add a frequency list, you must supply the names of the x-list and y-list as well, even when they're L₁ and L₂. Finally, you can enter an equation variable (such as Y₁) after the command, so that the line of best fit is stored to this equation automatically. This doesn't require you to supply the names of the lists, but if you do, the equation variable must come last. You can use polar, parametric, or sequential variables as well, but since the line of best fit will be in terms of X anyway, this doesn't make much sense. An example of LinReg(a+bx) with all the optional arguments: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :{2,1,1,1,2,1,1→FREQ :LinReg(a+bx) ∟FAT,∟CALS,∟FREQ,Y₁  # Advanced Uses (for programmers) LinReg(a+bx), along with LinReg(ax+b), can be used to convert a number to a string. # Related Commands Command Summary Calculates the best fit line through a set of points. Command Syntax LinReg(ax+b) [x-list, y-list, [frequency], [equation] Menu Location Press: 1. STAT to access the statistics menu 2. LEFT to access the CALC submenu 3. 4 to select LinReg(ax+b), or use arrows TI-83/84/+/SE 1 byte The LinReg(ax+b) is one of several commands that can calculate the line of best fit through a set of points. To use it, you must first store the points to two lists: one of the x-coordinates and one of the y-coordinates, ordered so that the nth element of one list matches up with the nth element of the other list. L₁ and L₂ are the default lists to use, and the List Editor (STAT > Edit…) is a useful window for entering the points. In its simplest form, LinReg(ax+b) takes no arguments, and calculates a best fit line through the points in L₁ and L₂: :{9,13,21,30,31,31,34→L₁ :{260,320,420,530,560,550,590→L₂ :LinReg(ax+b)  On the home screen, or as the last line of a program, this will display the equation of the line of best fit: you'll be shown the format, y=ax+b, and the values of a and b. It will also be stored in the RegEQ variable, but you won't be able to use this variable in a program - accessing it just pastes the equation wherever your cursor was. Finally, the statistical variables a, b, r, and r² will be set as well. These latter two variables will be displayed only if "Diagnostic Mode" is turned on (see DiagnosticOn and DiagnosticOff). You don't have to do the regression on L₁ and L₂, but if you don't you'll have to enter the names of the lists after the command. For example: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :LinReg(ax+b) ∟FAT,∟CALS  You can attach frequencies to points, for when a point occurs more than once, by supplying an additional argument - the frequency list. This list does not have to contain integer frequencies. If you add a frequency list, you must supply the names of the x-list and y-list as well, even when they're L₁ and L₂. Finally, you can enter an equation variable (such as Y₁) after the command, so that the line of best fit is stored to this equation automatically. This doesn't require you to supply the names of the lists, but if you do, the equation variable must come last. You can use polar, parametric, or sequential variables as well, but since the line of best fit will be in terms of X anyway, this doesn't make much sense. An example of LinReg(ax+b) with all the optional arguments: :{9,13,21,30,31,31,34→FAT :{260,320,420,530,560,550,590→CALS :{2,1,1,1,2,1,1→FREQ :LinReg(ax+b) ∟FAT,∟CALS,∟FREQ,Y₁  # Advanced Uses (for programmers) LinReg(ax+b), along with LinReg(a+bx), can be used to convert a number to a string. # Related Commands Command Summary Changes settings so that the correlation variables, r and r2, are not displayed when calculating a regression Command Syntax DiagnosticOff Menu Location Press: 1. 2ND CATALOG to access the command catalog 2. D to skip to commands starting with D 3. Scroll down and select DiagnosticOff (The DiagnosticOff command can't be found outside the catalog) TI-83/84/+/SE 2 bytes After the DiagnosticOff command is executed, all regression commands found in the STAT>CALC menu, as well as LinRegTTest, will not display the correlation statistics r and r2 (or just R2 in some cases). This is already turned off by default, although there is no disadvantage whatsoever to turning it on. To reverse this command, execute the DiagnosticOn command. The statistic r, known as the correlation coefficient, measures the strength and direction of any linear relationship in the data (therefore if your regression model isn't linear, it may not exist, unless the calculator performed a transformation on the data). If r is close to 1, then the relationship is strong and positive (that is, the variables increase and decrease together). If r is close to -1, then the relationship is strong and negative (that is, as one variable increases, the other decreases). If r is close to 0, there is no linear relationship. The statistic r2 or R2 is equal to the square of the above value (when it exists) and is also a measure of the strength of a relationship. Specifically, it represents the proportion of variance in the dependent variable that is accounted for by the regression model. If this value is close to 1, there is a strong relationship; if it's close to 0, there is either no relationship or the regression model doesn't fit the data. # Advanced Although these statistics are a good indication of whether a regression curve is good or not, they are not infallible. For example, the initial portion of data that actually correlates exponentially may well appear linear and have a high correlation coefficient with a linear fit. Another good way to check a regression curve is to look at the plot of the residuals vs. the x-values. If the regression curve is a good fit, then this plot should appear random in going from positive to negative. However, should you see a distinct pattern - say, if you tried a linear fit but the residual plot looks vaguely parabolic - you know you should try a different regression curve. You should also consider what your regression line implies about the nature of the data and vice versa. For example, if you're comparing the height of release of a ball to the time it takes to fall, a natural assumption is that the regression curve should pass through (0,0), and a curve that doesn't do that may be incorrect. However, take this advice with a grain of salt: if your curve fits the data points you put in but not such natural-assumption points, that may simply mean that the curve works on a limited domain. Or, it may mean your assumptions are wrong. # Command Timings Although the correlation statistics are not displayed with DiagnosticOff, they are calculated in either case. This means that DiagnosticOn and DiagnosticOff will not change how fast regressions are calculated. # Related Commands Command Summary Changes settings so that the correlation variables, r and r² (or R²), are displayed when calculating a regression Command Syntax DiagnosticOn Menu Location Press: 1. 2ND CATALOG to access the command catalog 2. D to skip to commands starting with D 3. Scroll down and select DiagnosticOn (The DiagnosticOn command can't be found outside the catalog) TI-83/84/+/SE 2 bytes After the DiagnosticOn command is executed, all regression commands found in the STAT>CALC menu, as well as LinRegTTest, will display the correlation statistics r and r² (or R2 for regressions that are not linear). This is turned off by default, but there is no disadvantage whatsoever to turning it on. To reverse this command, execute the DiagnosticOff command. The statistic r, known as the Pearson correlation coefficient, measures the strength and direction of any linear relationship in the data. If r is close to 1, then the relationship is strong and positive (that is, the variables increase and decrease together). If r is close to -1, then the relationship is strong and negative (that is, as one variable increases, the other decreases). If r is close to 0, there is no linear relationship. The statistic r² or R², known as the coefficient of determination, is equal to the square of the above value (when it exists) and is also a measure of the strength of a relationship. Specifically, it represents the proportion of variance in the dependent variable that is accounted for by the regression model. If this value is close to 1, there is a strong relationship; if it's close to 0, there is either no relationship or the regression model is not appropriate for the data. # Advanced Although these statistics are a good indication of whether a regression curve is good or not, they are not infallible. For example, the initial portion of data that actually correlates exponentially may well appear linear and have a high correlation coefficient with a linear fit. Another good way to check a regression curve is to look at the plot of the residuals vs. the x-values. If the regression curve is a good fit, then this plot should appear random in going from positive to negative. However, should you see a distinct pattern - say, if you tried a linear fit but the residual plot looks vaguely parabolic - you know you should try a different regression curve. You should also consider what your regression line implies about the nature of the data and vice versa. For example, if you're comparing the height of release of a ball to the time it takes to fall, a natural assumption is that the regression curve should pass through (0,0), and a curve that doesn't do that may be incorrect. However, take this advice with a grain of salt: if your curve fits the data points you put in but not such natural-assumption points, that may simply mean that the curve works on a limited domain. Or, it may mean your assumptions are wrong. # Command Timings Although the correlation statistics are displayed with DiagnosticOn, they are calculated in either case. This means that DiagnosticOn and DiagnosticOff will not change how fast regressions are calculated. # Related Commands Command Summary Finds the sample variance of a list. Command Syntax variance(list,[freqlist]) Menu Location Press: 1. 2ND LIST to enter the LIST menu. 2. LEFT to enter the MATH submenu. 3. 8 to select variance(, or use arrows. TI-83/84/+/SE 1 byte The variance( command finds the sample variance of a list, a measure of the spread of a distribution. It takes a list of real numbers as a parameter. For example: :Prompt L1 :Disp "VARIANCE OF L1",variance(L1  # Advanced Uses Frequency lists don't need to be whole numbers. Amazing as that may sound, your calculator can handle being told that one element of the list occurs 1/3 of a time, and another occurs 22.7 times. It can even handle a frequency of 0 - it will just ignore that element, as though it weren't there. One caveat, though - if all of the elements occur 0 times, there's no elements actually in the list and your calculator will throw an error. # Formulas The formula for variance used by this command is: (1) \begin{align} s_n^2 = \frac{1}{N-1} \sum_{i=1}^N (x_i - \overline{x})^2 \end{align} This is the formula for sample variance. The formula for population variance, which this command does not use, varies slightly: (2) \begin{align} \sigma^2 = \frac{1}{N} \sum_{i=1}^N (x_i - \overline{x})^2 \end{align} If the population variance is required, just multiply the result of variance() by 1-1/N. With frequencies wi, the formula becomes (3) \begin{align} s_n^2 = \frac{\sum_{i=1}^N w_i(x_i - \overline{x})^2}{\sum_{i=1}^N (w_i)-1} \end{align} where\definecolor{darkgreen}{rgb}{0.90,0.91,0.859}\pagecolor{darkgreen} \overline{x}is the mean with frequencies included. # Related Commands Command Summary Finds the sample standard deviation of a list. Command Syntax stdDev(list,[freqlist]) Menu Location Press: 1. 2ND LIST to enter the LIST menu. 2. LEFT to enter the MATH submenu. 3. 7 to select stdDev(, or use arrows. TI-83/84/+/SE 1 byte The stdDev( command finds the sample standard deviation of a list, a measure of the spread of a distribution. It takes a list of real numbers as a parameter. For example: :Prompt L1 :Disp "STD. DEV. OF L1",stdDev(L1  Caution: the standard deviation found by this command is the sample standard deviation, not the population standard deviation, which is the one most commonly used when dealing with a sample rather than the whole population. The formula for population standard deviation is similar, but N-1 is replaced by N. There is no single command that will calculate population standard deviation for you, but 1-Var Stats will return both (sample standard deviation, the one returned by stdDev(), is Sx, while population standard deviation is σx). You can also calculate population standard deviation of L1 with the following code: :stdDev(augment(L1,{mean(L1  # Advanced Uses Frequency lists don't need to be whole numbers. Amazing as that may sound, your calculator can handle being told that one element of the list occurs 1/3 of a time, and another occurs 22.7 times. It can even handle a frequency of 0 - it will just ignore that element, as though it weren't there. One caveat, though - if all of the elements occur 0 times, there's no elements actually in the list and your calculator will throw an error. # Formulas The formula for standard deviation used by this command is: (1) \begin{align} s = \sqrt{\frac{1}{N-1} \sum_{i=1}^N (x_i - \overline{x})^2} \end{align} This is the formula for sample standard deviation. The formula for population standard deviation, which this command does not use, varies slightly: (2) \begin{align} \sigma = \sqrt{\frac{1}{N} \sum_{i=1}^N (x_i - \overline{x})^2} \end{align} # Related Commands Command Summary Finds the median of a list. Command Syntax median(list,[freqlist]) Menu Location Press: 1. 2ND LIST to enter the LIST menu. 2. LEFT to enter the MATH submenu. 3. 4 to select median(, or use arrows. TI-83/84/+/SE 1 byte The median( command finds the median of a list. It takes a list of real numbers as a parameter. For example: :Prompt L1 :Disp "MEDIAN OF L1",median(L1  That's not all, however. Awesome as the median( command is, it can also take a frequency list argument, for situations when your elements occur more than once. For example: :Disp median({1,2,3},{5,4,4})  is short for :median({1,1,1,1,1,2,2,2,2,3,3,3,3})  The frequency list {5,4,4} means that the first element, 1, occurs 5 times, the second element, 2, occurs 4 times, and the third element, 3, occurs 4 times. # Advanced Uses Frequency lists don't need to be whole numbers. Amazing as that may sound, your calculator can handle being told that one element of the list occurs 1/3 of a time, and another occurs 22.7 times. It can even handle a frequency of 0 - it will just ignore that element, as though it weren't there. One caveat, though - if all of the elements occur 0 times, there's nothing to take the median of and your calculator will throw an error. # Error Conditions • ERR:DATA TYPE is thrown, among other cases, if the data list is complex, or if the frequencies are not all positive and real. • ERR:DIM MISMATCH is thrown if the frequency list and the data list have a different number of elements. • ERR:DIVIDE BY 0 is thrown if the frequency list's elements are all 0. # Related Commands Command Summary Sets the screen mode to Horiz. Command Syntax Horiz Menu Location In the program editor, 1. Press [MODE] 2. Press [DOWN] seven times 3. Press [RIGHT] 4. Press [ENTER] to insert Horiz TI-83/84/+/SE 1 byte Horiz is usually at the beginning of a program. It is used at the beginning to ensure that the screen mode is Horiz, for programs such as Hangman that want to use Input but also have the graph screen shown. Note that if you use pixels, the y-coordinate can be no larger than 30, since that is the maximum pixel's range. :Horiz  # Related Commands Command Summary Sets the screen mode to G-T. Command Syntax G-T Menu Location In the program editor, 1. Press [MODE] for the mode menu 2. Press [DOWN] seven times (for the split screen commands) 3. Press [RIGHT] twice to select G-T 4. Press [ENTER] to insert it This command can be used on the home screen, but must be selected from the catalog. TI-83/84/+/SE 2 bytes G-T puts the calculator into "Graph-Table" mode: this mode shows the home screen at full size, but the graph screen and table will be displayed together, each taking up half the screen (divided vertically). G-T is usually used at the beginning of a program to ensure that the screen mode is G-T , for programs such as math programs that want to demonstrate the thinking step-by-step. :G-T  With OS version 2.30 (on the TI-84+ and TI-84+ SE calculators), G-T mode can be used with stat plots as well. # Related Commands Command Summary Sets the screen mode to FULL. Command Syntax Full Menu Location In the BASIC editor, 1. Press [MODE] 2. Press [DOWN] seven times 3. Press [ENTER] to insert Full TI-83/84/+/SE 1 byte The Full command cancels the effects of either Horiz or G-T. Full is usually used either at the beginning and/or ending of a program. It is used at the beginning to ensure that the screen mode is Full, the standard setting. It is used at the end if the screen mode was changed in the middle of the program (as clean up). :Full  # Related Commands Command Summary Draws a line at any angle. Command Syntax Line(X1,Y1,X2,Y2[,erase,color,style]) Menu Location Press: 1. 2nd DRAW to enter the draw menu 2. 2 to insert the Line( token, or use arrows and ENTER. TI-83/84/+/SE 1 byte The Line( command is used to draw lines at any angle, as opposed to only drawing vertical or horizontal lines. Line(X1,Y1,X2,Y2) will draw a line from (X1,Y1) to (X2,Y2). Line( is affected by the window settings, although you can use a friendly window so there is no impact on the command. :Line(5,5,20,3)  # Advanced Uses Line has an optional fifth argument. It can be any real number, but the default is one. If the fifth argument, erase, is something other than 0, then it will simply draw the line. If erase is 0, then it will erase the line. :Line(5,5,20,3,0)  Leave off the ending argument if you are just drawing the line. :Line(5,5,20,3,1) can be :Line(5,5,20,3)  The ending argument can be a formula, which is useful for movement applications and other things such as health bars where the lines drawn are constantly different. The following draws or erases a line depending on whether a key is pressed. :getKey :Line(5,5,20,3,not(Ans  If working on a TI 84+CSE or TI 84+CE, then the fifth argument of the Line( command can be a color name or ID number: :Line(5,5,20,3,BROWN  The last argument, line style, is an optional argument that chooses what style of line to draw on the color calculators. 1 pixel wide line :Line(5,5,20,3,RED,1 2 pixel wide line :Line(5,5,20,3,RED,2 shaded above :Line(5,5,20,3,RED,3 shaded below :Line(5,5,20,3,RED,4  # Command Timings If you are drawing horizontal or vertical lines that stretch the entire graph screen, such as a border, it is better to use Vertical or Horizontal. These are smaller and are usually faster as well. # Related Commands # See Also Command Summary Draws a horizontal line on the graph screen. Command Syntax Horizontal Y Menu Location In the program editor: 1. 2nd DRAW to enter the draw menu 2. 3 to insert the Horizontal command, or use arrows and ENTER. TI-83/84/+/SE 1 byte Horizontal Y draws a vertical line from the left of the graph screen to the right at Y. Horizontal is usually only used to replace a line that stretches the entire length of the graph screen, along with its counterpart Vertical. Horizontal is affected by the window settings, unlike the Pxl- commands. :Horizontal 5  # Advanced Uses One of the fastest ways to make the entire screen black is by drawing horizontal lines from the bottom of the screen to the top. :For(A,Ymin,Ymax,ΔY :Horizontal A :End  If working with TI 84+C version calculators, the Horizontal command takes an additional color argument, as shown below: Horizontal 5,GRAY  # Related Commands Command Summary Draws a vertical line on the graph screen. Command Syntax Vertical X Menu Location In the program editor: 1. 2nd DRAW to enter the draw menu. 2. 4 to insert the Vertical command, or use arrows and ENTER. TI-83/84/+/SE/C/CSE 1 byte Vertical X draws a vertical line from the top of the graph screen to the bottom at X. Vertical is usually only used to replace a line that stretches the entire length of the graph screen, along with its counterpart Horizontal. Vertical is affected by the window settings, unlike the Pxl- commands. :Vertical 5  # Uses on TI 84+C Version Calculators The Vertical command takes an additional color argument for TI 84+C version calculators, as shown below: Vertical 5,BLACK  # Related Commands Now that you have learned the commands, design theory and game techniques, it's time to put that information to use. These project ideas are for programs that you should try to make to the given specifications, using whatever commands you need. Of course, the specifications aren't set in stone, so you don't have to include something if you don't want to. In addition to following the specifications, try to make the programs as optimized as possible, and use good design when structuring them (i.e., don't use Goto when a loop is really what you should be using). If you can successfully make all of these programs, and have done a good job writing them, you can consider yourself a good programmer. If you are having trouble making any of the programs, or you just want some input from other people, you can post in the forum. Before you do that, though, we encourage you to really try to create the programs and put some thought into them. ## Phone Directory Create a phone directory with these features: • Make a list of phone numbers, and also include the person(s) who own the phone number. • Display the phone numbers and person(s) on the screen. • Let the user sort through the phone numbers in ascending and descending order. • Let the user create, delete, and update the phone numbers and person(s). ## Role-Playing Game (RPG) Create an RPG with these features: • Use the home screen for the interface. • Split the map into multiple pieces, displaying each piece when needed. • Create a theme for the RPG and base everything off of it. • Give the player a few weapons to attack enemies with. • Create AI enemies that the player can battle for experience points. • Make a couple bosses that the player has to defeat to advance to the next level. • Upgrade the player weapons when set experience points are gained. ## Snake Create a snake game with these features: • Make a snake character that you can move around on the screen using the arrow keys. • Randomly display a piece of food on the screen for the snake to "eat". • Use collision detection to check if the food was eaten or the snake went off the screen. • If the snake goes over the screen boundaries, the snake is dead and the game is over. • Keep a highscore based on the highest amount of food the snake has eaten at one time. ## BlackJack Create a blackjack game with these features: • Use a graphical interface. • Have custom input for both players, alternating between players. • Implement all the rules of blackjack into the game. • Record the games won/lost by each player. ## Hangman Create a hangman game with these features: • Use a graphical interface. • Use custom input for both players. • Have one player choose a word, and the other player guess the word. • The guessing player gets ten chances to guess the word before they lose. • The guessing player selects a letter that they think is in the word. If the letter is there, then that letter is revealed and the player doesn't lose a chance. • If the letter is not there, the player loses one of their chances. • If the player guesses all the letters in the word, they win. If they run out of chances before they get the word, they lose. ## Flight Simulator Create a flight simulator with these features: • Use the graph screen • Use way points and navigation • Use multiple computing systems to determine attributes such as location, speed, angles, weather, engine condition, distance, fuel etc. • Use auto piloting • Include output of direction, angle relative to horizon, attributes, and system efficiency # 2008 03/10James Kanjo made a new Did You Know… system, where each DYK has it's own page in the dyk category. Now the DYK on the home page sidebar displays a randomly selected DYK. 01/10James Kanjo added a choose a "random command" link to the sidebar…COOL! 27/09Timothy Foster created the page TI-Nspire Programming. 15/09James Kanjo upgraded the framework of the TI|BD archives. Now it is even easier to add, update, rate and moderate programs! 04/09burr, the founder of the site, has finished contributing to the site, and moved on to other projects. (see his goodbye here) 04/09James Kanjo tagged the 25 remaining untagged "redirect" pages 04/09basickevin created the page artificial intelligence 03/09RandomProductions created the page How the Calculator Works. 01/09 — TI-Basic Developer has now existed for approximately two years. Thanks to all that made it a great year, and may the next year be even more successful and exciting. 28/07burr did some reorganization and cleanup to the resources page. 14/07Zaphod Beeblebrox created the page Text Sprites Reference 08/07basickevin created the page alternate routines to promote the creation of new optimizations 03/07burr and James Kanjo set up the framework for the new TI|BD archives 01/07Mapar007 created the page Binary and Hexadecimal number system 20/06Zaphod Beeblebrox changed the resources page to use the tabview 13/06James Kanjo added an "Instant Messenger" routine to the programs page 11/06James Kanjo created a "New Members" section on the home page 06/06James Kanjo finished integrating the new infobox framework into all 324 command pages 02/06burr updated the showcases page separating the programs by genre and using the tabview. 24/05RandomProductions spruced up the user input page to be a bit more recent. 18/05 — The development of the TI|BD site logo is complete, and has now replaced the previous site header. 10/05James Kanjo has set up a new framework for infoboxes. 04/05krazyness initiated the development of the TI|BD site logo, to replace the current header. 24/04DarkerLine has finished the first chapter of the Starter Kit, a tutorial for beginner programmers. 23/04burr created a validation tutorial that covers how to approach validating user input. 16/04burr added a file download to all of the routines and programs. 12/04burr created a TI-Basic Sidebar for Mozilla Firefox for quick reference of the TI-83 commands when you are away from the site. 02/04DarkerLine, Socks and James Kanjo worked together to upgrade the implemented "include template" sections of the site. Result: Site automatically retrieves the required parts of the "Recent News", "Did You Know" and "Featured Article" sections for the home page. 02/04James Kanjo made the Start page automatically retrieve the first 5 news items from the old news section. 30/03burr started the Featured Articles page that lists the best articles available on the wiki, along with changing the "Featured Article" section in the sidebar on the homepage into an include page. 27/03burr started a Did You Know... page with a list of premade DYK's, along with changing the "Did You Know…" section in the sidebar into an include page. 25/03James Kanjo added a warning to the grouping section, which the TI-Basic community may have previously been unaware of. 16/03Weregoose created two pages on the calculator's internal fonts. DarkerLine has already found these images useful on other pages. 08/03Socks started working on the TI-Basic Starter Kit. Feel free to contribute. 23/02RandomProductions put screenshots on all of the date and time command pages. 09/02burr created a portal page, which acts as a bridge between the TI-83 and 68k sections of the site, and is now the new homepage for the site. 29/01DarkerLine begins work on the 68k section of the site. 29/01 — All commands have now been documented! Woo! 26/01burr added an optimization walkthrough tutorial which takes a person through the literal process of optimizing a game. 24/01DarkerLine broke up the text manipulation page into a few routine pages: highlighting text, wordwrapping text and marquee. 09/01 — The zoom commands have been documented, finishing up all commands except for the finance ones. # 2007 16/12 — The xLIB Guru has merged with this wiki, and its content has been added. 13/12 — The page about user settings, along with its various subpages, is now complete. 11/12burr created a Boolean logic page detailing what Boolean logic is and how you can use it in your programs. 27/11DarkerLine finished writing the pages about the various variable types, and started on the settings commands. 24/11simplethinker started creating pages for the trigonometry and polar functions. 22/11burr added tags to the majority of the pages; only the command pages are left. 18/11DarkerLine started creating pages for the different variable commands. 16/11DarkerLine finished creating pages for the individual math commands. 06/11burr created a self-modifying code page explaining what self-modifying code is and how you can use it. 18/10burr began to create individual routines pages, using the new routine template 15/10alexrudd began to split up the math page into separate command pages. 14/10burr created a downloads page with over 100 zip files to download. 01/09 — TI-Basic Developer has now existed for approximately a year. May the next year be even more successful and exciting. 26/07burr put together a Frequently Asked Questions (FAQ) list of common TI-Basic related questions that people ask. 24/07burr made a Sitemap that has a hierarchical breakdown of the site for easy viewing. 22/07burr started a Common Coding Pitfalls page, which lists several different examples of code that are syntactically correct, but do not produce the correct or desired results. 01/07burr started a Code of Conduct page, which lays down some general conduct rules to follow when contributing to the wiki. 27/06burr started a Glossary page, which has general definitions for several of the words that are used throughout the wiki. 26/06burr created a Code Commenting page, which is extremely useful for those people who are working on multiple projects at the same time, and want to be able to come back to a project without all the stress of figuring out what everything is again. 23/06burr finished updating the Subprograms page, so now the external and internal subprograms are explained in comprehensive detail. 22/06Xphoenix added a general section to the Program Setup page, and also created two pages: Assembly Shells and Basic Builder. 22/06burr started a Program Setup page in the same fashion as the Program Cleanup page. Program setup includes getting the home screen, graph screen, and variables ready so your program can use them. 18/06DarkerLine finally finished the Statistics pages. He's going to go back and add complicated formulas no one understands sometime later. 13/06DarkerLine started working on the Statistics pages like he said he was going to a month ago… 03/06Xphoenix created pages for some of the Graph Screen commands. 05/05Harrierfalcon optimized one of the examples on the Compression Techniques page by using the seq( command. 30/04alexrudd added the xor and not( operators to the Logical Operators page. 22/04burr started the Project Challenges page. After you have gone through the wiki and learned the commands, design theory, and game techniques, you can now test yourself and try your hand at making some programs. 21/04burr started the Old News page, which is the archive place for all the old news and is kept for posterity sake. 19/04 — A few more games have been added to the Programs page, including: Avalanche, Maze Walkthrough, Pong, and Tic-Tac-To. The programs are all available for download in case anyone wants to try them out on their calculator. 15/04burr added a Wiki Conventions page that lays down some general guidelines about how to format page content. There's a similar Command Stub page for command pages. 13/04thornahawk and Xphoenix added some more information about the Math commands. 08/04burr started the Review Exercises page, which allows readers to test their comprehension and understanding of the information on the wiki. 30/03 — The Wiki Tour was started, providing a general overview of the wiki and giving beginners some direction about using the wiki. 26/03alexrudd began experimenting with internal page anchors, and has decided that we should try to integrate them into more pages. 25/03DarkerLine started working on the Statistics Commands. These commands are extremely useful for anybody who has to take a statistics class. 23/03burr updated the Contribute page with some guidelines to help beginners better use the wiki. 15/03Harrierfalcon added Number Functionality to Custom Text Input. 03/03burr started the Recursion page. Recursion is related to using subprograms to optimize a program, except the program calls itself instead of other programs. 21/02DarkerLine decided we should give each command its own individual page, so that all the relevant information about that command can be put on one page. Be sure to check out the Command Stub to see how the information is organized. 19/02burr started the Usability page. It offers some ideas to think about when designing a program, including preventing the user from hurting themselves and following the KISS principle. 16/02alexrudd started a Deck of Cards page that should be helpful to anyone who is wanting to learn how to manage the cards in a card game (such as Blackjack). # 2006 08/11alexrudd and DarkerLine are promoted to admins, so they are now able to do all of the admin-related things for the wiki. 14/10burr started the Marketing page. It offers some solid suggestions on ways to market your programs to the community. 10/10burr started the Writing Program Documentation page. Check it out if you are wondering why documentation is important and what things your program documentation should include. 07/10 — Talks of merging the wiki with the Function Library forum occur, but they ultimately fall through because it is decided that the wiki already covers much of the same content and the forum quality isn't very good. 06/10burr started the Look-Up Tables page. Look-up tables are commonly used to increase the speed of programs when speed is the primary need in the program. This is especially true if graphics or user input are involved. 24/09burr started the Custom Text Input page. It shows a simple input routine, briefly explaining how custom text input works and how you can expand the functionality to suit your own purposes and needs. 23/09alexrudd updated the Program Protection page, further refining the different ways to protect a program. In addition, some good discussion about program protection and whether it is appropriate occurred over at the UTI TI-Basic forum. 23/09burr started the Program Clean Up page. After a program finishes running, it should clean up after itself. This involves restoring the respective screens, deleting variables, and some other things. 22/09burr started the Optimizations page. The page details the many different optimizations that you can do to a program, organizing them into relevant and related categories. 06/09 — The wiki is moved from Wikispaces to Wikidot for hosting because the look of the pages and editor is better, and it offers a lot more space for the wiki to grow and mature. 01/09 — TI-Basic Developer wiki is started by burr using the content from his TI-Basic Developer guide as the foundation for the wiki. What is a Program? A program is an organized, step-by-step set of instructions. When executing a program, the calculator behaves in a predetermined manner, performing the instructions in a sequential order. The amount of free RAM is the only limit on the number and size of programs. When making programs, there is a general order that you must follow. You first need to create the program, then you edit the program, and finally you execute the program. Every program will go through this process, with the editing and executing being done numerous times to make changes or fix errors. In order to help you further understand and visualize the process, we are going to walk you through creating a program. We have chosen to demonstrate how to create the famous "Hello, World!" program, which is a common first program because of its simplicity. # Create a Program To create a program, you have to first go into the Program menu. This can be found by pressing the PRGM key. Then, press the right arrow twice [>] [>] to go to the NEW menu. Select 1:Create New and press ENTER. The Name= prompt is displayed, and alpha-lock is on. You now have to enter a name. Here are some things to remember about naming programs: 1. Each program must have its own unique name. 2. Program names can only be eight characters or less. 3. The characters must be A-Z, 0-9, or θ. 4. The first character must be A-Z or θ. For our program, we want a name which tells the user that it will display "Hello, World!" on the screen, so we have decided to go with the simple, but adequate "HELLO". As a general rule, you should choose a program name that actually relates to your program (such as its title). And, if your program is insignificant (such as a subprogram for a larger program), start it with θ or Z so that it appears at the bottom of the program list. After you have typed in a name that you are satisfied with, press ENTER. This will put you in the Program editor. When you are in the Program editor, you will see the name of your program at the top line. To exit the Program editor and return to the home screen, press 2nd and MODE. # Edit a Program Now that we have created our program, we want to edit it so that it does something. To edit a program, press the PRGM key to go back into the Program menu. This time, only press right > once. This will bring you to the EDIT menu. Scroll down to whichever program you want and press ENTER. This will cause the Program editor to open, with you being able to edit the program using a movable cursor. When you are editing the program, you can add any commands or instructions that you want. A colon (:) denotes the beginning of each new line, and you can put multiple commands on a line by separating each command with a colon. Because multiple commands put together is typically wider than the screen, this will cause the line to wrap around to the next line. There isn't a whole lot to our HELLO program, it just consists of two commands: ClrHome (to clear the screen) and Output( (to display the message). You can get to both commands by pressing PRGM to go to the program menu, and RIGHT to go to the I/O submenu, then selecting the right command. We're not going to get real fancy with the text (for example, although it's possible to use lowercase letters, it's a bit tricky, so we won't do it here). We will, however, use a trick to get the exclamation point — select the factorial ! from the PROB submenu of the MATH menu. :ClrHome :Output(2,2,"HELLO, WORLD!")  When editing, you can delete, overwrite, or insert commands and instructions. Move the cursor to whatever line you want, and then press DEL to delete an individual command or CLEAR to delete all of the commands on the line (leaving only the beginning colon); press DEL to also delete the line. For overwriting commands, simply select a command or type an instruction. The old command will be replaced with the new command. To insert a new command, press 2nd INS and either the space key several times for however many spaces you want or ENTER for a whole new line. As editing programs involves a considerable amount of movement and scrolling, there are some shortcuts that make it easier. You can move the cursor to the beginning or end of a line by pressing 2nd < or 2nd >, respectively. You can scroll down or up with the cursor seven lines at a time by pressing ALPHA v or ALPHA ^, respectively. Use these shortcuts whenever possible. # Execute a Program We have created and edited our HELLO program, so now we are finally ready for program execution. To execute a program, press the PRGM key to go back into the Program menu. This time, however, press right twice > > to get to the EXEC section. Scroll down to the HELLO program and press ENTER. This will cause the program's name to be printed on the home screen (with 'prgm' in front of it). Press ENTER again and the program will be executed. The busy indicator will turn on while the program is executing. If you put the commands in correctly, the program should execute fine and you will get the desired "HELLO, WORLD!" message; if not, there will be an error. When the calculator comes across an error while executing the program, it will give an error menu — telling you what the error is and giving you the option to see where the error is in the program (if the program isn't edit locked). This allows you to figure out why it's producing an error. Many times it will be a simple mistake, such as mistyping a command's arguments. However, sometimes the error will be much more sinister. Although you will usually let a program execute until it is finished, sometimes it is necessary to prematurely stop execution. For example, if you have a large program that takes a long time to execute and you don't want to wait. You can stop execution by simply pressing the ON key. After the ON key is pressed, the ERR:BREAK menu is displayed on the home screen with one or two items. The first item is 1:Quit. This item should be selected if you want to return to the home screen. The second item is 2:Goto, and it appears if the program isn't edit-locked (Assembly programs can make the program not able to be edited from the Program menu). This item should be selected if you want to go to the line of code where program execution was halted. Because there are several people contributing to this wiki, and each person undoubtedly has their own opinion and idea on how to format the content, we have come up with some conventions to use. These conventions are not set in stone, but please try to follow them unless you have a good reason not to. If you have a convention that you think the community should adopt, please add it to this list. (There is a separate set of conventions when making a command or routine page.) ### Style Conventions • Page headings are capitalized like an English paper would be capitalized, and paragraphs are four lines or fewer in number. • Follow the page structure with appropriate page headings, so a main point gets a first level heading and a secondary point gets a second level heading. • Talk in third person when appropriate or first person when wanting to get the readers' attention. • Follow the calculator manual when determining how to spell a word: in particular, home screen and graph screen should be spelled as two words instead of homescreen and graphscreen respectively. • If you need to abbreviate calculator names, use TI-83, TI-83+, TI-83+SE, TI-84+, TI-84+SE, TI-84+CSE, and TI-84+CE. If you want to refer to all five of the grayscale calculators, just use TI-83/84/+/SE. Referring to all calculators can be done via TI-83/84/+/SE/CSE/CE. • When referring to a TI-Basic command: • Include the parentheses if the command has one — e.g., Output( or abs(. • Make the first reference to the command on each page a link. ### Code Conventions • Include a colon (:) at the beginning of each line. • Don't pad code with unnecessary blank lines or spaces. • Commands have their closing parentheses, bracket, etc. when not demonstrating an optimization. • Change all of the TI-Basic tokens that don't display correctly to Unicode or something recognizable (for example, -> is a good substitute for →). • In the program editor, the calculator screen can only show a set number of characters per line before it will start wrapping the characters around on to the next line. This is not very readable, so all the characters will generally be displayed on the same line (unless there is a large number of characters). • When commenting your code, use // to denote the start of a comment Command Summary Finds the mean (the average) of a list. Command Syntax mean(list,[freqlist]) Menu Location Press: 1. 2ND LIST to enter the LIST menu. 2. LEFT to enter the MATH submenu. 3. 3 to select mean(, or use arrows. TI-83/84/+/SE 1 byte The mean( command finds the mean, or the average, of a list. It's pretty elementary. It takes a list of real numbers as a parameter. For example: :Prompt L1 :Disp "MEAN OF L1",mean(L1  That's not all, however. Awesome as the mean( command is, it can also take a frequency list argument, for situations when your elements occur more than once. For example: :Disp mean({1,2,3},{5,4,4})  is short for :mean({1,1,1,1,1,2,2,2,2,3,3,3,3})  The frequency list {5,4,4} means that the first element, 1, occurs 5 times, the second element, 2, occurs 4 times, and the third element, 3, occurs 4 times. # Advanced Uses You can also use the frequency list version of mean( to calculate weighted averages. For example, suppose you're trying to average grades in a class where homework is worth 50%, quizzes 20%, and tests 30%. You have a 90% average on homework, 75% on quizzes (didn't study too well), but 95% average on tests. You can now calculate your grade with the mean( command: :mean({90,75,95},{50,20,30  You should get a 88.5 if you did everything right. Frequency lists don't need to be whole numbers. Amazing as that may sound, your calculator can handle being told that one element of the list occurs 1/3 of a time, and another occurs 22.7 times. It can even handle a frequency of 0 - it will just ignore that element, as though it weren't there. In particular, mean(L1,L2) is effectively equivalent to sum (L1*L2)/sum(L2). One caveat, though - if all of the elements occur 0 times, there's nothing to take an average of and your calculator will throw an error. # Error Conditions • ERR:DATA TYPE is thrown, among other cases, if the data list is complex, or if the frequencies are not all positive and real. • ERR:DIM MISMATCH is thrown if the frequency list and the data list have a different number of elements. • ERR:DIVIDE BY 0 is thrown if the frequency list's elements are all 0. # Related Commands Command Summary Calculates some common statistics for two lists of data, and stores them to statistical variables. They're also displayed in a scrollable list, if done outside a program. Command Syntax 2-Var Stats [list1, list2, [freqlist]] Menu Location Press: 1. STAT to access the statistics menu 2. LEFT to access the CALC submenu 3. 2 to select 2-Var Stats, or use arrows TI-83/84/+/SE 1 byte This command calculates a bunch of common (and a few uncommon) statistics for a pair of lists (it uses L1 and L2 by default, but you can use any list by supplying it as an argument). You have to store the lists to variables first, though, before calculating statistics for them. For example: :{5,12,7,8,4,9→L1 :{1,0,2,5,7,4→L2 :2-Var Stats  The calculator treats the two lists as a list of ordered pairs. Some of the statistics calculated assume that this is the case, and the two lists are the same size: an error will occur if the lists don't match. Like other statistical commands, you can use a frequency list as well, for cases where one element occurs more times than another (you can do this with a normal list, too, but that might be inconvenient when an element occurs very many times). There is only one frequency list for both data lists, and the frequency applies to the ordered pair formed by an element taken from each list. For example: :{1,2,3→L1 :{1,2,3→L2 :{5,3,2→L3 :2-Var Stats L1,L2,L3  is the frequency-list equivalent of: :{1,1,1,1,1,2,2,2,3,3→L1 :{1,1,1,1,1,2,2,2,3,3→L2 :2-Var Stats  When you're running it from the home screen, 2-Var Stats will display the statistics; this won't happen if you do it inside a program. Either way, it will also store what it calculated to the statistics variables found in VARS>Statistics… The variables 2-Var Stats affects are: •\definecolor{darkgreen}{rgb}{0.90,0.91,0.859}\pagecolor{darkgreen} \overline{\textrm{x}}$is the mean (average) of the first list • Σx is the sum of the first list • Σx² is the sum of the squares of the first list • Sx is the sample standard deviation of the first list • σx is population standard deviation of the first list • minX is the minimum element of the first list • maxX is the maximum element of the first list •$\definecolor{darkgreen}{rgb}{0.90,0.91,0.859}\pagecolor{darkgreen} \overline{\textrm{y}}$is the mean (average) of the second list • Σy is the sum of the second list • Σy² is the sum of the squares of the second list • Sy is the sample standard deviation of the second list • σy is population standard deviation of the second list • minY is the minimum element of the second list • maxY is the maximum element of the second list • Σxy is the sum of products of each matching pair of elements in the lists • n is the number of elements in both lists 2-Var Stats will not work with "reserved" list names that the calculator uses internally. The only known such reserved list is the list RESID, and there's no reason to suspect there are any others. Ans, TblInput, and any expression which resolves to a list, are also not appropriate for this command: store all of these to a list before doing 2-Var Stats on them. # Advanced uses If you consider the two lists to be vectors, then Σxy is their dot product, and Σx² and Σy² are the squares of their norms; math done with these and other statistics can produce the shortest (but not necessarily quickest) way to calculate many vector operations. # Optimization Aside from statistical analysis, 2-Var Stats can also be used when you want to use the values it calculates more than once. This will save on size, since, for example Σx takes up less space than sum(L1), but considering how many calculations 2-Var Stats makes, it will usually be slower. # Related Commands Just like other programming languages, TI-Basic has the standard set of core operators built-in (math, relational, and logical), although they each have their own syntax and rules. # Math Operators There are five math operators: +, -, *, /, and ^. Anybody who has ever done even basic math should know and recognize at least the first four operators, but for those who don't, their meaning is pretty straightforward: + Adds two numbers together - Subtracts one number from another * Multiplies two numbers together / Divides one number by another ^ Raises a number to a power There are two similar negative symbols on the TI-83 calculators — the subtraction symbol (the - key) and the negation symbol (the (-) key). These aren't interchangeable. However, it's almost always clear from an expression which one is being used, so the - symbol will be used to represent both throughout most of this guide. # Relational Operators There are six relational operators: =, , >, , <, and . Just like with the math operators, these operators are used in almost every math class, and thus most people should know them. = X=Y is true if X is equal to Y X≠Y is true if X is not equal to Y > X>Y is true if X is greater than Y X≥Y is true if X is greater than or equal to Y < X<Y is true if X is less than Y X≤Y is true if X is less than or equal to Y Because the calculator does not have a separate time for logical values (true and false), they are represented by the numbers 1 and 0. This becomes important when dealing with piecewise expressions. # Logical Operators There are four logical operators: and, or, not(, and xor. Their interpretations are mostly intuitive when thinking about the meaning of the English word: and X and Y is true if both X and Y are true or X or Y is true if at least one of X and Y is true xor X xor Y is true if only one of X and Y is true not( not(X) is true if X is false Again, as with the relational operators, 1 is used to for 'true', and 0 is used for 'false'. It so happens that the logical operators treat all nonzero values as though they were 1 (true), so the expression '2 and 3' will be true just as '1 and 1'. Here is a truth table of the various values: A B A and B A or B A xor B not(A) 0 0 0 0 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 0 ## Order of Operations The TI-83 series of calculators has nine priority levels for evaluating expressions. All the functions on a priority level will be calculated from left to right before moving on to the next priority level. Of course, calculations within parentheses are done first. Here is a table of the priority levels: Priority Level Functions 1 Functions that precede their argument (such as √( or sin(), except for negation 2 Functions that follow their argument (such as 2 or !) 3 ^ and ×√ 3.5 Negation 4 nPr and nCr 5 Multiplication, division, and implied multiplication 6 Addition and subtraction 7 The relational operators =, , <, >, , 8 The logic operator and 9 The logic operators or and xor 10 Conversions such as ►Frac TI refers to the routine that determines order of operations as the Equation Operating System (EOSTM). Unfortunately, this cool name hasn't become common usage. ## Test your knowledge Here are some sample problems on logical operators, in order of complexity. For the more difficult ones, it may be best to break them up into smaller parts and work in steps. # Question 1 0 and 1 or 1 2 0 and (1 or 1) 3 4 and -4 xor (.6 and 0) 4 not(1) xor (1 and 1 xor 1) 5 1 and 0 xor (6*4 and 0) or not(0 and 6) 6 1 and (1 xor not(5 xor 1 and 0)) xor not(1 xor not(1 or not(1))) After seeing Michael Vincent interview Joe Wingbermeuhle, Jimmy Mardell, and most recently, Ben Mickle on ticalc.org, it made me start thinking about the many past contributors to the TI community. Although these people have no or minimal involvement in the community today, their contributions can still be felt. They released high-quality games and programs, that were innovative and pushed the boundaries of what was thought possible. They paved the way for everybody who came after them. Because most of these people have moved on to other things, most newcomers to the community don't have any knowledge of them, besides their contributions that they left behind. Using a program can give the newcomers some semblance of what the people were like, but it cannot tell them the stories behind the making of the programs or give them the experience of interacting with the people. In addition, most newcomers have no idea how much time and effort was spent on the programs. They just download programs, hardly stopping to think about what went into creating them. The reality is that the people invested a great deal of their own time to make them. They didn't have to, of course, but they believed that it was a worthwhile trade-off. They wanted to create programs that the community could enjoy. Although there is no real way to express these intangible things to newcomers, they can be better highlighted and put in perspective. The past contributors worked hard, so it only seems right that they should be thanked and remembered for their efforts. This will also give newcomers a better appreciation of them. A TI community timeline should be cooperatively created, detailing the past programmers and programming groups. It would show when they first got involved with the community, the release date of their contributions, any fond memories that people have of them, and any other relevant information. This information is not only important for the current newcomers, but for posterity. There have been many great TI programmers and programming groups over the years, and they are forever part of the fabric that makes up the TI community. Command Summary Gets a variable from another calculator. Command Syntax GetCalc(variable) (84+ and 84+SE only) GetCalc(variable,portflag) Menu Location While editing a program, press: 1. PRGM to enter the PRGM menu 2. RIGHT to enter the I/O menu 3. 9 to choose GetCalc(, or use arrows TI-83/84/+/SE 2 bytes The GetCalc( command allows you to make multiplayer games, where two calculators communicate with each other across a link cable that is connected between them. The GetCalc( command can only receive one variable from another calculator, and the variable can be any variable (a real, list, matrix, string, etc.). The calculator doesn't exchange variable values when the variable is received, but instead replace the variable of the same name on the receiving calculator. For the GetCalc( command to work correctly, the sending calculator must be in a preemptible state and it cannot be executing an assembly program. (The sending calculator is the one which is not executing the GetCalc( command.) The two main commands that you should use to ensure this are Pause and Menu(; however, any command that is waiting for user input will also work perfectly fine (such as Prompt and Input). The GetCalc( command behaves a little differently in the older TI-83 models. If the sending calculator is idle with the Pause or Menu( command, it will automatically "press enter" when the receiving calculator executes GetCalc(. This can be frustrating when in a menu, because it prevents the user's opportunity to make a selection. However, this can make real-time gaming more possible if used in conjunction with the Pause command. When the receiving calculator receives the variable, it could then execute the Pause command, while the sending calculator automatically exits the power-saving state and could then perform the GetCalc( command. All models after the TI-83 do not automatically exit their power-saving states. # Advanced Uses The TI-84+ and TI-84+SE will use the USB port if it is connected to a USB cable, otherwise they will use the I/O port. However, you can specify which port you want to use by putting a number after the variable as GetCalc('s second argument: zero to use the USB port if connected to a USB cable, one to use the USB port without checking to see if it's connected, and two to use the I/O port. # Related Commands # See Also As a way to test your comprehension of the information, and to ensure that you actually read through the information instead of merely skimming over it, we have provided review exercises. These exercises provide a way of helping you apply the information, so that you get a fuller understanding of the concepts. Highlight the area next to the word answer for the answer. 1. True or False: The ClrHome command should be used at the end of a program, to ensure that the program does not leave any leftover text on the home screen. Answer: 2. What type of variable cannot hold a complex number? Answer: 3. Which of the following uses of the Disp command returns an error? 1. Disp 2. Disp "" 3. Disp "Hello World 4. Disp "Hello","World 5. None of the above Answer: 4. Which draw command cannot be called from a program? Answer: 5. What is the difference between the iPart( and int( commands? Answer: 6. True or False: Programs can use the home screen for everything they can do on the graph screen. Answer: 7. What is the minimal modification that will allow this code to start-up? :Menu("Choose One,"Menu Item",1,"Menu Item",2 :Lbl A :Pause "Item 1 :Stop :Lbl 2 :Pause "Item 2  1. Add a closing quote on the menu title. 2. Remove the Stop command. 3. Change Lbl A to Lbl 1. 4. Add a closing quote on the menu title and change Lbl A to Lbl 1. Answer: 8. In a statistics class, the teacher asks the students to generate a list of 100 random numbers. Unfortunately, the exercise doesn't work as intended because 22 students, in a class of 30, get the exact same numbers (using different calculators). What's a likely explanation for this surprising coincidence? Answer: 9. How many digits of accuracy does the TI-OS have? How many can it display on the screen? Answer: 10. The Output( command can display text at any place on the screen, but what happens when the text goes past the end of the line? 1. Nothing. The text simply does not show up. 2. An error is returned. 3. The text will wrap around to the next line. 4. An ellipsis will be displayed at the end of the line, with the rest of the text not being displayed. Answer: 11. True or False: You need to use a Pause command before clearing the screen, otherwise the user will only see the text on the screen for a couple seconds; it will be a blur. Answer: 12. When is using the Menu( command appropriate, and even desired? (Choose the best answer.) 1. If you want a generic menu. 2. Your program is going to be text-based. 3. It is the most practical menu available in your situation. 4. You want your program to stand out, so you need a fancy menu. Answer: 13. What would be the effect of replacing a Disp command with an Output( command and vice verse? Give any instances where this switch might be useful. Also, when would you use Disp in conjunction with Output? Answer: 14. What is the maximum dimension of a list? Answer: 15. Which one statement is true about this code? :Menu("","",B,"",B :Disp "Test :Lbl B :Disp "Pizza :Output(1,1,"Spaghetti  1. An error will be returned when the Menu command is executed. 2. The program will execute, but there will not be any text displayed. 3. The "Test" text will be displayed along with the "Pizza" and "Spaghetti" text. 4. The "Pizza" and "Spaghetti" text will be displayed, but not the "Test". Answer: 16. True or False: Before using the Menu( command, you need to clear the home screen, otherwise you will have text interrupting the menu. Answer: 17. Consider the following code: :0:Menu("Difficulty","Easy",3,"Medium",2,"Hard",1 :Lbl 1:Ans+1 :Lbl 2:Ans+1 :Lbl 3:Ans+1  The Ans variable keeps track of the last answer, often being used in place of more permanent variables. If the user selects the "Hard" menu item, what will Ans's value be? What effect does the label ordering have on the value, if any? Why?Answer: 18. True or False: Using the home screen is faster than using the graph screen? Answer: 19. Which of the following cannot be used to test if a variable is any of 1, 2, 3, or 4? 1. If sum(A={1,2,3,4 2. If (A=int(A))(A>=1)(A<=4) 3. If A={1,2,3,4} 4. If A(int(A)=A)(A<5) Answer: 20. True or False: The following is an alternate to using the or operator. :If (X=1)+(X=2  Answer: 21. Name a command or function that cannot be interrupted by pressing the [ON] key. Answer: 22. For which of the following would not(B) not equal 0? 1. .01→B 2. 0→B 3. π→B 4. -4→B Answer: 23. True or False: The following is an alternative to using the and operator. :If Anot(B  Answer: 24. How many bytes is an uppercase character? A lowercase character? Answer: 25. Which of these user-created list names are actually possible on the calculator? 1. L1234 2. LBaDd 3. Lθθθθ 4. LABCD Answer: 26. What type of variable needs a special command to store to it? Answer: 27. Change this short program so it doesn't flicker and then optimize it as much as possible. :0→X:0→Y:Repeat 0 :ClrHome :Output(Y,X,"X") :getKey→K :If K=24:X-1→X :If K=25:Y+1→Y :If K=26:X+1→X :If K=34:Y-1→Y :End  Answer: 28. True or False: You can archive another program from within a program. Answer: 29. What is the maximum length of a string? Answer: 30. Which of the following variables is it possible to archive? 1. Y1 2. prgmKEWLGAME 3. the real variable T 4. the real variable A 5. L_RESID 6. L1 Answer: 31. Without trying it first, is this legal? :[A]L4([A]([A](L1(1),L2(1)),L1(1(L2(2L3  Answer: 32. How would you find the fifth element from the last in a sequence of 20 elements? Answer: 33. What will this code do? :DelVar B1→A :If A:If B :Disp "Hello World  Answer: 34. How do you get rid of the Done message at the end of a program? Answer: 35. Write a program that inputs a string and outputs the letters backward, one per line. Answer: 36. Will this code execute? :If 0:Disp "Your turn :Else:Disp "Guess not  Answer: 37. What is the simplest program you can have that has recursion? Answer: 38. Which of these are logically equivalent? 1. not(P or Q) 2. P and Q 3. not(P and Q) 4. not(P) or not(Q) 5. not(P) and not(Q) Answer: 39. True or False: There are actually 256 picture variables on the calculator, even though only 10 picture variables show up. Answer: 40. What are the differences between Assembly and TI-Basic? When would you use Assembly and when would you use TI-Basic? Answer: 41. How long will the program go through the loop until it stops execution? :0→X :While X :Disp "Another Loop :X+1→X :If X=25 :Stop :End  Answer: 42. What is wrong with this code? :If X=25 Then :Disp "X is 25 :X+1→X :Disp "X is now", X :End  Answer: 43. What are the only keys that can actually be held down, causing them to be repeated? Answer: 44. How would you go about converting a list to a matrix? What would the code look like? Answer: 45. True or False: There is no built-in way to convert a string to a number. Answer: The TI-Basic Developer wiki has a large quantity of content available, which can be very overwhelming to the person just starting out learning TI-Basic while using the site, so we have decided to help you out by giving you a very simple and quick introduction to the content that you should read first. If you already feel confident in your TI-Basic abilities, you can skip this tour and go read whatever it is that interests you. # Before You Begin The first page that you should check out is your first program. Before you can begin programming your calculator, you need to know how to make programs: creating, editing, and executing a program. These three steps are the basis for any program that you make, no matter how large or small it is. You should then read through the using your calc page. It is good to be able to operate your calculator more fully because it makes it easier to program, and just generally improves your calculator know-how. Be sure to read through the memory management section very thoroughly because the information will come in handy once you really start using your calculator, and come across situations where that information is extremely valuable. # The Commands After learning how to make a program and use your calculator, now you should move on to learning the different commands. Because there are literally hundreds of TI-Basic commands, you should start with the basic commands first to establish a solid foundation, and then move on to the more complex commands when you need to use them. Here are the easiest commands to use: You, of course, can read about any of the other commands if you want to, but it helps to see and try out the basic commands first before making the jump. Also, try using the commands together to start making simple programs and then work your way up to larger programs (at which point you should start using the more complex commands). # Design Theory When you are able to put together large programs, it is time to start learning and applying design theory to your programs. Design theory teaches you how to improve your program's design. In particular, the two main areas of program design that you should learn are: • Planning — Planning a program consists of thinking out what your program should do and how it should do it. This includes things like structuring a program and deciding which variables to use. • Optimizing — Optimization involves making your program as efficient as possible. There are all sorts of optimizations you can do, both simple and complex. # Programming Techniques There are several short pieces of code (known as routines) that are commonly used by most people in their programs. These routines are not usually stand-alone programs themselves, but instead meant to be used as a helper to the program. The most common techniques that people use are: • Animation — Animation is displaying text/graphics and then moving them to a new location after a short delay has occurred. • Menus — Menus provide the user with a list of options to choose from. • Movement — Movement allows the user to interact with the program. # Getting More Help Most of the members of this wiki can be found on the forum, so you can post there with questions and get help with whatever you are working on or trying to learn. In order to post on the forum, however, you need to create an account. This is an easy process, and should take no more than a couple minutes. You just need a valid email address to validate your account, and then you are good to go. We've also provided a comprehensive resources page on the wiki that has lots of useful information and links to other TI-Basic tutorials and guides on the Internet. If you see something that interests you, please check it out. Also, if you have made a quality tutorial or program, or know of one not listed, please consider adding a link to it on the page. The TI-Basic Developer wiki is part of the larger TI-Basic community, and that means staying connected to what is happening elsewhere around the community. As you grow and learn, you too will become part of the community. We look forward to seeing you progress as a programmer, and this wiki is our contribution to your continued growth. Command Summary Tests a pixel on the graph screen to see if it is on or off. Command Syntax pxl-Test(Y,X) Menu Location While editing a program press: 1. 2nd PRGM to enter the DRAW menu 2. RIGHT to enter the POINTS menu 3. 7 to choose pxl-Test(, or use arrows TI-83/84/+/SE 1 byte The pxl-Test( command is used to test a pixel at the given (Y,X) coordinates of the graph screen, to see whether it is on or off. One is returned if the pixel is on and zero is returned if the pixel is off. Please note that the coordinates are switched around so that the row comes first and then the column — it's (Y,X) instead of (X,Y). This command's coordinates are independent of the window settings. You can store the result of pxl-Test( to a variable for later use, or use the command in a conditional or loop. :Pxl-On(25,25 :If pxl-Test(25,25 :Disp "Pixel turned on!  # Error Conditions • ERR:DOMAIN is triggered if the coordinates are not whole numbers or not in the right range ([0..62] for row, [0..94] for column). These bounds are also affected by split screen mode (Horiz) # Related Commands Command Summary Toggles a pixel on the graph screen. Command Syntax Pxl-Change(row,column) Menu Location While editing a program press: 1. 2nd PRGM to enter the DRAW menu 2. RIGHT to enter the POINTS menu 3. 6 to choose Pxl-Change(, or use arrows TI-83/84/+/SE 1 byte The Pxl-Change( command is used to toggle the pixel at the given (Y,X) coordinates. If the pixel is on, it will be turned off and vice versa. Please note that the coordinates are switched around so that the row comes first and then the column — it's (Y,X) instead of (X,Y) like the Pt-Change( command. Also note that the row decreases as you go up which can confuse users. In addition to being easier to use because it is not affected by the window settings (meaning you don't have to set them when using the command), Pxl-Change( is faster than its equivalent Pt-Change( command, so it should generally be used instead whenever possible. # Error Conditions • ERR:DOMAIN is triggered if the coordinates are not whole numbers or not in the right range ([0..62] for row, [0..94] for column). These bounds are also affected by split screen mode. # Related Commands Command Summary Turns off a pixel on the graph screen. Command Syntax Pxl-Off(row,column) Menu Location While editing a program press: 1. 2nd PRGM to enter the DRAW menu 2. RIGHT to enter the POINTS menu 3. 5 to choose Pxl-Off(, or use arrows TI-83/84/+/SE 1 byte The Pxl-Off( command is used to turn off the pixel at the given (Y,X) coordinates. Please note that the coordinates are switched around so that the row comes first and then the column — it's (Y,X) instead of (X,Y) like the Pt-Off( command. Also note that the (0,0) point is the upper left corner of the Graph screen. In addition to being easier to use because it is not affected by the window settings (meaning you don't have to set them when using the command), Pxl-Off( is faster than its equivalent Pt-Off( command, so it should generally be used instead whenever possible. # Error Conditions • ERR:DOMAIN is triggered if the coordinates are not whole numbers or not in the right range ([0..62] for row, [0..94] for column). These bounds are also affected by split screen mode. # Related Commands Command Summary Turns on a pixel on the graph screen. Command Syntax Pxl-On(row,column) Menu Location While editing a program press: 1. 2nd PRGM to enter the DRAW menu 2. RIGHT to enter the POINTS menu 3. 4 to choose Pxl-On(, or use arrows TI-83/84/+/SE 1 byte The Pxl-On( command is used to turn on the pixel at the given (Y,X) coordinates. Please note that the coordinates are switched around so that the row comes first and then the column — it's (Y,X) unlike the (X,Y) of the Pt-On( command. Also note that the (0,0) point is the upper left corner of the Graph screen. In addition to being easier to use because it is not affected by the window settings (meaning you don't have to set them when using the command), Pxl-On( is faster than its equivalent Pt-On( command, so it should generally be used instead whenever possible. # Error Conditions • ERR:DOMAIN is triggered if the coordinates are not whole numbers or not in the right range ([0..62] for row, [0..94] for column). These bounds are also affected by split screen mode. # Related Commands Command Summary Toggles a point on the graph screen. Command Syntax Pt-Change(X,Y) Menu Location While editing a program press: 1. 2nd PRGM to enter the DRAW menu 2. RIGHT to enter the POINTS menu 3. 3 to choose Pt-Change TI-83/84/+/SE 1 byte The Pt-Change( command is used to toggle a point (a pixel on the screen) on the graph screen at the given (X,Y) coordinates. If the point is on, it will be turned off and vice versa. Pt-Change( is affected by the window settings, which means you have to change the window settings accordingly, otherwise the point won't show up correctly on the screen. Pt-Change( can be an interactive command: when on the graph screen, you can select it from the draw menu, and rather than have to input coordinates, be able to draw directly on the screen. Since you can both draw and erase points easily with Pt-Change(, this use of it is often more convenient than the Pen tool. # Related Commands Command Summary Turns off a point on the graph screen. Command Syntax Pt-Off(X,Y[,mark]) Menu Location While editing a program press: 1. 2nd PRGM to enter the DRAW menu 2. RIGHT to enter the POINTS menu 3. 2 to choose Pt-Off( TI-83/84/+/SE 1 byte The Pt-Off( command is used to turn off a point (a pixel on the screen) on the graph screen at the given (X,Y) coordinates. Pt-Off( is affected by the window settings, which means you have to change the window settings accordingly, otherwise the point won't show up correctly on the screen. # Advanced Uses The Pt-Off( command has an optional third argument that determines the shape of the point (its mark). The mark can be 1 (dot), 2 (3x3 box), 3 (3x3 cross), 6 (3x3 box), or 7 (3x3 cross). Note that by using the 3x3 shapes the X,Y coördinates will be the center of the shape and not the upperleft corner of the shape. You don't need to specify the mark when using the first mark because it is the default; also, any value that isn't 2, 3, 6, or 7 will be treated as the default of 1. :Pt-Off(5,5,1 Remove Mark :Pt-Off(5,5  # Related Commands Command Summary Turns on a point on the graph screen. Command Syntax Pt-On(X,Y[,mark]) Menu Location While editing a program press: 1. 2nd PRGM to enter the DRAW menu 2. RIGHT to enter the POINTS menu 3. 1 to choose Pt-On( TI-83/84/+/SE 1 byte The Pt-On( command is used to draw a point on the graph screen at the given (X,Y) coordinates. Pt-On( is affected by the window settings Xmin, Xmax, Ymin, and Ymax. Make sure to change these accordingly when using it in a program, otherwise, you don't know where the point will show up. # Advanced Uses The Pt-On( command has an optional third argument that determines the shape of the point (its mark). The mark can be 1 (dot), 2 (3x3 box), 3 (3x3 cross), 6 (3x3 box), or 7 (3x3 cross). Note that by using the 3x3 shapes the X,Y coordinates will be the center of the shape and not the upperleft corner of the shape. You don't need to specify the mark when using the first mark because it is the default; also, any value that isn't 2, 3, 6, or 7 will be treated as the default of 1. Remember to use the same mark when turning a point off as you used to turn it on. If you need to convert coordinates in pixel format into point coordinate format, it can easily be done with the following formula: (X pixel coordinate*ΔX)-absolute value(Xmax)=X point (Y pixel coordinate*ΔY)-absolute value(Ymax)=Y point The ΔX and ΔY variables are available under "VARS", "Window", options 8 and 9. These two variables represent the number of points per pixel on the graph screen, so multiplying the pixel value by the ratio of points to pixels will give you the point value, you then subtract the Xmax/Ymax from this value to calibrate it to the center of the screen. This formula is useful in programs that use the pixel commands for their speed advantage, but need a point value for commands such as Circle( or Line(. :Pt-On(5,5,1 should be :Pt-On(5,5  # Related Commands Command Summary Prompts the user to enter a value and then stores the value to the variable. Displays the graph screen and then the user can move around the cursor. Command Syntax Input Input ["Text",]variable Menu Location While editing a program press: 1. PRGM to enter the PRGM menu 2. RIGHT to enter the I/O menu 3. 1 to choose Input TI-83/84/+/SE 1 byte The Input command is the other way of getting user input on the home screen (getting user input on the graph screen is only possible with the getKey command). The Input command asks the user to enter a value for a variable (only one variable can be inputted at a time), waiting until the user enters a value and then presses ENTER. It does not display what variable the user is being asked for, but instead just displays a question mark (?). Because just displaying a question mark on the screen does not really tell the user what to enter for input or what the input will be used for, the Input command has an optional text message that can be either text or a string variable that will be displayed alongside the input. Only the first sixteen characters of the text message will be shown on the screen (because of the screen dimensions), so the text message should be kept as short as possible (a good goal is twelve characters or less). This is so the value the user inputs can fit on the same line as the text. In the case that the value is too long, it will wrap around to the next line. PROGRAM:INPUT :"Fruit :Input "Best "+Ans,Str1 :Input "Worst "+Ans,Str2 :Disp "That's "+Ans+"astic!  Input can be used to display every variable just before it requests user input, but some of the variables have to be entered in a certain way. If the variable is a string or a Y= function, the user must put quotes ("") around the value or expression. The user must also put curly braces ({}) around lists with the list elements separated by commas, and square brackets ([]) around matrices with the matrix elements separated by commas and each row individually wrapped with square brackets. # Advanced Uses When you just use the Input command by itself (without any arguments), the graph screen will be shown and the user can move the cursor around. Program execution will then pause until the user presses ENTER, at which time the coordinates of the cursor will be stored to the respective variables (R and θ for PolarGC format, otherwise X and Y). If a text message is longer than twelve characters or you want to give the user plenty of space to enter a value, you can put a Disp command before the Input command. You break the text message up and display it in parts. The Input command will be displayed one line lower, though, because the Disp command automatically creates a new line. :Disp "What is your" :Input "Name",Str0  Normally you can't get a quote character into a string (because quotes are used to identify the beginning and end of the string), but the Input command actually allows the user to enter a quote character (") as part of a string. This works without problems, and the quote can even be accessed by the user afterwards. Because a user-defined list variable doesn't need the prefixed character before it when referring to the list, you may be only asking the user to input a simple real variable but a list would also be allowed. There is nothing you can really do about this problem, except including the prefixed character when wanting a list inputted and trying to limit your use of Input and Prompt. :Input A should be :Input ∟A  # Optimizations When you are just using the text message to tell the user what the variable being stored to is, you should use the Prompt command instead. And, if there is a list of Input commands following the same pattern, you can reduce them to just one Prompt command. :Input "A",A :Input "B",B Replace with Prompt :Prompt A,B  # Error Conditions • ERR:INVALID occurs if this statement is used outside a program. # Related Commands Command Summary Calculates some statistics for a single list of data, and stores them to statistical variables. They're also displayed in a scrollable list, if done outside a program. Command Syntax 1-Var Stats [list, [freqlist]] Menu Location Press: 1. STAT to access the statistics menu 2. LEFT to access the CALC submenu 3. 1 or ENTER to select 1-Var Stats TI-83/84/+/SE 1 byte This command calculates a bunch of common (and a few uncommon) statistics for a list (it uses L1 by default, but you can use any list by supplying it as an argument). You have to store the list to a variable first, though, before calculating statistics for it. For example: :{5,12,7,8,4,9→L1 :1-Var Stats  Like other statistical commands, you can use a frequency list as well, for cases where one element occurs more times than another (you can do this with a normal list, too, but that might be inconvenient when an element occurs very many times). For example: :{1,2,3→L1 :{5,3,2→L2 :1-Var Stats L1,L2  is the frequency-list equivalent of: :{1,1,1,1,1,2,2,2,3,3→L1 :1-Var Stats  When you're running it from the home screen, 1-Var Stats will display the statistics; this won't happen if you do it inside a program. Either way, it will also store what it calculated to the statistics variables found in VARS>Statistics… The variables 1-Var Stats affects are: •$\overline{\textrm{x}}\$ is the mean (average) of the elements, as returned by mean(
• Σx is the sum of the elements, as returned by sum(
• Σx² is the sum of the squares of the elements
• Sx is the sample standard deviation, as returned by stdDev(
• σx is population standard deviation
• n is the number of elements in the list, as returned by dim(
• minX is the minimum value, as returned by min(
• Q1 is the first quartile
• Med is the median, as returned by median(
• Q3 is the third quartile
• maxX is the maximum value, as returned by max(

1-Var Stats will not work with "reserved" list names that the calculator uses internally. The only known such reserved list is the list RESID, and there's no reason to suspect there are any others. Ans, TblInput, and any expression which resolves to a list, are also not appropriate for this command: store all of these to a list before doing 1-Var Stats on them.

# Optimization

Aside from statistical analysis, 1-Var Stats can also be used when you want to use the values it calculates more than once. This will save on size, since, for example Σx takes up less space than sum(L1), but considering how many calculations 1-Var Stats makes, it will usually be slower. Here's a short example which saves 1 byte:

:Disp "RANGE:",max(L1)-min(L1
can be
:1-Var Stats
:Disp "RANGE:",maxX-minX


# Related Commands

These commands are used to test if experimental data supports some model we have. To do a significance test, we first assume the the null hypothesis - that any deviation from that model occurred by chance alone. Then we calculate the probability of such data occurring if the null hypothesis is correct. If this probability is sufficiently low (usually less than 0.05, or less than 0.01), then because it's so unlikely that the data occurred by chance, we conclude that some external factor did affect the data, rejecting the null hypothesis.

The following commands are avalable for significance testing:

How to decide which test to use:

Five of the tests are for fairly specific purposes:

1. If you have many categories, such as days of week, to compare against an expected value, use one of the χ² tests:
• The χ²-Test( command is for comparing frequencies of two different categorical variables (e.g. weather vs. month).
• The χ²GOF-Test( is for testing a distribution of a single categorical variable.
2. If you want to see the effects of many categories on one variable, use ANOVA.
3. If you're comparing the variance of two variables, use the F test.
4. Use LinRegTTest for testing the hypothesis of a linear relation between two variables.

For the remaining six tests:

1. If you're testing for significant difference betwen two data sets, use a command with 2- in it (for obvious reasons).
2. If your variable is a proportion, use 1-PropZTest or 2-PropZTest: proportion tests ALWAYS use z- rather than t-distributions.
3. If you already know the standard deviation, use a ZTest.
4. If you want to determine the standard deviation from the data, use a TTest.

These commands are used to calculate a confidence interval. Given a specific distribution type, and a confidence value 0 to 1 (common values are 0.95 and 0.99), one of these commands will give you an interval such that you can say, with the given confidence value, that the true population parameter we're interested in (usually the mean) will lie in the interval.

Although it's very easy to say "there's a 95% (or 99%) probability that the population parameter lies in the interval," some picky people feel that it's incorrect to talk about probabilities of the parameter, when it has a fixed value - we just don't know it. According to this school of thought, the correct way of phrasing a conclusion is "if we were to conduct this experiment (or study) multiple times, we would capture the correct value of the parameter in our interval 99% (for example) of the time."

All tests can be performed either on actual data, or on statistics such as mean and standard deviation. The following tests are available:

Here's how you decide which test to use:

1. If you have two unrelated samples, use the commands with a 2- in them.
2. If you're interested in a proportion, use one of the PropZ intervals.
3. If you know the standard deviation already, use a Z interval.
4. If you want to approximate the standard deviation from your data, use a T interval.
5. Use LinRegTInt for calculating an interval for the slope of a regression.

A probability distribution is a formula describing the way a random variable behaves, or our assumptions about the potential values of an unknown parameter. The TI-83 series calculators include a variety of commands that describe very common distributions (although you can calculate the probabilities directly, they often have complicated formulas, and it is faster to use these commands instead).

For the continuous distributions, …pdf( gives the probability density function (mainly useful for graphing), and …cdf( gives the actual probability of a result occurring in an interval. For the discrete distributions, …pdf( gives the probability for a single value, and …cdf( gives the probability for all values up to some limit.

When calculating confidence intervals and significance tests, using these functions approaches the "using a table" experience more closely, and gives you a better idea of what's going on; however, the appropriate Test or Interval command, if available, will be easier and faster (as well as smaller, if in a program) to use.

There are also four "shade" commands available: rather than just calculating a value, they also draw the curve of the probability density function on the graph screen, and shade in the area that corresponds to the desired probability.

The following probability distribution commands are available:

These commands are used to fit a line or curve to approximate a set of data (known as a regression model). If you're running the commands outside a program, the result will be displayed on-screen (DiagnosticOn and DiagnosticOff control whether you'll see the correlation statistics). Regardless, you can access the result in variables that can be accessed from the [VARS] > Statistics… > EQ submenu.

If you execute one of these commands with no arguments at all, the calculator will attempt to perform the regression on the data found in L₁ and L₂ with the former being the independent variable (x) and the latter being the dependent variable (y), but you can use any two lists you want by typing them after the command. You can also use a frequency list to assign weight to the data points. Finally, supplying an equation (such as Y₁) to the command will cause the regression model to be stored to that equation - it will also be stored to RegEQ, but you can't use that variable in programs.

The following regression models are available:

The TI-83 series calculators include a wide range of commands for statistical analysis. In addition to some wide-purpose statistical commands, the commands available include regression models, probability distributions, and tools for calculating confidence intervals and significance tests.

Virtually all statistical calculations that take actual data as an argument will accept both an actual list of data (each element occurs in the list the number of times it occurred in the data), and data split up by frequency (two lists, the first giving each distinct element that occurred in the data, and the second giving the number of times it occurred).

# General Statistical Commands

These commands are meant to determine sample statistics of data. Further commands which are not generally used in statistics but may be helpful are located in the [2nd][LIST] menu.

Plots are also a useful statistical tool, allowing you to analyze data graphically. The following commands exist for dealing with plots:

# Regression Models

These commands are used to fit a line or curve to approximate a set of data. If you're running the commands outside a program, the result will be displayed on-screen (DiagnosticOn and DiagnosticOff control whether you'll see the correlation statistics). Regardless, you can access the result in variables that can be accessed from the [VARS] > Statistics… > EQ submenu. Optionally, the regression model can also be stored to an equation variable.

# Probability Distributions

These commands are used to calculate or to graph probability values for various distribution types. For the continuous distributions, …pdf( gives the probability density function (mainly useful for graphing), and …cdf( gives the actual probability of a result occurring in an interval. For the discrete distributions, …pdf( gives the probability for a single value, and …cdf( gives the probability for all values up to some limit.

# Confidence Intervals

These commands are used to calculate a confidence interval. Given a specific distribution type, and a confidence value 0 to 1 (common values are 0.95 and 0.99), one of these commands will give you an interval such that you can say, with the given confidence value, that the true population parameter we're interested in (usually the mean) will lie in the interval.

# Significance Tests

These commands are used to test if experimental data supports some model we have. To do a significance test, we first assume the null hypothesis - that any deviation from that model occurred by chance alone. Then we calculate the probability of such data occurring if the null hypothesis is correct. If this probability is sufficiently low (usually less than 0.05, or less than 0.01), then because it's so unlikely that the data occurred by chance, we conclude that some external factor did affect the data, rejecting the null hypothesis.