Fungsi Distribusi Uniform
Function Uniform (a,b : double) : double;
Var u : double;
Begin
u := random;
Uniform := (b-a) * u + a;
End;
Fungsi Distribusi Eksponensial
Function Eksponensial (beta : double) : double;
Var u : double;
Begin
u := random;
Eksponensial := -beta * ln(u);
End;
Fungsi Distribusi Normal
Procedure Normal (mean,variance : double ; Var z1,z2 : double);
Var u1,u2,v1,v2,w,y,x1,x2 : double;
Begin
Repeat
u1 := random;
u2 := random;
v1 := 2 * u1 – 1;
v2 := 2 * u2 – 1;
w := sqr(v1) + sqr(v2);
if w <= 1 then
begin
y := sqrt ((-2*ln(w))/w);
x1 := v1 * y;
x2 := v2 * y;
z1 := sqrt (variance) * x1 + mean;
z2 := sqrt (variance) * x2 + mean;
end
Until w <= 1;
End;
Procedure Distribusi Lognormal procedure lognormal (mean,varr : double; Var zln1,zln2 : double);
Var y1, y2 : double;
begin
Normal (mean,varr,y1,y2);
zln1 := exp(y1);
zln2 := exp(y2);
end;
Fungsi Distribusi Weibull Function Weibull (alfa,beta: double) : double;
Var u,z : double;
Begin u := random;
z := -ln(u);
Weibull := beta * exp (ln(z)/alfa);
End;
Fungsi Distribusi t-student function tdistribution(m:integer):double;
Label r2;
Var v,x,r,s,c,a,f,g,mm : real;
begin mm:=0;
if m < 1 then begin writeln('impermissible degrees of freedom.'); halt;
end;
if (m mm) then begin s:=m; c:=-0.25*(s+1);
a:=4/power((1+1/s),c);
f:=16/a;
if m>1 then
begin
g:=s-1;
g:=power(((s+1)/g),c)*sqrt((s+s)/g);
end else
g := 1;
mm:=m;
end;
r2:repeat
r:=random;
until r > 0.0;
x:=(2*random-1)*g/r;
v:=x*x;
if (v>(5-a*r)) then
begin
if ((m>=3) and (r*(v+3)>f)) then goto r2;
if (r>power((1+v/s),c)) then goto r2;
end;
tdistribution :=x;
end;
begin
tipe11[1]:=0.2;
tipe11[1]:=0.3;
tipe11[1]:=0.5;
tipe11[1]:=0.8;
tipe11[1]:=1.0;
end.
ABCD PRINT
-
PRINT A4
Hitam putih Rp.200
Warna Rp. 300
Semi Blok Rp.500
Full Blok Rp.750
PRINT A5
Hitam Putih Rp.125
Warna Rp. 175
Semi Blok Rp.300
Full Blok Rp.500
Sc...
13 tahun yang lalu