-



         

- 5


h). , g h.

152.

Program Cohered;

( ;

)

Uses Crt, Graph;

Const N = 10000 ( );

W1 = 10 ( 0 o wl};

W2 = 5 ( 0 w2};

Type = Array(l..N] Of Real; U = ^;

Var A, B, C, D, E, F, Aa, Bb, Cc, Dd, , Ff, Dg, Dh, M : Real;

Sl, S2 : Double; I, K, J, I1, I2 : Integer;

LI, L2, V : Array [1..11] Of Real; G, H : U; Ch : Char;

Begin

If MaxAvail >= SizeOf(G) Then New(G);

If MaxAvail >= SizeOf(H) Then New(H);

Randomize; ( - )

Aa := 0; Bb := W2 * Random; Cc := 0; := Bb; Ff := Bb;

G^[l] = 0; H^[1] := 0;

For = 1 To 11 Do

Begin L1(K] := 0; L2[K] := 0 End;

For I = 2 To N Do

Begin

A := Wl * Random; := W2 * Random;

:= Cc + A; If > Then D := Else D := ;

E := D + B; F := E - C; G^[I] := F - B; H^[I] := D - ;

Cc := ; := E;

If G^[I] <= 1 Then Ll[l] := Ll[l] + 1; If H^[1] = 0 Then

L2[l] := L2[l] + 1;

For := 2 To 10 Do

Begin

If (G^[I] > - 1) And (G^[I] <= K) Then L1[K] := L1[K] + 1;

If (H^[I] > K - 1) And (H^[I] <= K) Then L2[K] := L2[K] + 1;

End;

If G^[I] > 10 Then Ll[l1] := Ll[ll] + 1;

If H^[I] > 10 Then L2[ll] := L2[ll] + 1;

Sl := Sl + G^[l]; S2 := S2 + H^[I];

End;

For I := 1 To 11 Do ( - g h}

Begin

L1[I] := L1[I] / N; L2[I] := L2[I] / N

End;

( - g h}

Sl := Sl / N; S2 := S2 / N; Dg := 0; Dh := 0;

For I := 1 N Do

Begin

Dg := Dg + Sqr(G^[I] - Sl); Dh := Dh + Sqr(H^[I] - S2)

End;

Dg := Dg / N; Dh := Dh / N;

WriteLn(' g h');

WriteLn;

For K := 1 To 11 Do

WriteLn ('11[', K, ']=', L1[K] : 6 : 4, '' : 20, '12(', , ']=',

L2[K] : 6 : 4);