Fungsi Padat Peluang
dimana a < x < b
a = batas bawah
b = batas atas
Mean
E(X) = (b + a)/2
Varian
Var(X) = (b – a)2/12
Fungsi Pembangkit Momen
Fungsi Karakteristik
Fungsi Pembangkit Peluang
1. perulangan "FOR..DO"
2. perulangan "REPEAT..UNTIL"
3. perulangan "WHILE..DO"
FOR..TO..DO
“.
program for_do_postiv;
uses wincrt;
var
i : integer;
begin
for i:= 1 to 5 do
writeln('pascal');
readln;
end.
FOR..DOWNTO..DO
“.
program for_do_negativ;
uses wincrt;
var
i : integer;
begin
for i:= 5 downto 1 do
writeln(i);
readln;
end.
program for_do_tersarang;
uses wincrt;
var
i,j : integer;
begin
for i:= 1 to 5 do
begin
for j:= 1 to 5 do
write(j,' ');
writeln;
end;
readln;
end.
program repeat_until;
uses wincrt;
var
i : integer;
begin
i:= 1;
repeat
i:=i+1;
writeln(i);
until i = 5;
readln;
end.
program while_do;
uses wincrt;
var
i:integer;
begin
i:=2;
while i 3 do
begin
writeln( i );
end;
readln;
end.
program bonus ;
uses crt;
var i: byte;
begin
for i := 1 to 10 do
begin
textcolor (i) ;writeln('pascal');
end;
readln;
end.
for < variable-name > := < initial_value > to [down to] < final_value > do S;Where, the variable-name specifies a variable of ordinal type, called control variable or index variable; initial_value and final_value values are values that the control variable can take; and S is the body of the for-do loop that could be a simple statement or a group of statements.
for i:= 1 to 10 do writeln(i);Here is the flow of control in a for-do loop −
program forLoop; var a: integer; begin for a := 10 to 20 do begin writeln('value of a: ', a); end; end.When the above code is compiled and executed, it produces the following result −
value of a: 10 value of a: 11 value of a: 12 value of a: 13 value of a: 14 value of a: 15 value of a: 16 value of a: 17 value of a: 18 value of a: 19 value of a: 20