The TI-89 Calculator in the Basic Probability and Statistics Course

Mark Wroth

United States Military Academy
Department of Mathematical Sciences

West Point, New York 10996 <mark.wroth@us.army.mil>


Table of Contents
1. Introduction
1.1. Why This Document?
1.2. Using Advanced Calculators in Probabality and Statistics
1.3. General Issues in Learning Probability and Statistics Armed with an Advanced Calculator
1.3.1. Interval Probabilities
1.3.2. Standardized Random Variables
2. Descriptive Statistics
2.1. Numerical Methods
2.2. Graphical Methods
2.2.1. Histograms
2.2.2. Box Plots
3. Basic Operations
3.1. Counting
3.2. Counting Techniques
3.2.1. Factorials
3.2.2. Permutations
3.2.3. Combinations
3.3. Random Variables and Probability Distributions
3.3.1. Discrete Random Variables
3.3.2. Continuous Random Variables
4. Estimation
4.1. Point Estimation
4.2. Interval Estimation
5. Hypothesis Testing
A. Symbols and Abbreviations
A1
B. Program and Function Reference
MA206() Set up a custom menu allowing easy access to functions commonly used in the basic probability and statistics course.
Hypergeometric Distribution Compute probabilities related to a hypergeometric distribution, specifically the probability that a hypergeometric random variable lies between two constants a and b, inclusive.
hygeopdf(x,n,succ,pop) Evaluate the PDF of a hypergeometric random variable.
hygeocdf Evaluate the CDF of a hypergeometric random variable.
TIStat.poissCdf Evaluate the probability that a Poisson random variable lies between LOW and UP inclusive.
TIStat.binomCdf Evaluate the probability that a Binomial random variable lies between LOW and UP inclusive.
unifCdf Evaluate the CDF of a uniformly distributed random variable.
expCdf Evaluate the CDF of an exponentially distributed random variable.
TIStat.normCDF Returns the probability that a normally distributed random variable with mean μ and standard deviation σ lies between LOW and UP.
TIStat.invNorm TIStat.invNorm returns the value of a normally distributed random variable such that a probability of AREA lies to the left of the value.
TIStat.inv_t TIStat.inv_t returns the value of a Student's T distributed random variable such that a probability of AREA lies to the left of the value.
TIStat.invChi2 Compute the value of a χ2 distributed random variable such that a probability of AREA lies to the left of the value.
TIStat.zInt Compute a confidence interval for the mean of a random variable.
TIStat.tInt Compute a confidence interval for the mean of a normally distributed random variable.
chi2int The chi2int() program (and its companion chi2gui(), which provides a graphical user interface to the program) computes confidence intervals on the population variance or standard deviation of a normally distributed population.
binomInt The binomint() program computes confidence intervals on the population proportion for a binomially distributed random variable.
C. Upgrading a TI-89 Calculator for MA206 Probability and Statistics
C.1. Overview
C.2. Installing the Advanced Mathematics Software using another TI-89
C.3. Installing the Statistics with List Editor Flash Application Using Another TI-89
Bibliography
List of Figures
3-1. Hypergeometric PDF

Chapter 1. Introduction

1.1. Why This Document?

Advanced calculators such as the HP-48 and TI-89 present both an opportunity and and a challenge to students (and teachers) of probability and statistics. On one hand, the calculator makes actually performing the sometimes tedious calculations needed in P & S a matter of punching a few buttons. Advanced calculators also larqely or completely eliminate the need for cumbursum tables. But this capability comes with a price. Not only does the student have to master the concepts of the course—a challenge in itself—but they must also learn what the capabilities of the calculator are and how to invoke them.

This document is aimed at students (and teachers) who are trying to master the aspects of the advanced calculator (specifically the TI-89) that apply to the basic probability and statistics course. It supplements the course textbook and the calculator handbook and focuses on those uses of the calculator specifically needed for this course. It covers both the built in operations of the calculator, and programs written specifically to assist with the subject.

We assume that the student has been using the same calculator through the core math sequence, and is therefor familiar with basic calculator operations. In addition to basic arithmatic computation, this includes symbolic manipulation, basic calculus (particularly numerical quadrature) and graphing of functions.

One of the powerful features of the advanced calculators is programmability. In addition to briefly covering the built in functions of the calculator, this document discusses some programs written to assist with subjects covered in the basic P & S course.


1.2. Using Advanced Calculators in Probabality and Statistics

The focus of many P & S courses—and many students—appears to be on mastering the basic computations of the subject. For example, a major goal during a block on the exponential random variable is being able to correctly compute probabilities involving such a random variable. Facility with this calculation is then assumed later in the course. With a properly set up calculator, the calculation itself is simple; the challenge is in knowing when to use the distribution, what value to use for the parameter, and how to interpret the result.

The calculator can also largely replace the use of tables, and hence of the need to standardize random variables for most purposes. The exception to this is that many statistical packages, including the TI-89, use and display standardized random variables in statistical tests, so some understanding of the process is needed.

The following sections are presented in an order generally conducive to a one semester course in probability and statistics, following the outline of MA206, the core course in the subject taught at USMA using [DEVORE] as the text. With some modification, it should be helpful in most basic probability and statistics courses.


1.3. General Issues in Learning Probability and Statistics Armed with an Advanced Calculator

1.3.1. Interval Probabilities

Computing the probability that a random variable lies in a stated interval is a common task in the probability and statistics course. Especially with the capabilities of the TI-89, there are several valid strategies students may use for computing such probabilities:

  • Manipulate the PDF (or PMF) directly. For example. integrate the PDF over the interval. This approach implies the need for a user-manipulable PDF (PMF) functions.

  • Subtract the endpoint CDF values. Most easily executed at the HOME entry line, this approach implies the need for a user-manipulable CDF function for each distribution.

  • Create (or find) a calculator program which computes the interval probability. Internally, such a program may use either computation approach.

There is no theoretical reason to choose between these techniques. Ideally, a student would master all of the different techniques and choose the technique appropriate to the particular problem.

Common practice in teaching the computation is to cover PDF-based approaches, but to emphasize CDF-based approaches. This fits well with the use of distribution tables, and may be easiest for some students because of this connection.

At the same time, the primary user interface for the probability computations in the TI-89 Statistics with List Editor is a program based GUI which allows the user to enter the distribution parameters and the ends of the interval. While entry line functions are also provided in the Statistics with List Editor, use of these functions is essentially undocumented. Consistency with the general approach of the TI-89 would appear to suggest GUI-based interfaces are desirable. This requires writing programs for the distributions which are not included in the Statistics with List Editor application. For MA206, this would include the Hypergeometric, Uniform, and Exponential distributions.

The TI-89 allows the student to approach the calculation of interval probabilities any of the above ways—given the availability of either existing programs or basic programming skills for the third approach. To help gain understanding, it may be a good idea for students to focus on one method and ensure it is mastered. If GUI-based programs are available for all of the distributions of interest, focusing on this technique is likely to be the easiest.


1.3.2. Standardized Random Variables

The use of the calculator largely eliminates the need to use traditional probability tables. Since being able to use the standard normal probability tables is one of the main ways the use of a standardized random variable is presented, eliminating the need to use the tables at all also eliminates one of the major uses of standardized variables. It is tempting to simply ignore the topic completely if the student has adequate calculator skills.

However, there are several reasons to understand the basic manipulations surrounding standardized random variables, and the standard normal distribution in particular. Perhaps least important is the fact that traditional tables, while in some sense obsolescent as calculators with basic probability functions become more common, are still available when calculators are not, so some ability to use them is probably a good idea. More important from the perspective of the course material is that the manipulations to standardize the Normal random variable are the basis of the manipulations by which we derive the formulas for confidence intervals. So understanding how to standardize the normal random variable is a lead in to the material on confidence intervals. Finally, statistical packages—including the TI-89's advanced statistics functions— frequently state hypothesis test results in terms of standardized test statistics. Understanding the test results depends on understanding the normalized versions of the statistics.


Chapter 2. Descriptive Statistics

2.1. Numerical Methods

The TI-89's one variable statistics application computes the sample mean, variance and standard deviation (using both the sample and population formulas), and the median and quartiles.

Computing One-Variable Sample Statistics

  1. Enter the sample data into a list.

  2. Select the 1: 1-Var Stats option from the [F4] Calc menu (of the Statistics with List Editor application).

  3. Enter the name of the list containing the sample data, either by entering the variable name directly, or by selecting [2nd] VAR-LINK and selecting the variable.

  4. Select ENTER to confirm the selection, and again to compute the statistics.


2.2. Graphical Methods

2.2.1. Histograms

A basic histogram is one of the standard plot types available. To create a histogram of data:

  1. Enter the data into a list variable.

  2. Select [F2] Plots to bring up the Plots menu.

  3. Select 1:Plot Setup....

  4. Highlight a plot line.

  5. Select [F1] Define.

  6. Select Plot Type; on the popup menu, select 4:Histogram

  7. Enter the name of the list variable containing the data in the x box.

  8. Enter an appropriate width for the histogram intervals in Hist. Bucket Width.

  9. Ensure the NO option is selected in the Use Freq and Categories? popup.

  10. Select ENTER.

  11. Select [F5] ZoomData.


2.2.2. Box Plots

A basic box plot is one of the standard plot types available.

  1. Enter the data into a list variable.

  2. Select [F2] Plots to bring up the Plots menu.

  3. Select 1:Plot Setup....

  4. Highlight a plot line.

  5. Select [F1] Define.

  6. Select Plot Type; on the popup menu, select 3:Box Plot

  7. Enter the name of the list variable containing the data in the x box.

  8. Ensure the NO option is selected in the Use Freq and Categories? popup.

  9. Select ENTER.

  10. Select [F5] ZoomData.

The [F3] Trace function allows easy examination of the particular values included in the plot.


Chapter 3. Basic Operations

3.1. Counting

The TI-89 computes several basic functions useful for counting problems.

For most of these operations, there are two or three different ways to access the same calculator function:

  • Select the function from a menu (usually the Math menu, accessed with the [2nd MATH key).

  • Type the name of the function in the Entry Line, using the alphabetic keys.

  • Add the function to the Entry Line using the CATALOG. Functions defined from flash applications (such as Statistics with List Editor) and user-defined functions are also available through the CATALOG function.


3.2. Counting Techniques

3.2.1. Factorials

The factorial function is accessed with the postfix operator ! which can be entered from the keyboard (using the [2nd] CHAR function) or from the [2nd] MATH 7: Probability menu.


3.2.2. Permutations

The "permutations” function can be accessed with the function nPr( function. This can be accessed via the [2nd] MATH 7: Probability nPr( menu pick.


3.2.3. Combinations

The "combinations” function can be accessed through the nCr( function. This can be accessed via the [2nd] MATH 7: Probability nCr( menu pick, or by typing the function name in the entry line..


3.3. Random Variables and Probability Distributions

3.3.1. Discrete Random Variables

3.3.1.1. Binomial Distribution

The Binomial probability distribution is one of the pre-defined probability distribution in the Statistics with List Editor application. It is accessed via the [F5] Distr menu, using either the B: Binomial Pdf or C: Binomial Cdf menu items.


3.3.1.2. Hypergeometric Distribution

The hypergeometric probability distribution is not one of the pre-defined distributions in the Statistics with List Editor. Since it is not pre-defined for us, we can define the PDF and CDF as TI-89 functions.

The PDF of the hypergeometric distribution is shown in Figure 3-1.

Figure 3-1. Hypergeometric PDF

(nCr(Succ, x) * nCr(Pop - Succ, n - x))/(nCr(Pop, n))

Where Pop is the number of elements in the population, Succ is the number of elements coded “success”, n is the sample size, and max(0, n - Pop + Succ) ≤ x ≤ min(n, Succ)

The side conditions deal with the fact that the minimum number of successes in the sample is limited by the total number of failures in the population and the sample size (you can't have more failures in the sample than there are in the population), and the maximum number of successes in the sample is limited by the number of successes in the population.


3.3.1.3. Poisson Distribution

The Poisson probability distribution is one of the pre-defined probability distribution in the Statistics with List Editor application. It is accessed via the [F5] Distr menu, using either the D: Poisson Pdf or E: Poisson Cdf menu items.


3.3.2. Continuous Random Variables

3.3.2.1. Arbitrary Distributions

The TI-89‘s calculus applications can significantly ease the manipulation of arbitrary continuous probability distributions through their ability to find both definite and indefinite integrals. You reach these functions through the HOME screen, and should already be familiar from earlier calculus courses.

The major caution in applying the basic calculus functions to the PDF is to ensure that the limits of integration are correctly applied. Like any computer, the TI-89 will do what you tell it to, which may not be what you intended, particularly for piecewise defined functions!

Probabilities. Finding the probability that an arbitrarily defined continuous random variable lies in a given interval is, by definition, a matter of integrating the PDF over the interval. For simply defined functions (e.g. the Exponential distribution) this is easily accomplished with the Integrate function from the HOME [F3] Calc menu.

Expected Value. Finding the expected value of an arbitrarily defined continuous random variable can be accomplished by applying the definition of expected value. For simply defined functions (e.g. the Exponential distribution) this is easily accomplished with the Integrate function from the HOME [F3] Calc menu.

Variance. Finding the variance of an arbitrarily defined continuous random variable can be accomplished by applying the definition of variance. For simply defined functions (e.g. the Exponential distribution) this is easily accomplished with the Integrate function from the HOME [F3] Calc menu. The computational formula, V(X)=E(X2)-[E(X)]2 can be applied by integrating to find the expected value of X2; this may not be easier than applying the definition directly.

Defining the PDF or the CDF as a TI-89 function allows it to be used in subsequent calculations. Examples of reasonable definitions are given for some of the probability distributions used in the basic probability and statistics course discussed below.


3.3.2.2. Uniform Distribution

The Uniform distribution is not a separately defined probability distribution in the Statistics with List Editor application. Therefore all manipulations of random variables with this distribution depend on manipulating the PDF directly, user defined programs, or on the use of known formulas.

The cumulative distribution function can be defined as a TI-89 function for convenience in calculation. An example of such a definition is shown in in the unifCdf reference page.


3.3.2.3. Exponential Distribution

The Exponential distribution is not a separately defined probability distribution in the Statistics with List Editor application. Therefore all manipulations of random variables with this distribution depend on manipulating the PDF directly, user-defined programs, or on the use of known formulas.

The expcdf() function (discussed in the expCdf reference page) can be used on the TI-89 to compute probabilities related to exponential random variables. It implements the piecewise definition of the function, and thus can be used without careful reference to the interval of definition.


3.3.2.4. Normal (Gaussian) Distribution

The Normal, or Gaussian, probability distribution is one of the pre-defined distributions in the Statistics with List Editor application. Because of its promenance in statistical applications, there are a variety of built-in functions for accessing and manipulating this distribuution.


3.3.2.4.1. Computing Normal Probabilities

There are two main methods for computing probabilities involving the Normal distribution; the Normal Cdf function (accessed from the [F5] Distr menu of the Statistics with List Editor), and with the Shade function (also accessed from the [F5] Distr menu of the Statistics with List Editor). Both require the mean, standard deviation, and limits of the interval; the Shade function, in addition to computing the probability that the random variable is in the interval, draws the PDF and shades the area of interest.


3.3.2.4.2. Normal Probability Plots

The [F2] Plots menu includes the ability to create a normal probability plot of data in one of the lists. To draw a normal probability plot:

  1. Start the Statistics with List Editor application.

  2. Enter the data into a list variable.

  3. Select the Plots menu by pressing [F2] Plots.

  4. Select 2:Norm Prob Plot.

  5. Fill out the resulting Norm Prob Plot... requestor:

    1. Select an unused list variable at the Plot Number popup.

    2. Enter the name of the list variable containing the data for which the probability plot is needed in the List: box.

    3. Select values for the remaining entries on the requestor. The default values are probably acceptable.

    4. Select ENTER to close the requestor.

  6. Select the Plots menu by pressing [F2] Plots.

  7. Select 1:Plot Setup.

  8. Select the plot variable containing the normal scores (the name of this variable was chosen in the Plot Number popup of the Norm Prob Plot...) by highlighting it using the cursor keys and pressing [F4].

  9. Display the plot by pressing [F5] ZoomData .


Chapter 4. Estimation

4.1. Point Estimation

The primary mechanism for computing point estimates is the 1: 1-Var Stats menu item of the F4 Calc menu of the Stats/List Editor Flash App. This application returns a variety of point estimates based on the sample data contained in one of the data lists.

A basic familiarity with the List Editor is very useful in computing point estimates from sample data. This subject is covered in Statistics with List Editor Application for TI-89/TI-92 manual.

Tip: A particularly useful technique with the 1-Variable Statistics application is to use the VAR-LINK menu to select the specific list for which to calculate statistics.


4.2. Interval Estimation

The main TI-89 function supporting estimation (other than the functions used for calculating sample statistics) is the [F7] Ints menu, which includes functions for Z and T-based confidence intervals on the mean (among others). These functions allow the interval to be calculated directly from sample data, or from previously computed sample statistics.

The 5: 1-PropZInt menu can be used to calculate confidence intervals on the population proportion of a binomial distribution. However, this function appears to use the approximate formula defined by [DEVORE] in Equation 7.11 (which is the standard form used by most texts rather than the more exact form defined in Equation 7.11. The binomial interval programs binomInt defined in this document supplement the 1-proportion Z Interval program by using the more exact formulation ([DEVORE] Equation 7.11).

The chi2int() and its companion GUI chi2gui() are user-defined programs that compute confidence intervals on the variance or standard deviation of a normal population. They are discussed in chi2int.

The [F5] Distr menu’s 2: Inverse submenu includes functions for computing the critical values of the Normal, Student’s T, and Chi-squared distributions (among others not covered in MA206).

Tip: The various inverse functions ask for the AREA (probability) at which the inverse is to be calculated. This area is the probability that the random variable is less than the returned inverse value. This is consistent with the general definition of a CDF. However, the critical values of a distribution are defined in terms of the probability that the random variable is greater than the critical value. The translation between the two is, of course, that the area above the critical value is 1 minus the area the inverse function is expecting.

This difference can be ignored by taking the absolute value of the resulting critical value—if the distribution is symmetric around zero. Becasue this relationship does not hold true for distribution not symmetric about zero (i.e. the Chi-squared distribution or the general normal distribution), relying on this property can lead the student into mistakes. It is more correct and more generally applicable to always remember that 1-α = AREA, and make the entry into the invers function accordingly.


Chapter 5. Hypothesis Testing

The [F6] Tests menu includes applications for (among others), Z and T-based hypothesis tests. These tests allow the test statistic to be provided, or to be computed from data entered in one of the lists. They also can display the distribution with the acceptance region shaded or simply provide the numerical results. In both cases, the calculator provides the p-value relevant to the test, rather than drawing a conclusion.


Appendix A. Symbols and Abbreviations

This appendix lists various symbols and abbreviations used in the text. In particular, it lists non-ASCII symbols; depending on the medium in which this document appears, these symbols may be differently rendered.

©

Represents the TI-89 comment symbol. Usually rendered with the closest available glyph, which is frequently the copyright symbol.

Integral sign.

Set intersection.

Square root (surd or radical).

α

Lower case Greek letter alpha.

LAMBDA

Lower case Greek letter lambda; usually the parameter of a Poisson or exponential distribution.

SUM

Summation operator, usually the upper case Greek Sigma.

The TI-89STORE” command as represented in the editor window.

Set union.


Appendix B. Program and Function Reference

The TIStat applications (belonging to the Statistics with List Editor flash application) need their own reference pages; the application manual ([TI-89STATSLE]) does not describe how to use the applications from the Home screen, although they are available from the CATALOG screen as well as from the MA206() program. Some of these have been added to this appendix, but this incomplete.

MA206()

Name

MA206() -- Set up a custom menu allowing easy access to functions commonly used in the basic probability and statistics course.

Synopsis

ma206()

Inputs

none

This program has no inputs.

Outputs

none

This program returns no direct outputs; it sets up a custom menu accessible by the user.

Description

This program sets up a TI-89 custom menu, which allows function names to be easily inserted into the Entry Line

Tip: Function and program names can also be easily pasted into the Entry Line by using the CATALOG key. Once in the Catalog window, pressing [F3] Flash Apps will bring up a list of the functions installed by any flash applications, and [F4] User-Defined will bring up a list of user defined functions.

Tip: When a function has been highlighted in either the [F3] Flash Apps or [F2] Built-in panes of the Catalog window, pressing [F1] Help will bring up a terse description of the inputs for the function.

Implementation

  1 :MA206()
  2 :Prgm
  3 :© Program to set up an MA206 custom menu
  4 :© Rev 2.1 23 JUN 01
  5 :© D/MathSci USMA (Mark Wroth)
  6 :Custom
  7 :Title  "Tools"
  8 : Item  "CustmOff"
  9 :Title "Calc"
 10 : Item "∫"
 11 : Item "SUM(" (1)
 12 : Item "√"
 13 :Title  "Counting"
 14 : Item  "nPr("
 15 : Item  "nCr("
 16 : Item  "!"
 17 :Title  "Distr"
 18 : Item  "TIStat.binomPdf("
 19 : Item  "TIStat.binomCdf("
 20 : Item  "TIStat.PoissPdf("
 21 : Item  "TIStat.PoissCdf("
 22 : Item  "hypergeo()"
 23 : Item  "hygeoPdf("
 24 : Item  "hygeoCdf("
 25 : Item  "expCdf("
 26 : Item  "unifCdf("
 27 : Item  "TIStat.normCdf("
 28 :Title "Intvl"
 29 : Item "TIStat.zInt("
 30 : Item "TIStat.tInt("
 31 : Item "TIStat.zInt_1P("
 32 : Item "BinomInt("
 33 : Item "Chi2Int("
 34 : Item "Chi2GUI()"
 35 :EndCustm
 36 :CustmOn
 37 :EndPrgm
 38         
(1)
The actual menu entry is the Greek letter Sigma, which the TI-89 uses as a summation operator. This symbol is not available in the HTML version of this document.

It does not appear to be possible to insert a function prototype (i.e. to give variable names for arguments to a function to be pasted into the entry line).

Hypergeometric Distribution

Name

hypergeo() -- Compute probabilities related to a hypergeometric distribution, specifically the probability that a hypergeometric random variable lies between two constants a and b, inclusive.

Synopsis

hypergeo()

Inputs

Sample size

The size of the sample drawn.

Pop size

The total size of the population from which the sample is drawn.

Successes

The number of successes in the population.

lower limit

The lower limit of the interval for which the probability is desired.

upper limit

The upper limit of the interval for which the probability is desired.

Outputs

probability

The primary output of the program is the probability that the random variable lies in the closed interval [a,b]. The program also echoes the parameters entered into the program as a check on data entry error.

Description

hypergeo is a program which prompts the user for the parameters of a hypergeometric distribution and the endpoints of an interval, and then computes the probability that the random variable lies in that interval.

The hypergeometric distribution models a situation where a sample is taken from a finite population consisting of a fixed number of successes and failures without replacement. The random variable is the number of successes drawn in the sample.

The format of the program is intended to be similar to the format used in the Statistics with List Editor application.

TI-89 Implementation

  1 :hypergeo()
  2 :Prgm
  3 :©(1) Hypergeometric probabilities
  4 :© Rev 2.0
  5 :© Mark Wroth
  6 :Local n,succ,pop,a,b,prob,usrmode
  7 :getMode("ALL")→usrmode
  8 :Dialog
  9 :  Title "Hypergeometric Distn"
 10 :  Request "Sample size:",n
 11 :  Request "Pop size:",pop
 12 :  Request "Successes:",succ
 13 :  Request "lower limit:",a
 14 :  Request "upper limit:",b
 15 :EndDlog
 16 :expr(n)→n(2)
 17 :expr(pop)→pop
 18 :expr(succ)→succ
 19 :expr(a)→a
 20 :expr(b)→b
 21 :© check inputs
 22 :© compute
 23 :If a<b Then
 24 :  SUM(hygeopdf(x,n,succ,pop), x, a, b)→ prob(3)
 25 :Else
 26 :  40 → main\err
 27 :  PassErr
 28 :EndIf
 29 :© Disp prob
 30 :Dialog
 31 :  Title "Hypergeometric Distn ..."
 32 :  Text "P("&string(a)&"≤X≤"&string(b)&")=&string(prob)
 33 :  Text " "
 34 :  Text "n = "&string;(n)&" N = "&string(pop)&" M = "&string(succ)(4)
 35 :EndDlog
 36 :setMode(usrMode)
 37 :EndPrgm
 38         
(1)
The © symbol is used to indicate the TI-89 comment symbol.
(2)
The Request function returns a string value; since we need a numeric value, we have to convert each stored value.
(3)
The calculation here should probably either include checks on the validity of the input parameters, or call hygeopdf to allow that function to do the error checking.
(4)
The choice of variable names in the output summary matches the convention used in [DEVORE] rather than mirroring the descriptive strings used in the input dialog.

hygeopdf(x,n,succ,pop)

Name

hygeopdf(x,n,succ,pop) -- Evaluate the PDF of a hypergeometric random variable.

Synopsis

hygeopdf(x,n,succ,pop)

Inputs

x

The value at which the PDF is to be evaluated.

n

The sample size.

succ

The total number of successes in the population.

pop

The total number of elements (successes and failures) in the population.

Outputs

probability

The PDF value.

Description

hygeopdf computes the probability that a hypergeometric random variable with sample size n, possible number of successes succ, and population size pop assumes the value x.

The hypergeometric PDF is defined as (nCr(Succ, x) * nCr(Pop - Succ, n - x))/(nCr(Pop, n)), where Pop is the number of elements in the population, Succ is the number of elements coded “success”, n is the sample size, and max(0, n - Pop + Succ) ≤ x ≤ min(n, Succ).

Example

To find the probabilitity that a random variable from a hypergeometric distribution with a population size of 50 with 15 successes and a sample size of 10 has exactly 5 successes:

  1. Enter hygeopdf(5.,10,15,50) in the entry line of the HOME window.

  2. Press Enter

  3. The expression you entered and the answer, .094903, will be displayed in the History Area.

    Note: If you enter all of the parameters using exact forms, the calculator will display the exact answer (in this case 904332/9529015). Entering any parameter using a decimal form (the 5. in the example) cause the calculator to provide the approximate answer.

TI-89 Implementation

Because of the very simple definition of hygeocdf(), it is important that we define hygeopdf() to return zero for invalid values of x. It is also appropriate to test for invalid parameter inputs; an invalid input here can propogate up to the CDF.

  1 :hygeopdf(x, n, succ, pop)
  2 :Func
  3 :If n>pop or succ>pop Then
  4 :  Return "'Invalid parameters"
  5 :EndIf
  6 :If max(0,n-pop+succ)≤x and x ≤ min(n, succ)(1) Then
  7 :  nCr(succ, x)*nCr(pop-succ, n-x)/(nCr(pop, n))
  8 :Else
  9 :  0
 10 :EndIf
 11 :©(2) PDF for a
 12 :© hypergeometric RV
 13 :© Rev 1.1
 14 :© Mark Wroth
 15 :EndFunc
(1)
Test for the side conditions on the values of the random variable.
(2)
The © symbol is used to represent the TI-89 comment symbol.

hygeocdf

Name

hygeocdf -- Evaluate the CDF of a hypergeometric random variable.

Synopsis

hygeocdf(x,n, succ,pop)

Inputs

x

The value at which the CDF is to be evaluated.

n

The sample size.

succ

The total number of successes in the population.

pop

The total number of elements (successes and failures) in the population.

Outputs

probability

The CDF value.

Description

hygeocdf(x, n, succ, pop) computes the probability that a hypergeometric random variable with sample size n, possible number of successes succ, and population size pop assumes a value less than or equal to x.

The hypergeometric CDF is defined as SUMxi=0(nCr (Succ, i) * nCr (Pop - Succ, n - i))/(nCr (Pop, n)), where Pop is the number of elements in the population, Succ is the number of elements coded “success”, n is the sample size. Unlike the PDF, there are no limits (in principle) on x, although some care is needed to ensure that the function behaves properly at all values.

Example

To find the probability that a random variable from a hypergeometric distribution with a population size of 50 with 15 successes and a sample size of 10 has 5 or fewer successes:

  1. Enter hygeocdf(5.,10,15,50) in the entry line of the Home window.

  2. Press Enter

  3. The expression you entered and the answer, .969998, will be displayed in the History Area.

    Note: If you enter all of the parameters using exact forms, the calculator will display the exact answer (in this case 2813126/2900135). Entering any parameter using a decimal form (the 5. in the example) cause the calculator to provide the approximate answer.

TI-89 Implementation

The CDF for the Hypergeometric can be implemented easily given the existence of a PDF function which correctly returns zero for values of x which violate the side conditions (see hygeopdf(x,n,succ,pop)).

  1 :hygeocdf(x, n, succ, pop)
  2 :Func
  3 : SUM(hygeopdf(i, m, succ, pop),i,0,x)(1)
  4 :©(2) CDF for a 
  5 :© hypergeometric RV
  6 :© Rev 1.0
  7 :© Mark Wroth
  8 :EndFunc
(1)
We depend on the error checking of hygeopdf() to catch any parameter errors, so the CDF does not need to do any independent error checking.
(2)
The © symbol represents the TI-89 comment symbol.

TIStat.poissCdf

Name

TIStat.poissCdf -- Evaluate the probability that a Poisson random variable lies between LOW and UP inclusive.

Synopsis

TIStat.poissCdf(LAMBDA[,LOW],UP)

Inputs

LAMBDA (required)

The parameter of the Poisson distribution.

LOW (optional)

The lower bound of the interval. Defaults to negative infinity.

UP (required)

The upper bound of the interval.

Outputs

Probability

The probability of that the random variable lies within the given interval.

Description

This program computes various probabilities connected with Poisson random variables. The use of the optional LOW argument allows the program to be used to compute the PDF, CDF, or the probability that the random variable lies in a specific interval.

It is important to understand that the interval over which the probability is computed is a closed interval; in other words, the endpoints are included in the interval.

TIStat.binomCdf

Name

TIStat.binomCdf -- Evaluate the probability that a Binomial random variable lies between LOW and UP inclusive.

Synopsis

TIStat.binomCdf(n,p[,LOW],UP)

Inputs

n (required)

The number of trials.

p (required)

The probability of success.

LOW (optional)

The lower bound of the interval. Defaults to negative infinity.

UP (required)

The upper bound of the interval.

Outputs

Probability

The probability of that the random variable lies within the given interval.

Description

This program computes various probabilities connected with binomial random variables. The use of the optional LOW argument allows the program to be used to compute the PDF, CDF, or the probability that the random variable lies in a specific interval.

It is important to understand that the interval over which the probability is computed is a closed interval; in other words, the endpoints are included in the interval.

unifCdf

Name

unifCdf -- Evaluate the CDF of a uniformly distributed random variable.

Synopsis

unifCdf(x,a,b)

Inputs

x

The value at which the CDF is to be evaluated.

a

The lower limit of the region for which the PDF is non-zero.

b

The upper limit of the region for which the PDF is non-zero.

Outputs

Cumulative probability

The probability that a uniformly distributed random variable with the specified parameters is less than or equal to x.

Description

This function evaluates the CDF of a uniformly distributed random variable. It will return zero for values less than the lower limit, a, one for values above the upper limit, b, and (x-a)/(b-a) between those two values.

Example

To find the probabilitity that a random variable uniformly distributed between 1 and 10 is less than 5:

  1. Enter unifcdf(5.,1,10) in the entry line of the Home window.

  2. Press Enter

  3. The expression you entered and the answer, .444444, will be displayed in the History Area.

    Note: If you enter all of the parameters using exact forms, the calculator will display the exact answer (in this case 4/9). Entering any parameter using a decimal form (the 5. in the example) cause the calculator to provide the approximate answer.

TI-89 Implementation

  1 :unifcdf(x,a,b) 
  2 :Func 
  3 : © CDF for an RV uniform 
  4 : © on [a,b] 
  5 : If a<b Then (1)
  6 :  If x<a Then 
  7 :   Return 0 
  8 :  ElseIf x>b Then 
  9 :   Return 1 
 10 :  Else 
 11 :   (X-a)/(b-a) 
 12 :  EndIf 
 13 : Else  (2)
 14 :  "Parameters a < b"
 15 : EndIf 
 16 : © Rev 1.0 
 17 : © Mark Wroth 
 18 :EndFunc 
(1)
Test for valid input.
(2)
If the input is invalid, return a string explaining why.

expCdf

Name

expCdf -- Evaluate the CDF of an exponentially distributed random variable.

Synopsis

expCdf(x,LAMBDA)

Inputs

x

The value of the random variable at which the CDF is to be evaluated.

LAMBDA

The parameter of the distribution. LAMBDA is one over the mean of the distribution.

Outputs

Cumulative probability

The probability that the random variable is less than or equal to the supplied x.

If an invalid parameter LAMBDA is supplied, an error string is returned, rather than a numeric result.

Description

This function implements the CDF for an exponentially distributed random variable with parameter LAMBDA. Such a random variable has PDF f(x) = LAMBDA e-LAMBDA x.

Example

To compute the probability that an exponentially distributed random variable with mean 5 is less than or equal to 3:

  1. Enter expcdf(3.,1/5) in the entry line of the Home window.

  2. Press Enter

  3. The expression you entered and the answer, .451188, will be displayed in the History Area.

    Note: If you enter both parameters using exact forms, the calculator will display the exact answer (in this case 1-e-3/5). Entering either parameter using a decimal form (the 3. in the example) cause the calculator to provide the approximate answer.

TI-89 Implementation

  1 :expcdf(x,LAMBDA) 
  2 :Func 
  3 : when(LAMBDA<0, when(x≥0,1-e^(-LAMBDA*x),0),“LAMBDA must be > 0”) 
  4 : © CDF of an exponential The “©” symbol is used here to represent the TI-89 comment symbol 
  5 : © RV with parameter LAMBDA 
  6 : © Rev 1.0 JUN 00
  7 : © D/MathSci USMA (Mark Wroth)
  8 :EndFunc 

The expCdf function wraps a simple call to the usual mathematical definition inside two tests. The first of these tests checks that the required parameter LAMBDA is greater than zero, as required by the definition of the function. The second test checks whether the input value x is greater than or less than zero, branching to the two piecewise definitions of the CDF depending on the result. Both tests use the where() function, which is in essence a simple branching structure.

TIStat.normCDF

Name

TIStat.normCDF -- Returns the probability that a normally distributed random variable with mean μ and standard deviation σ lies between LOW and UP.

Synopsis

TIStat.normCDF(LOW,UP[, μ,σ])
        

Inputs

LOW (required)

The lower bound of the interval over which the probability is desired.

UP (required)

The upper bound of the interval over which the probability is desired.

μ (optional)

The mean of the normally distributed random variable. If the mean is not supplied, it defaults to 0.

σ (optional)

The standard deviation of the normally distributed random variable. If the standard deviation is not supplied, it defaults to 1.

Outputs

Probability

The probability of that the random variable lies in the interval [LOW, UP].

Usage

This function is used from the command line of the HOME screen, and may be entered either by typing the name of the function or selecting it from the CATALOG screen, where it is found under F3: Flash Apps.

This function may also be accessed from the menu system, under F5 Distributions, 4: Normal CDF.

TIStat.invNorm

Name

TIStat.invNorm -- TIStat.invNorm returns the value of a normally distributed random variable such that a probability of AREA lies to the left of the value.

Synopsis

TIStat.invNorm(AREA[, μ, σ])

Inputs

AREA (required)

The cumulative probability that the random variable is less than the returned value.

μ (optional)

The mean of the random variable.

σ (optional)

The standard deviation of the random variable.

Outputs

Value

The value of the random variable below which the input probability falls.

Usage

This function is used from the command line of the HOME screen, and may be entered either by typing the name of the function or selecting it from the CATALOG screen, where it is found under F3: Flash Apps.

This function may also be accessed from the menu system, under F5 Distributions, 2: Inverse, 1: Inverse Normal.

TIStat.inv_t

Name

TIStat.inv_t -- TIStat.inv_t returns the value of a Student's T distributed random variable such that a probability of AREA lies to the left of the value.

Synopsis

TIStat.inv_t(AREA, DF)

Inputs

AREA (required)

The cumulative probability that the random variable is less than the returned value.

DF (required)

The number of degrees of freedom.

Outputs

Value

The value of the random variable below which the input probability falls.

Usage

This function is used from command line of the HOME screen, and may be entered either by typing the name of the function or selecting it from the CATALOG screen, where it is found under F3: Flash Apps.

This function may also be accessed from the menu system, under F5 Distributions, 2: Inverse, 2: Inverse t.

TIStat.invChi2

Name

TIStat.invChi2 -- Compute the value of a χ2 distributed random variable such that a probability of AREA lies to the left of the value.

Synopsis

TIStat.invChi2(AREA, DF)

Inputs

AREA (required)

The cumulative probability that the random variable is less than the returned value.

DF (required)

The number of degrees of freedom.

Outputs

Value

The value of the random variable below which the input probability falls.

Usage

This function is used from command line of the HOME screen, and may be entered either by typing the name of the function or selecting it from the CATALOG screen, where it is found under F3: Flash Apps.

This function may also be accessed from the menu system, under F5 Distributions, 2: Inverse, 3: Inverse Chi-square.

TIStat.zInt

Name

TIStat.zInt -- Compute a confidence interval for the mean of a random variable.

Synopsis

zInt(σ,List[,FRQ,CLEV] | σ,XBAR,N[,CLEV])

Usage

This program takes two forms depending on whether the sample statistics are to be computed from data contained in a list or entered directly by the user.

This program can also be accessed from the menu system.

TIStat.tInt

Name

TIStat.tInt -- Compute a confidence interval for the mean of a normally distributed random variable.

Synopsis

TIStat.tInt(LIST[,FRQ,CLEV] | XBAR,SX,N[,CLEV])

Usage

This program takes two forms depending on whether the sample statistics are to be computed from data contained in a list or entered directly by the user.

This program can also be accessed from the menu system.

chi2int

Name

chi2int -- The chi2int() program (and its companion chi2gui(), which provides a graphical user interface to the program) computes confidence intervals on the population variance or standard deviation of a normally distributed population.

Synopsis

chi2int(n,s2,clevel,type)

Inputs

n

The number of samples in the sample.

s2

The sample variance.

clevel

The desired confidence level for the confidence interval.

type

The type of interval desired, where 1 indicates a confidence interval on the variance, and 2 a confidence interval on the standard deviation.

Outputs

The chi2int program provides its outputs in two forms: a graphical requester that provides the requested confidence interval and echoes the user inputs, and by storing the user inputs and the desired confidence interval endpoints in the statvars directory.

The set of stored variables are different for the chi2int and the chi2gui programs. The chi2int stores:

statvars\lower

The lower end of the desired confidence interval.

statvars\upper

The upper end of the desired confidence interval.

In addition, the chi2gui will store the following user inputs to the indicated variables (and will use the values in those variables as the default choices when it opens).

statvars\n

The sample size

statvars\ssdevx

The sample standard deviation (square root of the entered sample variance.

statvars\clevel

The confidence level.

Usage

This function can be called in either of two ways: from the Home command line, as chi2int(n, s2, clevel, type) or by calling chi2gui(). If the chi2int for is used, the input arguments are:

If the chi2gui() form is used, there are no command line inputs; the program will raise a requester to allow the user to supply the needed values.

Example

Given a sample of size n = 17, and a sample variance of 137,324.3, compute a 95% confidence interval on the population variance.

  1. Begin at the Home screen.

  2. Enter the command chi2int(17,137324.3,.95,1)Enter.

    Tip: As a shortcut to entering the command name, use the Catalog function and select the F4 User-Defined tab. Then select the desired function from the list.

  3. Read the confidence interval (76171.3, 318080) on the resulting requester.[1]

Alternatively, using the chi2gui to solve the same problem:

  1. Start the chi2gui by entering chi2gui() at the Home screen.

  2. Enter the values for n, the sample variance, and the confidence level in the open requesters.

  3. Select the desired confidence interval type from the drop down menu.

  4. Press Enter.

  5. Read the confidence interval (76171.3, 318080) on the resulting requester.

TI-89 Implementation

The chi2int Program

  1 :chi2int(n,s2,clevel,type)
  2 :Prgm
  3 :© D/MathSci USMA (Mark Wroth)
  4 :© Revision 1.1 21 JUN 01
  5 :Local l,u,tstr
  6 :(n-1)*s2/(tistat.invchi2(1-(1-clevel)/2,n-1))→l
  7 :(n-1)*s2/(tistat.invchi2((1-clevel)/2,n-1))→u
  8 :"CI on σ2"→tstr
  9 :If type=2 Then
 10 : √(l)→l
 11 : √(u)→u
 12 : "CI on σ"→tstr
 13 :EndIf
 14 :Dialog
 15 : Title tstr
 16 : Text "Cint = ( "&string(l)&" , "&string(u)&" )"
 17 : Text "n    = "&string(n)
 18 : Text "s2    = "&string(s2)
 19 :EndDlog
 20 :l→statvars\lower
 21 :u→statvars\upper
 22 :EndPrgm

The chi2gui Program

  1 chi2gui()
  2 Prgm
  3 © D/MathSci USMA
  4 © Version 1.1 21 JUN 01
  5 Local n,s2,clevel,type
  6 string(statvars\n)→n
  7 string(statvars\ssdevx^2)→s2
  8 string(statvars\clevel)→clevel
  9 Dialog
 10  Title "Chi Squared CI"
 11  Request "n      ",n
 12  Request "s2     ",s2
 13  Request "C level",clevel
 14  DropDown "CI on ",{"variance","std dev"},type
 15 EndDlog
 16 If ok=1 Then
 17 expr(n)→n
 18 expr(s2)→s2
 19 expr(clevel)→clevel
 20 chi2int(n,s2,clevel,type)
 21 n→statvars\n
 22 √(s2)→statvars\ssdevx
 23 clevel→statvars\clevel
 24 EndIf
 25 EndPrgm

binomInt

Name

binomInt -- The binomint() program computes confidence intervals on the population proportion for a binomially distributed random variable.

Synopsis

binomint(success,n,clevel)

Inputs

success

The number of successes in the sample.

n

The size of the sample.

clevel

The desired confidence level (1-α).

Outputs

statvars\lower

The lower endpoint of the resulting confidence interval.

statvars\upper

The upper endpoint of the resulting confidence interval.

statvars\n

The size of the sample.

statvars\clevel

The desired confidence level (1-α).

Usage

This function is called by entering binomint(success, n, clevel) at the HOME screen.

Example

To compute a 90% confidence interval on the binomial parameter p based on a sample of 100 observations, 50 of which were successes:

  1. At the HOME screen, enter binomint(50,100,.9)ENTER.

  2. Read the resulting interval (.418848, .581152) in the output requester. This requester also echoes the input values.

The ends of the confidence interval are also stored in statvars\lower and statvars\upper.

TI-89 Implementation

This function implements Equation 7.10 from [DEVORE]. This expression includes several terms which are usually neglected (as in the TIStat.zInt_1P or Devore's Equation 7.11. The expanded function implemented here is considered acceptably accurate even if np or n(1-p) are not sufficiently large.

  1 binomint(success,n,clevel)
  2 Prgm
  3 © Find a "7.10" CI for the binomial parameter "p"
  4 © D/MathSci USMA (Mark Wroth)
  5 © Revision 1.1 21 JUN 01
  6 Local  l,u,phat,t1,t2,z
  7 success/n→phat
  8 tistat.invnorm(1-(1-clevel)/2,0,1)→z
  9 z*√(phat*(1-phat)/n+z^2/(4*n^2))→t1
 10 1+z^2/n→t2
 11 (phat+z^2/(2*n)-t1)/t2→l
 12 (phat+z^2/(2*n)+t1)/t2→u
 13 Dialog
 14 Title  "CI on p"
 15  Text  "Cint = ( "&string(l)&" , "&string(u)&" )"
 16  Text  "trials    = "&string(n)
 17  Text  "successes = "&string(success)
 18  Text  "C Level   = "&string(clevel)
 19  Text  "p-hat     = "&string(phat)
 20 EndDlog
 21 l→statvars\lower
 22 u→statvars\upper
 23 EndPrgm

Appendix C. Upgrading a TI-89 Calculator for MA206 Probability and Statistics

C.1. Overview

To load the TI-89 Statistics with List Editor flash application, you need to load the Advanced Mathematics Software Operating System/base code, and then install the Statistics with List Editor application. The TI manual indicates that it is about four times faster to do this from calculator to calculator than from desktop to calculator.

This discussion assume you have two TI-89 calculators, one with the Advanced Mathematics Software and Statistics with Lists application installed, and one which you are upgrading to that configuration, and that you have a calculator to calculator link cable.


C.2. Installing the Advanced Mathematics Software using another TI-89

  1. Ensure both calculators have fresh batteries.

    Warning

    A power loss (or any other interruption) during this operation will mean the receiving unit has to be reloaded using a computer.

  2. Ensure any data which is to be retained on the receiving calculator is backed up to another calculator or computer.

    Warning

    This procedure will delete all user variables and reset the receiving calculator to its factory state. This may include deleting flash applications.

  3. Link the two TI-89s using the calculator to calculator cable (as described on page 366 of the TI-89 and TI-92 Plus Guidebook.

  4. On both calculators, select the LINK menu

    1. Select [2nd ] VAR-LINK

    2. Select F-3 LINK.

  5. On the receiving calculator, select Receive Product Code

    1. Cursor down until option 5: Receive Product Code is highlighted

    2. Press ENTER

    3. A warning message will display. Press ENTER to continue (or ESC to abort).

  6. On the sending calculator, select Send Product Software

    1. Cursor down until option 4:Send Product SW is highlighted

    2. Press Enter

    3. A warning message will display. Press ENTER to continue (or ESC to abort).

  7. After a short pause (about five seconds), the receiving calculator will display a status message and progress indicator. Wait until the display clears (about six minutes). When the display clears, the transfer is complete.

    Warning

    Interrupting the transmission will result in the receiving calculator becoming inoperable until it is reloaded from a computer.

  8. Reload any backed-up data to be retained on the receiving calculator

For more information on installing base code updates, see Upgrading Product Software (Base Code), beginning on page 373 of the TI-89 and TI-92 Plus Guidebook.


C.3. Installing the Statistics with List Editor Flash Application Using Another TI-89

  1. Link the two TI-89s using the calculator to calculator cable (as described on page 366 of the TI-89 and TI-92 Plus Guidebook.

  2. On the sending calculator, select the LINK menu by selecting [2nd ] VAR-LINK

  3. On the sending calculator, select the Stats/List Edi flash application

    1. Select F-7 Flashapp to display the list of flash applications

    2. Highlight the Stats/List Edi application (it may already be highlighted, for example if its the only one there).

    3. Press F-4 to check mark the Stats/List Edi application. A small check mark should appear next to the application name.

  4. On the receiving calculator, select the LINK menu by selecting [2nd] VAR-LINK. Both calculators should now be in the VAR-LINK screen.

  5. On the receiving calculator, select the receive option

    1. Select F3 LINK

    2. Move the highlight to option 2:Receive

    3. Press Enter. The messages VAR-LINK WAITING TO RECEIVE and BUSY should appear on the status line.

  6. On the sending calculator, select the Send to TI-89/92 Plus option

    1. Select F3 LINK

    2. Move the highlight to option 3: Send to TI-89/92 Plus

    3. Press ENTER.

    The message SENDING TISTATLE, a progress bar, and the BUSY indicator should be displayed on the receiving calculator.

  7. Wait until the screen clears on the receiving calculator (about 75 seconds). When the receiving calculators VAR-LINK screen returns, the transmission is complete.

For more information on installing flash applications, see Transmitting Variables, Flash Applications, and Folders, beginning on page 367 of the TI-89 and TI-92 Plus Guidebook


Bibliography

Probability and Statistics for Engineering and the Sciences, Jay L. Devore, Duxbury Press, Belmont, 1995, Fourth.

TI-89 Guidebook, Texas Instruments.

This is the users manual for the TI-89 itself, as purchased.

TI-89 and TI-92 Plus Guidebook for Advanced Mathematics Software Version 2.0, Texas Instruments.

http://www.ti.com/calc/docs/8992pguide.htm. This is the updated manual for the Advanced Mathematics Software; it replaces the package.

Downloading Applications to the TI-89, Texas Instruments.

http://www.ti.com/calc/pdf/gb/eng/8992p/22link.pdf (Chapter 22 of theTI-89 and TI-92 Plus Guidebook)

Advanced Mathematics Software, Texas Instruments.

http://www.ti.com/calc/flash/89ams.htm. This is an overview page for the AMS upgrade.

Statistics with List Editor, Texas Instruments.

http://www.ti.com/calc/flash/89stats.htm. This is an overview page for the Statistics with List Editor package

Statistics with List Editor, Texas Instruments.

http://www.ti.com/calc/flash/pdf/statsle.pdf. This is the users guide for the Statistics with List Editor application

Notes

[1]

This is Example 7.15 from Devore's 5th edition. However, the use of the full accuracy of the Chi-squared inverse function rather than the five significant figures available from a set of tables results in a slightly different answer than Devore obtains.