Πlist; Pos - HP 39g Master Manual

Graphing calculator
Hide thumbs Also See for 39g:
Table of Contents

Advertisement

The MAKELIST function can also be used to simulate observations on
random variables.
For example, suppose we wish to simulate 10
Bernoulli trials with p = 0.75. We can use the
fact that a test like (X<4) or (Y>0.2) returns a
value of either 1 (if the test is true) or 0 (if the
test is false).
Thus:
MAKELIST(RANDOM<0.75,X,1,10,1)
will return a list of 1's and 0's corresponding to the simulated Bernoulli trials.
Various examples of this process are given in the 'Tips and Tricks' section
which immediately follows the chapter on Univariate Statistics. See page
130.
π
LIST({list})
This function returns the product of all the elements of a list.
Eg.
LIST({2,3,5}) would return a value of 30.
POS({list},num)
This function conducts a search of a list. It
returns the position in the list of the first
occurrence of the number you specify (see
example right). It is of more use to
programmers, who will not know in advance
what a list contains.
If the number specified is not in the list it returns zero. If the value occurs in
more than one place then only the first position is reported. The value
specified can be either a number (as shown) or a variable or an expression to
be evaluated.
267

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

40g39g+

Table of Contents