.


           

. . . .


repeat

I := I + u; n := n + 1;

u := -u*(x*x*(2*n - 1)/(2*n*(2*n + 1)))

until

abs(u) < 0.00001;

FF := 2*I/sqrt(2*Pi)

end

end;

{----------------------------------------------------------------------------------------}

{ . . . . . [m1; m2] }

Procedure

Interval(n, m1, m2 : longint; p : real; var PP : real);

var

x1, x2 : real;

begin

x1 := (m1 - n*p)/sqrt(n*p*(1 - p));

x2 := (m2 - n*p)/sqrt(n*p*(1 - p));

PP := (FF(x2) - FF(x1))/2

end;

{----------------------------------------------------------------------------------------}

begin

write(' '); readln(n);

write(' '); readln(q);

write(' '); readln(m1);

write(' '); readln(m2);

p := 1 - q;

Interval(n, m1, m2, p, PP);

writeln(' , ');

write(' [',m1, '; ', m2, '] ');

writeln(PP:1:8)

end.





10

{ n, }

{ np }

Procedure Number(p, e, PP : real; var n : longint);

var

x : real;

begin

x := 0;

repeat

x := x + 0.01

until

FF(x) >= PP;

n := round(e/(x*sqrt(p*(1 - p))) + 0.5);

n := sqr(n)

end;

{ - }

Program Task10;

uses WinCrt;

var

n : longint;

e, q, PP : real;

{----------------------------------------------------------------------------------------}