EasyManuals Logo

Texas Instruments Voyage 200 User Manual

Texas Instruments Voyage 200
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 #771 background imageLoading...
Page #771 background image
Activities 771
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

Other manuals for Texas Instruments Voyage 200

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments Voyage 200 and is the answer not in the manual?

Texas Instruments Voyage 200 Specifications

General IconGeneral
TypeScientific
Form factorPocket
Product colorBlue
Display resolution128 x 240 pixels

Related product manuals