Page 17-3
Random number generators, in general, operate by taking a value, called the
“seed” of the generator, and performing some mathematical algorithm on that
“seed” that generates a new (pseudo)random number. If you want to
generate a sequence of number and be able to repeat the same sequence
later, you can change the "seed" of the generator by using function RDZ(n),
where n is the “seed,” before generating the sequence. Random number
generators operate by starting with a "seed" number that is transformed into
the first random number of the series. The current number then serves as the
"seed" for the next number and so on. By "re-seeding" the sequence with the
same number you can reproduce the same sequence more than once. For
example, try the following:
RDZ(0.25)
`
Use 0.25 as the "seed."
RAND()
`
First random number = 0.75285…
RAND()
`
Second random number = 0.51109…
RAND()
`
Third random number= 0.085429….
Re-start the sequence:
RDZ(0.25)
`
Use 0.25 as the "seed."
RAND()
`
First random number = 0.75285…
RAND()
`
Second random number = 0.51109…
RAND()
`
Third random number= 0.085429….
To generate a sequence of random numbers use function SEQ. For example,
to generate a list of 5 random numbers you can use, in ALG mode:
SEQ(RAND(),j,1,5,1)
. In RPN mode, use the following program:
«
n
«
1 n FOR j RND NEXT n
LIST
»
»
Store it into variable RLST (Random LiST), and use
J5
@RLST!
to produce a
list of 5 random numbers.
Function RNDM(n,m) can be used to generate a matrix of n rows and m
columns whose elements are random integers between -1 and 1(see Chapter
10).
Содержание 49g+
Страница 1: ...hp 49g graphing calculator user s guide H Edition 4 HP part number F2228 90006 ...
Страница 197: ...Page 5 30 LIN LNCOLLECT POWEREXPAND SIMPLIFY ...
Страница 377: ...Page 11 55 Function KER Function MKISOM ...
Страница 457: ...Page 13 26 In the right hand side figure above we are using the line editor to see the series expansion in detail ...
Страница 775: ...Page 26 10 the location of the backup battery in the top compartment at the back of the calculator ...
Страница 838: ...Page L 5 ...