next up previous index
Next: V104 Uniform Random Up: CERNLIB Previous: V102 Pair of

V103 Random Bits

Routine ID: V103
Author(s): T. LindelöfLibrary: MATHLIB
Submitter: Submitted: 18.10.1966
Language: Assembler or Fortran (IBM)Revised: 01.02.1982

OBSOLETE

Please note that this routine has been obsoleted in CNL 218. Users are advised not to use it any longer and to replace it in older programs. No maintenance for it will take place and it will eventually disappear.
Suggested replacement: None. Use inline-code, e.g.,
DIMENSION A(100),IA(100)
CALL RANLUX(A,100)
DO 1 I = 1,100
1IA(I)=NINT(A(I))

generates a vector IA of length 100 of pseudo random zeros and ones with Prob(0)=Prob(1)=1/2 . See also RANLUX (V115).

IRND01 generates pseudo random zeros and ones with Prob(0)=Prob(1)=1/2 .

Structure:

FUNCTION subprogram
User Entry Names: IRND01, IR01UT, IR01IN

Usage:

    I = IRND01(DUMMY)
generates a pseudo random binary digit ( 0 or 1) in I. DUMMY is ignored and unchanged.

The bits generated in subsequent calls are statistically independent but functionally dependent on a 'seed' which the user can retrieve or set as follows:

    CALL IR01UT(SEED)
sets SEED to the current value of the internal 'seed', and
    CALL IR01IN(SEED)
replaces the the current value of the internal 'seed' in IRND01 by SEED.
SEED is of type REAL.

Notes:

The IBM version of IRND01 is just a simple interface to RNDM2 (V107) and rather slow.

V104


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995