Sequential random integer generator

Sequential random integer generator

C-394 Computer Physics C o m m u n i c a t i o n s 12 (1976) 1 6 3 - 1 7 1 © North-Holland Publishing C o m p a n y SEQUENTIAL RANDOM INTEGER GENERAT...

50KB Sizes 0 Downloads 76 Views

C-394 Computer Physics C o m m u n i c a t i o n s 12 (1976) 1 6 3 - 1 7 1 © North-Holland Publishing C o m p a n y

SEQUENTIAL RANDOM INTEGER GENERATOR * C.T.K. KUO

, T.W. C A D M A N

a n d R.J. A R S E N A U L T

University oJ Mao,land, College Park. Maryland 20 742, USA Received 4 October 1976

PROGRAM SUMMARY Title o f program: SRNG Catalogue number: ACIE Computer: UNIVAC 1108; Installation: University of Maryland, College Park, Maryland, U.S.A.

Operating system: UNIVAC 1108 EXEC

ly increasing numbers. Such random integers are used to specify the positions of randomly dispersed impurity atoms or solute atoms in many c o m p u t e r sinlulation experiments. A specific ease is that of solid solution strengthening.

Method of soluthm

Other peripherals used: Card reader, line printer

In order to produce a large subset of sequentially increasing, non-repeating random integers from a larger set of integers, each integer of the larger set is represented by a bit of a computer word. On the UNIVAC 1108, 35 bits can be used to represent 35 integers of the larger set, the remaining sign bit is used to indicate a particular word location. Two groups of r'mdom numbers are generated, which are uniformly distributed in the interval0 to 1. Group I is used to choose the eompt, ter word, and Group 2 is used to choose the bit within the c o m p u t e r word.

No. o f cards in combined program and test deck: 106

Restrictions on the complexity o f the prohlem

Keywords: General, random integer, generator, solid solution

The number of integers from which the r:,ndom subset can be chosen is limited by the size of the computational cell. The cell is limited by the computer storage capacity.

Program language used: F O R T R A N High speed storage required: 17000 words. No. oJ'bits in a word: 36 Overlay structure: None No. o f magnetic tapes required: Opt io nal

strengthening.

Nature o f physical problem

An algorithm to generate a subset of random integers from a larger set of integers has been developed to minimize both the computing time and the m e m o r y space. The algorithm deals with the whole array at the same time, generates a subset o f random integers for a given percentage of the range, and the generated subset of random integers is obtained as sequential* This work was supported by a NASA Grant No. NSG-3001, and the C o m p u t e r Science Center o f the University of Maryland.

Typical running time To select a sequential subset of 2.8 × 104 non-repe:lting random integers froln a larger set of 2.8 × 106 integers rcquircs -.15 minutes of UNIVAC 1108 m e m o r y time. However, changing the total n u m b e r of integers does not result in a linear change in thc computer time. The time required to select a subset of 2.8 × 103 sequential non-repeating random integers from a larger set of 2.8 x 105 intcgersis ~3 scconds.

Unusual features o f the program Two unusual features of this program are the use of one's eolnplimenl representation of minus zero and bit nlanipulation capability in thc UNIVA(" 1108 computer.