Íåêîòîðûå çàìå÷àòåëüíûå ôóíêöèè
6.1. Ôóíêöèÿ Áåññåëÿ
Äëÿ
à äëÿËåãêî âèäåòü, ÷òî
. Ýòè ôóíêöèè èãðàþò âàæíóþ ðîëü â ìàòåìàòè÷åñêîé ôèçèêå, íåáåñíîé ìåõàíèêå è ò. ä.Äëÿ îïðåäåëåíèÿ ñëàãàåìûõ ïðèìåíèì ðåêóððåíòíóþ ôîðìóëó
 êà÷åñòâå íà÷àëüíûõ çíà÷åíèé ñóììû è ñëàãàåìîãî èñïîëüçîâàòü ÷ëåí ðÿäà ïðè k = 0, ðàâíûé
.Äëÿ âû÷èñëåíèÿ çíà÷åíèÿ ôóíêöèè ïðè k = 0, íåîáõîäèìî èñïîëüçîâàòü ôóíêöèè âû÷èñëåíèÿ ñòåïåíè c îñíîâàíèåì
è ïîêàçàòåëåì n, à òàêæå ôóíêöèþ âû÷èñëåíèÿ ôàêòîðèàëà ÷èñëà n.Ôóíêöèÿ âû÷èñëåíèÿ ñòåïåíè.
Function
Extent(x : real; n : integer) : real;
var
i : integer;
E : real;
begin
E := 1;
if n = 0 then E := 1
else for
i := 1 to n do E := E*x/2;
Extent := E
end;
Ôóíêöèÿ âû÷èñëåíèÿ ôàêòîðèàëà.
Function Fakt(n : integer) : longint;
var
i : integer;
F : longint;
begin
F := 1;
if n = 0 then F := 1
else for
i := 1 to n do F := F*i;
Fakt := F
end;
À òåïåðü ñîñòàâèì ôóíêöèþ âû÷èñëåíèÿ âñåé ñóììû
Function J(x, eps : real; n : integer) : real;
var
y, jj : real;
k : integer;
begin
k := 0; y := Extent(x, n)/Fakt(n); jj := 0;
repeat
jj := jj + y;
k := k + 1;
y := -y*x*x/(4*k*(n + k))
until abs(y) < eps;
J := jj
end;
Ïðîãðàììà
Program Bessel;
uses WinCrt;
var
n : integer;
x, eps : real;
{----------------------------------------------------------------------------------------}
Function
t(eps : real) : integer;
var
k : integer;
begin
k := -1;
repeat
eps := eps*10;
k := k + 1
until eps > 1;
t := k
end;
{----------------------------------------------------------------------------------------}
Function Extent(x : real; n : integer) : real;
var
i : integer;
E : real;
begin
E := 1;
if n = 0 then E := 1
else for
i := 1 to n do E := E*x/2;
Extent := E
end;
{----------------------------------------------------------------------------------------}
Function Fakt(n : integer) : longint;
var
i : integer;
F : longint;
begin
F := 1;
if n = 0 then F := 1
else for
i := 1 to n do F := F*i;
Fakt := F
end;
{----------------------------------------------------------------------------------------}
Function J(x, eps : real; n : integer) : real;
var
y, jj : real;
k : integer;
begin
k := 0; y := Extent(x, n)/Fakt(n); jj := 0;
repeat
jj := jj + y;
k := k + 1;
y := -y*x*x/(4*k*(n + k))
until abs(y) < eps;
J := jj
end;
{----------------------------------------------------------------------------------------}
begin
write('Ââåäèòå çíà÷åíèå x '); readln(x);
write('Ââåäèòå çíà÷åíèå n '); readln(n);
write('Ââåäèòå òî÷íîñòü âû÷èñëåíèÿ '); readln(eps);
writeln('Çíà÷åíèå ôóíêöèè Áåññåëÿ ðàâíî ', J(x, eps, n):6:t(eps))
end.
6.2. Ãàììà-ôóíêöèÿ Ýéëåðà
Ðàññìîòðèì (âìåñòå ñ Ýéëåðîì) áåñêîíå÷íîå ïðîèçâåäåíèå
ñ÷èòàÿ x îòëè÷íûì îò íóëÿ è îò âñåõ öåëûõ îòðèöàòåëüíûõ ÷èñåë.
Ëåãêî ïðåäñòàâèòü åãî îáùèé ìíîæèòåëü òàê:
îòñþäà âûòåêàåò, ÷òî íàøå ïðîèçâåäåíèå (àáñîëþòíî) ñõîäèòñÿ.
Îïðåäåëÿåìàÿ èì ôóíêöèÿ ÿâëÿåòñÿ (ïîñëå ýëåìåíòàðíûõ) îäíîé èç âàæíåéøèõ ðàññìàòðèâàåìûõ â àíàëèçå ôóíêöèé, à åå ðîëü â òåîðèè âåðîÿòíîñòåé ïðîñòî íåîöåíèìà.
Èñïîëüçóÿ ôîðìóëó ñîñòàâèì ôóíêöèþ âû÷èñëåíèÿ Äëÿ ýòîãî íàéäåì, ÷òî n-é ÷ëåí áåñêîíå÷íîãî ïðîèçâåäåíèÿ
áóäåò ðàâåí , à ïåðâûé ÷ëåí äîëæåí áûòü ðàâåí òîãäà, ïðè óâåëè÷åíèè n ìîæíî ïîëó÷àòü ñîîòâåòñòâóþùèå çíà÷åíèÿ ãàììà-ôóíêöèè.
Òåïåðü íàäî îñòàâèòü ôóíêöèþ äëÿ âû÷èñëåíèÿ ñòåïåíè äåéñòâèòåëüíîãî ïîëîæèòåëüíîãî àðãóìåíòà a ñ ëþáûì äåéñòâèòåëüíûì ïîêàçàòåëåì x. Äëÿ ýòîãî äîñòàòî÷íî âîñïîëüçîâàòüñÿ ñîîòíîøåíèåì: ãäå a > 0.
Function
Extent_real(a, x : real) : real;
begin
Extent_real := exp(x*ln(a))
end;
Òåïåðü ìîæíî ñîñòàâèòü îñíîâíóþ ôóíêöèþ äëÿ âû÷èñëåíèÿ ãàììà-ôóíêöèè.
Function G(x, eps : real) : real;
var
n : longint;
g1, gg : real;
begin
n := 1; gg := Extent_real((n + 1)/n, x)/(x*(x + n));
repeat
n := n + 1;
gg := gg*n*Extent_real((n + 1)/n, x)/(x + n);
n := n + 1;
g1 := gg*n*Extent_real((n + 1)/n, x)/(x + n)
until abs(g1 - gg) < eps;
G := gg
end;
Ïðîãðàììà
Program
Gamma_function;
uses WinCrt;
var
x, eps : real;
{----------------------------------------------------------------------------------------}
{ Ôóíêöèÿ âû÷èñëåíèÿ ïîðÿäêà - êîëè÷åñòâà çíàêîâ ïîñëå çàïÿòîé }
Function t(eps : real) : integer;
var
k : integer;
begin
k := -1;
repeat
eps := eps*10;
k := k + 1
until eps > 1;
t := k
end;
{----------------------------------------------------------------------------------------}
Function Extent_real(a, x : real) : real;
begin
Extent_real := exp(x*ln(a))
end;
{----------------------------------------------------------------------------------------}
Function G(x, eps : real) : real;
var
n : longint;
g1, gg : real;
begin
n := 1; gg := Extent_real((n + 1)/n, x)/(x*(x + n));
repeat
n := n + 1;
gg := gg*n*Extent_real((n + 1)/n, x)/(x + n);
n := n + 1;
g1 := gg*n*Extent_real((n + 1)/n, x)/(x + n)
until abs(g1 - gg) < eps;
G := gg
end;
{----------------------------------------------------------------------------------------}
begin
write('Ââåäèòå çíà÷åíèå àðãóìåíòà '); readln(x);
write('Ââåäèòå òî÷íîñòü âû÷èñëåíèÿ '); readln(eps);
writeln('Çíà÷åíèå ãàììà-ôóíêöèè ðàâíî ', G(x, eps):6:t(eps))
end.
Òàê êàê n- å ÷àñòè÷íîå ïðîèçâåäåíèå èìååò âèä
òîãäà ìîæíî ïîëîæèòü
Íàïèñàâ àíàëîãè÷íóþ ôîðìóëó äëÿ ëåãêî âèäåòü, ÷òî
è ìû ïðèõîäèì ê ïðîñòîìó è âàæíîìó ñîîòíîøåíèþ:
Åñëè âû âûïîëíÿëè ïðåäûäóùóþ ïðîãðàììó äëÿ ðàçëè÷íûõ çíà÷åíèé àðãóìåíòà, òî ñìîãëè óáåäèòüñÿ, ÷òî òî÷íîñòü âû÷èñëåíèÿ íåâåëèêà, äàæå ïðè äîñòàòî÷íî áîëüøîì çíà÷åíèè n.
Ôîðìóëà äàåò âîçìîæíîñòü áîëåå òî÷íî âû÷èñëÿòü çíà÷åíèÿ ãàììà-ôóíêöèè äëÿ çíà÷åíèé àðãóìåíòà, çàêëþ÷åííîãî â èíòåðâàëå (1; 2).
Äëÿ ýòîãî ñîñòàâèì ñëåäóþùóþ ôóíêöèþ:
Function
Gamma(x, eps : real) : real;
begin
x := x - 1;
Gamma := x*G(x, eps)
end;
Program
Gamma_function;
uses WinCrt;
var
x, eps, gg : real;
{----------------------------------------------------------------------------------------}
{ Ôóíêöèÿ âû÷èñëåíèÿ ïîðÿäêà - êîëè÷åñòâà çíàêîâ ïîñëå çàïÿòîé }
Function
t(eps : real) : integer;
var
k : integer;
begin
k := -1;
repeat
eps := eps*10;
k := k + 1
until eps > 1;
t := k
end;
{----------------------------------------------------------------------------------------}
Function Extent_real(a, x : real) : real;
begin
Extent_real := exp(x*ln(a))
end;
{----------------------------------------------------------------------------------------}
Function G(x, eps : real) : real;
var
n : longint;
g1, gg : real;
begin
n := 1; gg := Extent_real((n + 1)/n, x)/(x*(x + n));
repeat
n := n + 1;
gg := gg*n*Extent_real((n + 1)/n, x)/(x + n);
n := n + 1;
g1 := gg*n*Extent_real((n + 1)/n, x)/(x + n)
until abs(g1 - gg) < eps;
G := gg
end;
{----------------------------------------------------------------------------------------}
Function Gamma(x, eps : real) : real;
begin
x := x - 1;
Gamma := x*G(x, eps)
end;
{----------------------------------------------------------------------------------------}
begin
write('Ââåäèòå çíà÷åíèå àðãóìåíòà '); readln(x);
write('Ââåäèòå òî÷íîñòü âû÷èñëåíèÿ '); readln(eps);
if (x < 2) and (x > 1) then gg := Gamma(x, eps)
else gg := G(x, eps);
writeln('Çíà÷åíèå ãàììà-ôóíêöèè ðàâíî ', gg:6:t(eps))
end.
Åñëè ïîëîæèòü x ðàâíûì íàòóðàëüíîìó ÷èñëó m, òî ïîëó÷èì ðåêóððåíòíóþ ôîðìóëó
Òàê êàê (÷òî ëåãêî ïðîâåðèòü), òî îòñþäà
Ýòà ôîðìóëà äàåò åùå îäíó âîçìîæíîñòü óòî÷íèòü çíà÷åíèÿ ôóíêöèè äëÿ íàòóðàëüíûõ çíà÷åíèé àðãóìåíòà. Äëÿ âû÷èñëåíèÿ ïî ýòîé ôîðìóëå ñîñòàâèì åùå îäíó ôóíêöèþ.
Function G_natural(m : integer) : longint;
var
i : integer;
g : longint;
begin
g := 1;
for i := 2 to m do
g := g*i;
G_natural := g
end;
Ïðîãðàììà
èçìåíèòñÿ è ñòàíåò òàêîé:
Program
Gamma_function;
uses WinCrt;
var
x, eps, gg : real;
{----------------------------------------------------------------------------------------}
{ Ôóíêöèÿ âû÷èñëåíèÿ ïîðÿäêà - êîëè÷åñòâà çíàêîâ ïîñëå çàïÿòîé }
Function
t(eps : real) : integer;
var
k : integer;
begin
k := -1;
repeat
eps := eps*10;
k := k + 1
until eps > 1;
t := k
end;
{----------------------------------------------------------------------------------------}
Function Extent_real(a, x : real) : real;
begin
Extent_real := exp(x*ln(a))
end;
{----------------------------------------------------------------------------------------}
Function G(x, eps : real) : real;
var
n : longint;
g1, gg : real;
begin
n := 1; gg := Extent_real((n + 1)/n, x)/(x*(x + n));
repeat
n := n + 1;
gg := gg*n*Extent_real((n + 1)/n, x)/(x + n);
n := n + 1;
g1 := gg*n*Extent_real((n + 1)/n, x)/(x + n)
until abs(g1 - gg) < eps;
G := gg
end;
{----------------------------------------------------------------------------------------}
Function Gamma(x, eps : real) : real;
begin
x := x - 1;
Gamma := x*G(x, eps)
end;
{----------------------------------------------------------------------------------------}
Function G_natural(m : integer) : longint;
var
i : integer;
g : longint;
begin
g := 1;
for i := 2 to m do
g := g*i;
G_natural := g
end;
{----------------------------------------------------------------------------------------}
begin
write('Ââåäèòå çíà÷åíèå àðãóìåíòà '); readln(x);
write('Ââåäèòå òî÷íîñòü âû÷èñëåíèÿ '); readln(eps);
if x = trunc(x)
then gg := G_natural(trunc(x))
else
if (x < 2) and (x > 1)
then gg := Gamma(x, eps)
else gg := G(x, eps);
writeln('Çíà÷åíèå ãàììà-ôóíêöèè ðàâíî ', gg:6:t(eps));
end.
Åùå îäíó âàæíóþ ôîðìóëó äëÿ ôóíêöèè ìû ïîëó÷èì, åñëè ïåðåìíîæèì ïî÷ëåííî ðàâåíñòâà
è
Ìû íàõîäèì:
èëè
Ýòî - ôîðìóëà Âåéåðøòðàññà.
Áèáëèîòåêà ÷àñòî âñòðå÷àþùèõñÿ ïðîöåäóð è ôóíêöèé
55. Âû÷èñëåíèå ÷èñëà e.
Procedure number_e(eps : real; var
e : real);
var
n : integer;
u : real;
begin
e := 0; u := 1; n := 1;
repeat
e := e + u;
u := u/n; n := n + 1
until 3*u <= eps;
end;
56. Âû÷èñëåíèå êîðíåé ëþáîé ñòåïåíè èç ïðîèçâîëüíîãî ÷èñëà.
Procedure Radical(n : integer ; x, eps : real; var b : real);
var
n : integer;
z, m, u : real;
begin
b := 1; u := 1; n := 1;
repeat
u := (m - n + 1)*x*u/n; b := b + u; n := n+1
until abs(u) <= eps;
end;
57. Ïðîöåäóðà âû÷èñëåíèÿ áåñêîíå÷íîãî ïðîèçâåäåíèÿ
Procedure
Multiplication(eps : real; var Mult : real);
var
n : longint;
Mult1 : real;
begin
n := 2; Mult1 := 1;
repeat
Mult1 := Mult1*(1 - 1/sqr(n));
n := n + 1;
Mult := Mult1*(1 - 1/sqr(n))
until abs(Mult - Mult1) < eps
end;
58. Ïðîöåäóðà âû÷èñëåíèÿ ÷èñëà ïî ôîðìóëå Âàëëèñà.
Procedure Wallis(eps : real; var Mult : real);
var
n : longint;
Mult1 : real;
begin
n := 1; Mult := 1;
repeat
Mult := Mult*(4*sqr(n)/(4*sqr(n)-1));
n := n + 1;
Mult1 := 4*sqr(n)/(4*sqr(n)-1)
until Mult1 < eps
end;
59. Ïðîöåäóð âû÷èñëåíèÿ ýëëèïòè÷åñêîãî èíòåãðàëà 1-ãî ðîäà ÷åðåç áåñêîíå÷íîå ïðîèçâåäåíèå.
Procedure Elliptic(k, eps : real; var Kk : real);
var
Kk1 : real;
begin
Kk1 := k;
repeat
k := (1 - sqrt(1 - sqr(k)))/(1 + sqrt(1 - sqr(k)));
Kk1 := Kk1*(1 + k);
k := (1 - sqrt(1 - sqr(k)))/(1 + sqrt(1 - sqr(k)));
Kk := Kk1*(1 + k);
until abs(Kk1 - Kk) < eps;
Kk := Kk*Pi/2
end;
60. Ðåêóððåíòíàÿ ôóíêöèÿ âû÷èñëåíèÿ èíòåãðàëà âåðîÿòíîñòåé.
Function
FF(x : real) : real;
var
n : integer;
u, I : real;
begin
if x >= 5
then FF := 1
else if x <= -5
then FF := -1
else
begin
u := x; n := 0; I := 0;
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;
61. Ïðîöåäóðà âû÷èñëåíèÿ èíòåãðàëà .
Procedure
Integral(x, eps : real; var I : real);
var
n : integer;
u : real;
begin
u := x; n := 1; I := 0;
repeat
I := I + u;
n := n + 1;
u := -(u*x*x*(2*n - 3))/((2*n - 2)*sqr(2*n - 1))
until abs(u) < eps
end;
62. Ïðîöåäóðà âû÷èñëåíèÿ ýëëèïòè÷åñêîãî èíòåãðàëà 2-ãî ðîäà ñ ïîìîùüþ èíòåãðèðîâàíèÿ ðÿäîâ.
Procedure Elliptic2(k, eps : real; var Ek : real);
var
n : integer;
u : real;
begin
u := k*k/4; n := 1; Ek := 0;
repeat
Ek := Ek + u;
n := n + 1;
u := (u*k*k*(2*n - 1)*(2*n - 3))/(4*n*n);
until abs(u) < eps;
Ek := Pi*(1 - Ek)/2
end;
63. Ôóíêöèÿ Áåññåëÿ:
Function
J(x, eps : real; n : integer) : real;
var
y, jj : real;
k : integer;
begin
k := 0; y := Extent(x, n)/Fakt(n); jj := 0;
repeat
jj := jj + y;
k := k + 1;
y := -y*x*x/(4*k*(n + k))
until abs(y) < eps;
J := jj
end;
64. Ôóíêöèÿ âû÷èñëåíèÿ ñòåïåíè ïîëîæèòåëüíîãî äåéñòâèòåëüíîãî ÷èñëà ñ ïðîèçâîëüíûì äåéñòâèòåëüíûì ïîêàçàòåëåì.
Function
Extent_real(a, x : real) : real;
begin
Extent_real := exp(x*ln(a))
end;
65. Ôóíêöèè äëÿ âû÷èñëåíèÿ ãàììà-ôóíêöèè.
Äëÿ ïðîèçâîëüíîãî äåéñòâèòåëüíîãî àðãóìåíòà x, îòëè÷íîãî îò íóëÿ è îò âñåõ öåëûõ îòðèöàòåëüíûõ ÷èñåë.
Function G(x, eps : real) : real;
var
n : longint;
g1, gg : real;
begin
n := 1; gg := Extent_real((n + 1)/n, x)/(x*(x + n));
repeat
n := n + 1;
gg := gg*n*Extent_real((n + 1)/n, x)/(x + n);
n := n + 1;
g1 := gg*n*Extent_real((n + 1)/n, x)/(x + n)
until abs(g1 - gg) < eps;
G := gg
end;
Âû÷èñëåíèå ãàììà-ôóíêöèè äëÿ çíà÷åíèé àðãóìåíòà èç ïðîìåæóòêà (1, 2)
Function Gamma(x, eps : real) : real;
begin
x := x - 1;
Gamma := x*G(x, eps)
end;
Âû÷èñëåíèå ãàììà-ôóíêöèè íàòóðàëüíîãî àðãóìåíòà.
Function
G_natural(m : integer) : longint;
var
i : integer;
g : longint;
begin
g := 1;
for i := 2 to m do
g := g*i;
G_natural := g
end;
Óïðàæíåíèÿ
194. Âû÷èñëèòü ñóììó ÷ëåíîâ ðÿäîâ, çàäàííûõ ôîðìóëàìè îáùåãî ÷ëåíà. ×èñëî ÷ëåíîâ ðÿäà çàäàåòñÿ ïîëüçîâàòåëåì.
195. Ñîñòàâüòå ôóíêöèè äëÿ íàõîæäåíèÿ ñ óêàçàííîé òî÷íîñòüþ ÷èñëà ïóòåì âû÷èñëåíèÿ ñëåäóþùèõ ðÿäîâ:
a)
á) ðÿä Ëåîíàðäî Ýéëåðà:
196. Ñîñòàâüòå ôóíêöèè äëÿ âû÷èñëåíèÿ ñ óêàçàííîé òî÷íîñòüþ çíà÷åíèé òðèãîíîìåòðè÷åñêèõ ôóíêöèé ïóòåì âû÷èñëåíèÿ ñëåäóþùèõ ðÿäîâ:
à)
Äëÿ âû÷èñëåíèÿ çíà÷åíèÿ ÷ëåíà ðÿäà èñïîëüçîâàòü ðåêóððåíòíóþ ôîðìóëó
á)
Äëÿ îïðåäåëåíèÿ çíà÷åíèÿ ÷ëåíà ðÿäà èñïîëüçîâàòü ôîðìóëó
197. Äàíî äåéñòâèòåëüíîå x. Âû÷èñëèòü ïðèáëèæåííîå çíà÷åíèå áåñêîíå÷íîé ñóììû:
Íóæíîå ïðèáëèæåíèå ñ÷èòàåòñÿ ïîëó÷åííûì, åñëè âû÷èñëåíà ñóììà íåñêîëüêèõ ïåðâûõ ñëàãàåìûõ, è î÷åðåäíîå ñëàãàåìîå îêàçàëîñü ïî ìîäóëþ ìåíüøå 0.00001.
198. Âû÷èñëèòü ïðèáëèæåííîå çíà÷åíèå áåñêîíå÷íîé ñóììû (ñïðàâà îò êàæäîé ñóììû äàåòñÿ åå òî÷íîå çíà÷åíèå, ñ êîòîðûì ìîæíî ñðàâíèòü ïîëó÷åííûé ðåçóëüòàò):
à) 0.6931478... ,
á) 1,
â)
ã)
Íóæíîå ïðèáëèæåíèå ñ÷èòàåòñÿ ïîëó÷åííûì, åñëè âû÷èñëåíà ñóììà íåñêîëüêèõ ïåðâûõ ñëàãàåìûõ, è î÷åðåäíîå ñëàãàåìîå îêàçàëîñü ïî ìîäóëþ ìåíüøå äàííîãî ïîëîæèòåëüíîãî ÷èñëà eps.
199. Äàíî: íàòóðàëüíîå n, äåéñòâèòåëüíîå x. Âû÷èñëèòü:
à) á)
â)
200. Äàíî: äåéñòâèòåëüíûå a, h, íàòóðàëüíîå n. Âû÷èñëèòü
ãäå
201. Äàíî: íàòóðàëüíîå n, äåéñòâèòåëüíîå x. Âû÷èñëèòü:
202. Âû÷èñëèòü:
à) á)
â) ã)
203. Âû÷èñëèòü ñóììó ÷ëåíîâ ðÿäà
ñ òî÷íîñòüþ äî ÷ëåíà ðÿäà ìåíüøåãî 0.0000001.
204. Óñòàíîâèòü, ñõîäÿòñÿ ëè ñëåäóþùèå ðÿäû:
à) á) â)
205. Ñîñòàâèòü ïðîãðàììó âû÷èñëåíèÿ áåñêîíå÷íîãî ïðîèçâåäåíèÿ:
×àñòè÷íîå ïðîèçâåäåíèå èìååò âèä
ãäå C - ýéëåðîâà ïîñòîÿííàÿ, à áåñêîíå÷íî ìàëàÿ. Ïðîèçâåäåíèå ñõîäèòñÿ è åãî çíà÷åíèå ðàâíî
206. Ýéëåðîì áûëè íàéäåíû ñëåäóþùèå ðàçëîæåíèÿ òðèãîíîìåòðè÷åñêèõ ôóíêöèé â áåñêîíå÷íûå ïðîèçâåäåíèÿ:
1)
2)
Ñîñòàâüòå ïðîãðàììû âû÷èñëåíèÿ ýòèõ ïðîèçâåäåíèé è âû÷èñëèòå çíà÷åíèÿ sinx è cosx ñ çàäàííîé òî÷íîñòüþ.
207. Äàíî íàòóðàëüíîå n. Ïîëó÷èòü:
à) á)
â)
ã)
ä) å)
208. Äàíî íàòóðàëüíîå n. Ïîëó÷èòü ãäå
209. Âû÷èñëèòü èíòåãðàë Èñïîëüçîâàòü ðàçëîæåíèå â ëîãàðèôìè÷åñêèé ðÿä.
Îòâåòû
Ê çàäàíèþ 1
Program
Task1; {Âû÷èñëåíèå sinx ñ ïîìîùüþ ðÿäà}
uses WinCrt;
var
n, k : integer;
x, e, eps, sin, u : real;
{----------------------------------------------------------------------------------------}
{ Ôóíêöèÿ âû÷èñëåíèÿ ïîðÿäêà - êîë-âî çíàêîâ ïîñëå çàïÿòîé }
Function t(eps : real) : integer;
var
k : integer;
begin
k := -1;
repeat
eps := eps*10;
k := k + 1
until eps > 1;
t := k
end;
{----------------------------------------------------------------------------------------}
begin
write('Çàäàéòå òî÷íîñòü âû÷èñëåíèÿ '); readln(eps);
write('Ââåäèòå çíà÷åíèå àðãóìåíòà â ðàäèàíàõ '); readln(x);
u := x; n := 2;
sin := x;
repeat
u := -u*x*x/((2*n-1)*(2*n-2));
sin := sin + u;
n := n + 1
until abs(u) < eps;
write('Çíà÷åíèå sin( ', x:1:t(eps), ' ) ðàâíî ', sin:3:t(eps));
writeln(' ñ òî÷íîñòüþ äî ', eps:1:t(eps))
end.
Ê
çàäàíèþ 2
Program Task2;
uses WinCrt;
var
n : integer;
p, u, eps : real;
{----------------------------------------------------------------------------------------}
{ Ôóíêöèÿ âû÷èñëåíèÿ ïîðÿäêà - êîë-âî çíàêîâ ïîñëå çàïÿòîé }
Function
t(eps : real) : integer;
var
k : integer;
begin
k := -1;
repeat
eps := eps*10;
k := k + 1
until eps > 1;
t := k
end;
{----------------------------------------------------------------------------------------}
begin
write(' Óêàæèòå òî÷íîñòü âû÷èñëåíèÿ ÷èñëà ïè '); readln(eps);
u := 1; p := 0; n := 1;
repeat
p := p + u;
n := n + 1;
u := -u*(2*n - 3)/(2*n - 1)
until abs(u) < eps;
write('×èñëî Ïè ðàâíî ', 4*p:1:t(eps), ' ñ òî÷íîñòüþ äî ');
writeln(eps:1:t(eps))
end.
Ê
çàäàíèþ 3
Program Task3;
uses WinCrt;
var
k : integer;
a, u, z, z1, e, eps : real;
{----------------------------------------------------------------------------------------}
{ Ôóíêöèÿ âû÷èñëåíèÿ ïîðÿäêà - êîë-âî çíàêîâ ïîñëå çàïÿòîé }
Function t(eps : real) : integer;
var
k : integer;
begin
k := -1;
repeat
eps := eps*10;
k := k + 1
until eps > 1;
t := k
end;
{----------------------------------------------------------------------------------------}
begin
write('Ââåäèòå çíà÷åíèå a>1 '); readln(a);
write('Çàäàéòå òî÷íîñòü eps '); readln(eps);
u := 1; z := 0;
repeat
u := u*a;
z := z + 1/(1 + u);
z1 := z + 1/(1 + u*a)
until abs(z1 - z) < eps;
write('Ñóììà ðÿäà ðàâíà ', z1:1:t(eps));
writeln(' ñ òî÷íîñòüþ äî ', eps:1:t(eps))
end.
Ê
çàäàíèþ 4
Program Task4;
uses WinCrt;
n : integer;
var
a : longint;
{----------------------------------------------------------------------------------------}
Function c(a : integer) : longint;
var
s, z : integer;
begin
z := 0;
repeat
s := a mod 10;
z := z + s;
a := a div 10
until s = 0;
c := z
end;
{----------------------------------------------------------------------------------------}
begin
a := 7;
n := 1;
while n <= 1000 do
begin
a := c(a*a);
n := n + 1
end;
writeln(n - 1, '- é ÷ëåí ïîñëåäîâàòåëüíîñòè ðàâåí ', a)
end.