var i,j:integer;dx:double;nxi,fi:variant;
begin
dx:=sx;
sx:=0;
if typ=true then begin
Graph1.RandomData:=0;
Graph1.GraphTitle:='Гістограма';
Graph1.GraphType:=3;
Graph1.NumPoints:=m;
for i:=1 to m do begin
Graph1.Data[i]:=ni[i];
Graph1.XPosData:=xi[i];
end;
Graph2.RandomData:=0;
Graph2.GraphTitle:='Полігон';
Graph2.GraphType:=6;
Graph2.NumPoints:=m;
for i:=1 to m do begin
Graph2.Data[i]:=ni[i];
Graph2.XPosData:=xi[i];
end;
Graph3.RandomData:=0;
Graph3.GraphTitle:='Діаграма';
Graph3.GraphType:=6;
Graph3.GraphStyle:=2;
Graph3.NumPoints:=m;
for i:=1 to m do begin
Graph3.XPosData:=xi[i];
Graph3.Data[i]:=ni[i];
end;
Graph4.RandomData:=0;
Graph4.GraphTitle:='Функція розподілу';
Graph4.GraphType:=6;
Graph4.NumPoints:=2*m+2;
fi := VarArrayCreate([0,2*m+2], varDouble);
nxi := VarArrayCreate([0,2*m+2], varDouble);
for i:=1 to m do begin
sx:=wi[i]+sx;
fi[2*i]:=sx-wi[i];
fi[2*i+1]:=sx;
nxi[2*i]:=xi[i];
nxi[2*i+1]:=xi[i];
end;
fi[2*m+2]:=1;
nxi[1]:=xi[1]-s;
nxi[2*m+2]:=xi[m]+s;
j:=0;
for i:=1 to 2*m+2 do begin
Graph4.Data[i]:=fi[i];
Graph4.XPosData:=nxi[i];
end;
end
else begin
Graph1.RandomData:=0;
Graph1.GraphTitle:='Гістограма';
Graph1.GraphType:=3;
Graph1.NumPoints:=r-1;
for i:=1 to r-1 do begin
Graph1.Data[i]:=ni[i];
Graph1.XPosData:=xi[i];
end;
Graph2.RandomData:=0;
Graph2.GraphTitle:='Полігон';
Graph2.GraphType:=6;
Graph2.NumPoints:=r-1;
for i:=1 to r-1 do begin
Graph2.Data[i]:=ni[i];
Graph2.XPosData:=xi[i]+dx/2;
end;
Graph3.RandomData:=0;
Graph3.GraphTitle:='Діаграма';
Graph3.GraphType:=6;
Graph3.GraphStyle:=2;
Graph3.NumPoints:=r-1;
for i:=1 to r-1 do begin
Graph3.XPosData:=xi[i]+dx/2;
Graph3.Data[i]:=ni[i];
end;
Graph4.RandomData:=0;
Graph4.GraphTitle:='Функція розподілу';
Graph4.GraphType:=6;
Graph4.NumPoints:=2*(r-1)+2;
fi := VarArrayCreate([0,2*(r-1)+2], varDouble);
nxi := VarArrayCreate([0,2*(r-1)+2], varDouble);
sx:=0;
for i:=1 to r-1 do begin
sx:=wi[i]+sx;
fi[2*i]:=sx-wi[i];
fi[2*i+1]:=sx;
nxi[2*i]:=xi[i];
nxi[2*i+1]:=xi[i];
end;
fi[2*(r-1)+2]:=1;
nxi[1]:=xi[1]-3;
nxi[2*(r-1)+2]:=xi[r-1]+3;
j:=0;
for i:=1 to 2*(r-1)+2 do begin
Graph4.Data[i]:=fi[i];
Graph4.XPosData:=nxi[i];
end;
end;
end;
end.
Список літератури
1. Крамер Гарольд. Математические методы статистики. М.: Мир, 1976.
2. Бух Арлей. Введение в теорию вероятностей и математическую статистику. М., 1951.