START

int t; float r,x,y,z,b;

Get the i/p

do

switch
(t)

Case

1

Case 2

2

Case 3

3

Case 4

4

Case 5

5

WHILE (T<5)

STOP

Y GEN R Z=(X-Y)+2*R*Y PRINT Z 6 6 6 .FLOWCHART FOR EXPONENTIAL RANDOM VARIATE 1 GET Y GEN R X= -((LN R)/Y) PRINT X 6 6 6 FLOWCHART FOR UNIFORM RANDOM VARIATE 2 GET X.

Y=1 B=EXP(-P) GEN R X++ TR=TR*R TR<B PRINT X 6 .FLOWCHART FOR POISSON RANDOM VARIATE 3 X=0.

FLOWCHART FOR BINOMIAL RANDOM VARIATE 4 GET Y FOR i=1toN GEN R R>P X++ NEXT PRINT X 6 6 .

FLOWCHART FOR NORMAL RANDOM VARIATE 5 GEN r FOR i=1 to N GEN R SUM = SUM+R NEXT X=STD*(SUM-6))+EX PRINT X 6 6 .

Sign up to vote on this title
UsefulNot useful