Welcome to my blog..!! Enjoy to read and get your knowledge. Hopefully, you can understand it

Kamis, 05 Januari 2012

PROGRAM STATISTIKA DESKRIPTIF


program statistika_deskriptif;
uses wincrt;
var
x:array [1..100] of real;
mean,rata,varians,s_2,standar_deviasi,s_d:real;
n,j,i:integer;
begin
write('masukkan n banyaknya angka = ');
readln(n);
for i:=1 to n do
begin
write(i, ' = ' );
readln(x[i]);
end;
rata:=0;
for i:=1 to n do
rata:=rata+x[i];
mean:=rata/n;
writeln('mean= ',mean:0:0);
varians:=0;
for i:=1 to n do
begin
write('varians= ');
readln(s_2);
s_2:=sqr(x[i]-mean);
writeln('varians= ',s_2:0:0);
end;
s_d:=0;
for i:=1 to n do
begin
write('standar deviasi= ');
writeln(s_d);
s_d:=sqrt(s_2);
writeln('standar deviasi= ',s_d:0:0);
end;
end.

PROGRAM BINOMIAL


program binomial;
uses wincrt;
var i,j,k,n,x: longint;
a,b,c,d,e,p:real;
begin
readln(n,x,p);
a:=1; b:=1; c:=1; d:=1; e:=1;
for i:=1 to n do
a:=a*i;
for j:=1 to x do
begin
b:=b*j;
c:=c*p;
end;
for k:=1 to (n-x) do
begin
d:=d*k;
e:=e*(1-p);
end;
writeln(a/(b*d)*c*e);
end.
 

Reta Noorina Prastika 1311100090 Blak Magik is Designed by productive dreams for smashing magazine Bloggerized by Ipiet
Thanks to Blogger Templates Blog | Distributed by Deluxe Templates © 2008