S= a1 + a2 + a3 +... ε > 0, . S , :
│Si Si-1│ < ε, Si i (.. i ), Si-1 ;
│ai ai-1│< ε, ai i- ,
ai-1 ;
│Si│ < ε │ai│ < ε.
() . , .
, , , . , .
( ) ( 4.5.2-3, 4.5.2-4, 4.5.2-5).
, : a0, a1, a2, a3,, ai,, an, , .
ε, , , :
an < ε;
an > ε ( 4.6.2-1, 4.6.2-3,
4.6.2-5 );
|an| < ε
( 4.6.2-4);
| an+1 -an|<ε ( 4.6.2-2).
4.6.2-1. -Function, ( n! =1*2*3*4*... n) , a.
(.4.6.2-1).
Do While... Loop.
. : b ; n , , . , : (.. n>=1 AND n<=15), n .
Function Pr621(ByVal a As Double)As Double Dim b As Double Dim n As Integer b = 1 n = 1 Do While b <= a n = n + 1 b = b + 1 / n Loop Return b End Function |
. 4.6.2-1. Pr621(),
,
, Do While...Loop
|
|
4.6.2-1
- Pr621() , , . 4.6.2-2.
Dim aa, bb As Double aa = vvodDbl2(" a=", TextBox1) bb = Pr621(aa) vivodDbl1(bb,TextBox2) |
. 4.6.2-2. Pr621()
Do UntilLoop (. 4.6.2-3), (. 4.6.2-4).
Function Pr623(ByVal a As Double) As Double Dim b As Double Dim n As Integer b = 1 n = 1 Do Until b > a n = n + 1 b = b + 1 / n Loop Return b End Function |
. 4.6.2-3. Pr621(),
,
, , Do UntilLoop
4.6.2-1
( . 4.6.2-1 b <= a b > a), .. , , . b <= a b > a.
, .4.6.2-3.
, , - , 4.6.2-4.
Function P624(ByVal a As Double) _ As Double Dim b As Double Dim n As Integer b = 0 n = 0 Do n = n + 1 b = b + 1 / n Loop Until b > a Return b End Function |
. 4.6.2-4. Pr624(),
,
, , DoLoop Until
4.6.2-1
, : n = 0, b = 0. True
b > a, False ( DoLoop Until).
b <= a,
DoLoop Wile.
, , .
4.6.1-2. -Function, n, [1;15], (.. n>=1 AND n<=15).
, i=0, 1, 2,...; x0=0. , |xi+1-xi| ε=10-4.
xi+1 xi . x a x ( ). , a (.. xi) x (.. xi+1) e=10-4.
|
|
(. 4.6.2-5) , , Do... Loop Until c .
Function P625() As Double Dim a, x, d As Double x = 0 d = 1E-4 Do a = x x = -Exp(a) Loop Until Abs(x - a) < d Return x End Function |
. 4.6.2-5. Pr625(),
4.6.2-2
- Function Pr625() , , . 4.6.2-4.6.
Dim xx As Double xx = Pr625() vivodDbl1(xx, TextBox1) |
. 4.6.2-6. Pr625()
4.6.2-2
4.6.2-3.
, , , d, , (3 <d <100).
, , n=0, 1, 2,- .
, , , . 100 , d (. 4.6.2-7). TextBox ( ), - Sub.
Sub Pr627(ByVal x As Double, _ ByVal d As Double) Dim n As Integer = 0 Dim a As Double Do = x^n / 3^n vivodID11(n, "n=",a, "a=", TextBox3) n=n+1 Loop While a <= d And n < 100 End Sub |
. 4.6.2-7. Pr627(),
4.6.2-3
- Sub Pr627() , , . 4.6.2-8.
Dim xx, dd As Double xx = vvodDbl2(" xx= ", TextBox1) dd = vvodDbl2(" dd= ", TextBox2) Pr627(xx, dd) |
. 4.6.2-8. Pr627()
4.6.2-3
4.6.2-4. -, ε: .
ε , , ε.
, . , , . q , an+1 an .
Function Pr629(ByVal x As Double,_ ByVal e As Double) As Double Dim a, s As Double Dim n As Integer = 0 a = x 1 s = 0 Do Until Abs(a) < e Or n > 100 vivodIntLs12(n, ListBox1) vivodDblLs13(a, ListBox2) s = s + a a = -a * (x - 1) / (n + 2) n = n + 1 Loop Return s End Function |
. 4.6.2-9. Pr629(),
ε
4.6.2-4
. n- :
|
|
. n- :
n+1
an+1 an, q
, :
(n) n=0, n-
, x-1 a0=x-1.
- Function . 4.6.2-9, , 100 , .
-Function Pr629() , , . 4.6.2-10.
Dim xx, ee, ss As Double xx=vvodDbl2(" xx=", TextBox1) ee=vvodDbl2(" ee=", TextBox2) ss = Pr629(xx, ee) vivodDbl1(ss, TextBox3) |
. 4.6.2-10. Pr629()
4.6.2-4
. n- :
n+1
an+1 an, q
, :
(n) n=0, n-
, x-1 a0=x-1.
Function P6211(ByVal x Double, _ ByVal e As Double) As Double Dim a, s As Double Dim n As Integer = 0 a = x 1 s = 0 Do Until Abs(a) < e Or n > 100 vivodIntLs12(n,ListBox1) vivodDblLs13(a,ListBox2) s = s + a n = n + 1 a =- a * (x - 1) / (n + 1) Loop Return s End Function |
. 4.6.2-11. Pr6211(),
ε
4.6.2-4
-
. 4.6.2-11. , , n (n=n+1) , .