Rand(), Randmat(), Rclgdb – Texas Instruments PLUS TI-89 User Manual

Page 505

Advertising
background image

488 Appendix A: Functions and Instructions

8992APPA.DOC TI-89 / TI-92 Plus: Appendix A (US English) Susan Gullord Revised: 02/23/01 1:48 PM Printed: 02/23/01 2:21 PM Page 488 of 132

rand()

MATH/Probability menu

rand([

n

])

expression

n

is an integer

ƒ zero.

With no parameter, returns the next random
number between 0 and 1 in the sequence.
When an argument is positive, returns a
random integer in the interval [1,

n

].

When an argument is negative, returns a
random integer in the interval [ë

n

,ë 1].

RandSeed 1147 ¸

Done

rand() ¸

.158...

rand(6) ¸

5

rand(л 100) ¸

л 49

randMat()

MATH/Probability menu

randMat(

numRows

,

numColumns

)

matrix

Returns a matrix of integers between -9 and 9
of the specified dimension.

Both arguments must simplify to integers.

RandSeed 1147 ¸

Done

randMat(3,3) ¸

8 л 3 6

л 2 3 л 6

0 4 л 6

Note:

The values in this matrix will

change each time you press ¸.

randNorm

()

MATH/Probability menu

randNorm(

mean

,

sd

)

expression

Returns a decimal number from the specific
normal distribution. It could be any real
number but will be heavily concentrated in
the interval [

mean

-3ù

sd

,

mean

+3ù

sd

].

RandSeed 1147 ¸

Done

randNorm(0,1) ¸

.492...

randNorm(3,4.5) ¸

ì3.543...

randPoly

()

MATH/Probability menu

randPoly(

var

,

order

)

expression

Returns a polynomial in

var

of the specified

order. The coefficients are random integers
in the range ë 9 through 9. The leading
coefficient will not be zero.

order

must be 0–99.

RandSeed 1147 ¸

Done

randPoly(x,5) ¸

л 2ш x

5

+3ø x

4

м 6ш x

3

+4ø xì 6

RandSeed

MATH/Probability menu

RandSeed

number

If

number

= 0, sets the seeds to the factory

defaults for the random-number generator. If

number

ƒ 0, it is used to generate two seeds,

which are stored in system variables

seed1

and

seed2

.

RandSeed 1147 ¸

Done

rand() ¸

.158...

RclGDB

CATALOG

RclGDB

GDBvar

Restores all the settings stored in the Graph
database variable

GDBvar

.

For a listing of the settings, see

StoGDB

.

Note:

It is necessary to have something

saved in

GDBvar

before you can restore it.

RclGDB GDBvar ¸

Done

(Sets the random-number seed.)

Advertising
This manual is related to the following products: