EasyManuals Logo

Texas Instruments Titanium TI-89 User Manual

Texas Instruments Titanium TI-89
1008 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #775 background imageLoading...
Page #775 background image
Activities 775
Simulation of Sampling without Replacement
Simulation of Sampling without ReplacementSimulation of Sampling without Replacement
Simulation of Sampling without Replacement
This activity simulates drawing different colored balls from an urn without replacing them.
Detailed information about the steps used in this example can be found in the electronic
chapter Programming.
Sampling-without- Replacement Function
Sampling-without- Replacement FunctionSampling-without- Replacement Function
Sampling-without- Replacement Function
In the
Program Editor, define drawball( ) as a function that can be called with two
parameters. The first parameter is a list where each element is the number of balls of a
certain color. The second parameter is the number of balls to select. This function
returns a list where each element is the number of balls of each color that were selected.
:drawball(urnlist,drawnum)
:Func
:Local templist,drawlist,colordim,
numballs,i,pick,urncum,j
:If drawnum>sum(urnlist)
:Return “too few balls”
:dim(urnlist)
!colordim
:urnlist
!templist
:newlist(colordim)!drawlist
:For i,1,drawnum,1
:sum(templist)!numballs
:rand(numballs)
!pick
(continued in next column)
:For j,1,colordim,1
:cumSum(templist)
!urncum
:If pick
urncum[j] Then
:drawlist[j]+1
!drawlist[j]
:templist[j]
N1!templist[j]
:Exit
:EndIf
:EndFor
:EndFor
:Return drawlist
:EndFunc

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments Titanium TI-89 and is the answer not in the manual?

Texas Instruments Titanium TI-89 Specifications

General IconGeneral
Display TypeLCD
Display Resolution160 x 100 pixels
Memory188 KB RAM, 2.7 MB Flash ROM
TypeGraphing Calculator
DisplayMonochrome
ProcessorMotorola 68000
Processor Speed12 MHz
Power Source4 AAA batteries
ConnectivityUSB
ProgrammingTI-BASIC, Assembly
Operating SystemAMS (Advanced Mathematics Software)

Related product manuals