Вы находитесь на странице: 1из 400

.

2,

..
.. ,
.. , ..




,

2012

519.854
22.176
13
13 .

2-,
: , 2012. 400 ., ISBN 978-5-94836-303-5
, .
, , .

, , , .
, . ( )
.

, , .
, ,

, -.
519.854
22.176

Pearson Education Limited 2002


This translation of DISCRETE MATHEMATICS
FOR COMPUTING, First Edition is published by
arrangement with Pearson Education Limited.
2012, ,
, ,
-,

ISBN 978-5-94836-303-5
ISBN 0-201-73047-2 (.)


................................................
..................................................................

6
9

1.
........................................................................

1.1. ............................................................
1.2. ...................................................................
 1 ...........................................................
..................................................

11
11
14
19
21

2.
.............................................

2.1. .................................................
2.2. .................................................
2.3. ..................................................
2.4. .............................................
 2 ...........................................................
..................................................
. ................................

23
23
27
30
32
35
38
39

3.
 ..........................................................

3.1.  ....................................
3.2. ........................................................
3.3. ......................................
 3 ...........................................................
..................................................
. ....................................

44
44
51
53
58
61
63

4.

....................................................................
4.1. ....................................................
4.2. .....................................................
4.3.  ..........
 4 ...........................................................
..................................................
.  ..................

5.

........................................................................

5.1.
5.2.
5.3.
5.4.

 ................
.....................................................................
 ......................
 .........................................................

68
68
73
77
82
85
86
91
91
96
102
105

4
 5 ........................................................... 108
.................................................. 112
.  ....... 113
6.
.............................................................

6.1.  ......................................
6.2. ..............................................
6.3. ...........................................................
 6 ...........................................................
..................................................
. ..............................

117
117
120
128
131
135
136

7.

............................................................................
7.1. ..................................................
7.2. ....................................................
7.3. .......................................................................
 7 ...........................................................
..................................................
.  .........................................

141
142
147
152
158
163
165

8.

............................................
8.1. ...............................................
8.2. ..........................................................
8.3.  .........................................................
 8 ...........................................................
..................................................
. ..................................

171
171
175
181
184
187
189

9.

.............................................................
9.1. .............................................................
9.2. ...............................................................
9.3. .................................................
 9 ...........................................................
..................................................
. 2- ................

194
194
200
205
208
211
212

 ...................................................

217

  ..................................

275
.1. ......................................... 275
.1.1.  ........................................................... 277

5
.1.2. 
.................................................................. 278
.1.3. 
............................................. 279
.2. ................................................... 281
.2.1. , 282
.2.2.  ............................. 286
.3. ........................................................ 288
.3.1.  .......... 289
.3.2.  ................................................... 292
.4.  ........................................ 294
.4.1. .......................................... 300
...............................
.........................................................
.5.  ............
..............................................................
.5.1. .......................
 .5.1 .....................................................
.5.2. ....................................
 .5.2 .....................................................
.5.3. .  ................................................................
 .5.3 .....................................................
.5.4.  ..
 .5.4 .....................................................
.6.  
...........
..............................................................
.6.1. m-  ............................................................
.6.2. ,   .............................
.6.3. NP-   ...................
.6.4.  ............................................
.6.5.    ....................
.6.6. ........
 .6 ........................................................


305
305
305
305
306
317
318
332
333
344
345
359
359
359
361
362
366
368
372
381
392

................................................................... 395

................................................

397


:=
P
P Q
P Q
P Q

n!
{P } A {Q}
aS
a 6 S
{x : P (x)}

N
Z
Q
R
AS
AB
AB
A\B
U
A
AB
|S |
(a; b)
AB

R2

An

P (A)
M (i; j )
xRy

 
P
P Q
P Q
P Q


n
-  A
a | S
a  S
x,
P (x)





A |  S
A B
 A B
A B

 A
A B
S
 
  A B

  n  A

,
i- j -
 (x; y ) R

15
24
25
25
27
28
28
37
39
45
45
45
46
46
46
46
46
46
47
47
48
48
48
49
54
55
55
56
57
61
71
72

R
Ex
xy

R 1
SR
MN
f (x)
f : A B
f (A)
f 1 : A
gf
|x|
x
P (n; k )
C (n; k )
O (g (n))
(v )
G = (V; E )
(G)
Kn


Mk

M
d[v
p
pq
pq
{

R
x
x |   y
 



 R S
 M N
x
A B
f

 f g
x
x
(n; k )-

(n; k )-

, , g (n)

V
E

 n



 k 
M

v
 p
 p q
 p q
{

75
78
80
87
88
89
91
92
94
97
97
97
102
104
110
110
121
123
137
143
143
146
148
154
160
171
176
176
182
195
195
195
200


a
a

205

205

205

205

209

a
a b
b


| , , .
 ,
  ,
,  . , ,  , 
 ,
, , .
  ,
  .  , ,
,  .
, , , . , 
,   .
   () .
20 .  , , .
  ,
.
7

- 8

4
6

- 2

- 3
?

- 5
pp
ppp
p
?
- 6

10

  ,
.    . 
 , , , 
, .
 ,
   .
 ,  , Pearson Edu ation ,   .
,  | , .

2001

. ,
 , ,  . 
. , , 
, .

      .  | 
. , ,
,  . 
|  ,    .
 | , .
  
.   , , 
 . 1  , , .

1.1.
 ,  . 1.1.
 :

( ) : , , , ,
1

Pas al |  . |

.  .

12

1.

. 1.1. 
, .

1.1.

.  .
 1.1

|
120
147
142
107
81

120
|
132
42
157
45

147
132
|
108
66
105

142
42
108
|
168
61

107
157
66
168
|
112

81
45
105
61
112
|

, , |
.  7. , . 1.2, , . 1.1.
   ( , 
), 
, , .

1

 ,
( ) .

1.1.

2
3

13

 () ,
, .
2  
.

81

120
107

147

45
105

112

157
132

142

66
61
168

42

108

1.2.

1.3, 1.4 1.5  ,


  , . ( 339)
 ,
.

45

45

42

1.3.

, , 
. ,
, ,  .   ,

14

1.

, ? ,

 !  |   ,   .
.

81

81

45

45

105

42

42

1.4.

81

45

105

66

42

1.5.

1.2.
 , . .
begin
 
,   

end

, :    .

1.2.

15

    
:
 :=

1.2.1. ( , First Se ond ,

  Sum .)
begin

First and Se ond ;


:=
Sum First + Se ond ;
Input

end

   ,
 .  
:
;
;
 .

   ,
 , .  :
begin
 1;
 2;

.........

 n;

end
1.2.2. ( : One

Two .)

begin

One and Two ;


Temp := One ;
One := Two ;
Two := Temp ;
Input

end

 , ,  One T wo 5 7 , . 1.2.

16

1.

 1.2
T emp

One

T wo

2
3
4

5
5
5

5
7
7

7
7
5

  .  if-then
if-then-else.   :
begin
if then 
end

:
begin
if then  1
else  2
end
1.2.3. ( n   ab .)
begin
Input n;

if n < 0 then ab := n
else ab := n;
Output ab ;
end

, , 
  n, | 
 ( ).  ,
,  else:
begin
Input n;

if n < 0 then n := n;
ab := n;
Output ab ;
end

   n  .

1.2.

17

  , 
.

 
:
for X := A to Z do ;
while do ;
repeat

 1;
 2;
.............
 n;
until .

(1)
(2)

(3)

X | , A Z | .
(1)   . :
for do 

(2)   ,
,  , , .
, .
,  (3) 
,  . (2) (3) ,    , 
   .
1.2.4. (  n

.)

begin
sum := 0;
for i := 1 to n do
begin
j := i i;
sum := sum + j ;
end
Output sum;
end

n = 4,  . 1.3

18

1.

 1.3






Sum

1
2
3
4

1
4
9
16

1
5
14
30

: sum = 30.
1.2.5. (

,
.)
begin
v :=  ;
u := ;
v u;
while  do
begin
u :=  ,

 ;

end

 ;

end

|   ,  .
. ,  ( ) ( . 7, . 146).
 |  , 
 . 
, 
, . |
 .    . , ,  1.2.5 ?

 1

19

, , , : ?  1.5  , (  1.2.4). . , 
 ? ,
?
: |
  ,
 .

 1
1.1. . 1.6 , -

.
.  , , .
B

3
1

6
G

A
3

1.6.

1.2.

() n = 3;
() n = 5.
begin
f := 1;
Input n;

for i := 1 to n do
f := f i;
Output f ;
end

20

1.

   n?
1.3.  i j  m = 3 n = 4:
begin
Input m, n;

i := 1;
j := m;
while i 6= n do
begin
i := i + 1;
j := j m;
end
Output j ;

end

 
 m n > 0.   n = 0?
1.4. , 

begin
f irst := 1;
Output f irst;
se ond := 1;
Output se ond;
next := f irst + se ond;
while next < 100 do
begin
Output next;
f irst := se ond;
se ond := next;
next := f irst + se ond;
end
end

  
.
1.5.  l, sum k ,   n = 6.

21

begin
Input n;

k := 1;
l := 0;
sum := 0;
while k < 2n do
begin
l := l + k ;
sum := sum + l;
k := k + 2;
end
Output sum;

end

   n.
1.6.  ,

. 1.1.  ?
begin

 
 : 1, 2, 3, . . . . .;
m := ;
:= ;
:= 1;
while > m 1 do

begin
if
then
begin
;
:= 1;
end;
:= + 1;
end

end


 -

 ,  
.

22

1.

|  , 

 .

() , ,
() , .
|  , -


.
 ,
.
, -

    

   ,

 .

   (-

), 
, .

 .
    -

 .

2



  (). , , .
,  .
 , ( )   ,
. ,   ,  1 . ,
 ( ,  ),
   , . ,
,
.
, ,   .
,    .

2.1.
. , , . . ( ) ( ). ,

;

| ;
1

29 |  .

,  ,
.

24

2.

. ,
, P , Q | | R | 29 |  .
  , , , ,
 , ,  . ,

( P ) | ;
(P Q) |  | ;
(P Q) |  | .
2.1. P | , Q |  . 
.

() | ,  .
()  , | .
() | ,  .
.

() ( P ) Q.
() ( P ) ( Q).
() P Q.
 ,  , . .
 . 
.
 P ( P ),  P . 
 . 2.1.
 2.1
P

2.1.

25

P Q (P Q). -

,
.    .
| . 2.2.
 2.2
P

(P

P
Q (P Q). ,
,
 . , (P Q) , P ,
Q, , .  . 2.3.
 2.3
P

(P

2.2. : VIII
, , 1 ?
. P , Q | VIII
R | .  : (P Q) ( R). , P ,
Q R . (P Q) ( R)
: ( ) , .
1

|  , XVII{XVIII .. . | .  .

26

2.

, 
 , , 
.  .
2.3. , ( (P ( Q))) (( P ) Q).
.  (. 2.4)

:
R = ( (P ( Q)))

S = (( P ) Q):

   P Q.
 2.4
P

 . , R S .
 , . : ,
|  . 
, .
P , Q. ,
 P ,  , Q .  P ,
Q , .
P | () 1 = 5, Q |
( ) 3 = 7 R | () 4 = 4. , : P , Q
P , R, | .
2.4.

. 1 = 5, ,  2 ,
, 3 = 7. , P , Q

2.2.

27

.  1 = 5
3  2 = 2. (2)2 = 22 , . . 4 = 4.  ,
P , R .
P , Q  ,  P ,
Q . .
  ,  P Q P , Q.   P Q , P Q, P
Q, Q P .
   . 2.5.
 2.5
P

(P Q)

2.5. (( Q) ( P ))   (P Q).
, (( Q) ( P )) (P Q).
. (. 2.6).
 2.6

(P Q)

((

) (

))

 ,
, , .

2.2.
  , | ,
. , ,

28

2.

 
 .
, ,

. , x | , x = x2 , 
 x = 0 x = 1 .
  .  . ,  ( ),   
 .
2.6. ,

() 180 .
() .
() x, x2 = 2.
()  .
.

() .
() . 1 .
() .
() . 2 , .
 2.6 , , ( ) 
, .
() , , .
 ,  .
 .
1

| . |

.  .

2.2.

29

2.7. P (x)  x |
x2 = 16. : x : P (x) 

. x : P (x) , x, x2 = 16. ,
, ,  x2 = 16   x = 4. , x = 4 |

.  x,  x : P (x).

2.8. P (x) | : x |
x2 +1 = 0. : x : P (x) 

.  :
x, x2 + 1 = 0. -

, . .
x2 > 0, , x2 + 1 > 1. ,
x : P (x) .
 2.8  : x : P (x). , , ,
, x, x2 + 1 = 0. ,
x, x2 + 1 6= 0.
 x P (x).
 P (x) 2 :
x : P (x) x P (x);
x P (x) x : P (x).

 , , .
2.9. , x y | ,
P (x; y )  x + y = 0. -

 .
() x y : P (x; y );
2

() y : x P (x; y ).


. | .  .

30

2.

() x y : P (x; y ) ,
x y ,
x+y = 0. , , ,  x
, y = x x + y = 0
.
() y : x P (x; y ) :
y , x  x + y = 0. , , : y ,
. , .

2.3.
 .
| 
. ,
(P Q).  ,
:
, P   Q.   , P , Q | ,   (P Q)
 (. . 2.5 . 27).
1. .

2. . , Q
 P .  , , 
   (( Q) ( P )),
 2.5, (P Q).

, P
, Q ,  ,  .  - ,
 (P Q)  , P , Q .
3. .

2.10.   ,  xy x y .

2.3.

31

. , ,
x,  x = 2m + 1, m |
. , y = 2n + 1 n.

, 

xy = (2m + 1)(2n + 1) = 4mn + 2m + 2n + 1 = 2(2mn + m + n) + 1

.
2.11. n | . ,   , n2 , n
.
. n2 n2 , n n .  ,

   ,
n n2 .
 n , n = 2m - m. , n2 = 4m2 = 2(2m2 ) | .

2.12.  ,
x2 = 2 , . .

 .

. , x
x2 = 2 , . .  x = m
n
m n,  n 6= 0.  , 

 , - .
, 
2m
3m
. , x = m
n = 2n = 3n . . , m n .
 .
,  , x = m
n (m n ). x 2
x2 = 2. , m
m2 = 2n2 .
n = 2,
2
 , m . , m (. . ()) 
m = 2p - p. m2 = 2n2 , , 4p2 = 2n2 , . . n2 = 2p2 .
n .  , , m, n | .

32

2.

2.  ,  m
n,
.
  :
x2 = 2 ,
. . .

2.4.
  
, ,  . , 
- ,  ,   
. , .
, , , . 
, ,  a1 ; a2 ; a3 ; : : : ; an .
begin
i := 0;
M := 0;
while i < n do
begin
j := j + 1;
M := max(M; a);
end
end

: a1 = 4, a2 = 7, a3 = 3

a4 = 8  . 2.7.
 2.7

j <

4?

0
1

0
4

2
3
4

7
7
8

2.4.

33

 M = 8, . ,    M , 
.
 
n?
a1 ; a2 ; a3 ; : : : ; an n Mk  M  k -  .
1. a1 1,
 M  0 a1 ,
, , a1 ( 0).
 .
2.  k -  Mk |
a1 ; a2 ; : : : ; ak ,   Mk+1 max(Mk ; ak+1 ), . .
a1 ; a2 ; : : : ; ak ; ak+1 .
. 1 ,   1. . 2,  2.  . 2
, , 
3, . .  ,   n, . .
.
 .


P (n) | ,  n.
,
1. P (1)
2. k > 1  (P (k ) P (k + 1)) .
 P (n)  n.
2.13.  ,

1 + 2 + +n =
  n.

n(n + 1)

34

2.

nn

. P (n) |  1 + 2 + + n =
.
2
n = 1 |  1,
(

+1)

 , 

1(1 + 1)
= 1:
2
, P (1) .
 , 1 + 2 + + k =
- k . 

kk

( +1)
2

1 + 2 + + k + (k + 1) = (1 + 2 + + k ) + (k + 1) =
k (k + 1)
=
+ (k + 1) =
2

1
=
k (k + 1) + 2(k + 1) =
2

1
=
(k + 2)(k + 1) =
2
(k + 1)(k + 2)
=
:
2
 ,  k 
P (k ) P (k + 1)

. ,    ,  P (n)  n.
2.14. ,
7n 1 6   n.
. , a
b , 
a = mb  - m. , 51 17,
 51 = 3 17. ,   , ,
b b.
P (n)  7n 1 6.
n = 1
7n 1 = 7 1 = 6;

. .  P (1) .
, 7k 1 6  - k . 

 2

35

7k+1 1 = 7(7k ) 1 =

= 7(7k 1) + 7 1 =
= 7(7k 1) + 6:

 7k 1 6,  
7(7k 1) + 6 6.
, 7k+1 1 6,  k
 (P (k ) P (k + 1)) .

P (n) n.
2.15. x1 ; x2 ; : : : ; xn -

:
x1 = 1

xk+1 = xk + 8k

 k > 1:

, : xn = (2n 1)2 n > 1.


. xn = (2n 1)2 P (n).
n = 1, (2n 1)2 = (2 1)2 = 1, 
P (1).
 , xk = (2k 1)2 k > 1. 
xk+1 = xk + 8k =

= (2k 1)2 + 8k =
= 4k 2 + 4k + 1 =
= (2k + 1)2 :

2
, xk+1 = 2(k + 1) 1   (P (k ) P (k + 1))  k > 1. ,
 ,  P (n) 
  n.

 2
2.1. P , Q R |  -

P:

36

2.

Q:
R:

.
.

 , P , Q R.
() .
() , .
() , .
() , .
() , .
2.2. P : , Q |

.  :
() , ;
() ;

() , ( )
.
 , () ().
2.3. , 

 , .  :
() (P ( P ));
() P ( P );

() (P (P Q)) Q.

2.4. , (P Q) R (( P ) R) (Q R).

2.5. x , P (x)  x

. 
:
() ;
() ;
() .

 2

37

 () ,
()  ,
.
2.6. P (x) x , Q(x) | x ,
x | - . :

x (P (x) Q(x)):
:
() ;
() ;
() .
2.7. () -

:
n m | n + m | .

() :
n2 | n | .
()  ,
n + m |
, | .
2.8.

() 1 + 5 + 9 + + (4n 3) = n(2n 1)
n.
() 12 +22 + + n2 = 16 n(n +1)(2n +1)
n.
()

+ 315 + + (2n1)1(2n+1) =
n.

n
n

1 3

+1

() n3 n 3  n.
() 1 1! + 2 2!+ + n n! = (n + 1)! 1
n.
( n! n  1 n :
n! = 1 2 3 (n 1) n.)

38

2.

2.9. x1 ; x2 ; : : : ; xn -


x1 = 1

xk+1 =

xk

 k > 1:

xk + 2

x2 , x3 x4 .  ,
xn =

n > 1.

2n 1

2.10. x1 ; x2 ; : : : ; xn -


x1 = 1; x2 = 2

xk+1 = 2xk xk1

 k > 1:

x3 , x4 x5 . xn
.


   -

, . . .

 -

 .   , , ... .
. 2.8  ,
.
 2.8

(P Q)

, 
.

39

 x 
, , : P (x).
() () | .


(P Q)  P Q.

( Q P ) (P Q).

 (P Q),   Q P  ,
.
  , .
 | :

P (n) | ,  n.
,
1. P (1)
2. k > 1  (P (k ) P (k + 1)) .
 P (n)  n.

.
( , , , ),  ,  ,  .
.
P | ,
A, Q | ,  , . {P } A {Q} ,
A  P ,  Q. P
 , Q |

40

2.

 . {P } A {Q} .
A {P } A {Q}. 
.
1. .

begin
z := x y ;
end
.  P :
x = x1 y = y1 . Q | z = x1 y1 .

{P } {Q}
x = x1 y = y1 , z = x1 y1 .     x = x1 y = y1
,  z , x y . : z = x y , x = x1 y = y1
z = x1 y1 .

A 
,  A1 ; : : : ; An


{P } A1 {Q1 }; {Q1 } A2 {Q2 }; : : : ; {Qn1 } An {Q};


  .
2.  -

{x |

begin
y := ax;
y := (y + b)x;
y := y + ;
end
{y = ax2 + bx + }

. , 

- .

41

{x = x1 }
begin
y := ax;
Q1 {y = ax1 x = x1 }
y := (y + b)x;
Q2 {y = ax21 + bx1 }
y := y + ;
end
Q {y = ax21 + bx1 + }
P

, , , :

{P } y := ax {Q1 },
{Q1 } y := (y + b)x {Q2 },
{Q2 } y := y + {Q}, |
. , 

{P } {Q}
, . . .

.  
if ... then,
 .
: ,
if then
1;

else
2;

 P , Q. 
:

{P } 1 {Q}
{P ()} 2 {Q}.

42

2.

3. , .

{x |

begin
if x > 0

then
ab := x;
else
abs := x;

end
{abs | x}

. P {x = x1 },
 Q {abs | x}.
{P x > 0} abs := x {Q} ,
 x1  .
{P (x > 0)} abs := x {Q} ,
x1 .

 -    ,
 while ... do, . 
.
4.  .

{n |

begin
sq := 0;
for i := 1 to n do
sq := sq + 2i 1;
end
{sq = n2 }

. P (n)  sq = n2  n-
 , sqk |  sq  k - 

. ,
(1) sq1 = 12 ;

(2) sqk = k 2 , sqk+1 = (k + 1)2 .

43

,    sq1 = 1  (1)
. ,  k -  sqk = k 2 . 
 
sqk+1 = sqk + 2(k + 1) 1 = k 2 + 2k + 1 = (k + 1)2 :

 ,  (2) .
, , P (1) (. (1)). , 
  ((P (k ) P (k + 1))  
k > 1. ,  
, P (n) n.
4 for 
(). ,  , while ... do,  ,    .
,  .

3


 | ,
  
, .
    .  , , 
.
,    , 
 . , , 
, ,  . ,
, ,   ,  ,  ( 
  ).
  .
  

, I.

3.1. 
|  , . ,
{, , };
{2, 3, 5, 7, 11};
{, , , }.
 .  ,  . -

3.1. 

45

, S = {3; 2; 11; 5; 7} | , . , S  ,
 ,  ,  , .
 a S , a |
S . , a  S .
a  S , : a 6 S .
 , . 
  . 
S = {x : P (x)}

 , x,
 P (x) . , 
S = {x : x | }

S = {1; 3; 5; 7; : : :}:


2n 1, n | ,
  :
S = {2n 1 : n | }:

3.1.   , -

() A = {x : x | x2 + 4x = 12};

() B = {x : x | , };

() = {n2 : n | }.
.

() x2 +4x = 12, x(x +4) = 12. x | ,


12, 1, 2, 3, 4,
6 12. , x + 4 12.
: x = 6 x = 2.
 x2 + 4x 12 = 0. 
x = 6 x = 2.
, A = {6; 2}.

46

3. 

() B = {,  , }.
() = {0; 1; 4; 9; 16; : : :}.
, .

|  ;
N = {1; 2; 3; : : :} | ;
Z = {0; 1; 2; 3; : : :} | ;

Q = { pq : p; q Z; q 6= 0} | ;
R = { } | .
, N 0.
 ,    
.  
  .    , 
 .
 .   .
,    
. , = {0; 1; 4; 9; 16; : : :}
Z = {0; 1; 2; 3; : : :}.
, A  S ,
S .  ,
A S . : A S .
. 3.1 .  .
, .
, .
A = B
  :

{x A x B }

{x B x A}:

3.1. 

47

S
A

3.1. 

3.2.
A = {n : n2 | }

B = {n : n | }:

, A = B .
x A, x2 | .
  2.11, , x |
. , x B , . . A B .
,  x B .  x |
.  2.10, x2 , , x A. 
x B , B  A, . . B A. , A = B .

A B
A B = {x : x A

x B }:

,  A, B , .
 . 3.2.
A B
A B = {x : x A

x B }:

,  A,
B .   . 3.3.

48

3. 

3.2.

3.3. 

1 B A
A \ B = {x : x A x 6 B }:

 A \ B A,
 B (. . 3.4).
  U , U
.  .
 A U  A U , . . U \ A.
, U \ A A  
1

 . | .  .

3.1. 

49

A.  , ,  U , 
A = {x : (x A)}

A = {x : x 6 A}:

 . 3.5.

3.4.

\B

3.5. 

A B

A B = {x : (x A x 6 B )

(x B x 6 A)}:


,  A  B ,
,  B , A. ,
, A, B ,
. , ,
. 3.6.

50

3. 

3.6.

3.3.
A = {1; 3; 5; 7};

B = {2; 4; 6; 8};

C = {1; 2; 3; 4; 5}:

A C , B C , A \ C B C .
.
A C = {1; 3; 5; 7; 2; 4};
B C = {2; 4};
A \ C = {7};
B C = (B \ C ) (C \ B ) = {6; 8} {1; 3; 5} = {6; 8; 1; 3; 5}.

3.4.
A = {x : 1 6 x 6 12 x };

B = {x : 1 6 x 6 12 x , 3}:

, (A B ) = A B .
. ,

U = {1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12}:

,
A = {2; 4; 6; 8; 10; 12}

B = {3; 6; 9; 12}:

3.2.

51

(A B ) = {6; 12} = {1; 2; 3; 4; 5; 7; 8; 9; 10; 11}


A B = {1; 3; 5; 7; 9; 11} {1; 2; 4; 5; 7; 8; 10; 11} =

= {1; 2; 3; 4; 5; 7; 8; 9; 10; 11}:

, (A B ) = A B .

3.2.
 ,  , .
, | , . 1
  , . 3.1.
 3.1

3.5. , A B
: (A B ) = A B .
.

(A B ) = {x : x 6 (A B )} =
= {x : (x (A B ))} =

= {x : (x A) (x B ))};

A B = {x : (x 6 A) (x 6 B )} =

= {x : ( (x A)) ( (x B ))}:

,
:
(P Q)
1

( P ) ( Q);

, . |

.  .

52

3. 

P Q |  .     (. 3.1), ,  (P Q) (A B ), ( P ) ( Q) | AB .
, (A B ) = A B .

,  3.5, , . ,
, .
 3.2.
 , ,   3.5.
(. 3.2)
 , 
 
, U .  , |
.
 3.2.

A

(B C ) = (A B ) C

(B C ) = (A B ) C

B =BA

B =BA

=A

U =A

U =U

A=A

A=A

(B C ) = (A B ) (A C )

(B C ) = (A B ) (A C )


A

A=U

A=

=U

=A

=A

(A B ) = A B

(A B ) = A B

3.3.

53

 . ,  , 
,  -  , .
3.6.  , ,
 A B :
A B = (A B ) (A B ):

.   -

A B = (A B ) (B A):

, .
(A B ) (A B ) =

(. )

= (A B ) (A B )) =

(. .)

= (A (A B )) (B (A B )) =

(. .)

= ((A B ) A) ((A B ) B ) =

(. .)

= ((A A) (A B )) ((B A) (B B )) = (. .)

= ((A A) (B A)) ((A B ) (B B )) = (. )

= ( (B A)) ((A B ) ) =

(. .
)

= (A B ) (B A)
,

A B = (A B ) (A B );

3.3.
6 , ,

.   ,
. , 
  ? 
 ?

54

3. 

S . |S |.
  .  ,
 .
.

|A B | = |A| + |B | |A B |:

.  . 3.7, A B : A \ B , A B B \ A,
. ,
A = (A \ B ) (A B )

B = (B \ A) (A B ):

|A \ B | = m;

|A B | = n;

|B \ A| = p:

 |A| = m + n, |B | = n + p

|A B | = m + n + p =
= (m + n) + (n + p) n =
= |A| + |B | + |A B |:

A B

A B

3.7.

B A

3.3.

55

3.7. 63  ,
,  
. 16 , 37 |
, 5 ,
   ?
. .
A = {, };

B = {, }:


,

|A| = 16;

|B | = 37;

|A B | = 5:

|A B | = 16 + 37 5 = 48:

, 63 48 = 15  
.
 ,
, 
.  
.
, ,  , .  .
 ,   .
   (a; b), a | A, b | B .  
  A B A B .
, A B = {(a; b) : a A b B }. 
   ,     ,
 .
3.8. A = {x; y } B = {1; 2; 3}.
: A B , B A B B .
.  A B

{(x; 1); (x; 2); (x; 3); (y; 1); (y; 2); (y; 3)}:

56

3. 

 B A |

{(1; x); (2; x); (3; x); (1; y ); (2; y ); (3; y )}:
, A B B A !  B B

{(1; 1); (1; 2); (1; 3); (2; 1); (2; 2); (2; 3); (3; 1); (3; 2); (3; 3)}:
 3.8, ,   A B 1

|A B | = mn;

|A| = m |B | = n:

, 
 .
 
,  . , A B  3.8
 . 3.8
x

(x, 1)

(x, 2)

(x, 3)

(y, 1)

(y, 2)

(y, 3)

3.8.

   R . RR
R2 , , 
 (x; y ). 
. R2  . . 3.9
1

, ,  A
( m ) n  . |
.  .

3.3.

57

  A1 ,

A2 , . . . , An

A1 A2 An = {(a1 ; a2 ; : : : ; an ) : ai Ai ; i = 1; 2; : : : ; n}:

|   , , .    . 
.
y

(3, 2)

3.9. 

, A1 , A2 , . . . , An  A,  An 
 n  A.
3.9. B = {0; 1}.  B n .
. B 
n. n.

,
 
. S = {s1 ; s2 ; : : : ; sn },   . A S ,  n-
(b1 ; b2 ; : : : ; bn ), bi = 1, si A bi = 0  .   A.  
 ,  , 1
, 0 .

58

3. 

3.10. S = {1; 2; 3; 4; 5}, A = {1; 3; 5} B = {3; 4}.


 A B , 
A B , A B B .
. ,
A a = (1; 0; 1; 0; 1), B b = (0; 0; 1; 1; 0). ,
a b = (1; 0; 1; 0; 1) (0; 0; 1; 1; 0) = (1; 0; 1; 1; 1);
a b = (1; 0; 1; 0; 1) (0; 0; 1; 1; 0) = (0; 0; 1; 0; 0);

b = (0; 0; 1; 1; 0) = (1; 1; 0; 0; 1):

  
: A B = {1; 3; 4; 5}, A B = {3}
B = {1; 2; 5}.

 3
3.1. () :
A = {x : x Z 10 6 x 6 17};

B = {x : x Z x2 < 24};

C = {x : x Z 6x2 + x 1 = 0};

D = {x : x R 6x2 + x 1 = 0}:

: 6x2 + x 1 = (3x 1)(2x + 1):

()    :
S = {2; 5; 8; 11; : : :};

T = {1;

1
3

1
7

1
15

; : : :}.

3.2. U = {p; q; r; s; t; u; v; w}. A = {p; q; r; s}, B =


= {r; t; v } C = {p; s; t; u}.

:
() B C ;

() A C ;

() (A B ) (A C );

() B \ C ;

() A B C ;

() (A B );

() C ;
() B C .

 3

59

3.3. 

A = {x : x | ,  };

B = {x : x | ,  };

C = {x : x | , }.

, :
() C A B ;

() B C ;

() B C ;
() A B = .

 :
() A B C ;

() (A B ) C .

3.4.  :
A = {3n : n Z n > 4};
B = {2n : n Z};

C = {n : n Z n2 6 100}.

()   ,  A, B C :
(i) ;
(ii) {10; 8; 6; 4; 2; 0; 2; 4; 6; 8; 10};

(iii) {6n : n Z n > 2};

(iv) {9; 7; 5; 3; 1; 1; 3; 5; 7; 9}.

()   A \ B .

3.5. ,

A (B C ) = (A B ) (A C ):

, 
A, B C .

60

3. 

3.6. , -

A (B C ) = (A B ) (A C ):

, A (B C )  (A B ) (A C ).

3.7. 

() (A B ) B = A B ;
() (A (B C )) = A B C ;

() (A B C ) (A B C ) (A C ) = ;
() (A \ B ) \ C = A \ (B C );

() A A A = A.

3.8.    :
A B = (A B ):

A B .  :
() A A = A;

() (A A) (B B ) = A B ;

() (A B C ) (A B C ) (A C ) = ;
() (A B ) (A B ) = A B .

3.9. ()  , A, B C :

|A B C | =
=|A| + |B | + |C | |A B | |B C | |A C | + |A B C |:
()  , ,   . 25  , 27 , 12 . , 20 ,
, 
, | . ,

61

  .  
 ?
?
3.10.  A B ,
A B = B A?
 A, B C
A B = A C . , B = C ?

3.11. A, B C |  . ,

() A (B C ) = (A B ) (A C );

() (A B ) C = (A C ) (B C ).

3.12. P (A) ,
 A.
, P (A) = {C : C A}.

() P (A), A = {1; 2; 3}.

() , P (A) P (B ) = P (A B ) A B .
() , P (A) P (B )  P (A B ).

3.13. U = {1; 2; 3; 4; 5; 6} | . -

 :
A = {1; 2; 4; 5}

B = {3; 5}:

 A B
A B ,   .


|  , -

 , U | .

N = {1; 2; 3; : : :} | .

Z = {0; 1; 2; 3; : : :} | .

Q = { pq : p; q , q 6= 0} | .

R = { } | .

62

3. 

S A,  S. : A S .

,
 .
A B
A B = {x : x A x B }:

A B
A B = {x : x A x B }:

 B A
A \ B = {x : x A x 6 B }:

 A ( U ) -

A = {x : x 6 A}:

A B

A B = {x : (x A x 6 B ) (x B x 6 A)}:

 ,
, U .
S . |S |.
,

|A B | = |A| + |B | |A B |:
 A B -

A B = {(a; b) : a A b B }:

A B  .
R R R2 .

( n) B n ,
B = {0; 1}.

63

.
   . 
  .

 .
   
, I.   ,   .
( I,

II)
(, I)
( III, IV)
(, II)
( III, IV)
(, III)
( III, )
(, IV)
(, )
(, IV)
(, VII)
(, )
( VII, V)
(, VII)
( V, VIII)
( , V)
( V, VI)
(, VI)
( VI, II)
( II, )
(, )
(, )
( , {)
({, )

, (x; y ) , x y , (x; y ) , x | y .
,  , , , , PROLOG.
,  
. , : I
III?, ,   ( I, 3)  .
  : ? | . ,    . ,  ? | (x, IV)
 IV?.
, , x ,  ,   .

64

3. 

1. :

() ? | ( II, );
() ? | (, II);
() ? | ();
() ? | (, II).
. 
,  . ,  ,  
.

,  .
  , 
 .    , ,
, .
,
 x,  (x; y ), .  (1)  , ,
x | y , x | .
(1) (x) from (x; y ).
,  (2),   .
, x | y , y | x.
(2) (y; x) from (x; y ).
2.  1?
 :

() ? | ({);
() ? | (, );
() ? | ().
.   () 1 -

,  (1),  :
(, IV).
 () , {   - .

65

() | ,   (, )  (2).
 (), 
 .
 ,   ,  (1):
(3) (y ) from (x; y )
, 
:
(3) (x; y ) from ( (x) (y; x))
3. :

() ? | ( IV);
() ? | ( IV, III);
() ? | ( IV, );
() ? | ( VIII, V).
.

()  (,
IV)   (3).
()  ( III,
IV)   ()
 (4).
  | .
,  () ()
  , , .  ,   
. , III, IV | , III. ,  (4)
  ().
() ,  VIII.  (3) 
? | ( VIII).

66

3. 

,  , , 
,  ,
 .
 
. ,    ,   .
, , , 
 (A) (B ):
(A) (x) from (x; y );
(B ) (x) from ( (x)).
 : ? | ( VIII),  ,   (A) (B ).  ? | ( VIII)  . ( VIII) .  (B )  ? | ( VIII)  ! ,    , 
.
4.   .   (x) ,   , x |
- x | - .   (1)
 .
  ?
.    :

(x) from ([ (x; y ) (z; y )


[ (x) (x; y )).
[ (x; y ) (z; y )  
: , , , . [ (x) (x; y )
.

67

 ,  . , , 
II.
 .
,  , .  ,  
 .

4

, , , , .
  (, )   ,
(, , . . ).     A B A B
 ,  ,
.
 S K . 
 S K    (s; k ), : s
k .  ... ...,
.

 .  
. ,   : .  , . . 
n-  
  .

4.1.
A B  R   A B . ,
A = B ,  R A.
4.1. ,

. 4.1.   ,
P :

4.1.

69

() R = {(x; y ) : x | y };
() S = {(x; y ) : x | y }.
&

&

&

4.1.

() R  : (, ), (, ), (, ), (, ), (, ) (,
).
() S : (, ), (, ), (, ), (, ), (, ), (, ), (, ),
(, ) (, ).
4.2.   ,  A = {1; 3; 5; 7}
B = {2; 4; 6}:

() U = {(x; y ) : x + y = 9};
() V = {(x; y ) : x < y }.
.

() U : (3; 6), (5; 4) (7; 2);


() V = {(1; 2); (1; 4); (1; 6); (3; 4); (3; 6); (5; 6)}.
4.3.
R = {(x; y ) : x | y }

 A = {1; 2; 3; 4; 5; 6}.
 , .

70

4.

. R : (1; 1), (1; 1), (1; 2), (1; 3), (1; 4), (1; 5),
(1; 6), (2; 2), (2; 4), (2; 6), (3; 3), (3; 6), (4; 4), (5; 5) (6; 6).

     ,  .  ,
 .
A B | R | . .   R
, ,   . 
, , , 
.
 V A = {1; 3; 5; 7} B = {2; 4; 6}  4.2 ().  . 4.2.
1

4.2.

A ,
A, , ,  ,
.
4.4. ,  R

 4.3.

. R |
A = {1; 2; 3; 4; 5; 6};

. 
. 4.3.

4.1.

4.3.

71

  . ,
 R A
B . 
- . :
A = {a1 ; a2 ; : : : ; an };

B = {b1 ; b2 ; : : : ; bm }:

 R  M n
m .  A,
| B ,
 . ,
 i- j -
M (i; j ),  :
M (i; j ) = ; (ai ; bj ) R;
M (i; j ) = ; (ai ; bj ) 6 R;

 n m .
, U  4.2() 
:
2

3

5
7

72

4.

  ,  .
.
4.5. R A = {a; b; ; d}

   A.  ,
 R.
. R  : (a; b),
(a; ), (b; ), (b; d), ( ; b), (d; a), (d; b) (d; d).
4.6.  ,  R
 4.3.
. R :

1
2
3
4
5
6

R | ,  (x; y ) R  x R y . ,  x |
y  .  4.3
 x | y  .
,  ,
:

(   );
 ;
;

4.2.

73

4.7. R A = {1; 2; 3; 4}  . 4.7.

 , 
R,  

.
4.3.
.   R = {(2; 1); (3; 2); (4; 3)}.

( 
) :
1

3
4

  
x y = 1:

4.2.
, .
, R A

, x A x R x;
, x R y y R x  x y A;
, (x R y y R x x = y ) x y A;
, (x R y y R z x R z ) x; y; z A.
   . R , (x; x) R
 x; ,
(x; y ) R , (y; x) R; ,
: (x; y ) R x 6= y , (y; x) 6 R; , (x; y ) R (y; z ) R (x; z ) R.

74

4.

, , , . . , . x
y ,  : y
x. , 
x  y , y x . , ,
, x y
y z x z .
, . , A , . .
.  , M , ,
, , (M (i; i)), ; M , . . M (i; j ) = M (j; i);  :

M (i; j ) = i 6= j M (j; i) = :
, .

4.8. (, -

, )
:
() x y ;
() x 6= y ;
() x  y
.
.

() x , . , , , , , 2
6, : 6 2. ,
. , x
y , y z .    , y = mx

4.2.

75

m, | z = ny , n | . , z = ny = (nm)x, . . x z . ,
. , ,  : x y y
x , y = x.
()  x 6= x , . ,  x 6= y
, y 6= x.
, , , 2 6= 3 3 6= 2, ,
, 2 = 2. , 
x 6= y y 6= x , x = y .

()  , x   .
,  x
 y y  x. , , x, y z ,
x  y ,
y  z , .  ,
.

R A
,   R ,
.       R A A ,  R
. , R
 R . , 
R R , , R R
.
, R R P ,
1. R P ;
2. R R ;
3. R  , R P .

76

4.

4.9. A = {1; 2; 3}, R A  :


R = {(1; 1); (1; 2); (1; 3); (3; 1); (2; 3)}:

, .
.
 (x; x). ,
:
.

R = {(1; 1); (1; 2); (1; 3); (3; 1); (2; 3); (2; 2); (3; 3)};

 .

, . ,
R = {(1; 1); (1; 2); (1; 3); (3; 1); (2; 3); (2; 1); (3; 2)}:

,  .  R  (3; 1)
(1; 2),  (3; 2). ,  (2; 3) (3; 1)  (2; 1),  (3; 1)
(1; 3) |  (3; 3). :
R {(1; 1); (1; 2); (1; 3); (3; 1); (2; 3); (3; 2); (2; 1); (3; 3)}:

 (2; 1) (1; 2). , R  (2; 2).  ,


 ( , 
 A2 ). ,
R = {(1; 1); (1; 2); (1; 3); (3; 1); (2; 3); (3; 2); (2; 1); (3; 3); (2; 2)}:

,   4.9,  . 8 ,  , 
.
 . , , . 
 , 
.

4.3. 

77

4.3.

 
 .
, A .  . (. .
), , - .
 .

... , ...
. , ,
.
R, : x R y ,
xy > 0 .
.
... , ...
. 
.
, ,
  . 
 . |
.
A    A1 ; A2 , . . . An A,
:
1) A = A1 A2 An ;
2) Ai Aj =  i 6= j .
Ai .
A   . 4.4. , ,

78

4.

. ,
.

4.4.

, R A . 
.
.   Ex  x A  Ex = {z A : z R x}.
.
R | 
A.  
A.
. .
,   A. , Ex | 
A. , R | , . . x R x. , x Ex Ex .
, x R y Ex = Ey . , x R y  z Ex .  z R x
x R y . R | , ,
z R y . , z Ey . , Ex Ey .
, Ey Ex , Ex = Ey , .
 ,  , , A .

4.3. 

79

. 
, Ex |  A 
 A. , x A, x Ex . , x  . ,
A  . ,
A  .
, ,  , . , .  . , Ex Ey 6= . 
z A,   Ex Ey . ,
z R x z R y .  R | , , x R z z R y . R, x R y .
,  , Ex = Ey . , , Ex Ey 
, .   . 
. 
, ,
A,   : , .
4.10. R  R
: x R y , x y | . ,
R |


, 0,

2.

.  x x = 0 Z
x, R . x y ,  y x = (x y ) . ,
R | . x y y z | .
 x z = (x y ) + (y z ) | , . . .
, R .

, , R , . , R | .
Ex 
x   :
Ex = {z R : z x | }:

80

4.

,
E0 = Z;

1
| } =
2
1
1 1 1 1
= {: : : ; 1 ; ; ; 1 ; 2 ; : : :};
2
2 2 2 2

= {z R : z 2 | } =

= {: : : ; 1 + 2; 2; 1 + 2; 2 + 2; : : :}:

E 1 = {z R : z
2

E2

, , R
A  .  , - . , 
,  .
.

6 ;
 ;
... ... .

   .
R |  A,
 x 6= y x R y x 
 , y |  . 
y  . x  y , z ,
x R z z R y , x   1 y  x y .
 
 , .  A,
x y , x  y
.
 ,    
.
1

 x. |

.  .

4.3. 

81

4.11. , ... ...   A = {1; 2; 3; 6; 12; 18}.

  ,
  .

.   .
 4.1

 

1, 2, 3

2, 3

12

1, 2, 3, 6

18

1, 2, 3, 6

6
18

12

3
1

4.5.

 A ,  
 .
.
6 ;
 .
 ,
.  .   , ,
 2 2

, . , Z  6 ,
. | .  .

82

4.

( ) (
 ).
  4.11
, , 1. , : 12 18.  .
 . ,
{1; 2; 6; 18}  ... ....

 4
4.1.    -

, :
a

2
3

4.2. -

N   ,  :
R ={(x; y ) : 2x + y = 9};
S ={(x; y ) : x + y < 7};

T ={(x; y ) : y = x2 }:

4.3. R | {1; 2; 3; 4},  : u R v , u + 2v |


. R :

()  ;
() ;
() .
4.4. ,

, :
() ... , ...;
() ... ...;
() ... , ...;
() ... , ....

 4

83

4.5. ,  Z

, , ?
() x + y | ;
() x + y | ;
() xy | ;
() x + xy | .

4.6.  ,  , {x : x Z 1 6 x 6 12}.

() R = {(x; y ) : xy = 9};

() S = {(x; y ) : 2x = 3y };

() R  ;
() S  .
4.7.  . 

 .

() x , y ;
() x = 2y N ;
() x < y R ;
() x y .
4.8.  , 




(a; a); (b; b); ( ; ); (a; ); (a; d); (b; d); ( ; a); (d; a) ;

{a; b; ; d}.
 ?

4.9.
A  ,
A:

() A | , R 
: x R y ,  x   y ;
() A = Z, R : x R y ,
x y | ;

() A | , x R y , x ,
y ;

84

4.

() A = R2 , R  : (a; b) R ( ; d) , a2 + b2 = 2 + d2 .
4.10. R Z  : x R y
, x2 y 2 3. ,
R 

4.11. -

 :

() {1; 2; 3; 5; 6; 10; 15; 30} x y ;


()  {1; 2; 3}
X |  Y .
4.12.  R A =
= {a; b; ; d; e; f; g; h}  . 4.6. R
 A.
g

4.6.

4.13. ()  : X Y

, , 
 .  X ( ), Y ,
X  Y ; X 
Y , , X  Y ,  , Y  X .

85

 : ,
, , . , 
.


A B
 R A B . A = B , , R | A.


 (   ),  ,  .
R A
, x R x x A;
, x R y y R x x; y A;
, (x R y y R x x = y )
x; y A;
, (x R y y R z ) x R z x; y z A.
R R P ,
1) R P ;
2) R R ;
3) R |  ,
R P .
, R A .
x A 
Ex = {z A : z R x}:

A    A1 ; A2 ; : : : ; An A, :
A = A1 A2 An Ai Aj =  i 6= j:

Ai   . R | A, A.

86

4.

, R
A . ,
 , ,
 .
 | ,   .

R |  A x R y ,
x 6= y , x  y . , x  y z , x R z
z R y , , x |   y . : x y .
 , -

 . ,
x y , x    y .

. 
, , . ,  
,
 ().
 4.2. T1 =

4000123

1.2.83

2 ,

5001476
5112391
5072411
5532289
5083001
5196236
4936201

4.5.84
21.3.84
12.12.84
15.8.83
9.7.83
21.3.84
7.10.77

4 ,
17 ,
21 ,
4 ,
18 ,
133 ,
11 ,

, , .
, . 4.2  : , , , ,  . . 4.3 
 .

. 

87

,   . ,   . 4.2
 
, . 4.2 ,  . 4.3.
 4.3. T2 = 

.
.

n ,  A1 ;
A2 ; : : : ; An     A1 A2 An .  n ,
 Ai ,  n-
.
, . 4.3  T 2
A1 A2 A3 A4 A5 , A1 | ,
A2 = A3 = A4 = A5 = {, , , }.
 | (, , , ,
),  , 
.
, ,   , : , .
 ,  , 
, .
  
. , (1, {, }) . 4.4.
1.
(2, {, ., . .}).
. . 4.5

88

4.

 4.4. T3 = (1, {, })

2 ,

4 ,
17 ,
21 ,
4 ,
18 ,
133 ,
11 ,
 4.5

.
.

 
,  , . , R S | , 
,  R |    A1 Am B1 Bn , S |  
A1 Am C1 Cp .  A1 ; A2 ; : : : ; Am . R S |
 A1 Am B1 Bn C1 Cp , (a1 ; a2 ; : : : ; am ; b1 ; b2 ; : : : ; bm ; 1 ; 2 ; : : : ; p ),
(a1 ; : : : ; am ; b1 ; : : : ; bm ) R, (a1 ; : : : ; am ; 1 ; : : : ; p ) |
 S .
, (3, 2) . 4.6.
 4.6

.
.

2 ,
18 ,

4 ,
11 ,
133 ,

. 

89

 ,
 . , (1, =  = ) . 4.7.
 4.7

5001476
5083001

4.5.84
9.7.83

4 ,
18 ,

2. (2, . . = ).
. (. 4.8) 2, ,  .

.
 4.8

.
.

,   .
3. ,   :
R1 = (T2, {, ., . });
R2 = (R1, . = . = );
. -, 2, , . . , . -

R1. ,
, ,
. R2 (. 4.9).
 4.9

90

4.

4.  :
R1 = (T1,  = );
R2 = (T2,{, . .});
R3 = (R1, R2).
. 1 , -

, R1.
2 , ,  R2.
R1 R2 .
R1 R2,  (. 4.10).
 4.10

4000123

1.2.83

5196236

21.3.84

4936201

7.10.77

2 ,

133 ,

11 ,

.
.

5.    (,  )  -

,   :
.
.   -

.
R1 = (1,  = );
R2 = (2, . . = . . = );
R3 = (R2, . = . = );
R4 = (R1, R3);
R = (R4,{, }).

,    , 
-  . 
 | ,   .
,  
 .  , 
,  , 4.
  .
   .   ,  .  , ,   . , 
, .
,    .   , ( ). , 
 .

5.1.

R | A B .  R1 B A  :
R1 = {(b; a) : (a; b) R}:

, ... ...
... ....
 , .

92

5.

. R |
A B , S |
B C .  R S
A C ,
S R  :
S R = {(a; ) : a A; C a R b; b S b B }:


A C ,  B .
5.1. R | a | b, S b | . 
 : S R S S .
. a | b, b | , a, ,
, . . a  . ,
S R , a | .
, S S |
a | .
5.2. , R S -

,  . 5.1. ,  S R.
a

5.1.

.  ,   ,  .
R = {(a; 1); (a; 2); (a; 3); (b; 2)}

S = {(1; y ); (2; x); (3; x)}:

  .
a R 1 1 S y (a; y ) S R;

a R 2 2 S x (a; x) S R;

5.1. 

93

a R 3 3 S x (a; x) S R;
b R 2 2 S x (b; x) S R:

 . 5.2  .
a

S R

5.2.

  , . ,
  .
  .
:
A = {a1 ; a2 ; : : : ; an }; B = {b1 ; b2 ; : : : ; bm } C = { 1 ; 2 ; : : : ; p }:

, R | A B , S |
B C . , M R 
:
M (i; j ) = (ai ; bj ) R;
M (i; j ) = (ai ; bj ) 6 R:

, N S   :
N (i; j ) = (bi ; j ) S;
N (i; j ) = (bi ; j ) 6 S:

bk B , ai R bk bk S j ,
i- M k - . , j -
N k - .

,     ai (S R) j , P (i; j ) P S R . i- M
, j -
N , P (i; j ) = .

94

5.

 , P  S R   :
P (i; j ) = [M (i; 1) N (1; j )

[M (i; 2) N (2; j )
::::::::::::::::::::::::::::::::::::::::

[M (i; n) N (n; j ):

 P = M N  .
5.3. R S |  5.2.
S R   R S .
. R A = {a; b} B = {1; 2; 3}

M =

 A B
, .
, S | B = {1; 2; 3} C = {x; y },


N = :

, P S R





:
P =

M , N | . P .
P (1; 1)    M  N . ,



P (1; 1) = = ( ) ( ) ( )

= = :

95

5.1. 

,  M
,  N .
: P (1; 1) = .
 M N , , 
. , P (1; 2) = .
 , M
 N ,  P (2; 1) = .
, P (2; 2) = , M N .
,



N =
:

5.4. R A = {1; 2; 3; 4; 5} -

 R R ,  R .
.  R R

 R R (x; z ), x R y y R z
- y A. R  R R  R. 
,  , , R R , R.  R
.

96

5.

5.2.
 
 , A B . |
,  .
A B ,  A
B . , a A  (a; b).
 ,
, A, .
, . 5.3 ,  {a; b; } {1; 2},  (a; 1), (b; 1)
( ; 2).
a

5.3.

5.5. ,
A = {a; b; } B = {1; 2; 3}
A B .

() f = {(a; 1); (a; 2); (b; 3); ( ; 2)};


() g = {(a; 1); (b; 2); ( ; 1)};
() h = {(a; 1); ( ; 2)}.
.

() f | ,  a B : 1 2.
() g .
() ,  b .

5.2.

97

5.6. :

() x | y ;
() Z, : {(x; x2 ) : x Z};
() R, : {(x; y ) : x = y 2 }
?
.

() , 
, .
() ,  
x x2  .
() |
, , ,
 : (2; 2) (2; 2) | .
,  (x; y ) x.
f | A B .
x A  y B , , (x; y ) f , : y = f (x), , f A B ,
f (x) x  f f ,
x.
,  f : A B , ,
f  A B . A   , B |
1 f .
 , 
A f , 
. , f
 B ,
x A. f (A) 
:
f (A) = {f (x) : x A}:
. 5.4 ,  A B .
1

, f  A
B . | .  .

98

5.

f(A)

5.4.

: A B

f : A B , A B | , .
 , , .

5.5.

= f (x)

, f : R R,
f (x) = x2 , . 5.5.  x

 R.  y (
R). , . . ,
(x; y )   R R, y = f (x).  ,
, f (2) = 4, (2; 4) ,
.
5.7. g : R R,
g (x) = 2 x.  x = 2
x = 3. .

5.2.

99

.  . 5.6. : g (2) = 0 g (3) = 1.


y

x
(2, 0)

(3, -1)

5.6. g (x) = 2 x

 .
f : A B | . , ,
f (a1 ) = f (a2 ) a1 = a2

a1 ; a2 A.

 ,
a1 6= a2 f (a1 ) 6= f (a2 );

. .  .
, .
f ,
, 
. , b B
a A, b = f (a).  , -  f .
f  ,
, .
5.8. , ,
. 5.7, , . .

100

5.

()

()
a

()

()

5.7.

() ,  1 a, b. ,
, 2 .
() ,  . , 
 .
() 1  a, b. , . , 
.
() , .
 () .
5.9. , h : Z Z, h(x) = x2 , .
. ,  f : R R, f (x) = x2 ,
 . ,  h

5.2.

101

. h, . 5.8,
.
y

1
x
-3

-2

-1

5.8. h(x) = x2 ,  Z.

, h ,
a1 6= a2 , h(a1 ) = h(a2 ).
 . , a1 = 2 a2 = 2.
 , , , h. -  
 . , 1, .
5.10. , k : R R, k (x) = 4x + 3, .
. , k (a1 ) = k (a2 ), . .

4a1 + 3 = 4a2 + 3:
, 4a1 = 4a2 , a1 = a2 . , k |
.
b R. ,
a R, h(a) = b. , a a = 14 (b 3).
, k | .
k ,
| .

102

5.

5.3.

, f : A B | .  f 1 .
  ,  f 1 : B A
.
f  (a; b), b = f (a). f , f 1  (b; a), a = f 1 (b).
, :
f (a) = b, f 1 (b) = a. ,  .
5.11.  5.8 ?
.  

, . , () .


 .
k : R R, k = 4x + 3 (.  5.10).
k :
x -

4x -
3

4x + 3-

: 4  3 |
: 4 3, .
 , :
1

4

(x 3) (x 3)

4


3

, k 1 : R R k 1 = 14 (x 3).
,  . y = k (x), x = k 1 (y ).
, y = 4x + 3. y , , x = 14 (y 3). , k 1 (y ) = 14 (y 3) ,   x , k 1 (x) = 14 (x 3),
.

5.3. 

103

, ,
, . : .
f : A B .
. f ,

. .

, .

f : A B | . , f 

 :

f = (a; b) : a A f (a) = b :

 :


f 1 = (b; a) : a A f (a) = b :

f , b B
a A, f (a) = b. , f a   b .
,  f 1 ,
B
A. ,  , , f 1
, .
 , . , f 1 | . 
b B a A, (b; a) f 1 . , (a; b) f , . . b = f (a).
f .
 f 
. , f (a1 ) = f (a2 ).  : (f (a1 ); a1 )
(f (a2 ); a2 ) | f 1 .  f 1 ,
: a1 = a2 , f .
 , f , .  : ,
, . 
5.12.
A = {x : x R x 6= 1}

f : A A :

f (x) =

x
x1

104

5.

, f .
. , f (a1 ) = f (a2 ). 
a1
a1 1

a2

a2 1

a1 a2 a1 = a1 a2 a2 ;

a1 = a2 . , f .
b A | f . a
A, : f (a) = b, . .
a
a1

= b:

 a,
a=

b
b1

a = bb 1 A, f (a) = b.
f .
, , f , . , .
 : f 1 (b) = a ,
f (a) = b. ,  f ,
a=

 , f 1 : A A,

b1

f 1 (x) =

. . f .

x
x1

  .
 , 
,  .
f : A B g : B C | , 
g f A C  (a; ),
b B (a; b) f (b; ) g . b = f (a)
  a,  f | . , = g (b)   b (g

5.4. 

105

). , = g (f (a))  a , , 
f g | .
,  g f : A C ,   (g f )(x) = g (f (x)).
5.13. : f : R R, f (x) = x2
g : R R, g (x) = 4x + 3. g f , f g , f f g g .
.  R -

R.

(g f )(x) = g (f (x)) = g (x2 ) = 4x2 + 3;


(f g )(x) = f (g (x)) = f (4x + 3) = (4x + 3)2 = 16x2 + 24x + 9;
(f f )(x) = f (f (x)) = f (x2 ) = x4 ;

(g g )(x) = g (g (x)) = g (4x + 3) = 4(4x + 3) + 3 = 16x + 15.


  .
 .   , sin x, log x, |x| . . ,
.
,
,   . |
 , ,  . ,  . 
 .

5.4. 
f : A B | ,  A, B | . , A n :
a1 ; a2 ; : : : ; an .  , |A| > |B |, 
f 1 .
,  ai 6= aj , f (ai ) = f (aj ).
1

 ,   
 : 10 9 ,
. | .  .

106

5.

 , ,
 i 6= j : f (ai ) 6= f (aj ). 
B  n :
f (a1 ); f (a2 ); : : : ; f (an ). , |B | > n,  : n = |A| > |B |. ,
ai ; aj A, f (ai ) = f (aj ).
5.14. 15 . , 

. A, 12 B .
f : A B , 
.  |A| = 15, |B | = 12, |A| > |B |.   f  , . .

 5.14 . 15 12 . , .
,  ,  . ,
,
   , , ,  . | . ,
  , , f ( A)
( B ).   .
5.15. -

 ,
,
?
. A | , B |

 ,  , 33 . f : A B
,   :   . ,
f ( ) = (; ). B 33 33 = 1 089 
.  , |A| > |B | = 1 089,

5.4. 

107

 , . 
1 090 2 .
5.16. ,  1, 2, 3, 4, 5, 6,
7 8 , ,
9.
.  , 9.

{1; 8}; {2; 7}; {3; 6}; {4; 5}:


A  ( ), B :


B = {1; 8}; {2; 7}; {3; 6}; {4; 5} :

f : A B , 
  B , . , f (3) = {3; 6}.  
A  . ,
 9.
 . f : A B , A B | . |A| > k |B |
k ,
f ,   k + 1 .
,
f  k , A
k |B | .
5.17. -

 ,
, 
?
. f : A B |  5.15.
, B 1 089 . 

 , , |A| > 4|B | = 4 356.  ,  4 357 .


2

, ,
 .  . | .  .

108

5.

5.18. , 
, , ,
.
. x | , A |   B = {0; 1}. 
f : A B  :
f (a) =

0; a x;
1; a x:

5 = |A| > 2|B |, ,


x, .
 , a, b x.
, 
.  , - , a b
. x. , : a, b x |
. ,
, x .
 ,     ,
, . ,  
A B . ,
, ,  
,  .

 5
5.1. R |

{1; 2; 3}

{1; 2; 3; 4};

 :


R = (1; 1); (2; 3); (2; 4); (3; 1); (3; 4) :
, S |

{1; 2; 3; 4}

{1; 2};

 5

109

:
S = (1; 1); (1; 2); (2; 1); (3; 1); (4; 2) :

R1 , S 1 S R. ,

(S R ) 1 = R 1 S 1 :
5.2. R | ... ..., S |

... ... .  : R1 , S 1 , R S , S 1 R1 R R.

5.3. , R | 
A, R1  A.

R R1 ?

5.4. R S M N ,

M =

N =

 M N . ?
5.5. A = {0; 2; 4; 6} B = {1; 3; 5; 7}.  A B
,  A B ?

()


(6;

() (2;

() (2;

() (6;


3); (2; 1); (0; 3); (4; 5) ;

3); (4; 7); (0; 1); (6; 5) ;

1); (4; 5); (6; 3) ;


1); (0; 3); (4; 1); (0; 7); (2; 5) .

, ?
5.6. , -

 Z, ,
, .
() f (n) = 2n + 1;

110

5.

() g (n) =
() h(n) =

n;

n ;
2
2n; n ;
n + 1;
n 1;

n ;
n :

5.7. :

() f : Z Z, f (x) = x2 + 1;

() g : N N, g (x) = 2x ;

() h : R R, h(x) = 5x 1;

2x 3 x > 1;
() j : R R, j (x) =
x+1
x < 1;

() k : R R, k (x) = x + |x|;

() l : R R, l(x) = 2x |x|.

, , (|x|
x,  x  x > 0 x  x < 0).

5.8. , ,  x ,  x, : x.

() A = {1; 0; 1; 2} j
k f : A Z 2 +1
x
: f (x) =
:
3
f .
() , g : Z Z,

jnk
g (n) =
2
, .

5.9. f : A B : f (x) = 1 + x2 , A

, 0,
B | 1. ,
f .

5.10. f : R R g : R R :
f (x) = x2

(
2x + 1;
g (x) =
x;

x > 0;
x < 0:

 : f g , g f g g .

 5

111

5.11. f : A B g : B C | . ,

() f g , g f ;

() f g , g f ;

() f g , (g f )1 = f 1 g 1 .
5.12. () ,

-   ?

() ,
: 
  ?
() 52 , 
?
() 52 , 
?
5.13. ,  79 ,

 2 .
() ,  ,
 , . .,
 ,
| .
() , 
.
5.14. S = {1; 2; : : : ; 20}.

()
S , 
22?
() , 11 S ,
 - .
(:  f ,  . , f (12) = 3.)

112

5.


R A B
R1 ; 
B A : R1 = (b; a) : (a; b) R .

R | A B , S | B C .  R S A C ,
 :


S R = (a; ) : a A; C a R b; b S b B :

M N | R S .  M N
 S R.

,  A B , f A B , 
A B .

 f : A B A B . A   f ,
B | f .  y = f (x),
, y B | f , 
x.  y x  f .

f  B :


f (A) = f (x) : x A (  ).

f : A B (
), f (a1 ) = f (a2 ) a1 = a2 a1 ; a2 A.
f : A B ,  . ,
b B a A, f (a) = b.
, , ,
.
f , f . f : A B

. 

113

, . f
f 1 : B A. f (a) = b, f 1 (b) = a.
 , f : A B | , A B ,
 |A| > |B |,  f
. |A| > k |B | k ,
f   k + 1 .

.

  ,
  .  
  , ,   
.
  ,  . ,  ,    .
 ,  ,  
.


C = ; ; ; : : : ; | 
 , P
0; 1; 2; : : : . S () . , | S,  .
,   :
har

: S C,

har(s)

|   s.

: S S, rest(s) | ,  
s  .

rest

add har : C S S, add har( ; s) | ,  s .


len

: S P,

len(s)

| s.

114

5.

 ,
, . ,   ,
|  .
1.
har(s),
len(rest(s))


add har har(s); add har

s = .


,

rest(s)

.
har(s)

= har() = ;

len(rest(s))

= len(rest()) = len() = 2;


add har har(s); add har ; rest(s)
=


= add har ; add har ; rest() =

= add har ; add har(; ) =
= add har(; ) = .

2. 
add har( har(s); add har( ; rest(s)));

s |   , | .
.   ,
  
s.
3. third : S C  -

 .
third har rest.
.   s   ,  s

 .

third(s)

= har(rest(rest(s))):

. 

115

4.   ,
reverse2 : S S,  

2 .

s | . har(rest(s)), | har(s).
 rest(rest(s)). , reverse2(s)
:
.

add har( har(rest(s)); add har( har(s); rest(rest(s)))):

5. , s = .
Input s

begin
u := ;
t := s;
i := 0;
while i < len(s) do
:= har(t);
t := rest(t);
u := add har( ; u);
i := i + 1;
end
Output u

?
.  , t, u
i while 

. 5.1

 5.1


0
1
2
3
4






0
1
2
3
3

i <

4?

 .

116

5.

,  . , rest 
s = , reverse2  2. , ,
.  . ,
 .
, rest   :
rest : S S,
: s S s 6= ,
rest(s) | ,  s,  .
 , . , ,
rest(rest(s))  1 ,
  rest rest | s S len(s) > 1.

6

 ,  . ,
, 
. ,  ( 3)   ( 5).
,    : 
.

.  
 , :
 , 
.  
.    ,  .
,  
:
(x1 + x2 + + xk )n :

 , .
 ,
. 
 ,  .

6.1. 
  .
1.

: ,
.   
 . 
?

118

6.

2. ,
 .  6 9 .
 ?
3. 3 4?
 .  ,  .
4 + 2 + 3 = 9 , 
.
6 ,
 ,
  .  ,
, , 6 9 = 54.
 .
, A B | , n1 A, n2 B ,
A B n1 + n2 .
 ,  k n1 , n2 | , . .,  nk ,
 k 
n1 n2 nk .

,  , | . , A B
, |A| = n1 , |B | = n2 ;  A
B , , . , 
, |A B | = |A| + |B |, . . A B
n1 + n2 . , n1 + n2
A B .
 . A1 n1 
, A2 | n2 , . . 
 k
 A1 A2 Ak ,
|A1 | |A2 | |Ak |.
 .
  , .  , , -

6.1. 

119

 .
, 3, | 4.   ,  (
3), 10 10  .
  , 
1 10 10 = 100. 
. 100. ,
  , 100 + 100 = 200 , 3 4.
6.1. .

, . 
?

, 3 4 = 12 1 . 3 2 = 6 .
, 4 2 = 8 . ,
, ,
12 + 6 + 8 = 26.
6.2.


( ). ,  . ?
. 33

.    33 33 33 = 35 937. ,
 10 10 10 = 1 000. ,

,   : 35 937 000
.

 :  .
, . | .
 .

120

6.

6.2.
,  : (A), - (B )
 (C ). 
?

. , ,
. ,
, . . AA? ,
 ? ,
AB BA ?
 .
1.  .
9 : AA, AB , AC , BA, BB , BC ,
CA, CB CC .
2.  , 
. | 6 : AB , AC , BA, BC ,
CA CB .
3. ,  .
 | 6 : AA, AB , AC , BB , BC
CC .
4. , , , 
,
: AB , AC BC .
 
,  . 
, .
 . , x1 ; x2 ; : : : ; xk X k .
 k n , , (n; k )-.  ,  .
 , 
, .  ,  .  
,  .

6.2.

121

(n; k )-   (n; k )-, ;


(n; k )-   (n; k )-,  ;
 (n; k )-  (n; k )-  ;
 (n; k )- 
(n; k )-  .
  (n; k )- .   n . 
,  
, . . k
,   , , (n; k )-  nk .
6.3.  
N . (+ ),
N 1 . -

 ?

. | 0 1.   N . , , -

,  , 
, , .
(2; N )- . , 2N .

, :

000000 00

+ 000000 00;

0. ,  
(2N 1) .

(n; k )- 
 1 : P (n; k ). .   n . ,

 .

k
An

. |

122

6.

(n 1) . | (n 2) ,  k - ,
 (n k + 1) . 
  .
P (n; k ) = n(n 1)(n 2) (n k + 1):

 ,  1 n n n!.  
P (n; k ),  , .
P (n; k ) = n(n 1)(n 2) (n k + 1) =

(n k )(n k 1) 2 1
=
(n k )(n k 1) 2 1
n(n 1)(n 2) (n k + 1)(n k )(n k 1) 2 1
=
=
(n k )(n k 1) 2 1
n!
=
:
(n k )!
= n(n 1)(n 2) (n k + 1)

, (n; k )- 
P (n; k ) =

n!

(n k )!

6.4.

,  : , , , , 
   ,
 .
. ,  
 ,
.   P (6; 4). ,
P (6; 4) =

6!
6!
654321
=
=
:
(6 4)!
2!
21

 :
P (6; 4) =

6 5 4 3 6 2 6 1
= 6 5 4 3 = 360:
6 2 6 1

6.2.

123

 , . . ,
  .
(n; k )-  2 C (n; k ).
.
 : (n; k )n! .  P (n; k ) = (n
k)!
 
, P (n; k ), , C (n; k ).
 ,  .
. n = 4, k = 3. A = {1; 2; 3; 4}, .
(4; 3)-  | 
,  ,
, . ,  {1; 2; 3} (4; 3)- .  {2; 1; 3}, 
( ),
( ).   ? ,  .
(n = 4, k = 3) , 
. . .

(n; k )- , . .  B A, |B | = k |A| = n.
 (n; k )- ?
,  (k; k )-
! (, .) 3 :
P (k; k ) =

k!
= k !:
(k k )!

 , (n; k )-   k ! (n; k )- . ,
C (n; k ) =

P (n; k )
k!

n!

(n k )! k !

k

`n Cn ,  ,
 , : k . | .  .
3
, 0! = 1. | .  .

124

6.

6.5.
. 
?
. (7; 3)- -

.  :

C (7; 3) =

7!
7654321
7!
=
=
=
(7 3)! 3!
4! 3!
(4 3 2 1)(3 2 1)
7 6 5 6 4 6 3 6 2 6 1
7 6 6 5
=
= 35:
(6 4 6 3 6 2 6 1)(3 2 1)
6 3 6 2 6 1

, 35 .
, , . , ,  ,  . 
,  , 
,  - .
, , ,
 , a, .
, , ,  ||,
: ||. ,  , ,  |
, , ,  , .  , ,
( ), 
,
. ,   , 
. ,
, (7; 2)- , . . C (7; 2). ,  
, | ,  . 7 6 . ,
 ,   . , 7 6 2. ,

6.2.

125


76
7654321
=
=
2
(2 1)(5 4 3 2 1)
7!
7!
=
= C (7; 2):
=
5! 2!
(7 2)! 2!

(n; k )- 
(k n ), ,  n 1 k .  , (n 1) + k
. , (n; k )-    (n 1) (n + k 1)
. , (n; k )- 
C (n + k 1; n 1) =

(n + k 1)!
(n + k 1)!
=
:
(n + k 1 (n 1))! (n 1)!
k ! (n 1)!

6.6. , -

 ?

.  -

, . . .
 ,   ( 6
) , . . (6; 5)- . ,
C (6 + 5 1; 6 1) = C (10; 5) =

10!
= 252:
5! 5!

. 6.1  k n- ,
.
 6.1

k
n

(n + k 1)!
k ! (n 1)!

n!
(n k)!

n!
(n k)! k!

, ,  .

126

6.

4  49 . ,  ,
, .
. | 
49 . (49; 6)-

49!
49!
=
= 13 983 816;
(49 6)! 6!
43! 6!
 : 1 13 983 816. ,  , .
, , ,  , .
,  , ,
,   , 
.
, ,
 . ,
 , $1 ( ), ,
( ) , $10. $10.
, :  . C (6; 3) ,
, C (43; 3) .  , $10,

6!
43!

= 246 820:
C (6; 3) C (43; 3) =
3! 3! 40! 3!
| 
, . .
246 820
1

0; 018:
13 983 816
57
4

 . |

.  .

6.2.

127

6.7. , , -

.
12 ?
() , ;
() , ;
() , , ?

.
C (12; 5) =

12!
= 792
7! 5!

() , .
10!
= 120
7! 3!
. , 120
.
C (10; 3) =

() ,
.
10!
= 252
5! 5!
, ,
.
C (10; 5) =

()  
 , , .
C (10; 4).  ,
. , 2 C (10; 4)
, , .
 , 792
: (), () (). ,
, ,
792 120 252 = 420:

128

6.

6.3.
C (n; k ) 
(a + b)n . ,
(a + b)3 = (a + b)(a + b)(a + b) =
= aaa + aab + aba + abb + baa + bab + bba + bbb =
= a3 + 3a2 b + 3ab2 + b3 :
, ,   ,  . , ,
 a b. 
, C (3; 2) = 3 
,  b ( a).
 : C (3; 0) = 1, C (3; 1) = 3, C (3; 2) = 3 C (3; 3) = 1.
 C (n; k ),
 , , 0! = 1.
, .
, (a + b)n ,
 ank bk ( k 
0 n)   b, k , a,
(n k ) .  C (n; k )
 k n, C (n; k )
ank bk  k = 0; 1; : : : ; n. ,

(a + b)n = C (n; 0)an + C (n; 1)an1 b + C (n; 2)an2 b2 + + C (n; n)bn :

.  C (n; k ) .
 (. . 6.1).
C (0; 0)
(1; 0) C (1; 1)
C (2; 0)
C (2; 1)
C (2; 2)
C (3; 0)
C (3; 1)
C (3; 2)
C (3; 3)
C (4; 0)
C (4; 1)
C (4; 2)
C (4; 3)
C (4; 4)
C (5; 0)
C (5; 1)
C (5; 2)
C (5; 3)
C (5; 4)
C (5; 5)
C

:::

C n;

0)

:::

C n;

:::

1)

:::
:::

:::
:::

:::
:::

:::
:::

:::
:::

:::

C n; n

6.1. 

:::

1)

:::

C n; n

6.3.

129

(n + 1)- ,  
(a + b)n .
 , 

1
:::

1
5
:::

1
4

1
3
10
:::

1
2
6

1
3
10

1
4

:::

1
5
:::

1
:::

 C (n; 0) = C (n; n) = 1, . :
C (n; k ) = C (n; n k );

 C (n; k ).
, 
. ,  , , 
, .
:
C (n 1; k 1) + C (n 1; k ) = C (n; k );

  0 < k < n.
 :
(n 1)!
(n 1)!
+
=
(n k )! (k 1)! (n k 1)! k !


1
(n 1)!
1
=
=
+
(n k 1)! (k 1)! n k k


(n 1)!
n
=
=
(n k 1)! (k 1)! (n k )k

C (n 1; k 1) + C (n 1; k ) =

n!

(n k )! k !

= C (n; k ):

,
 . , 

130

6.

7! . .
 ,
 .  
3!, | 2!, 
7!
= 420
3! 2!
.
 .
.
n!
n1 ! n2 ! nr !

 n , n1
 1, n2 |  2, . .  nr  r .
6.8.   15 -

    ?

. 15 ,
  .

15!
= 68 796
5! 5! 5!
.

n1 ! n2n!! nr ! .
  xn1 1 xn2 2 xnr r 
(x1 + x2 + + xr )n .
,  xn1 1 xn2 2 xnr r ,   x1 , n1
, x2 , n2 , . .  ,  xn1 1 xn2 2 xnr r  n
, n1  , n2 | . .
6.9.

()  x3 y 2 z 4  (x + y + z )9 ;
()  x3 y 2  (x + y + 3)7 .

 6

131

()  x3 y 2 z 4  (x + y + z )9

9!
= 1 260:
3! 2! 4!
()  x3 y 2 z 2  (x + y + z )7

7!
= 210:
3! 2! 2!
 (x + y + z )7 210x3 y 2 z 2 :
z = 3, ,  (x + y + 3)7
 1 890x3 y 2 . ,  x3 y 2
 (x + y + 3)7 1 890.

 6
6.1. ()  ,

. ?

() , 
. ?
() . ,
 .
?
6.2. () | , -

, 
.
? ?

() ,  6 000,
,  ?
() ,  ,
. | ( 26 ),
, .  ?

132

6.

6.3. S | , -

 : 0, 1, 2, 3, 6,  0
 , , .
() S ?
() S 
 ?
()  ()?
()  () , 4 000?

6.4. :

() P (7; 2), P (8; 5), P (6; 4) P (n; n 1);

() C (10; 7), C (9; 2), C (8; 6) C (n; n 1).

, C (n; k ) = C (n; n k ).

6.5. ()  -

,
 ?

() 20  .  ?
() ,  ,   6.2 (). 
  ?
6.6. () 18 . -

.
.

() 5 7
 8 11 .
?
()
   .
 ?
 ?
6.7.  -

,   , -.
() ?

 6

133

() ,
 -?
() , ?
() ,

?
6.8. -

,  | , | .
 
. 
,
()    ;

()    ;
()  ?
6.9. ()   -

.  .
 ?

()  . ?
6.10.   ,

   .

()  ?
() ,
 , 
 ?
6.11. :

21

35

35

21

1:

() .

134

6.

() , a, b | 
,  :
a + 2b + .
() 
:
C (n; k ) + 2C (n; k + 1) + C (n; k + 2) = C (n + 2; k + 2)

 0 6 k 6 n 2.
( ()
.)
6.12. () a = b = 1, ,
n = 0; 1; 2; : : :  :
C (n; 0) + C (n; 1) + + C (n; n) = 2n :

, S n 2n .
(:  ,  k S .)
() ,
C (n; 0) C (n; 1) + C (n; 2) + (1)n C (n; n) = 0:

6.13. () 

?
() ?
() ?
6.14. ()  a3 b5 
(a + b)8 .

()  xy 3 z 4  (x + y + z )8 .
()  xy 2 z 
(x + 2y + z 1)5 .

135


, A B | ,  n1 A n2 B ,
A B n1 + n2 .
 ,  k n1 , n2 | , . .,  nk ,
 k 
n1 n2 nk .

k S n. 
  ,  (n; k )-,  | (n; k )-.
  ,  
, .  
.
| :

(a + b)n = C (n; 0)an + C (n; 1)an1 b + C (n; 2)an2 b2 + + C (n; n)bn ;

n!

C (n; k ) =

(n k )! k !
(n; k )- (n; k )-,
, . 6.1.
 6.1

k
n

(n + k 1)!
k ! (n 1)!

n!
(n k)!

n!
(n k)! k!

  ,
n!
n1 ! n2 ! nr !

 n , n1
 1, n2 |  2, . .  nr  r .

136

6.

.
|  .    . ,
, , . 
  ,   .
, , X , n ,  
 . X 
, , . . ,  X
, , . ,
 n . ,  ()  X , ,
 ,  , (  )  .
   . . ( ) 
1 + log2 n . . 6.2, 
, .
 6.2
n

1 + log 2 n

8
64

4
7

218 = 250 000

19

, log2 2k = k .
1.  A, B , C , D E
n, 3n2 , 2n2 + 4n, n3 2n  .
,  n = 1,
n = 10, n = 100 n = 1000,  -

1 .

. . 6.3.

, ,  n ( ), , n  -

137

( ).   n.
 n,
 (. B C ).
 6.3
A

1
10
100
1000

3n

1
10
100
1000

3
300
30
0,83

2n + 4n

2n

6
240
20,4
0,56

1
1
0,28
11,6

2
1,024
4 1017
10176

, f (n) g (n) , 

. ,  f (x)
, g (x),  C , |f (n)| 6 C |g (n)| n.
1 f (x) = O (g (n)).
2. , 2n2 + 4n = O (n2 ).
.  n 6 n2  n > 1, ,

2n2 + 4n 6 2n2 + 4n2 = 6n2


n N. ,  C = 6   , , 2n2 + 4n = O (n2 ).
, , n2 6 2n2 + 4n  n > 1. , n2 = O (2n2 + 4n). , n2 2n2 + 4n,
 ,  . , B C 1  ,
,
.

,   1

, O(g (n)) , ,
g (n).  , ,
. | .  .

138

6.

, .  :
2
3
: : : nk : :}:
2n
|n n n {z





log n

 , (n log n) n n2 , (n2 log n) n2 n3 . .


,
,  . ,  ,
 n.  
. 6.2.
 
f (n)  g (n) 
, f (n)  g (n),
, , g (n). , 
( )  

.
, , f (n) = 9n + 3n6 + 7 log n. ,
 ( ,
) 
. 9n = O (n), 3n6 = O (n6 ) 7 log n = O (log n).
n log n  , n6 , , 9n, 7 log n  O (n6 ). , f (n) = O (n6 ), f (n)
3n6 .  , f (n)
, n6 . , 
f (n)  , n6 .
3.  , ,

  
:
() n4 + 2n3 + 3;
() 6n5 + 2n ;
() 5n + n2 log n.

()  O (n4 ),  n4 |
.

139

()  O (2n ),  2n |
.
()  | n2 log n.  , , n2
n3 . , ,
, , O (n3 ).

6.2. 


, ,  n 
 .

140

6.

4. 

,  ,    x := x + 1, .
begin
for i := 1 to 2n do
for j := 1 to n do
for k := 1 to j do
x := x + 1;
end
. (  i)  2n . ,   j ,  n
. j  x := x + 1  j .
,   i
 x := x +1  1+2+ + n , 12 n(n +1).

T (n)  :
T (n) = 2n

, T (n) = O (n3 ):

1
n(n + 1) = n2 (n + 1):
2

, , ,  
. ,
,  . 7.1. :   ,
,    , , . ,
, , | ,
.  7.1, ,
.
C
c

g
d

A
e
D
a

b
B
f

7.1.

,  , ,  . , 
, . | ,  , .  


142

7.

 .   , .

7.1.
. 7.1 ,
 . , , : ,  
?
| ,
, . A, B , C D
, a, b, , d, e, f g
(. . 7.2). (
) ,
 . , ,
  .
C

7.2.

, , ,  
, . ( ),  , , .
, ,
, - , ,
1 ,   1
,  ,
. | .  .

7.1.

143

: ,
 .
,  , ,   ,
, .  v (v ) , 2.
 , ,
, . ,  : (B ) = (C ) = (D ) = 3
(A) = 5. ,  ,
 ,    ,
.
  G = (V; E ), V | , E | ,  G  (, ) ( ,  ).
, . 7.2, , ,
, A B (
).
u v  ,
- e,  ,
u ( v ).  ,  E  ,
 ,
V . ,  , . . ,
.
, e, u v , v u
( , , . . ).
 ,  u
v , uv ( vu).
,
, .
M , M . -

M .
2

, v x, ,
. | .  .

144

7.

7.1. G(V; E ) V =
= {a; b; ; d; e} E = {ab; ae; b ; bd; e; de}.  .
. G  . 7.3.
c

7.3.

:
a
b

d
e


, .

G = (V; E ) G = (V ; E ),
E E V V .
7.2. H , K L,
. 7.4,  G.

G, H K 
. 7.5. H K |  G,
. L  G, 
4, G .
.

k G  v0 ; v1 ; : : : ; vk , i = 1; : : : ; k 
vi1 vi .
v0 v1 : : : vk . , 1 4 3 2 5 | 4
G  7.2.

7.1.

145

7.4.

 

v0 ; v1 ; : : : ; vk ,  ,
 v0 = v1 , ( ) .

, | , 
.

7.5.

7.3. G  7.2.
. 5:

132541

1 2 5 4 3 1:

 , -

146

7.

,  . ,
4:
1 2 5 4 1;

12341

2 5 4 3 2;

3:
1231

1 3 4 1:

, , . , , 
.
.
, 
- . , .

(G).    .   .
.

G = (V; E ) | .  = (G), . . 
G.
begin
V := V ;
:= 0;
while V 6= do
begin
y

V ;

, y ;
y V

E ;

end

:= + 1;

end
7.4. -

, . 7.6.

7.2.

147

7.6.

. . 7.1.
 7.1
V


y = 1
y = 2
y = 7

{1; 2; 3; 4; 5; 6; 7; 8}
{2; 4; 5; 7}
{7}

0
1
2
3

, (G) = 3.   . 7.7.

7.7.

7.2.
, ,   .  , 

148

7.

.  , , ,
| .
  , , . .
, 
 .
.
 , . , -  .
  Kn , n |
. ,  .
K5 . 7.8. a b d e a,
, . . ,
a,
. , 
a.  , 4 3 2 = 24
.  , , K5 12
1 .

7.8.

K5

( ) 
() | . 
.
1

 : a b
, . | .  .

d e a

a e d b a

7.2.

149

7.5. , , . 7.9,

7.9.

. , . v C , ,  ( ) 2.  | 2 3.  2
. , ab, ae, d, b, hi, hg ij 
C (. . 7.10).
bf C ,   2. , f j
f g C , f .
je gd  C ,     .
ed, 
: , , , ,
. : , . 7.10,
.


 . , 
.

150

7.

  ,  ,
  .

7.10. ,

, , |
. , ,  ,   , , , ,  2 .
.
,
 . ,
 ,  .   . 
, , ,
,  ! .
.

 ,
2

, ,

.  .

7.2.

151

V . ,  ,   , |  w.
begin

end

v V ;
:= v ;
w := 0;
v := v ;
v ;
while do
begin
u,
v ;
:= u;
w := w + v u;
v := u;
v ;
end
:= v ;
w := w + v v ;

7.6. , . 7.11. D.
B

5
7

8
6

10

7.11.

. . 7.2.
 7.2
u

DC

DC A

DC AB

DC ABD

0
3

9
14
24

A
B
B

152

7.

DCABD 24.  

, : ABCDA 23 ACBDA 31.


  6; 1 1016 , 
 .

7.3.
 , ,
,  . G = (V; E ) ,
(. . ).
G = (V; E ) | n m . ,
 G :

 G .
G m = n 1.

G , .
G , , G
 .

. .
 , n
n 1 .
7.7.   ,
T n m  :
m = n 1.
. ,   n = 1.
T n ( m ), n > 1
, k < n
k 1 .
T . T 
  .
 , (  T

7.3.

153

).  ,   | .
T1 T2 . n1 |
T1 , n2 | T2 . n1 + n2 = n, n1 < n
n2 < n.
 T1 n1 1 , T2 |
n2 1. , T (
) (n1 1) + (n2 1) + 1 = n 1 ,
.
, , . G,
G, 
.
G :   ,  , ,  ,   .  7.7,
,  n
n 1 .
7.8. , -

. 7.12.

7.12.

. .
  : a, b, d
f . | b, , e g .  . 7.13.

,   7.8,   :

 , .   . 
.

154

7.


.  
, , .
, , .
 ,  1
 
.

7.13.

 .
G = (V; E ) | .
G, 

.  
T .
begin
e := G ;
T := {e};
E := E \ {e}
while E 6=
begin
e := E ;
T := T {e };
E := E \ {T },
T
;

end
end
7.9. . 7.3 ( ) 
A, B , C , D E . .

7.3.

155

 7.3
A

|
13
3
9

13
|
11
11

3
11
|
9

9
11
9
|

9
13
7
2

13

A
B
C

. :  |
DE 2; | AC 3; | CE 7.

, . 7.14

7.14. 

 | AD , AE CD ,
9. , 
. 
 . BC BD 11.
 ,  
: {AC; BC; CE; DE } {AC; BD; CE; DE } 23 .

,  , ,
, , (. 7.15). 
, .
. ,
 . 7.16,   .
.
. , , (, ). ,   , . , ,   , .

156

7.

. 1623

I
. 1654

I
. 1662

II
. 1687

I
. 1667

III
. 1695

I
. 1700

II
. 1710

7.15.

7.16.

 . ( ). T1 , T2 , . . . , Tk |
v1 , v2 , . . . , vk , ,   v v1 , v2 , . . . , vk , T v . v1 , . . . , vk
T | v .
,  , , ,   (. . 7.17).
,
.  T .
, | , , (
)  . , , .
 . , , , , . 

7.3.

157

. ,
.
.

7.17.

 , , , ,
   .
, -  ,  (. .
| ). ,  ,  
.
7.10. T | ,

. 7.18.

7.18.

158

7.


()
()
()
()

T ;
 B ;
T ;
C .

T ,  T    .
. () A; () D ; () G, H , E , I J ; () F .
T . 7.19.

7.19.

 7
7.1. ,   
G  .

 , , 
n(n1) .
Kn n
2

n Kn ?

7.2.    , , 
G , 

.

 7

159

7.3. , :

  Kn .
7.4.  , -

. 7.20   .

7.20.

()

()

()

7.5. . 7.21 

 7.3?

7.21. 

160

7.

7.6. . 7.22.

7.22.

3, 4, 5, 6 7.
7.7. . 7.23 P .

7.23.

9. , P
.
7.8.   -

(. 7.24),

() A;
() D .

 7

161

7.24.

7.9. , , -


()


()

, :

7.10. , T  3 -

 2.
 1.  1 T ?
(: T n  .)

7.11. ( ),  | . G | n
k  .

() , G n k .

() , 
G , G 
2k  1.

162

7.

() ,
  1.
7.12. , -

. 7.25.

7.25.

7.13. . 7.4  ( )

 7.4

|
78
56
73
71
114

78
|
132
121
135
96

56
132
|
64
85
154

73
121
64
|
144
116

71
135
85
144
|
185

114
96
154
116
185
|

  , , .
7.14. v T  -

 .
T | .

163

() :
(i) 1 ;
(ii)  2;
(iii) 3,
i (i > 0) (i + 1) .
()  n, 
n 2n .
( ,
( )  .)


G = (V; E ) V ,
, E , -

 .

u v ,
- e,  , u v .
 v (v ) , v .

, ( ),

  ,
.
, .
,   G = (V; E ) .
 G = (V; E ) V E ,
 .

 G, , .

164

7.

G = (V; E ) G = (V ; E ),
E E V V .
k 
v0 ; v1 ; : : : ; vk , 
vi1 vi .
v0 ; v1 ; : : : ; v0 , -

,  , .
, , .

,  -

   .
, 
,  . , , .
 .  

G = (V; E ) . G = (V; E ) n m
:
() G | ;
()  G ;
() G m = n 1;
() G , ;
() G ,  ,
 .

. 

165

G , G.   -


  .
, | . ,   v ( ), v . ,  ( ), .
, ,
. | ,
.

T - ,  T .
,  v  , v . ,
, , 
.
v T  , .
T .

. 
  , , ,   .
 , ,   , 
( ),
. , ,
 v , , ,  
 | . ,
,  .

166

7.

, ,  . 7.26,
    . ,   ( ) ,
,   .






7.26. 

   - ,  ,  .
, 
( ),
 .  , -   .  ,  , 
  .
  (  ), .
,     . , 

  (  ).

. 

167

 (
 ).
 ,  (
 ) ,  , ,  ,
 .
()
begin
if then
 := ;
else
if  = then
 := ;
else
if  < then
 :=  ( );
else
 :=  ( );
end
1.
, . 7.27. ,  |
R,  .
. R > K ,     K .  R < T ,   
 T . , R 6= M
 M ,

, .

K
T

C
M

7.27.

( )
,   . ,

168

7.

  .
(, )
begin
if then
;

else

if = then
:
 ;

else

end

if < then
:= (; );
else
:= (;  );

2. 
R, A L 1.
. R > K , 
  K . , R < T . -

,   T .  R > M   M ,
R  M  , . 7.28.  A L,  , 
. 7.29.

K
T

C
M

V
R

7.28.


,  . ,

. 

169

 . 7.26     
 , .

K
T

C
M

V
R

L
7.29.

  , , . 
. . , ,  ,
. , , , ,
 .
()
begin
if then
;

else
begin
 ( );
 ;
 ( );

end
end
3.  ,  2  R, A L.
.  :
A; C; K; L; M; R; T ; V:

170

7.

 (. 7.30)
 , ,
  .

K
T

C
M

V
R

L
7.30.

8


 4
  . ,
,  ,  . 
,  
.
.  |
 .
PERT | Program Evaluation and Review
Te hnique.  
 - .
    .
 
( ( ) , ). 8.2  , . , , ,
4.2. ,    .
, 
.

8.1.
  G =
(V; E ), V | , E |
V .  ( ),  . 
E .
,  (u; v ) u v G, uv .  

172

8.

. ,  u v uv u v ,
vu v u. uv | , u
v .
. 8.1   
V = {a; b; ; d} E = {ab; bd; b; db; d }.

8.1.

()

a

b


d

( a, d | b).
k  v0 ; v1 ; : : : ; vk ,  vi1 vi
(i = 1; : : : ; k ).
G  
v0 ; v1 ; : : : ; vk , ,  v0   vk , 
. G , .
 ,
   (  ,    ).

.

8.1.

173

8.1.  

, ,  ,
.  . 8.1. ,  .
 8.1


(A)
(B)
(C)
(D)
(E)
(F)
(G)
(H)

B
C
H
C
D, G
E
C

.  (. . 8.2) |  , -

 .
| . A H.
 ,
.

8.2. : 

,  8.1 
, ,

174

8.

.   .  , 1, 2, 3, . . . , n |
uv | , u i v
j , i < j .
 .  G = (V; E ).
v  A(v ).
begin
for v V do

A(v );

label := 0;
while ,
A(v ) = do
begin
label := 1;
u := A(u) = ;
 u;
for v V do;
A(v ) := A(v ) \ {u};

end

end

  .  , .
8.2.  , -

. 8.2.
.
0

A(A) = {B}, A(B) = {C}, A(C) = {H}, A(D) = {C},


A(E) = {D; G}, A(F) = {E}, A(G) = {C} A(H) = .

 while. 1 H
H A(v ).
A(A) = {B}, A(B) = {C}, A(C) = , A(D) = {C},
A(E) = {D; G}, A(F) = {E} A(G) = {C}.
 while. 2
C C A(v ).

8.2.

175

A(A) = {B}, A(B) = , A(D) = , A(E) = {D; G},


A(F) = {E} A(G) = .

  while.   :
 ? ,   . , , 3 B,
B A(v ). A(A) = , A(D) = ,
A(E) = {D; G}, A(F) = {E} A(G) = .
 while. 
. 4 A A A(v ). A(D) = , A(E) = {D; G}, A(F) = {E}
A(G) = .

 while. 5 D
D A(v ). A(E) = {G}, A(F) = {E}
A(G) = .

 while. 6
G G A(v ). A(E) = , A(F) = .

 while. 7 E
E  A(v ). A(F) = .

 while. 8 F.

,  : H, C, B, A,
D, G, E, F. , ,
.

8.2.
 
, , .  (
)  .
,  
  ,
 :
 . ,  
,  .

176

8.

 ,   
  .
G = (V; E ) | n , M |
. ,  i-
j - i
j . ,  ,  1.  M
M 2 . 
2. M 3 = M M M  
3, , M k  k .
,
M = M M 2 : : : M n

  .
,
  , |  
. ,

a11

a12 : : : a1(n1)

a1n

b11

b12 : : : b1(n1)

b1n

a21 a22 : : : a2(n1) a2n

b21 b22 : : : b2(n1) b2n =


::: ::: :::
::: ::: :::
:::
:::
:::
:::
am1 am2 : : : am(n1) amn
a11 b11
a21 b21
=

:::
am1 bm1

bm1 bm2 : : : bm(n1) bmn

a12 b12
a22 b22
:::
am2 bm2

:::
:::
:::
:::

a1n b1n
a2n b2n
:

:::
amn bmn

G = (V; E )  E E
G.
8.3. , -

. 8.3.

.  .


M =

8.2.

177

8.3.


M2 =

, M 2  2
G, : a b , a b d b d .
  M .

M3 =

:


,

M =

, ,  M  M 2  a b d.
M  M   .   M
.
G = (V; E ) | v1 ; v2 ; : : : ; vn .  W0 = M ,
W1 , W2 , . . . , Wn ,  Wk (k > 1),
 i- j - Wk (i; j ),
,  ( )

178

8.

vi vj
{v1 ; v2 ; : : : ; vk }.
W0  M ,
Wn | M . 
for  .  ( k ) W1 , W2 , . . . , Wn .
.

W = M G = (V; E ) M .
begin
W := M ;
for k = 1 to n do
for i = 1 to n do
for j = 1 to n do

W (i; j ) = W (i; j ) W (i; k ) W (k; j ) ;
end

 , 
- .   .
 ( k ) Wk ,   Wk1 .
i- Wk ,
:

Wk1 (i; j ) Wk1 (i; k ) Wk1 (k; j )
(1)

 j .

Wk1 (i; k ) = , Wk1 (i; k ) Wk1 (k; j ) = , (1)  Wk1 (i; j ). ,
i- . ,
Wk1 (i; k ) = ,
 (1)
Wk1 (i; k ) Wk1 (k; j ) . i-    i
k . ,  Wk 
.
1. k - Wk1 .
2. i (i = 1; : : : ; n), k -
,  i- Wk .

8.2.

179

3. i (i = 1; : : : ; n), k -
,    k - ,
 i- Wk .
8.4. 

, . 8.4.
3

8.4.

. W0 

W0 =

 W1 .  ,
1- W0 . 2, 
W0 1, 2 4 W1
.  ,

:
?
?
?
?
?
W1 =


? ? ? ? ?

, 3, 3 W1    1- 3-
W0 .

W1 =
:

? ? ? ? ?

180

8.

  3 5-
W1   ,  5- 1-
W0 .

W1 =
:

W1 .  W2 ,  W1 . 2- W1 ,
2 4  W2 . W2 |
  1- 2- W1 .
 W2   3- 2- W1 . , ,  W2 |
 ,  5- 2- W1 . ,

W2 =

, ,  3- 3-
W2 . ,
, 3,  1 2.
(. 8.4), , 3: 3 1 2 3.
W3 .

W3 =
:

4 ,
 ,  4.
, W4  W3 . ,
, 5. ,
, . . W5 = W4 . , W5 = M , 
 .

181

8.3. 

8.3. 
 
,  ,  .
 , 
| .
 , ,  (
) (  ).
. 8.5. , , .
, 
    . , ,
, . ,
 , ,
, ,   
 .
1

2
4

E
2

8.5.

 ,
 , . 
 . ,
 A (. . 8.5).  | 
, . -

182

8.

,  , ,
. , u v , u v .
 w, w(u; v )

0;
w(u; v ) = ;

d;

u = v;
u v ,
uv | d:

A
B
C
w=
D
E
F

2
0

1
0

3
4

5
:
0 2

0 1
0

v  d[v , A v .
d[v  (A; v ), ,  . 
d[v .
u,  A d[u .
 d[u .
, v , d[v
,  A
  u. ,  d[v .
,  , . 8.2 , d[v .  d[v
. . , d[v
.

8.3. 

183

 8.2

0
1
2
3
4
5

A
B
D
C
E
F

0
0

B; C; D; E; F

C; D; E; F

0
0
0
0

2
2
2
2

3
3
3
3

C; E; F

E; F

5
5

3
3
3

 A,   w  d[v .
   . d[v |
d[B = 2.

B, A.
, A
B . d[v ,  .
,    A B C 3,
 A B E | 6,
A . ,  , d[C 3 d[E 6.

, C D
A. .
D .   A D E 5,
d[E 5.   .
d[v C .

C  d[v . 
F ,  A B C F .
, d[F , 8.
: E F .

E , 
d[F 8 6.

F .

184

8.

(V; E ) | , A | .  A
v   d[v . u v
w(u; v ) uv ,  PATHTO(v )   A v .
begin
for v V do
begin
d[v := w(A; v );
PATHTO(v ) := A;
end
A;
while do
begin
u :=
A;
u;
for v
uv E do
begin
d := d[u + w(u; v )
if d < d[v then
begin
d[v := d ;
PATHTO(v ) := PATHTO(u); v ;
end
end
end
end

 8
8.1. {1; 2; 3; 4; 5; 6}

 8

185

, 1 (
)
()  () 1 2;
()  () 3 6;
() 5.
8.2.  v G + (v ) , v ,  (v ),

,  |   |  .

? 
?
8.3. , 

,  .
,  
,  ,
.
() , ,  . 8.6, .

8.6.

() , (. . ,
 ), 
.

186

8.

() : ,  ,
.
8.4.  ( -

) :
a
b

d
e
f

 , 
. ?
 . 8.1?
8.5. . 8.3     -

.  
.

 8.3


-





, , ,

8.6. M = M (i; j ) | G V = {1; 2; 3; : : : ; n}.   , A(v )


v V .

187

8.7. G


M =

M 2 , M 3 M 4 . M .
8.8.  W1 , W2 , W3
W4 G  , 
M .
8.9.  -

, . 8.7, 
() A;
() C .

8.7.

8.10.  
S . 8.8.  S T .


 G =
= (V; E ), V | , E |
V . E .

uv | , u v .

188

8.

k 
v0 ; v1 ; : : : ; vk ,  vi1 vi (i = 1; : : : ; k ).

8.8.

G   v0 ; v1 ; : : : ; vk , ,  v0 
,  .

, .  .
G = (V; E ) | : 1, 2, 3, . . . , n , 
uv | , u i v
j , i < j .

 
, .   .
G = (V; E ) | n M .  M k  k  
G.
M = M M 2 : : : M n

189

. 
 .
 -

.  W0 , W1 , W2 , . . . , Wn , W0 = M , Wn = M k > 1
Wk  Wk1 :
1. k - Wk1 .
2. , k - ,  Wk .
3. , k - ,    k - ,
 Wk .
   -

 .
, u v , u v .  u v , 
.
  .

.
 , ( )  
, | . ,   .
8.9 , ,  .
  ,
 . 
   
.   
,  .   . 
 ,  
 .

190

8.

   .
,  , 
.  ,
  
.

8.9.

, . 8.9,   
  , . , 1
 . 8.10.
,  , 
1 .  , 1,
 (. 8.4).
 8.4

2
2

3
2

4
4

5
4

6
4

7
4

 . | .  .

191

1.  , -

2  , .
  2.
1
5

5
5

8.10.  1

. . 8.5.
 8.5

2
3
4
5
1
6
7

4
4
4

0
0
0
0
0
0
0

4
4
4

3
3
3
3
3
3

3
3
3
3
3

6
6
6

4
4
4
4

6
6

9
9
8

1,
1,
1,
1,
6,
7

3,
4,
5,
6,
7

4, 5, 6, 7
5, 6, 7
6, 7
7

,  
2 . , PATHTO(6) = 2; 3; 6.
 
. 8.11 . 8.6 .

192

8.

 8.6

1
1

3
3

4
4

6
3

7
3

2
4

3
3

5
4

3
3

4
3

8.11.

8.12.

2. , 

2 4 3 1. 
 2?
.  , 

2 4, 1. . 
. 8.12.
| . 8.7.
 8.7

1
4

3
3

4
4

5
4

6
3

7
4

3.  -

1 2, 5 6?

. 5 6   -

2, 
, 1, .

193

1,   1 6.
 : PATHTO(6) = 1; 4; 5; 7; 6.
 . 8.13.
 8.8 | .
 8.8

2
2

3
2

4
4

5
4

1
5

7
2

6
8.13.

6
4

7
4

| ,
.   ,  ,  .
, {0; 1}   , .
  ,
(. 2) ,
( 3) . ,
 ,
.  , ,  
.
 ,   .
 ,  , ,
.   .
,  , 2- .

9.1.
B = {0; 1}
  (),
() ( ).  () () 0
1  . 9.1.

0 1
0

0 1

0 1
0

0 0

1 1

0 1

9.1.

9.1.

195

0 1  :
0 = 1 1 = 0:
 p q (. . , 
0 1)  , 
 p, p q p q (. . 9.1 . 9.2).
 9.1
p

0
1

 9.2

1
0

0
0
1
1

0
1
0
1

0
1
1
1

0
0
0
1

  , , 2. , . 9.1 . 9.2
, ,
 p q P Q,  0 1 .  , p
( P ), p q | (P Q), p q | (P Q).

.
   (), () ( ),  , ,
, 
  .
 9.3.
:

:

:

q = q p,

q = q p;

(q r) = (p q ) r,

(q r) = (p q ) r;

(q r) = (p q ) (p r),

(q r) = (p q ) (p r);

p = p,

p = p;

(p q ) = p,

(p q ) = p;

(p q ) = p q,
(p q ) = p q.

196

9.

,
. ,  ,  (.  .).
9.1. :
p (q r ) = (p q ) (p r ):

.   . 9.4.
  ,
p (q r ) (p q ) (p r ) .
 9.4
p

0
0
0
0
1
1
1
1

0
0
1
1
0
0
1
1

0
1
0
1
0
1
0
1

0
0
0
0
0
0
1
1

0
0
0
0
0
1
0
1

(q r)

0
1
1
1
0
1
1
1

(p q ) (p r)

0
0
0
0
0
1
1
1

0
0
0
0
0
1
1
1

, 3,
. ,  ,  , 
 .
 9.5

 1 ,
, . , 
,  .
1

 . |

.  .

9.1.

197

9.2. , (
p q ) (p q ) -

p.

. .

(
p q ) (p q ) =
=
=
=
=



(
p) q (p q ) = ( )

(p q) (p q ) =
p (
q q) =
p0 =

( (
p) = p)
( )
( q q = 0)
(  ):

n  p1 ; p2 ; : : : ; pn f : B n B , f (p1 ; p2 ; : : : ; pn ) |
.
| ,   (
). . m(p; q; r ) 
p, q r , (. 9.6).
 9.6
p

0
0
0
0
1
1
1
1

0
0
1
1
0
0
1
1

0
1
0
1
0
1
0
1

0
0
0
1
0
0
0
0

m |  , . . ,
 1 .
 m(p; q; r ) = 1 p = 0, q = 1 r = 1, 2
m(p; q; r ) = p q r:

p q r .
2

,  
1 , p = q = r = 1.
 q r = 1 p = 0;

= r = 1:

q r  -

198

9.

9.3. , -

 , . .  pi . m(p1 ; p2 ; : : : ; pr )
. m(p1 ; p2 ; : : : ; pr ) | .  
m

. , 
| 1.  pi = 1, ,  m, pi ;
pi = 0, pi .
, . 9.6
 0, 1, 1, 1. , m(0; 1; 1) = 1. m(p; q; r ) = p q r .

,  ,   . , ,  ( )   .
 f (p; q; r ), | . 9.7. 
:
p q r;

p q r;

p q r:

 f 
 .
 9.7
p

0
0
0
0
1
1

0
0
1
1
0
0

0
1
0
1
0
1

0
1
0
1
1
0

1
1

1
1

0
1

0
0

1  ( , f1 f2 fs 1 ,

9.1.

199

fi 1), f
:
f (p; q; r ) = (
p q r ) (
p q r ) (p q r):

f . ,
 
.
9.4.
q r ).
f = (p q ) (
. . 9.8  f .
 9.8
p

0
0
0
0
1
1
1
1

0
0
1
1
0
0
1
1

0
1
0
1
0
1
0
1

0
1
0
0
0
1
1
1

 :
p q r;

p q r;

p q r;

p q r:

, :
f (p; q; r ) = (
p q r ) (p q r ) (p q r) (p q r ):

,  . , : p q , p q  p. , ,  . ,
{p q; p q; p} |  . . , 
(p q ) = p q. ,
p q = (
p q):

200

9.

,  
 : , . . {p q; p} |  .   , 
 , .
9.5. {  :
p { q = (p q ):

, { { } |  .

. ,
p, p q p q { .

p = (p p) = p { p:


p q) = (p { p) (q { q ) =
p q = (

= (p { p) { (q { q ):

,
p q = (p q ) = (p { q ) =

= (p { q ) { (p { q ):

, { { } |   .

9.2.
  
.   ,  , .
 , ,
, .
, .
.
,  
,  . , 
pqr pqr pqr

(
p q r ) (
p q r ) (p q r):

9.2.

201

| .
 :
pqr pqr pqr = (
pr q prq ) pqr =

= pr (
q q ) pqr =
= pr pqr




q q = 1:

 , , . ,  ,
,  ,  . ,  :
 ,
. 
,
 q .
  , , 1950-
. , | ,   ,    .
 p, q r
 (. 9.2). ,
  p q , |
 r r.
pq

pq

pq

pq

r
r
9.2.


,
 .
,  .
, ,
, ,  1. ,
pqr pqr pqr . 9.3.

202

9.

pq
r

pq

pq

r

pq

9.3. pqr pqr pqr

   ( , . 9.3).  
 . ,
.
,  - ( , 
) ,  .
, (. 9.4) pqr pq r pqr
, pqr pqr .
pq
pq
pq
pq
r

r

1
1

9.4.
pqr pq r pqr

,
 (. 9.5).
 .
pq
r
r

pq

pq

pq

1
9.5.
pqr pq r pqr

,
pqr pq r pqr = pq r (pqr pqr ) =

= pq r pr (
q q ) = pq r pr:

9.2.

203

9.6. 
pqr pqr pqr pq r pq r:

. . 9.6, -

.
pq

pq

r

pq

pq

9.6.
pqr p
qr pqr pq r pq r

, 
:
pqr pqr pq r pq r;
(),  :
pq r pqr:

().
  ().
pqr pqr pq r pq r = (p p)qr (p p)q r =

= qr q r = q (r r) = q:

  ().
pq r pqr = pr(q q) = pr:

 ,  1 q pr.
1

, , pq r
 ,
.  , . : f = f f , f |  . 
 . | .  .

204

9.

9.7. 

f (p; q; r ) = (p q ) r (q r ):

.  f (. 9.9).
 9.9
p

0
0
0
0
1
1
1
1

0
0
1
1
0
0
1
1

0
1
0
1
0
1
0
1

1
1
0
0
1
0
0
0

f :
pqr pqr pqr:

 . 9.7.
pq

pq

pq

r

pq

9.7. pqr pqr pqr

, 
 : pqr pqr pqr pqr.
  : pq qr. ,
pq qr.

  ,
 ,
,  .   .   .  {
-. (., , [??)
 .

9.3.

205

9.3.
 ,
, 
 .  ,  .
 . 9.8.
a
a

a
a b
b

9.8.

,  . 
.
9.8.  ,

 . 9.9?
p
1
q

3
6

7
4

r
5

9.9.

206

9.

. . 9.10  -

. 9.9.
 9.10

1
2
3
4
5

p; q

pq

p; q

pq

pq; r

pqr




pq ; r

pq r

pq; r

6
7

pq r

pqr; pq r
pqr

pqr;

pq r

pqr

pqr

pqr

pqr pq r

 ,  pqr pqr pq r.

,  ,
.   ,
  , 
.
9.9.  , -

9.8  , .

. 

. 9.10.   (
 ).
pq
r

r

pq

pq

9.10.

pq

pqr

pqr pq r

pqr pq r = pq (r r) = pq
pqr pqr = (q q)pr = pr:

pq pr , , , p(q r ).

9.3.

207

 ,  9.8,  . 9.11.
p
p(q r)

q
r

9.11.

  . , {; }  .
 , .
,    , 
{ .
9.10. ,
p(q r ),  { .
. -, ,
p(q r ) = p { (q r ) { p { (q r ) :

-,

q r = (q { q ) { (r { r ):

 . 9.12.

9.12. p (q r)

208

9.

 9
9.1.   ,

9.2.  ,  -

() (p q) r = p q r;

() ((p q) (r (p q))) = p q .

9.3. g (p; q; r; s), | (. 9.11).


 9.11
p

0
0
0
0
0
0
0
0

0
0
0
0
1
1
1
1

0
0
1
1
0
0
1
1

0
1
0
1
0
1
0
1

0
1
1
0
0
0
0
0

1
1
1
1
1
1
1
1

0
0
0
0
1
1
1
1

0
0
1
1
0
0
1
1

0
1
0
1
0
1
0
1

0
0
0
1
0
1
0
0

9.4. 
p (
q r ) p (q r)

.
9.5.  (p q) r ,  :

() 

() { .

 9

209

9.6. {  
p { q = (p q ):

, {{}  .

9.7.

pqr pqr pq r pqr

 .
9.8. f (p; q; r ) | . 9.12.
 9.12
p

0
0
0
0
1

0
0
1
1
0

0
1
0
1
0

1
0
1
0
0

1
1
1

0
1
1

1
0
1

1
0
1

 f .
9.9. ,

,  . 9.13.

p
q

9.13.

210

9.

 , , : .
9.10.  , -

p { (
q { r )


p (
q r ):

, 
. 9.14, , : 1 .
p

q
r

9.14.

p
q
r

p
q

9.15.
1

. |

.  .

211

9.11. , -

. 9.15.

9.12.

p { q ,
 { .
(:  q { q =
= (
p { q), ,  r r = r { r .)


  : 0 1.

 ,   ,
.
n  p1 ; p2 ; : : : ; pn f : B n B , f (p1 ; p2 ; : : : ; pn ) |
.

, ,  ,
.
p q | . 
:
 9.13.
:

:

:

q = q p,

q = q p;

(q r) = (p q ) r,

(q r) = (p q ) r;

(q r) = (p q ) (p r),

(q r) = (p q ) (p r);

p = p,

p = p;

(p q ) = p,

(p q ) = p;

(p q ) = p q,
(p q ) = p q.

212

9.


.   .
,
,  .
,  ,  ,  . ,

,  .
| ,  , .

,
 (. 9.16).
a
a

a
a b
b

9.16.

, 
, .

. 2-

2- | ,
2 , . , 10 +2 11 = 101. 2-   
.   . , 1 +2 1 = 10.
2

 . |

.  .

. 2-

213

x y , 
, u v | ,  ,  . 9.17.

9.17.

 (. 9.14)  . , u = xy (  ) v = x
y xy (  2 ).
 9.14
x

0
0
1
1

0
1
0
1

0
0
0
1

0
1
1
0

1. , ,
. 9.18,  .
x
y

1
4

9.18. 

. 3 4
  2 ( . 9.15).

214

9.

 9.15

x; y

xy

xy

2
3
4

x; y
x; y

xy

xy; xy

 xy

xy

2- .

2- 
, ,
. , 2- , : 11 +2 10 = 101.
a b 
, d | (. 9.19). e, f g |
.
e

a
b

2-

f
g

9.19.

,  ,
 e, f g ,
,  
 .
 :  
. ,  . 9.20,
  : a +2
b +2 d.
 2 ( v2 ) g .  u2 v1  
,  u3 f . ,  , e,  u1 u3
 .
2.  2-

 11 +2 10 = 101.

215

. 2-

. :
a = 1;

b = 1;

= 1;

d = 0:

 a +2 = 1 +2 1 = 10, u1 = 1 v1 = 0. ,
b +2 d = 1 +2 0 = 01, : u2 = 0 v2 = 1, g = 1.
, u2 +2 v1 = 0 +2 0 = 00, . . u3 = 0. f = 0.
, u1 u3 = 1 0 = 1, e = 1.
, 11 +2 10 = 101, .

9.20.

2-  . 9.21.
a

3
c

9.21. 2-

3.  11 01

. 9.21.

. ui vi ,  i  i = 1, 2 3.  a = 1, b = 1, = 0
d = 1,
a +2 = 1 +2 0 = 01 u1 = 0 v1 = 1;

216

9.

b +2 d = 1 +2 1 = 10 u2 = 1 v2 = 0

( g = 0):

  v1 = 1 u2 = 1.
v1 +2 u2 = 1 +2 1 = 10 u3 = 1 v3 = 0

( f = 0):

,
u1 u3 = 0 1 = 1;

( e = 1):

, , , 100 =
= 11 +2 01, .
. 9.22 3- ,
a, b, d, e, f .  g , h, i j .
a

c
d
e

2-

9.22. 3-

4. , . 9.22 

:
() 110 +2 011;
() 101 +2 111.

.  1001 () 1100 -

().


 1

1.1.
B  . 1.1.

1.1.

14.
1.2. () f = 6,

() f = 120.
 n  f = n!.
1.3. . 1.1
 1.1
i

1
2
3
4

3
9
27
81

6= 4?

n > 0 mn .
n = 0 .
,   ,  
1 i.
1


. | .  .

i < n

6=

218

1.4. : 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89.

 ,
, ,
.

1.5. . 1.2
 1.2
l

sum

0
1
4
9
16
25
36

0
1
5
14
30
55
91

1
3
5
7
9
11
13

k <

12?

  n .
1.6. . 1.3
 1.3

1
2
3

BG
DE
EF

6
5
4

4
5
6
7
8
9
10
11

AB
BC
CD
EG
FG
AF
CE
CG

3
3
3
3
3
2
2
1

  . = 11 m = 7.
  .  :
BG, DE, EF, AB EG. , . 1.2.

219

3
G

1
2

1.2.

 2

2.1.

() P Q,

() P ( Q),
() R P ,

() ( P ) ( Q).

() R P ,
2.2. () ( P ) ( Q).

() P ( Q).

() (P Q) ( (P Q)).
  . 2.1.
 2.1
P

((

) (

))

 , () () .
2.3.   . 2.2

. 2.3. , () () |
.

 2.2
P

(P (

))

220

 2.3
P

(P

(P (P Q)) Q

2.4. . 2.4.
 2.4
P

Q R P

Q (

)R

`
R (P Q) R (

)R QR

,  .
,





(P Q) R

( P ) R Q R
.
2.5. () x P (x);

() x : P (x);
() x P (x).

()
: x P (x) (. . ()
()).
() : x : P (x). : .
2.6.  : | -

. . ().

2.7. () n m  n = 2a
m = 2b, a, b | . ,
n + m = 2a + 2b = 2(a + b);

n + m.

221

() n | , n = 2a + 1 -
a. n , 
n2 = (2a + 1)2 = 4a2 + 4a + 1 = 2(2a2 + 2a) + 1:

, n2 | . , n2 |
, n | .
() , n + m |
, : n m , , |
. , , . .
m, n | , m = 2a n = 2b
- a b. ,
n + m = 2a + 2b = 2(a + b)

,  .
 m n | .   m = 2a + 1, n = 2b + 1 a
b. , 
n + m = (2a + 1) + (2b + 1) = 2(a + b) + 2 = 2(a + b + 1);

.    .
, . ,
.
2.8. ()  1 + 5 + 9 + + (4n 3) = n(2n 1)
P (n). n = 1
1.   n = 1

1:

n(2n 1) = 1 (2 1 1) = 1:

P (1) .
, P (k )  k > 1.
, 
P (k + 1). .

222


1 + + 4(k + 1) 3 = 1 + + (4k 3) + (4k + 1) =
= k (2k 1) + (4k + 1) =
= 2k 2 + 3k + 1 =
= (k + 1)(2k + 1) =


= (k + 1) 2(k + 1) 1 :

 ,   P (n)
 n > 1.
() P (n) :
12 + 22 + + n2 =

1
n(n + 1)(2n + 1):
6

 12 = 1 16 n(n + 1)(2n + 1) =
n = 1), P (1) .

1
6

1 2 3 = 1 (

, P (k )  k > 1
, P (k + 1).
12 + + (k + 1)2 = 12 + + k 2 + (k + 1)2 =
1
= k (k + 1)(2k + 1) + (k + 1)2 =
6

1
= (k + 1) k (2k + 1) + 6(k + 1) =
6
1
= (k + 1)(2k 2 + 7k + 6) =
6

1
= (k + 1) (2k + 3)(k + 2) =
6


1
= (k + 1) (k + 1) + 1 2(k + 1) + 1 :
6

,  , P (n)
n > 1.
()  P (n) 
1
1
1
n
+
+ +
=
:
13 35
(2n 1) (2n + 1)
2n + 1
n = 1,
 |
n
1
= :
2n + 1
3

1
3

223

, P (1) | .
P (k ) - k . 

=
=
=

1
1
1

=
+
+ +
13 35
2(k + 1) 1 2(k + 1) + 1

1
1
1
+ +
+
=
13
(2k 1)(2k + 1) (2k + 1)(2k + 3)
k

2k + 1

1
k (2k + 3) + 1
=
=
(2k + 1)(2k + 3)
(2k + 1)(2k + 3)

2k 2 + 3k + 1
(2k + 1)(k + 1)
k+1
=
=
:
(2k + 1)(2k + 3)
(2k + 1)(2k + 3)
2k + 3

P (k +1)
 P (k ). , P (n)
n.
() : n3 n 3 P (n).
 13 1 = 0 3, P (1)
.
, P (k ) k > 1.

(k + 1)3 (k + 1) = k 3 + 3k 2 + 2k =

= (k 3 k ) + 3k 2 + 3k:

k 3 k 3   ,
3k 2 + 3k = 3(k 2 + k ) 3. ,
(k 3 k ) + 3k 2 + 3k 3. 
  : P (k ) P (k + 1),
  P (n)
n.
() P (n) :
1 1! + 2 2! + + n n! = (n + 1)! 1:
n = 1,   :
1 1! = (1 + 1)! 1:

224

, P (1) .
 P (k )  - k  :
1 1! + 2 2! + + (k + 1) (k + 1)! =
= 1 1! + 2 2! + + k k ! + (k + 1) (k + 1)! =
= (k + 1)! 1 + (k + 1)!(k + 1) =
= (k + 1)!(k + 2) 1 = (k + 2)! 1;
P (k +1), . , P (n) 
n.
2.9. x2 = 13 , x3 =

1
7

x4 =

1
15

P (n) |  xn = 2n11 . n = 1
P (1). ,
P (k )  - k > 1. 
xk+1 =

xk

xk + 2

2k

2k

+2

1
1
= k+1
:
k
1 + 2(2 1)
2
1

, P (k ) P (k + 1).
, P (n) |  n.
2.10.  :
x3 = 2x2 x1 = 2 2 1 = 3;
x4 = 2x3 x2 = 2 3 2 = 4;
x5 = 2x4 x3 = 2 4 3 = 5:

 ,  .  . P (n)  xn = n. P (1) P (2)


. , ,
, P (3), P (4) P (5).
, k > 1 P (k 1) P (k ). 
xk+1 = 2xk xk1 = 2k (k 1) = k + 1:

,  P (k + 1)
 P (k 1) P (k ).  ,

225

 , ,
 P (n) n.
 3

3.1. () A = {10; 11; 12; 13; 14; 15; 16; 17};


B = {4; 3; 2; 1; 0; 1; 2; 3; 4};
C=
; 1 1
D = 2; 3 ;

() S = {3n 1 : n N};
T = {1=(2n 1) : n N}.

3.2. () {t};

() ;

() {p; q; r; s; t; u};
() {q; r; v; w};

() {p; s};

() {u; w};

() {r; v };
()

{p; r; s; u; v };

3.3. () ,  A B .

() , 
B ; ,
.
() , B C
 (B C ) \ (B C ),  B , C , . .
.
() ,
, , .

() ,
.
() , .
3.4. ()

(i)

B;

(ii) B C ;

(iii) A B ;

(iv) C \ B .

() A \ B = {3n : n Z n > 4; n| }.
,  n 2k + 1,
: A \ B = {6k + 3 : k Z k > 2}.

3.5.  . 3.1.

226


x A (B C ), x A (x B ) (x C ) .
,


(x A) (x B ) (x A) (x C ) :

, x (A B ) (A C ).
: A (B C ) (A B ) (A C ).
 .
B

C
BC

A (B C)
B

A B - .
A C - .

(A B) (A C)

3.1.

3.6.  . 3.2.
B

C
A (B D C)

BDC
B

C
A B - .
A C - .

(A B) D (A C)

3.2.

A, B C , A
B , C ,  -

227

A (B C ) = (A B ) (A C ). , 
A = {1; 2}, B = {3; 4} C = {4; 5}. 
B C = {3; 5}

A (B C ) = {1; 2; 3; 5}:

,
A B = {1; 2; 3; 4};

A C = {1; 2; 4; 5}

(A B ) (A C ) = {3; 5}:

3.7. ()  :

(A B ) B = (A B ) B = (. .)
= A (B B ) = (. )
= AB

(. )

()  :
(A (B C )) = A (B C ) = (. .)
= ABC
( . .)
()  ,
(A B C ) (A B C ) (A C ) =


= (B (A C ) B (A C ) (A C ):

, 


(B (A C ) B (A C ) (A C ) =

= (B B ) (A C ) (A C ):

  .


(B B ) (A C ) (A C ) = (A C ) (A C ):

  :

(A C ) (A C ) = (A C ) (A C ) = :

228

() :
(A \ B ) \ C = (A B ) \ C =

(  \)

= (A B ) C = (  \)

= A (B C ) = ( )
= A (B C ) = ( )
= A \ (B C )
(  \)

()  , :
A A = (A \ A) (A \ A) =

= (A \ A) =

= AA=
=

(  )
( . )
(  \)
( . )

,
AAA=A=

= (A \ ) ( \ A) =

(  )

= (A ) ( A) = (  \)
= A=
( . ,
=A
. .)
3.8. . 3.3.

3.3.

()   
:
A A = (A A) = A:

229

()   ,    ,  .
(A A) (B B ) = A B = (A B ) = A B:
()    .
(A B ) (A B ) = (A B ) =

= ((A B )) =
= A B:

3.9. ()  . 3.4.
B

A
2
6

3.4.

1, 2, ... , 8,
 , , i ni . 

|A| + |B | + |C | =
= (n1 + n2 + n4 + n5 ) + (n1 + n2 + n3 + n6 )+
+ (n1 + n3 + n4 + n7 ) =
= 3n1 + 2n2 + 2n3 + 2n4 + n5 + n6 + n7 :
,

|A B | + |B C | + |A C | =
= (n1 + n2 ) + (n1 + n3 ) + (n1 + n4 ) =
= 3n1 + n2 + n3 + n4 :

230

,
,

|A B C | = n1 :

|A| + |B | + |C |
|A B | |B C | |A C | + |A B C | =
= 3n1 + 2n2 + 2n3 + 2n4 + n5 + n6 + n7
3n1 n2 n3 n4 + n1 =
= n1 + n2 + n3 + n4 + n5 + n6 + n7 =
= |A B C |;
1 .
() A ,
, B | , , C | ,
.   ,

|A B C | = 25 + 27 + 12 20 5 3 = 36:
, 36   . (. . 3.5).
,   .

2 . ,  C \ (A B ),  , ,
 , . , C   :
C = (C \ A) (C A):

|C | = |C \ A| + |C A|:

  ,  . | .  .
2
. | .  .

231

A
20
4

5
C

0
3
4

3.5.

, |C | = 12 |C A| = 5. ,
|C \ A| = 12 5 = 7.  ,
C \ A , ,  . C \ A
, .
,  : (C \ A) \ B . 
 .




(C \ A) \ B = |C \ A| (C \ A) B :

(C \ A) B .
C , 
B ,  A. 
C ,  B ,  A,
. ,



(C \ A) B = C B (C \ A) B = C B = 3:
:

12 5 3 = 4:

3.10.   A B (a; b),


a A b B . AB = B A,  (a; b)
A B  B A, . . a B b A.
a A b B ,
A = B .

A C   (a; ), a A C . A B = A C , (a; ) A B ,
B . : C B . B C , ,
B C . , B = C .

232

3.11. () x A (B C ).  x = (a; t); a A


t (B C ). , t B , . . (a; t) A B ,
, t C (a; t) A C . , (a; t)
(A B ) (A C ). ,
A (B C ) (A B ) (A C ):

. x (A B ) (A C ), x A B
x A C . , x = (a; t),  a A, t
 B , C , . . t B C .  , x A (B C ).
: (A B ) (A C ) A (B C ):

() x (A B ) C .  x = (s; ), s (A B )
C . s | ,
s A, x A C , s B , . . x B C .
x  A C , B C .
, x (A C ) (B C ).
. x (A C ) (B C ),  x = (s; ) C , s
A, B . ,
s (A B ).  , x = (s; ) (A B ) C .
 x ,
(A C ) (B C ) (A B ) C:
.


3.12. () P (A) = ; {1}; {2}; {3}; {1; 2}; {1; 3}; {2; 3}; {1; 2; 3} .
() C P (A) P (B ).  C A C B , 
C (A B ). , P (A) P (B ) P (A B ).
 C P (A B ).  C (A B ), . .
C A C B . , P (A B ) P (A) P (B ).
P (A) P (B ) = P (A B ).

() P (A) P (B ) , A, , B .
, P (A) P (B ) P (A B ).
,   A B A,
B . , , A = {1; 2; 3}, B = {4; 5},
C = {1; 2; 5}. , , C P (A B ), , , C 6 P (A) P (B ).

233

3.13. A a = (1; 1; 0; 1; 1; 0). B b = (0; 0; 1; 0; 1; 0).

A B .

a ( b) = (1; 1; 0; 1; 1; 0) (1; 1; 0; 1; 0; 1) =

= (1; 1; 0; 1; 1; 1):
, A B = {1; 2; 4; 5; 6}.

A B
(a ( b)) (b ( a)) =


= (1; 1; 0; 1; 1; 0) (1; 1; 0; 1; 0; 1)

(0; 0; 1; 0; 1; 0) (0; 0; 1; 0; 0; 1) =
= (1; 1; 0; 1; 0; 0) (0; 0; 1; 0; 0; 0) =
= (1; 1; 1; 1; 0; 0):
 , A B = {1; 2; 3; 4}.
 4



(1; a); (1; ); (2; a); (2; ); (3; b); (3; ) .
 . 4.1.


4.2. R = (1; 7); (2; 5); (3; 3); (4; 1) .

S = (1; 1); (1; 2); (1; 3); (1; 4); (1; 5); (2; 1); (2; 2); (2; 3);

(2; 4); (3; 1); (3; 2); (3; 3); (4; 1); (4; 2); (5; 1) .
4.1.

T = {(n; n2 ) : n N}.

4.1.

234

4.3. ()  : R = (1; 1); (1; 2);



(1; 3); (1; 4); (3; 1); (3; 2); (3; 3); (3; 4) :

()  . 4.2.

4.2.

() R :

4.4. () , .

() , .
() , .
() , .
4.5. () ,  x + y  y + x.

, x + x .
, , , 1+4 4+3 |
, 1 + 3 | .
() ,  x
x + x | .
x + y = y + x .
 , x + y y + z ,
(

235

). x + z
.
() : xy = yx.
,   xy yz : x, y
z . ,  xz .
, , , 2 2 = 4 |
.
() ,  x + x2 =
= x(x + 1) |   , .
 .
. , x + xy y + yz |
, x | ( x + xz |
), x | ( : x, y
z | , , x + xz | ). ,
x + xz | ,
.
: 2 + 2 3 = 8 | ,
3 + 3 2 = 9 | , ,
.


4.6. () R = (1; 9); (3; 3); (9; 1) .


() S = (3; 2); (6; 4); (9; 6); (12; 8) .
()  R
R (1; 1); (9; 9) :

()  S
S (9; 4) :

4.7. () x , y .

() x = 2n y  n.
() x < y ( ).
() x  y .

236

4.8.  , -

 :



(a; a); (b; b); ( ; ); (d; d); (a; ); (a; d); (b; d); ( ; a); (d; a) :
 :



(a; a); (b; b); ( ; ); (a; ); (a; d); (b; d); ( ; a); (d; a); (d; b) :

  ,
 (b; a) (  (b; d) (d; a)),
( ; d) (- ( ; a) (a; d)) (d; d) (
 (d; a) (a; d)).

  (b; ) (  (b; a)
(a; )).
,   :


(a; a); (b; b); ( ; ); (a; ); (a; d); (b; d); ( ; a); (d; a);

(b; a) ( ; d); (d; ); (d; d); (b; ) :

,  (x; y ) (y; x), x 6= y . 


,  .  .
4.9. () ,

 .

() :

.
() . , | .
()  (0; 0).
4.10.  x2 x2 = 0 3, R -

x2 y 2 3, y 2 x2 = (x2 y 2 )
3. R .

237

, x2 y 2 y 2 z 2 3.
 x2 z 2 = (x2 y 2 ) + (y 2 z 2 ) | , 3. 3,
R.
, 0, 
 : E0 = {n : n2 3}.  n2
, n 3,
E0 = {0; 3; 6; : : :}.
, 1, :
E1 = {n : n2 1 3}:

n2 1 = (n 1)(n +1), : (n 1)
(n + 1) 3. , n = 3m 1,
m | , , E1 = {::: 1; 1; 2; 4; 5; :::}.
, E0 E1 = Z,
: E0 E1 .
4.11. () . 4.3.

4.3.

() 
 .
 .
1 ;
6 {1; 2};

2 {1};

10 {1; 3};

3 {2};
15 {2; 3};

5 {3};
30 {1; 2; 3}:

238

4.12. R = (a; d); (a; g ); (b; e); (b; g ); (b; h); ( ; e); ( ; g ); ( ; h);


(d; g ); (e; g ); (e; h) :

: a, b, f .
: f , g h.
4.13.   :

, , , , .

 5

5.1. R1 = (1; 1); (1; 3); (3; 2); (4; 2); (4; 3) .

S 1 = (1; 1); (1; 2); (1; 3); (2; 1); (2; 4) .

S R = (1; 1); (1; 2); (2; 1); (2; 2); (3; 1); (3; 2) .



(S R)1 = (1; 1); (1; 2); (1; 3); (2; 1); (2; 2); (2; 3) .


R1 S 1 = (1; 1); (1; 2); (1; 3); (2; 1); (2; 2); (2; 3) =
= (S R)1 .

5.2. R1 | ... ....


S 1 | ... ....
R S | ... ....

S 1 R1 | ...   ....
R R | ... ....

5.3.  R | , -

, . R,  (x; x). R1 , . . R1 | . , x R1 y y R1 x. , 
 y R x x R y .
, , x = y ,
R1 .
, x R1 y y R1 z .  y R x z R y . R | , , z R x.
, x R1 z , . . R1 .

, , R1
. ,  R1  -

239

 R , R1 | R.
5.4.
MN =




= :

M N   S R.

5.5.  () () .

 () ,  0 A 
B .
 () , 0 A
B : 3 7.
 () , 
A (6 0)
3 B . ,
, 7 B
.
 () , , . .
.
5.6. () f (a1 ) = f (a2 ), 2a1 + 1 = 2a2 + 1, a1 = a2 .
, f | .
, f  , , f | .

() g , , , g (4) =
= g (1) = 2. , g (2m) = m, m |  ,  Z. ,
g | .
() , h(n) | ,
n | , , n | . ,
h(a1 ) = h(a2 ), a1 + 1 = a2 + 1, a1 1 =
= a2 1.  : a1 = a2 .
h | .
m | , m 1
,   h,
h(m 1) = (m 1) + 1 = m:

240

m | , m + 1

h(m + 1) = (m + 1) 1 = m:

, m, n ( (m 1)
(m + 1)), h(n) = m. , h | .
5.7. . 5.1.

() f 

{n2 + 1 : n Z} = {1; 2; 5; 10; : : :}:


 f (1) = f (1) = 2, .
, f (x) = 3 . f .
() g

{2; 4; 8; 16; : : : }:

 g (a) = g (b) 2a = 2b ,
 a b.  , g | . ,  g (x) = 3 .
() h  R.
h(a) = h(b), 5a 1 = 5b 1, . . a = b. , h | . h  ,
.
() j  R.  j (1) = j ( 32 ) = 0, j | . 
, .
() k , .  , k
. , , x1 < 0 x2 < 0
: k (x1 ) = k (x2 ) = 0.

5.1.

, x > 1
x < 1

241

242

() l | , . . R. , .
x > 0, l(x) = x > 0,  x < 0 l(x) = 3x < 0.
,  l(a) = l(b) a b .
, l  : a = b.
a < 0 b < 0, l(a) = l(b) ,
3a = 3b; a = b. ,  l(a) = l(b) a = b, . . l |
.
j
k
2
2
(1) +1
=
= 0: , f (0) = 0,
5.8. () f (1) =
3
3
f (1) = 0 f (2) = 1.  ,
f | {0; 1}.

() g , , , g (0) =
= g (1) = 0. , 


2n
g (2n) =
= n;
2


n |  .
5.9. f (a) = f (b), 1+ a2 = 1+ 2b , a = b.
g . f (x) = y
2
 1 + x2 = y , x = y
.
1
 y = 1, -

.
B  x,  f . , f |
.

, f , .  , . 2
.
f 1 : B A  f 1 (x) = x
1

(2x + 1)2 ; x > 0;
5.10. (f g )(x) = f (g (x)) =
x2 ;
x < 0;
(g f )(x) = g (f (x)) = 2x2 + 1;

g (2x + 1); x > 0;
(g g )(x) = g (g (x)) =
g (x);
x < 0:

243

x > 0, 2x + 1 > 1 
g (2x + 1) = 2(2x + 1) + 1 = 4x + 3:

x < 0, x > 0. , g (x) = 2(x) + 1 = 1 2x:


,

4x + 3; x > 0;
(g g )(x) =
1 2x; x < 0:
5.11. () (g f )(a1 ) = (g f )(a2 ) 
: g (f (a1 )) = g (f (a2 )). g , f (a1 ) = f (a2 ).
, f | . ,
a1 = a2 . , g f | -

() C .  g | , b B , g (b) = .
b, f ,
a A,  f (a) = b.   ,  :
C a A, g (f (a) = ,
 g f .
() , f (a) = b g (b) = . ,    (g f )(a) = . ,
(g f )1 ( ) = a. f 1 (b) = a g 1 ( ) = b.
(f 1 g 1 )( ) = f 1 (g 1 ( )) = f 1 (b) = a:

, C
(g f )1 ( ) = (f 1 g 1 )( );

5.12. ()  -

. , , 
. ,
, -  .

() A ,  ,
 .  A . B = {2; 3; 4; : : : ; 12}  .

244

f : A B ,   .   , , |A| > |B |, -
 . , 12 .
() : ,
, . , 
, , 
.
() A , B | .
f : A B  .  
,  |A| > 3|B | ,
.
: 13 .
5.13. ()

A | ,  ,
B |  .
f : A B , 
 , .
12 ,  
 12 12 = 144. , 132
 | . ,  ,   
,  
.   , . . B ,

|B | = 12 +

132
= 78:
2

 |A| = 79, |B | = 78, ,  


, ,
.
() A , B | f : A B ,
  .
|A| = 2 79 = 158. ,
,
, | 31 (

245

: , ). , |B | = 31.  , |A| > 5|B |,


,   , ,  6 ,
.
5.14. ()   S ,
22: {2; 20}, {4; 18}, {6; 16}, {8; 14}, {10; 12}.
A ,
S , B | 
. f : A B -

, . , f (6) = {6; 16}.   


, , |A| > |B |,
A, f . ,
, 22. , |B | = 6. ,
S 6 .

() , f ,  S ,  .
S 10 , 19. S | 1, 3, 5, 7 9.
 , B f S .
A |  S , |
 11 . f : A B ,
 n A
.  |B | = 10,   
, . n m.
 n = 2i b, b | 1 , i = 0; 1; 2; 3; 4. , m = 2j b, j = 0; 1; 2; 3; 4. i > j ,
1

,  n b. 
n = n=b | . n - ,
1, , k, n . ,
n  kb, .
 b n. , n =
= n=b , 1.

i
n = 2  i. | .  .

246

m n.  n m. 

, ,  11 S   ,
.
 6

6.1. ()   5 8 7 = 280

() 5 3 = 15
 .
.
,   15 + 6 = 21
.
() 
, 66 = 36  63 = 216
. 6 + 36 + 216 = 258
.
6.2. () , 10 : 0, 1, 2, 3, 4, 5, 6, 7, 8 9.

( ,
) 0.
, 9 102 = 900
 . 
  . , 900
.

  .  ,   ,  .  , :
900 10 = 9000.

()   1,
3 5. 
( 5).
3 53 = 375 , 
6000,  .
() 262 = 676 
.

247

36 (26 10 ).
364 = 1 679 616 . , 6761 679 616 = 1 135 420 416
.
6.3. () 

(1, 2, 3, 6), |
. S 4 53 = 500
.

() .  
( 0
). | 4 3 2 = 24. ,
4 24 = 96 S   .
() S : 0, 2 6.  0,  4 3 2 = 24 .
 | 2 6, (
0)  3 3 2 = 18
.   ()
24 + 18 + 18 = 60 .
()  () , 4 000,
4, 5 6. 0, 1, 2, 3, 6. ,
6. 3  4 3 2 = 48 . , 48 ,
. (),  4 000.
6.4. () P (7; 2) = 42, P (8; 5) = 6 720, P (6; 4) = 360, P (n; 1) = n
P (n; n 1) = n!:

() C (10; 7) = 120, C (9; 2) = 36, C (8; 6) = 28,


C (n; 1) = C (n; n 1) = n.

, k
n,   n k
n. , , , .
C (n; k ) = C (n; n k ).

248


:
C (n; n k ) =

n!
n!
=
= C (n; k ):
(n (n k ))!(n k )!
k !(n k )!

6.5. ()   ,  . P (17; 3) = 4080

  .

() ,  ,   . ,
P (20; 2) = 380   .
() ,   .
P (26; 2) = 650 .  , 10
24  , 
. ,  P (34; 4) = 1 113 024 . ,   ,
 650 1 113 024 = 723 465 600
.
6.6. ()


 . ,
C (18; 11) = 31 824
.

() C (8; 5) = 56
, | C (11; 7) = 330 .  , 56 330 = 18 480
.
() C (5; 3) = 10   C (5; 1) = 5
. 10 5 = 50 , .
 C (5; 4) = 5.
5 .
, 5 + 5 = 10 ,
 .
6.7. ()

C (12; 3) = 220 .

249

() C (8; 3) = 56 ,
 - .
 220 -
, ,
-,
220 56 = 164.
() ,   , C (9; 3) = 84. ,
C (7; 3) = 35 . 
, 84 + 35 = 119 .
  , -, .
C (4; 3) = 4. : 115 , .

() C (5; 2) C (3; 1) = 10 3 = 30 ,
,
C (5; 1) C (3; 2) = 15 ,
. ,
C (5; 1)C (3; 1)C (4; 1) = 60 ,
 . 30 + 15 + 60 =
= 105 .
6.8. () C (8; 2) C (5; 2) C (3; 2) = 840 -

,    .

()  , C (8; 6) = 28 .  ,
C (8; 1) C (8; 5) = 448

.  , 28 + 448 = 476 ,
 . 
, , C (16; 6) = 8 008, 7 532 .
() U .
 . ,

250

|U | = 8 008: X | ,   . .  X . , 
, ,   x = U \ X ,  . , X
,
 .
A | ,
 , B |  ,
, C | , . ,
X = A B C:


(. . 60).
.

|X | = |A B C | =
= |A| + |B | + |C |
|A B | |A C | |B C | + |A B C |:
, , :

|A| = C (8; 6) = 28;


|B | = C (11; 6) = 462;
|C | = C (13; 6) = 1 716:
A B ,
 .  6 , | . , AB = |AB | = 0.
, A C ,
  . ,
: |A C | = 0.
  B C , ,

251

. :

|B C | = C (8; 6) = 28:
, A B C = , , , A B = . ,

|X | = |A B C | =
= 28 + 462 + 1 716 28 = 2 178:
,

|X | = |U | |X | = 5 830:
6.9. () 

  . C (n + k 1; n 1), n = 5
k = 6. ,  C (10; 4) = 210
.

() |  12
 . , C (4 + 12 1; 4 1) = C (15; 3) = 455 .
6.10. () |  -

 .

C (4 + 5 1; 4 1) = C (8; 3) = 56

.
()  ,  C (4; 2) = 6.    .

C (2 + 5 1; 2 1) = C (6; 1) = 6

.
   .    . , ,

252

 A B .
 
 , : 5A 5B .
 A C , 
5A 5C . ,   , 
.
, 
 , 
, 6 2 = 4. ,
, 5  , 4 6 = 24.
4  . : 28.
6.11. () , :

21

35

35

21

1 8 28 56 70 56 28 8 1
9 36 84 126 126 84 36 9 1:

() 
, 
1 + 2 7 + 21 = 36;
7 + 2 21 + 35 = 84;
21 + 2 35 + 35 = 126;

. .   .
()
C (n; k ) + C (n; k + 1) = C (n + 1; k + 1)

C (n; k + 1) + C (n; k + 2) = C (n + 1; k + 2):

, 
C (n; k ) + 2C (n; k + 1) + C (n; k + 2) =

= C (n + 1; k + 1) + C (n + 1; k + 2):
 ,  :
C (n; k ) + 2C (n; k + 1) + C (n; k + 2) = C (n + 2; k + 2):

253

6.12. () a = b = 1 , 
C (n; 0) + C (n; 1) + + C )n; n) = (1 + 1)n = 2n :

k -  S n   k
n  .
, C (n; k ). S 0 1, 2, ...
n . , n- 
C (n; 0) + C (n; 1) + + C )n; n) = 2n

.
() a = 1, b = 1

C (n; 0) C (n; 1) + C (n; 2) + (1)n C (n; n) =

= (1 1)n = 0:
6.13. ()

11!  , , , , , , ,
, , .   ,
,
11!
= 83 160
5!2!2!
.

() , , , , , , , , ,

10!
= 7560
5!2!2!
. ,
, , 
.
() ,
. ,
10!
= 15 120
5!2!
,
.

254

6.14. () C (8; 5) = 56.

()  xy 3 z 4 ,  
(x + y + z )8 ,
8!
= 280:
1!3!4!
()  ab2 d,  
(a + b + + d)5 ,
5!
= 60:
1!2!1!1!
,   a + b + + d
60ab2 d. a = x, b = 2y , = z d = 1. ,
(x + 2y + z 1)5 , 
60x(2y )2 z (1) = 240xy 2 z . ,
 xy 2 z (x + 2y + z 1)5 240.
 7

7.1. G . ,

 , 1. 
,  ,  . ,
, , uv  ,  u v . , 
 .

 Kn . ,  
Kn (n 1).  ,
n(n 1).  ,
 n(n21) .
,  
Kn (n 1). , ,
G , . Kn |
, n | , 1.
7.2. G = (V; E ) |  n > 2 . S  .

255

 G,  n 1. ,
S {0; 1; 2; : : : ; n 1}:

S 0, n 1,
 ,  n 1
. ,
 0, . , |S | 6 n 1. f : V S ,  G . |V | = n,
: |V | > |S |.  ,    , , f 
, . . .
7.3. -

1 6, . . 7.1.
2

7.1.

 Kn n n
. (
) , | .

7.2.

256

7.4. 1 4,

, (. 7.2).

 G, H K ,
, . 7.2 (a) H ,
. 7.2 () | K , . 7.2 () | G.
7.5. . 7.3  ,

  7.3.

7.6.

1 2 6 8 7 5 4 3 1:
3, 4, 5, 6 7.
3: 2 8 6 2, 2 8 7 2, 4 7 8 4 4 5 7 4.
4: 2 7 8 6 2, 2 8 4 7 2 4 5 7 8 4.
5: 1 2 7 4 3 1, 1 2 8 4 3 1, 2 6 8 4 7 2 2 7 5 4 8 2.
6: 1 2 7 5 4 3 1, 1 2 8 7 4 3 1, 1 2 7 8 4 3 1 1 2 6 8 4 3 1.
7: 1 2 6 8 7 4 3 1 1 3 4 5 7 8 2 1.

7.3.

7.7. 9: a b f j i d g h a.

C  P . ,  ,
 ,
: ah, bf , i, dg ej . , C ah. , C a,
 ab ae. , , ,
C ae. ,

257

2 (
 , ). C
ab. ,
 b ( ).
C : bf b . e
 2. C
: ej de.
.
, C ej .  ed
 .
. 7.4, ,
C , , C .
b

f
a

c
h

7.4. 

, d 
 dg d . ,
C . i  .  ,
i. i C ,
hj ji,
 hg jf .  , . 7.5.
 C f g ,
 f g . -

258

C , . .
, . ,
ej 
.
b

f
a

c
h

7.5.
b

f
a

c
h

7.6.

 , C ed, ej , , . 
,  . 7.6.

259

. 7.6 ,  j C
f j ji. f g ,  ,  f ,
C . f g .
 g : gd gh.  , hi d
.  . 7.7,
, :
 i ,  
.
 , P . , P |
.
b

f
a

c
h

7.7.

7.8. () A C B D E A -

4 + 2 + 3 + 2 + 8 = 19.

() D E B C A D 2 + 4 + 2 + 4 + 5 = 17.
7.9.

1 6,  . 7.8.

() , . 7.8 () ,  2 4 5 3 6 2.

260

() , . 7.8 () | ,  ,  .

()

()

7.8.

7.10. n | . 

3 + 3 + 3 + 2 + 2 + 2 + 2 + (n 7) = n + 10:
, T , . .
n 1.  ,  :
n + 10 = 2(n 1):

, n = 12, ,
T  1 .

7.11. ()  G T1 , T2 , . . . , Tk . , Ti ni (i = 1; : : : ; k ).
Ti (ni 1) .
G

(n1 1)+(n2 1)+ +(nk 1) = n1 +n2 + +nk k = nk:


() ,

 1. T | r > 2 . ,  1.
  r 1
 2 . , 
, 1 + 2(r 1) = 2r 1. , T r 1 , 
, 2(r 1)

261

  , ,
, , 2r 1.
 .
()  . () , ,
G 9 6 = 3  .
. ()  
( ). 
. ,  . . 7.9.   1.

7.9.

7.12.

,   , 
,  .  : BE , AB , EF , EG, F H ,
DG CD . ,  , 
. 7.10.

7.10.

7.13. A , D | ,
G | , L | , S |

262

W | . : AG ( 56), GL ( 64) AS ( 71).


AL ( 73),  ,  .
AD ( 78), GS

( 85) ( ).  DW ( 96).   ( 365), . 7.11.


A

7.11. 

7.14. () . 7.12.

7.12.

() 1 2 . , 21 = 2. , 
n = 1.
,  k 2k k > 1. ,
 k + 1 2k k . 
,  2 2k = 2k+1 k + 1.
,
k + 1 .    , ,

263

 n 2n
.
 8

8.1. . 8.1.

()  1 2
 1 4 6 2.
()  3 6:
3 5 6 3 2 6.
() 5 | 1 4 6 3 2 1.

8.1.

8.2. uv , 1,  u  v . ,  -

 .  .

,
v . 
, u
, , v
u.  , , v ,  
+ (v ). , ,

264

,  (u).
8.3. () , -

, ,  
d 0 ( d
). ,   d.

,  ,
,  :
d . ,  0. ,
, d .
| .  a b d e a,  .  ,
 .  b d e a | 
b a.
() C | .
.
, C
v0 v1 v2 : : : vk v0 :

, vi1 vi  vi1
vi . , , vk vk v0 .  . , 
 
, 
 v0 v1 v2 : : : vk v0 ,  .
() , ,
 .
8.4.  :
A(a) = {b}; A(b) = { }; A( ) = ; A(d) = {a; e};

A(e) = { }; A(f ) = {b; d; e}:

1 , . -

265

:
A(a) = {b}; A(b) = ; A(d) = {a; e};
A(e) = ; A(f ) = {b; d; e}:

 , . 2 b . :
A(a) = ; A(d) = {a; e}; A(e) = ; A(f ) = {d; e}:

 . 3 a .  :
A(d) = {e}; A(e) = ; A(f ) = {d; e}:

e ,  4. 
A{d} = ; A(f ) = {d}:

5 d ,  .  
:
A(f ) = :

f 6.
 
: (1), b(2), a(3), e(4), d(5) f (6). :


b
a
e
d
f

   ,

266


.
. 8.1 .
,   .
 
 .
8.5.   . 8.2.

8.2.   

:
A() = {}; A() = {}; A() = {}; A() = {};

A() = {; }; A() = ; A() = {}; A() = {};


A() = {}; A() = {; ; ; }; A() = :

,  1 2 ,
.

A() = {}; A() = ; A() = ; A() = {};
A() = {; }; A() = {}; A() = {};

A() = ; A() = {; ; }:

3, | 4 | 5, , .

267


A() = ; A() = {}; A() = ; A() = ;
A() = ; A() = {; ; }:

6, 7, 8 9
.
A() = {}; A() = :

, ,  10,
 11 .  .
8.6.
begin
for j := 1 to n do
A(j ) := ;
k := 1;
begin
while k 6 n do
if M (k; j ) = then
A(j ) := A(j ) {k };
k := k + 1;
end
end
8.7.

M2 =

M3 =

M4 =

268

2
3
4
M = M M M M =

8.8.

M = W0 =

W2 =

M = W4 =

W1 =

W3 =

8.9. () . 8.1.
 8.1

0
1
2
3
4
5

A
B
C
D
E
F

0
0
0
0
0
0

B; C; D; E; F

C; D; E; F

23

D; E; F

10

3
3
3
3
3

10

15

10
10
10
10

15

15
15
15

17

17
17

23

E; F
F

23

 A:
AB
3,
AC
10,
A C D 15.

() . 8.2.

A C D E 17,
A C D F 23.

269

 8.2

A; B; D; E; F

0
0

13

A; B; E; F

11

13

A; F

11
11

7
7
7

A; B; F

5
5
5

13

0
0
0

13

0
1
2
3
4

 C :
CD
5,
C D E 7,

11,
13.

CDEB
CDF

8.10. . 8.3.
 8.3

0
1
2
3
4
5
6
7

S
C
A
B
D
F
E
T

0
0
0
0
0
0
0
0

10 4
10 4
9 4
9 4
9 4
9 4
9 4
9 4

A; B; C; D; E; F; T

22 18
22 18
14 22 17
14 20 17
14 20 17
14 20 17
14 20 17

A; B; D; E; F; T

B; D; E; F; T

26
26

E; F; T

25

5
5
5
5
5
5

14
14

D; E; F; T

E; T

25

 S :
SC
SA
S A; B
SCD

4,
5,
9,
14,

S AB F
S AB F E
S AB F E T
SCDET

17,
20,
25,
25.

 9

9.1. . 9.1 . 9.2 |

, .
. ,
.

270

 9.1
p

 q

(p q )

0
0

0
1

1
1

1
0

0
1

1
0

1
0

1
1

0
1

0
0

1
0

1
1

0
0

0
0

 q

(p q )

1
1
1
0

1
1
1
0

 9.2
p

0
0
1
1

0
1
0
1

1
1
0
0

1
0
1
0

0
0
0
1

9.2. ()  , , (
q ) = q , 

(p q) r = (
p q ) r = p q r:
()  , ,  ,
((p q) (r (p q))) =

= (p q) (r (p q)) =

=
=
=
=

(
p q ) (
r (p q)) =
r (
p q )) =
(
p q ) (
((
p q ) r) (
p q) =
p q:

9.3. pqrs pqr s pqrs pq rs:


9.4.

f = p (
q r ) p (q r) :

 f  . 9.3.
 :
f = pqr pq r pqr pqr pqr pqr:

9.5. () (p q) r =

(p q) r





= (p q) r =

= ((
p q ) r) = (p q r):

271

() (p q) r =


= p (q { q ) r =



= p (q { q ) { r {



{
p (q { q ) { r =
h

=
p { (q { q ) {
i

{ r {
{ p { (q { q )
h

{
p { (q { q ) {
i

{ p { (q { q )
{ r :

 9.3
p

 (q r)

0
0
0
0

0
0
1
1

0
1
0
1

 r
1
1
0
1

1
0
1
1

0
0
0
0

1
0
1
1

1
0
1
1

1
1
1
1

0
0
1
1

0
1
0
1

1
1
0
1

1
0
1
1

1
1
0
1

0
0
0
0

1
1
0
1

r

(
q r)

9.6. p,
p q p q p { q . .
p = (p p) = p { p;

p q = (p q ) = (p { q ) =

= (p { q ) { (p { q );

p q = (
p q) = p { q =

= (p { p) { (q { q ):

{ { } .
,
 { { } .
p { q p { q .

272

,
p { q = (p q ) =



p q

= (
p { q) =


= (p { p) { (q { q ) :

p { q = (p { p) { (q { q )

{ (p { p) { (q { q ) :

9.7.  . 9.1.
pq

pq

pq

r

pq

9.1.

pqr pqr pq r pqr

 .
pqr pqr pq r pqr = (
pqr pqr ) (pq r pqr ) =
r r) =
= pr (
q q ) pq (
= pr pq:

9.8. f = pqr pq r pqr pqr: f 

. 9.2.
pq
r
r

pq

pq

pq

1
1

9.2.

273

 . ( 
).   :
pqr pq r = pr

pqr pqr = pr:

: f = pr pr:

9.9. pqr pqr .

. 9.3.
pq
r

pq

pq

pq

r
9.3. pqr pqr

 ,  pr .  . 9.4.
p
r

9.4. pr

9.10. 

p { (
q { r ) = p { (
q r) =

= p { (q r) =

= p (q r) =
= p (q r) =
= p (
q r ):

. 9.5.
9.11. pqr
pq r qr , pqr pq r pqr pqr , 
qr = (p p)qr:

274

pr pq . 9.7, , ,
pr pq = pqr pq r pqr pqr:

 , , . .
.
p

q
r

9.5.

(
q r)

9.12. , 
p { q = (p q ) = p q = (
p q) = (
p { q) =


= (p { p) { (q { q ) {

{ (p { p) { (q { q ) :

  . 9.6.
p

9.6.

 
. .

.1.

 .   
, | | . , , ,  

  ,   , .
, ,    .
  .    ( ,   ) .
, .  . 
, ,   , . ,
.   , ,
,  .
,  , . 
,  ,   
.   , . 
,  ,   ,   
, 
.
, , 
 . ,
.  
 . , , -

276

 

,  
.

  .
   ,  
 .
, ,  ,   ,
  , 
 ,   .
, ,   . ,  
, ,
  .

,
.  
,  [0; 1. ,
, ,
 ,
,  | .
  [0; 1
[21. , 
.
n m .  n n, 2m (  , 
) m | .
|  , ,  . , .
,  R,  [0; 1. ,
. . , , . R, ,
 k. , , 12R  [0; 12, nR | [0; n.
nR  . 
nR (, ,  nR). -

.1.

277

 . ,
R n, nR 0,
1. 
nR +1, | 1 n.
, , , 
nR +1. ,    ,  ,
. .  :  ,
| . .  n
,  , i-
j -
N = (n 1)i + j .  N = n R +1
,  , . .
. i j , .  , ,
:
 
N
i=
+ 1; j = N (i 1)n:
n
, , 
.
1

.1.1. 

M , n
m , n n 2m ,
 .
, , . . i = 1; 2; : : : ; n;
M (i; i) = . - (k = 1; 2; : : : ; m) 
 ,
(i; j )  .
(i; j ) i = j ,
m .

Input

n | ;
m | ;
M | n n,

begin
for k = 1 to m do
begin

 

1 ,

 1. , ,

nR + 1 =

, .

+ 1.

278

 


 R;
N := n R + 1;
i := N : n + 1;
j := N (i 1) n;
if M (i; j ) 6= and i 6= j then
begin
M (i; j ) := ;
M (j; i) := ;
2

end
Output M |

end

else

end

m := m + 1

.1.2. 

M , n m ,
nn m : ,
. - (k = 1; 2; : : : ; m)
  ,
(i; j )  .
(i; j ) i = j ,
, m .

Input

n | ;
m | ;
M | n n,

begin
for k = 1 to m do
begin

 

R;


N := n R + 1;
i := N : n + 1;
j := N (i 1) n;
if M (i; j ) 6= and i 6= j then
2

else

begin
M (i; j ) := ;
end

.1.

end
Output M |

end

279

m := m + 1

,
-  . |
. .
.1.3. 

, n m ,
nn m : , ,
. ,
,  . ,
- (k = 1; 2; : : : ; m)  
, (i; j )
i < j , (i; j ), i > j , (j; i)  .
(i; j ) ( i < j ) (j; i) ( i > j )
i = j ,
m .

Input

n | ;
m | ;
M | n n,

begin
for k = 1 to m do
begin

 


 R;
N := n R + 1;
i := N : n + 1;
j := N (i 1) n;
if i 6= j and i < j and M (i; j ) 6= then
M (i; j ) := ;
if i 6= j and i > j and M (i; j ) 6= then
M (j; i) := ;
else
m := m + 1
2

end

end

Output M | .
  , 
 , , 

280

 

.  . ,
 .
.1.1. , 5 8 , .
. n = 5 m = 8.
 :
 .1.1
k

2
1

0,21132

0,26215

0,79253

0,28052

0,93648

20

24

10

6
6
6
4

0,35606

10

3
7
7
7
5

7
7
7
5

6
6
6
4

6
6
6
4

6
6
6
4

2
7

6
6
6
4

6
6
6
4

7
7
7
5

7
7
7
5

7
7
7
5

7
7
7
5

.2.

281

. .1.1

2
8

0,16043

10

10

11

0,40480

0,74225

0,70183

11

19

18

10

11

11

7
7
7
5

2
9

6
6
6
4

6
6
6
4

6
6
6
4

6
6
6
4

7
7
7
5

7
7
7
5

7
7
7
5

 . .1.
.2.

 , ,
  ,
, . . 
.
,  
-
,   . 
| 
,     .
 ,  ( )

.1.

282

 

 
.
   .
W (. . 176),
 .   .
. G n
S n n,  i- j -
S (i; j ) = , i = j ,
i- j -. ,
S (i; j ) = S (j; i), . . .
, ( . 185).
C n n,
C (i; j ) = , i = j i j , , j - i-.
, S (i; j ) = (. . S (i; j ) = ,
i j   ).
C W , C (i; j ) = , 
i j , j i. , C (i; i) = i.  ,   i-
j - W (i; j ) = , W (j; i) = ,  j -
i-.  ,
  :

i = j;
C (i; j ) = ;
W (i; j ) W (j; i); i 6= j:
.  , 
(. . 177). , 
. 
 .  ,  S . 
.
.2.1. ,

G(V; E ) n M .
 W , W , . . . , Wn, 

W = M E;
0

283

.2.

E |

:::

:::

:::
:::
:::
:::

:::

 Wn | S , 
  :


Wk (i; j ) = Wk (i; j ) Wk (i; k) Wk (k; j ) ;
1

k = 1; :::; n; i = 1; :::; n; j = 1; :::; n:

. 178.
.2.1.  , G = (V; E ), . .2,
 .


2
3

M =
:


4
5
,  W
,
.  ,

W = M E =
:


 W  W  ,  , W .

? ? ? ? ?

W =
:

? ? ? ? ?
0

.2.

284

 

  W , ,
. 178. W   W   ,  
W . ,  W 
 W .

W =
:

? ? ? ? ?
  W .  
W    
 W . ,

W =
:


W .   W
,  W . W    ,
W , 
W .

W =
:


W W . 2 4
,  W . ,  W  
W .

W =
:


W . W .
,
  W
1

285

.2.

 W .
W , ( 2
4), .  W W
.

W =
:


 W . W
,   W
. W   

W .

W =
:


 ,

W =
:


 (. 282), 

C=
:


3
,
,
2
4
 .  - 1
5
.2.1 
(. . .3).
, ,  .  , .
4

.3.

286

 

.2.2. 

  , . 
.
, i- ,  i.
,
, 
.    ,  , ,
,   , , . 
  .

Input

V | G;
M | G;
C | G;

begin

p := 0;
B := C ;

while B 6= do
begin
p := p + 1;

Vp

B;

V,

Mp 
M , 

Vp ;
B ,
Vp ;
V Vp ;

Output

end

end

p |  G;
Vi , i = 1; 2; : : : p, | i- 
Gi G;
Mi , i = 1; 2; : : : p; | i-
 Gi G.

.2.2.   G, -

  .1.1, .

287

.2.

,  :
W

,  (. 282),


C=
:

 p :=0, B = C . B 6= , 

 .
{  p := p + 1 = 0 + 1 = 1;
{ V := {1; 3; 4; 5};
{ M , M ,  , V :
1

:=

 V
M   G.
{ B , V :
B := [ ;
{ V , V , V := {2}.
 B 6= ,  .
{  p := p + 1 = 1 + 1 = 2;
{ V := {2};
1

288

 

{ M , M ,  , 2 V :
M := [ :
 , V M
 G.
{ B , V :
B := :
 B = , , , .  
G.  . .4.
2

.3.

 ,  
3 2
.  ,
 ,
:

5
4
.   .
,  ,
. 
,  
, .  ,
, | .  .
 ( ) , ,  , . P  a G  ,
, .  
,  a.  , 
1

.4.

289

.3.

 , . . P = a a a : : : ak a. P
G, G , P .
G P .    G .  G ,
b
P
P as,

- G . as 
P ,
a
b
 G.   as , . .
P
P = as b : : : bm as . P P a

a
a
P = a a : : : as b : : : bm as as : : : am a;
a
, P (. . .5). P
,  .  ,
.
1

+1

.5.

.3.1. 

Input

G(V; E ) | 

begin

:= ;
a := d;

dV;

while E 6= do
begin

:= d;
P := ;

repeat
begin

d ,
(d; x) E ;

(d; y ) E :
(d; y) = P ;
P := P {(d; y)};
(d; y ) ;
d := y;
end;
until y 6=
if P 6= then
P := P (a; ) P P ( ; a);

290

 

else
end

P := P ;

end

Output P |
G
.3.1. G(V; E ),

V = 1; 2; 3; 4; 5; 6


E = (1; 2); (1; 4); (2; 3); (2; 4); (2; 5); (3; 4); (4; 6); (5; 6) :


. :  -

 ,   .
 d V .
{ d := 1;
{ P := ;
{ a := d = 1.
  while E 6= do ... end.  = ,
d , 1.
{ := d = 1;
{ P := .
  repeat . ..until y 6= .
{ (d; y) E : (d; y) = P , d = 1
( (1; 2));
{ : P := 1 2;
{ (1; 2)
( := {(1; 4); (2; 3); (2; 4); (2; 5); (3; 4); (4; 6); (5; 6)});
{ d := y = 2.
{ (d; y) E : (d; y) = P , d = 2
( (2; 3));
{ : P := 1 2 3;
{ (2; 3)
( := {(1; 4); (2; 4); (2; 5); (3; 4); (4; 6); (5; 6)});
{ d := y = 3.
{ (d; y) E , (d; y) = P , d = 3
( (3; 4));
{ : P := 1 2 3 4;

.3.

291

{ (3; 4)
( := {(1; 4); (2; 4); (2; 5); (4; 6); (5; 6)});
{ d := y = 4.
{ (d; y) E , (d; y) = P , d = 4
( (4; 1));
{ : P := 1 2 3 4 1;
{ (1; 4) ( := {(2; 4); (2; 5); (4; 6); (5; 6)});
{ d := y = 1.
 ,  .
 = ,  := = 1 2 3 4 1. 6= , 
.
{ d P , (d; x),  E ( d = 2);
{ := d = 2;
{ P := .
   repeat .. .until
y 6= .
{ (d; y) E , (d; y) = P , d = 2
( (2; 4));
{ : P := 2 4;
{ (2; 4) ( := {(2; 5); (4; 6); (5; 6)});
{ d := y = 4.

{ (d; y) E , (d; y) = P , d = 4
( (4; 6));
{ : P := 2 4 6;
{ (4; 6) ( := {(2; 5); (5; 6)});
{ d := y = 6.
{ (d; y) E , (d; y) = P , d = 6
( (6; 5));
{ : P := 2 4 6 5;
{ (6; 5) ( := {(2; 5)});
{ d := y = 5.

292

 

{ (d; y) E , (d; y) = P , d = 5
( (5; 2));
{ : P := 2 4 6 5 2;
{ (5; 2) ( := );
{ d := y = 2.
= = 2, .  6= , 
P := P (a; ) P P ( ; a) = P (1; 2) P P (2; 1) =
= 1 2 4 6 5 2 3 4 1:
, = . ,
.  : = 2 4 6 5 2 3 4 1.
.3.2. 

G , - 
,  ,
 . .
k G  (, k |
). , 
 G Pi . ,
k=2. ,
G  . , G G ,
k=2 E ,  .  G P .
P E k=2 ,  G.
, , ,  
, ,  ,  
.    ,
  , .
  ,

,   . G, 
  .   . Gd G, ,
,
.
 ,

.3.

293

 . , ,  
.
,  
,  , 
.
 a ,  -
P , , .  g  ,
 . g  (g; r),
,   .   g ,
.
,   g  P
; , P a .
 P  G  .
 a .  P a
, a  
a ; P
, a  .
   P .
 P a an ,  ai  . an
(ai ; an) ,  ,  .
 an  P  ; , an
 . .
0

Input

n | ;
V | ;
m | ;
E | ;
M | ;

begin

P := ;
k := 2m;
V := V ;

while k 6= 0 do

aV;

294

 

begin

(a; b),
M (a; b) = ,  
(a; b),
M (b; a) = ;
if b V then

begin

b V ;
 M (a; b) := ;

else

end
Output P |

end

end

P := P {(a; b)};
k := k 1;
a := b;

M (a; b) := ;

, 


.

.3.2.   

,  . .6  .

. , 
,   . 4 1.  . .4.2.
.
5
1
 ,
 :


= (1; 2); (2; 3); (3; 1); (1; 5); (5; 2); (2; 1); (1; 3); (3; 2); (2; 5); (5; 4); (4; 5); (5; 1) :
3

.6.

.4. 

  | .
,

295

.4. 

.
 .
, ,
 (   . 81).
 .4.2
k

(a; b)

2
12

{1; 2; 3; 4; 5}

6
6
6
6
6
4
2

11

(1; 2)

{1; 3; 4; 5}

{(1; 2)}

(2; 3)

{1; 4; 5}

{(1; 2); (2; 3)}

(3; 1)

{4; 5}

{(1; 2); (2; 3); (3; 1)}

(1; 5)

{4}

{(1; 2); (2; 3); (3; 1); (1; 5)}

(5; 2)

{4}

{(1; 2); (2; 3);


(3; 1); (1; 5); (5; 2)}

(2; 1)

{4}

{(1; 2); (2; 3); (3; 1);


(1; 5); (5; 2); (2; 1)}

6
6
6
6
6
4
2

6
6
6
6
6
4
2

6
6
6
6
6
4
2

6
6
6
6
6
4
2

6
6
6
6
6
4
2

10

6
6
6
6
6
4

3
7
7
7
7
7
5
3
7
7
7
7
7
5
3
7
7
7
7
7
5
3
7
7
7
7
7
5
3
7
7
7
7
7
5
3
7
7
7
7
7
5
3
7
7
7
7
7
5

296

 

. .4.2

2
5

(1; 3)

{4}

{(1; 2); (2; 3); (3; 1); (1; 5);


(5; 2) (2; 1); (1; 3)}

6
6
6
6
6
4

2
4

(3; 2)

(2; 5)

(5; 4)

(4; 5)

{4}

{4}

{(1; 2); (2; 3); (3; 1); (1; 5);


(5; 2) (2; 1); (1; 3); (3; 2)}

{(1; 2); (2; 3); (3; 1); (1; 5); (5; 2);
(2; 1); (1; 3); (3; 2); (2; 5)}

{(1; 2); (2; 3); (3; 1); (1; 5); (5; 2);
(2; 1); (1; 3); (3; 2); (2; 5); (5; 4)}

{(1; 2); (2; 3); (3; 1); (1; 5); (5; 2) (2; 1);
(1; 3); (3; 2); (2; 5); (5; 4); (4; 5)}

6
6
6
6
6
4

6
6
6
6
6
4

6
6
6
6
6
4

6
6
6
6
6
4

2
0

(5; 1)

{(1; 2); (2; 3); (3; 1); (1; 5); (5; 2) (2; 1);
(1; 3); (3; 2); (2; 5); (5; 4); (4; 5); (5; 1)}

6
6
6
6
6
4

3
7
7
7
7
7
5
3
7
7
7
7
7
5
3
7
7
7
7
7
5
3
7
7
7
7
7
5
3
7
7
7
7
7
5
3
7
7
7
7
7
5

, , ,  ,  ( ). ,   ,  , , , . 
 .
 , 
.
(a; S ) ,  S ; a S ,
 | ;  | .

.4. 

297

(a; S ) S , S

S {a}.

 (S )  S

.
(a; S ) S , S
S \ {a}.
(S ; S ; S ) S S , . . S = S S .
(S ) S .
  .   7 . 167 169 .  ,
, |  (S ).    v ; v ; : : : ; vp , v |
 , vi | vi (i = 1; 2; : : : ; p), vp
. vp
 .  vp ,
   .
  (S )   (v),  v.  .
1

Input

begin
if T = then output
else

;

(r)
( r |  );
:= l(v), v |
 ;


Output

end

,

 .

Pro edure (v).


begin
if v w then return (w)
else return v
end
.4.1. ,
. .7

298

 

.  , 1

if
(1).
1 |
3
2
2, then
end
(2).
2 | 4
6
4, - begin
while
(4).
4 ,
5
 4 else
 .
4 begin,
 = begin.
 (a; S )  . , ,  , 
v. :
v ; v  ;
v ;
v v, v ( v | ,
);
v ; 
v b,  ,
b,  v b. (, , a, b .
, , b, ,  , .)
,   (a; S ) ,
 S .    (a; S ),  
v,
 ( v l(v)). ,
 (a; S ) w,
v.  (a; S )
,  .
Pro edure (a; S )
begin
(1)
if v | then v 
else
(2)
if v
.7.

.4. 

(5)
(6)
(7)

u then
w then
u w

if v
else

(3)
(4)

299

else

u ,

 v


v
y;

return (b; S );

l(v) := b;

end
.4.2. (a; S )  S , . .7, a | if .
. if  -

1
1, (end
2 3),   (5)
. , if
3
(),  4
then
 begin
2, | end.  (end; S ).
5
6
(2) else
while
, 2 end . (3)
,
.  (4): 2 , 4
() 3 ().  (end; S ) .
 ( (7)): 
1 end (l(1) := end).
. .8.
, 
, .
,  
: leftson, rightson key.
:

v; v | i;
leftson(i) =
?; i ;

v; v |  i;
rightson(i) =
?; i  ;
key(i) = l (i) | i:
.8.

300

 

,  , . .7, 
 .
i

leftson

rightson

key

if

end

then

begin

else

while

 
. 
leftson rightson, .
, 4 2, 4
leftson.
.4.1.

 ,  S S ,  . 
   
. , ,   
. ,
  , 
.
 .   , ,
,  
S .
 , ,  
.

.
,  1, 2, . . ., n. , , |
. ,    .
, - ,  . 
.

(S ; S ; S ).
1

.4. 

301

r next n, r(i) |
, i, next(i) r,  , i. i |
 - ,  next(i) = 0.   list,
,
list(j ) 
j r.
, size, size(j ) j .
, r,
,   
.  ext-name int-name.
ext-name(j ) , j , int-name(k) | ,
k:
.4.3.   ,  {1; 3; 5; 7}; {2; 4; 8}; {6} 1, 2, 3
2, 3, 1 .
. , . r next n = 8.
, , list, size, ext-name
r | , int-name |
. 
.
 .4.3

 .4.4

 .4.5

next

list

size

ext-name

int-name

  (S ; S ; S )  S S   S .  S .
1

302

 

(i; j; k)
Input
i; j

|
i j );

(

r, next, list, size, ext-name, int-name;

(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)

Output

begin

A := int-name(i);
B := int-name(j );
element := list(A);
while element 6= 0 do

begin

(element) := B;
last := element;
element := next(element)
r

end

(last) := list(B);
(B) := list(A);
size(B ) := size(B ) + size(A);
int-name(K ) := B ;
ext-name(B ) := k

next
list

end

i; j

k.

 :
1)  i j ( (1) (2));
2)  
( (3));
3)   r
( (4){(7));
4)     ( (8){(10));
5)  k.
,     .
.4.4. (1; 2; 4)
 .4.3.

. ,  ,
 .4.6{.4.8.

303

.4. 

  . ,   ,  ,
| .  (S ; S ; S )
,  ,
S , S , , S S ( 
).    .
1

 .4.6

 .4.7

 .4.8

list

size

ext-name

next

3
4

int-name

  father , root , name , size ,


 .
father
,  : father (i) i. i | ,
father (i) = 0. root
, root (i) ,  i. size (i)
i. name (i) ,  i. i , name (i) = 0.
.4.5.  father , root , name size , 
 .4.3, ,

1 = {1; 3; 5; 7}; 2 = {2; 4; 8}; 3 = {6}
 , . .9.
.9.

304

 

. .4.9 .4.10.
 (i; j; k).
Input
i, j

|
i

(
father , name , root , size ;

begin

Output

end

j );

large := root (i);


small := root (j );
father (small ) := large;
size (k ) := size (large) + size (small );
name (large) := k ;
name (small ) := 0;
root (k ) := large;
root (small ) := 0;
root (large) := 0;
i j

 .4.9

k.
 .4.11

 .4.10

father

name

father

name

5
6

root

size

.4.6. (i; j; k)

 .4.3. .
.  (1; 2; 4)
.4.11 .4.12.  . .10.
 .4.12

root

size

2
.10.


. . , . .

2004    . .  ,
 ,
, .
. |   .
  , 

,   , , ,   .
   , 
.
  ,  .
.5. 

, , . 
  ,  , . , ,
,  , ,   .
 ,
   , 
 .

306

:
for i = 1 to n
for j = i to n i + 1
< >
for j
for i

end
end

 , n = 10?  . ,
 n,  
.  S (n)

S (n) = n + (n 2) + (n 4) + : : :
  .
 ,  ,  ,
 
.
, 
 .
.5.1.

,
  .  ,   ,
  .
:
a + a + + an ;
ak | k | 
. ak . ,   , , , k, . . ak = f (k).
  :
1+4+ +n ;
(.1)
1 + 41 + + n1 ;
(.2)
(.1) | f (k) = k , (.2) | f (k) = k .
   ,
,    .

.5. 

307

 , . - |  , - |  .   
,  :
n
X

k=1

ak ;

16

k 6n

ak :

(.3)

1820 -. , 
(.3),  . |   ak  k. |
n. , 1+2+3+4+5, 
1+2+ +5 P k,  1+2+3+4+5 = 15,
k
  .
 , 
| .  |
n
X
(a + (k 1) d) = na + (n 2 1)n d;
(.4)
k
 |
n
X
qn 1
aqk = a
:
(.5)
q1
k
(.4) (.5)  ,  .
,  ,
. , 
S (n),
5

=1

=1

=1

S (n) =

n
X

k=1

ak ;

. .  
. S (n)
. , 
S (n).
| .

, ,  n.
  , 
 . ,
.

308

, , , ,  n.


f n = 0,  f (n) = o(g (n)) (1. -. nlim


g n
).
2. -. , fg nn <
n,  f (n) = O(g(n)) ( O
). , o- O-,
.
3. . > 0
> 0, n ,  n > n  g(n) 6
6 f (n) 6 g (n),  f (n) = (g (n)). f (n) = (g (n)) ,
g(n)  f (n).
f n = 1,  f (n) g (n) (
4. . nlim
g n
). , : f (n) g(n),
f (n) = g(n) + o(g(n)).
 
.
(

S (n) =

n
X

k=1

ak ;

S (n) | g(n),
S (n) g(n). .
 S (n) = (g(n)), ,  , . S (n) = O(g(n))
  .
1

.5.1. O- S (n) = kPn k .


. , 1 6 k 6 n  k
3

=1

S (n) =

n
X

k=1

n
X

k=1

6 n3

=n :
4

 ,
S (n) =

n
X

k=1

= O(n ):
4

. , ,    n = 1, , ,
 n = n, n + 1.

309

.5. 

 ,  , g(n) = n

n
X
S (n) = k ; . . S (n) = (n ):
4

k=1

 
n ,  n > n 
n
X
S (n) = k > n :
(.6)
1

k=1

. 
. n  (.6).   , n > n 
1

S (n + 1) =

nX
+1
k=1

(n + 1) :

> 1

(.7)

 .
S (n + 1) =

S (n + 1) =

n
X

k=1

nX
+1
k=1

n
X

k=1

+(n + 1) ;
3

+(n + 1) = S (n) + (n + 1)
3

> 1 n4

+ (n + 1) :
3

 ,
n + (n + 1) > (n + 1)
(.8)
 n,  (.7),
.   (.8),
 , 
(n + 1) > ((n + 1) n ); 6 4n +(6nn+ +1)4n + 1 :
, n > 1 
(n + 1)
n
1;
>
=
4n + 6n + 4n + 1 4n + 6n + 4n + n 15
= , , S (1) = 1 > 1 , ,
,  n > 1 
n
X
1
S (n) = k > n :
15
1

15

15

k=1

,  n > 1  S (n) 6 n , ,
 = , = 1, S (n) = (n ), g(n) = n
 S (n).
4

15

310

 . , 
. |   . | , 

n
n
n
X
X
X
( ak + dbk ) = ak +d bk :

k=1

k=1

k=1

,   
 .
 .

n
n
X
X
U (n) = ak ; V (n) = bk ;
k=1

k=1

 k  ak 6 bk .  , U (n) 6 V (n).  
. ,
 .
.5.2. 
U (n) =

n
X

k=1

k+1

2k :
1

.  |
V (n) =

n
X

k=1

2k ;
1

| (.5) V (n) = P 2k = 2n 1.
k
k k < 1, U (n) 6 V (n) = 2n 1, ,
U (n) = O(2n ):
 .   |
 .   , ak = f (k), 
 y = f (x)   x.
y = f (x) , ,
=1

+1

ak 6

kZ+1
k

f (x) dx

ak >

Zk

k 1

f (x) dx;

311

.5. 

| S (n) = P ak
S (n) 6

k=1

nZ+1

f (x) dx

S (n) > a

Zn

f (x) dx:

y = f (x) , ,
kZ+1

ak >

f (x) dx

ak 6

k 1

S (n)
S (n) >

nZ+1

f (x) dx

Zk

S (n) 6 a

f (x) dx;

Zn

f (x) dx:

.5.3. S (n) = kPn k


1

  .
. f (x) = x ,
  .
nZ
n
1 dx 6 S (n) 6 1 + Z 1 dx;
=1

+1

, ln(n + 1) 6 S (n) 6 1 + ln(n). , S (n) ln(n). , , ,


S (n) = ln(n) + O(1):

.5.4. Pn 
S (n) =

k=1

ln k:

. y = ln x   ,
Zn

ln xdx <

n
X
1

ln k <

nZ+1

ln xdx:

ln xdx = x ln x x, 
R

n ln n n <

n
X

k=1

ln k < (n + 1) ln(n + 1) (n + 1):

312

 ,
n
X
ln k n ln n:
k=1

   n!. , n! = 1 2 3 n, 
n
P
n
n
k
n
n! = e
= ek ; n < n! < (n + 1) :
ln(

!)

=1

+1

ln

en

en+1

, n!,
(.,  [16).

.5.5. , kPn k = O(1).


. , ,
1

=1

n
X

k=1

n. f (x) = x ,   . 
n
n
X
1 6 1 + Z 1 dx = 1 1 + 1 = 2 1 6 2;
1

k=1 k

. , R dx
x = x.
.5.6. 
 ,
n
P
S (n) = k :
2

k=1

.   . ,  k > 1 
Zk

x dx < k <
3

k 1


S (n) =

k=1

x dx;
3

S (n) =
n
X

k+1
Z

n
X

k=1

k <
3

k >
3

Zn

nZ+1

x dx =

1
4

x dx = n ;
4

1 ((n + 1)
4

1):

.5. 

, g(n) =

1
4

313

S (n) n.

1 6 (1S=(4)nn) 6 (1=4)(((1n=+4)n1) 1) ;
(1 + 1=n) 1=n = 1:
lim (1=4)(((1n=+4)n1) 1) = nlim

n
1
 ,


S (n)
lim
= 1;
n (1=4) n
,
n
X
1
S (n) = k n :
4
4

k=1


 ,
 .
. ,
 
. 

n
X
(a + (k 1) d) = na + (n 2 1)n d:
k

n
X
S (n) = (a + (k 1) d):
.

S (n)

=1

k=1

n = 1  . ,
n, (n + 1)
S (n + 1) =

nX
+1
k=1

(a + (k 1) d) =

n
X

k=1

(a + (k 1) d) + a + nd = S (n) + a + nd;

 S (n) = na + (n 2 1)n d,
(n 1)n d + a + nd = (n + 1)a + n(n + 1) d;
S (n + 1) = na +
2
2
.
 . , S (n) , ,   ,
 
.

314

n  |
S (n) = P k :  
k
 n, . .
S (n) = An + Bn + Cn + Dn + E:
(.9)
S (1) = 1 | ,
A + B + C + D + E = 1:
S (n) (.9) |  ,
S (n + 1) = A(n + 1) + B (n + 1) + C (n + 1) + D(n + 1) + E;

S (n + 1) = S (n) + (n + 1) :
(.10)
,  (.10) S (n) (.9),
An + Bn + Cn + Dn + E + (n + 1) =
= A(n + 1) + B(n + 1) + C (n + 1) + D(n + 1) + E;
 n.   n,  
A, B, C , D.

4A = 1;

6A + 3B = 3;
4A + 3B + 2C = 3;

A + B + C + D = 1:
,  A = , B = , C = , D = 0. A, B, C , D
A + B + C + D + E = 1;
, E = 0, ,  (.9)
n
X
1 = 1 n + 1 n + 1 n = n (n + 1) :
S (n) =
k
4
2
4
4
k
,    
.
(1 + 2 + + n) = n(n2+ 1) ; (1 + 2 + + n ) = (1 + 2 + + n) :
 .    ,  , 
.   , 
.
3

=1

=1

.5. 

315

.5.7. S (n)
S (n) =

n
X

k=1

k(k + 2)

.  S (n)

1 ; S (2) = 1 + 1 = 11 :
3
3 8 24
 ,

n 
X
1
1
S (n) =
2k 2(k + 2) ;
k
 , 

n 
n
n
X
1X
11X
1 :
1
1
S (n) =

=
2k 2(k + 2) 2 k k 2 k k + 2
k
S (1) =

=1

=1

=1

=1


n
n
X
1 ; V (n) = X
1 ;
U (n) =
k
k
+
2
k
k
=1

=1

| V (n).  ,
 | 0 = + ,
1

n
1 = 1 + 1 +X
1 1 1 = nX 1 1 1 =
1 2 k k+2 1 2 k k 1 2
k k+2
n
X
= k1 + n +1 1 + n +1 2 11 12 ;
k
,
1 + 1 1 1;
V (n) = U (n) +
n+1 n+2 1 2



1
1
1
1
1
1
S (n) = (U (n) V (n)) = U (n) U (n)

+ + :
2
2
n+1 n+2 1 2
,  n > 3 S (n) = 34 2(n 1+ 1) 2(n 1+ 2) .

V (n) =

n
X

=1

=1

+2

=1

=1

316

.5.8. 
 ,  (.5).

. S (n) = kPn aqk .


1

=1

S (n) =

n
X

k=1

aqk

= a+

n
X

aqk

k=2

=a+q

n
X

k=2

aqk

= a + (q

k=2
n
aq aqn

 ,  0 = (
S (n) = a + (q

k=2
nX
+1

= a + q(


n
X

k=2

aqk
aqk

n
X

+ aqn) aqn = a + q(

) aqn = a(1 qn) + q(

aqk

k=1

k=1

aqk

aqk

+ aqn) aqn;

), 

k=2
n
X

n
X

n
X

+ aqn ) aqn =
1

aqk ):
1

= S (n);

 S (n) 
S (n) = a(1 qn ) + qS (n);
, 
n
X
qn 1
S (n) = aqk = a
:
q1
k
1

=1

 .  
 
. .

n
X
(.11)
S (n) = k3k :

k=1

.
f (x) =

n
X

k=1

kxk ;


x = 3, . .
n
X
k3k = f (3):
k=1

.5. 

317

, 
.
f (x) =
n
P
xk
k=1

n
X

k=1

kxk = x

n
X

k=1

kxk

n
X

= x dxd (

k=1

xk ):


n
n
X
X
xn 1 xn x
xk = x xk = x
= x1 :
x1
+1

k=1

k=1

,

n
d X
nxn
(
xk ) =
dx k

+1

=1

 ,

(n + 1)xn + 1 :
(x 1)

(n + 1)xn + 1 ;
(.12)
(x 1)
k
, ,  x = 3, 
n
X
3
k3k = f (3) = (n3n (n + 1)3n + 1):
4
k
,  
(.11) . , ,
f (x) =

n
X

kxk = x

nxn

+1

=1

+1

=1

S (n) =

n
X

k=1

k2k = f (2);

 ,
 (.12).
. ,

P
ak , , k 
.
=1

 .5.1

.5.1.1. kPn (2n 2k).


.5.1.2. kPn k k .
=1

=1

( +1)

318

.5.1.3.  kPn k.
=1

n
P

.5.1.4.  k
.5.1.5. , kPn

=1

k3

= O(1).

=1

.5.2.

 , . ,
 , , , ,  0; 7x = 2,
 , , , , . ,   ( ,
,  ).
 x = 0; 3x + 2, x = 1  xn , 

x = 1;
(.13)
xn = 0; 3xn + 2:
 ,  . . rn = |xn xn |.  (.13)
xn = 0; 3xn + 2, xn = 0; 3xn + 2,
xn xn = 0; 3 (xn xn ):
, rn = 0; 3 rn . ,  xn n.  x = 1, x = 2; 3,  n > 2
|xn x | = |(xn xn ) + (xn xn ) + + (x x ) + (x x )|:
 , 
|xn x | 6 |xn xn | + |xn xn | + + |x x | + |x x |;
,
|xn x | 6 rn + rn + + r + r ;
 rn = 0; 3 rn ,
|xn x | 6 0; 3n r + 0; 3n r + + 0; 3r + r :
 , 
1 0; 3n ;
|xn x | 6 r
1 0; 3
 xn .
.

+1

+1

+1

+2

+1

+2

+1

+1

+1

+1

.5. 

319

,  . dmn = |xn xm|,  , n > m.


 
dmn 6 rn + rn + + rm + rm ;
,
1 0; 3nm :
dmn 6 0; 3n r + 0; 3n r + + 0; 3mr + 0; 3m r = 0; 3m r
1 0; 3
 " > 0, n = n ("), , 
n > n , m > n  dmn < ". 
,  xn   n
.
xn = z ,   xn = 0; 3xn +2.
nlim

nlim
xn = nlim
(0; 3xn + 2),  z = 0; 3z + 2, ,

 .  , 
 ,   . , (.13) 
 
 .

.
a (a > 0),   |, , ,  . a 
x = a.
2x = x + a, 
1  a
x= x+ :
2
x
 xn,  :

x = 1;
(.14)
xn = (xn + xan ):
,   
. ,

1  a
y(x) = x + ;
2
x
, 
dy 1 
a
=
1

:
dx 2
x


  x = a.
y(x) (0; a) ( a; ).
  x = a
, , , 





1 a + a = a:
y>
2
a
1

+1

+1

+1

+1

1
2

320

, , ,
a: xn > a  n > 1. , , , , . . xn 6 xn  n > 2.
,  x > a 
1 x + a  6 1 x + x = x:
2
x
2
,  , , , xn = z , 
 . nlim




1
a
xn = xn +
;
2
xn
,  
1  a
z= z+ ;
2
z
z = a.  ,    ,
 ,   .
,  ,
 ,  .   .  , 
 .
 , , .
,   
, .
,  T (n),
n . ( , n > 0 n > 1).
.
. T (n) 
n: 1 6 n 6 m.
. , ,
T (n)  n 6 k (k > m),  n = k + 1,
. . T (k + 1) |  , 
.
 ,

.
n
P
, S (n) = ak
k


S (0) = 0;
(.15)
S (k) = S (k 1) + ak ; k > 1:
+1

+1

=1

.5. 

321

. f (n) = n!,
.  
n! = 1 2 3 (n 1) n;
  .   .

f (0) = 1;
(.16)
f (k) = k f (k 1); k > 1:
,  
.
 , 
 (. (.13), (.14)), (.
(.15), (.16)). ,   , . , 
 f (k) = ak .
 
. x ; x ; :::; xn 
, 
 .
xn = f (xn ; xn ; :::; xni ); n > i:
xn  , ,
  .
,   ,  ,  . , ,
. , , ,
 . 
    .  ,
,
.

 .
.

 -

  p .

322

an = an

+ an + + panp ; p 6= 0:
, .  b ; b ; :::; bn ; ;
:::; n .
B = {b ; b ; :::; bn}, C = { ; ; :::; n },  D = b B + C , ( b   ),
 , .
  p. , , p = 2. . 
dy
dy
+ d dx
+ d y = 0:
(.17)
dx
  2 
(.18)
an = an + an an an an = 0:

y = ex . (.17), 
 ex + d ex + d ex = 0;  + d  + d = 0:
    + d  + d = 0,
.

 2 an = rn . (.18),

rn = rn + rn ; r r = 0:
 r  r r = 0,
.
,  A B
 .
I.  + d  + d = 0
 = k ,  = k ,

 y = Aek x +
k
x
+Be . r r = 0 r = r , r = r ,
 an = Arn + Brn .
II.  + d  + d = 0
 =  = k,
1

323

.5. 

 y = Aekx +
kx
+Bxe . r r = 0
r = r = a,

n.
 an = Aan + Bna
n
. ,  an = a ,  r = a
.  an = nan.  (.18)
nan = (n 1)an + (n 2)an ;

nan (a a ) + an ( a + 2 ) = 0:
a | , (a a ) = 0,
. . a 2, ( a + 2 ) = 0.  ,  an = nan
.
III.  + d  + d = 0    = i,  y =
= Ae x os x + Be x sin x.
r r = 0 
 r = i,  an = A ( + i)n + B ( i)n.
 ,   . ,  
,
.  + i

+ i = ( os ' + i sin ');
p
   = + , ' 

os ' =  ; sin ' =  (0 6 ' < 2):
(( os ' + i sin ')) n = n( os n'+i sin n').  n ,  bn = n os n' n =
=  sin n' . 
 an = An os n' + Bn sin n'.
2

324

.5.9.  ()
fb(n),

fb(1) = 1; fb(2) = 1;
fb(n) = fb(n 1) + fb(n 2) ; n > 3:

(.19)

. , 
. r =
= r + 1 r r 1 = 0, , 

1
5
r; =
2 ;

!n
!n
1
+
5
1
5
fb(n) =
+d 2
:
2
2

1 2

  d. fb(1) = 1,
!
!
1
+
5
1
5

2 + d 2 = 1;
 (.19) fb(2) = 1,
!
!
1
+
5
1
5

+d 2
= 1:
2

 d. ,  = ; d = ;

!n
!n
1
1
+
5
1
1
5
fb(n) =

:
5 2
5 2
2

.5.10. -

 ( )

a = 7; a = 19;
an = 4an 3an ; n > 2 :
. r = 4r 3 r 4r +3 = 0,
 r = 1, r = 3,
an = + d 3n:
a = 7, + 3d = 7,  a = 19, + 9d = 19.
 ,  = 1, d = 2, 
an = 1 + 2 3n:
1

325

.5. 

.5.11. 
a = 4; a = 12;
an = 4an 4an ; n > 2:
1

. r = 4r 4 r 4r +
2

+4 = 0, ,  r = r = 2.
,
an = 2n + d n 2n :
a = 4, 2 + 2d = 4, . .
a = 12, 4 + 8d = 12.  ,  = 1,
d = 1,
an = 2n + n 2n :
.5.12.

a = 1; a = 2;
an = 2an 4an ; n > 2:
.
r = 2r 4 r 2r +4 = 0.
,  r ; = 1 3i.   ,  .   = 1 + 3 = 2. 

1
os ' = 2 ; sin ' = 23 ; ' = 3 ;

 n 
 n 
+
d 2n sin
an = 2n os
3
3 :
  ,



+ 3d= 1;
2 + 2 3d = 2;
,  = 1, d = 0,
 n 
an = 2n os
3 :
1

1 2

 

an = an

p.

+ an + panp;

rp = rp + rp + + p ;
1

p 6= 0;

326

rp rp rp p = 0:
r = b m,  m
an = bn ; an = nbn ; an = n bn ; : : : ; an = nm bn :
   r = ( os '
i sin ') m,
 2m :

an = n sin sn';
an = n os n' ;
n
an = n os n' ;
an = nn sin n';

m
n
an = n  os n' ; an = nm n sin n';
1

 ,  .
.5.13.


a = 3; a = 10; a = 19;
an = 4an 5an + 2an ; n > 3:
. r = 4r 5r + 2
r 4r + 5r 2 = 0.
r = r = 1, r = 2. r = 1 2,

: an = 1; an = n, r = 2 
an = 2n. 
an = b + n + d2n .  b, , d

b + + 2d = 3;
b + 2 + 4d = 10;

b + 3 + 8d = 19;
,  b = 0; = 1; d = 1,
an = n + 2n :
1

 -

p   p
an = an + an + + p anp + g(n);
(.20)
p 6= 0, g(n) | .
.  
g(n), (  )
. -
.   .


327

.5. 

, 
, .
g(n)  .  ,   . g(n) 
g(n) = g (n) + g (n) -
an = an + an + + p anp + g (n);
an = an + an + + p anp + g (n);
(.20).  , .
g(n) g(n) = Pm(n) bn, Pm(n)  m, an = ns Qm(n) bn,
Qm (n) |  Pm (n), s | r = b
. r = b , s = 0. , Pm(n) 
Pm (n) = Pm (n) 1n .
.5.14.
an = 4an 3an + 5 2n + (5n + 4):
1

. ,

r = 1, r = 3. an = + d 3n, d 
. 
g(n) = 5 2n + (5n + 4).
n
g (n) = 5 2 g (n) = (5n + 4).
an = 4an 3an + 5 2n.
g (n) g (n) = Pm(n)bn , Pm(n) = 5 |
 m = 0; b = 2  b = 2
,  s = 0. 
an = n Q (n) 2n = A 2n, A |
,  .
, 
1
A 2n = 4A 2n 3A 2n + 5 2n A = 5; A = 20;
4
, an = 20 2n.
an = 4an 3an + (5n + 4).
g (n) g (n) = Pm(n) bn, Pm (n) = 5n + 4 |
  m = 1; b = 1,  b = 1
1,  s = 1. 
an = n Q (n) 1n = n(An + B),
1

328

A B | ,  -

. , 
n(An + B ) = 4(n 1)(A(n 1) + B ) 3(n 2)(A(n 2) + B ) + (5n + 4):
  n, 
 A B.

4A + 5 = 0;
8A + 2B + 4 = 0;
,  A = , B = 7,
5
an = 20 2n + n( n 7):
4

5
an = 20 2n + n( n 7) + + d 3n ;
4
d |  .
5
4

   -

  
an = b(n) an + (n); n > 1;
a  .
F (n),
1 :
F (n) = Q
n
b(k)
.

k=1

.
an
n b(n)
= aQ
+ Qn (n) :
n
n
Q
b(k )
b(k)
b(k)
1

k=1

k=1

k=1

yn = b(n + 1) F (n + 1) an , 
 yn = yn + F (n) (n).

n
P
a
+
F (k) (k)
n
X
k
yn = y + F (k) (k); an =
:
b(n + 1) F (n + 1)
k
1

=1

=1

.5. 

329

 

n
Y

k=1

b(k) = e

ln

n
Q

k=1

b(k)

=e

n
P

k=1

ln

b(k)

 .
.5.15.

a = 0;
an = nn an + 2; n > 1:
.
1 = 1 :
F (n) = Q
n
n+1
0

+1

k=1

k+1
k

yn = b(n + 1) F (n + 1) an =

n+1
(n + 2) an = (n + 1) an:
n+2

 yn 

y = 0;
yn = yn + n ;

n
n
X
2 ; an = 2(n + 1) X
1 :
yn =
k+1
k+1
0

+1

k=1

k=1

 , -

 , T (n).
,    |
 f (n), T (n)
n, . .  n > 1  T (n) 6 f (n).   .
f (n), , ,
  .
 .
.5.16. ,

T (1) = ;
(.21)
T (n) = 2T ([ n ) + n; n > 1;
, [x .
.

330

. f (n) f (n) = a n log n + b, a b  -

.  .
n = 1 ,  b > . , k < n 
T (k) 6 a k log k + b:
k = [ n ,  (.21) 
h n i
 n
n 
T (n) = 2T
+
n 6 2 (a k log k + b) + n 6 2 a log + b + n =
2
2 2
= a n log n a n + n + 2b 6 a n log n + b:
 , a > +b.  ,
   , b > a > + b.
 b = , a = + .  , 
n > 1
T (n) 6 ( + ) n log n + :
, T (n) = O(n log n). ,   , ,   . , T (n)
f (n) = n log n. ,
 
T (n) 6 ( + ) n log n + ;
n = n, n , n = n + 1  . 
  , n 
n = n + n mod 2:
2

 | , 
.
.5.17. T (n) = 3T ([ n ) + n:
. m, 4m < n 6 4m, 
 
T (n) 6 3T (4m ) + 4m;
T (4m ) = 3T (4m )+4m ,    , 




3
m

m
m

m
T (n) 6 3 3T (4 ) + 4
+4 =3 T 4 +4 1+ 4 :

T (4m ) = 3T (4m ) + 4m ;
.

.5. 

331

 

3 3 ;
T (n) 6 3 T (4 ) + 4 1 + +
4 4
  , 
 
 m !
3
3
3
m
m
T (n) 6 3 T (1) + 4 1 + +
+
+
:
4 4
4
 q = 3=4,  , 4,
T (n) 6 3m T (1) + 4m :
m m 6 log n + 1,
T (n) 6 3 n T (1) + 16n;
3 n = n = o(n), T (n) = O(n).
3

m3

+1

log4

log4

+1

log4 3

, 1980 . . , .
. [20 
 .   
,  . ,  .5.16
, . | .
. (J. L. Bentley, Dorothea Haken, J. B. Saxe, 1980) a > 1 b > 1 |
, f (n) | , T (n)  
n
h n i
T (n) = aT
+ f (n);
b
:
1) f (n) = O(n b a") " > 0,
T (n) = (n b a );
2) f (n) = (n b a),
T (n) = (n b a logb n);
3)
> 0 " > 0,  n  f (n) >
> n b a "  d < 1, ,  n 
n
a f ( ) 6 d f (n); T (n) = (f (n)):
b
.

log

log

log

log

log

332

 
.
.5.18.  T (n) = 8T ([ n )+n:
. a = 8, b = 4, f (n) = n,
n ba = n
= n = nn:
f (n) = O(nn) " = 1=:2, ,  
, , T (n) = (n n).
.5.19.  T (n) = T ([ n )+5:
. a = 1, b = 4=3, f (n) = 5,
n b a = n = = n = (1);
  .
f (n) = 5 = (n b a ) = (1);
 T (n) = (log = n).
.5.20. 

h n i
T (n) = 2T
4 + n log n:
. a = 2, b =; 4," f (n) = n log n, n b a = n = n =: = n,
f (n) = n log n > n ,  n " = 0; 5.   .
n
 
2f n4 = 2 n4 log n4 6 12 n log n = d f (n); d = 12 < 1;
, T (n) = (n log n).
4

log

3
2

log4 8

log

log4 3 1

log

4 3

log

0 5+

log4 2

 .5.2

.5.2.1.   .
.5.2.2. ,

(
a = 1; 
an = 2an
1

+ an ; n > 1;
  n .
.5.2.3.
1
2
2 1
an = an + n + n :
3
3
3 3
1
3

.5. 

333

.5.2.4.
an = 2an

+ 2:
.5.2.5.
an = 5an 6an :
.5.2.6.
an = 6an 9an
.5.2.7.
an = 2an 2an :
.5.2.8. ,

, 
| A(3; 5),

n + 1; m = 0;
A(m; n) = A(m 1; n); n = 0;

A(m 1; A(m; n 1)):


n

.5.3. .

 .  D, 
f (x + h) f (x)
Df (x) = lim
:
h
h
, 
.
 , 
f (x) = f (x + 1) f (x):
  - ,
, h 0,
| h = 1.
, . , ,
 .
.

334

 D


|
,
R . 


g(x) = Df (x); ,
R
R
g(x)dx =f (x) + C:  g(x)dx | 
g(x) ,  g(x).
 -  
 P. -   .
g(x) = f (x);
,
X
g(x)x = f (x) + C:
P
g(x)x  g(x) |
, g(x). C   , 
C p(x), p(x + 1) = p(x):
, , ,
,   |
 .
  . , .
 { :
  .

 .

g(x) = Df (x)

Zb

= f (b) f (a):

= f (b) f (a):

g(x)dx = f (x)

 
g(x) = f (x)
b

b
X
a

g(x)x= f (x)

 P g(x)x   , a
,  . 
.  .
k=b
X

k=a

g(k); b > a:

(.22)

, - 
g(x), f (x), . . g(x) = f (x + 1) f (x): 

.5. 

335

k g(k) = f (k + 1) f (k). (.22)  

k=b
X

k=a

g(k) = g(a) + g(a + 1) + g(a + 2) + + g(b 1) + g(b):

 g(x) f (x),
(.22) 
k =b
X

k =a

g(k) = (f (a + 1) f (a)) + (f (a + 2) f (a + 1))+

+ (f (a + 3) f (a + 2)) + + (f (b) f (b 1)) + (f (b + 1) f (b)) :


 ,
.   
k=b
X

k =a

g(k) = f (b + 1) f (a);

   , . .
b
X
a

g(x)x =

k=
b1
X
k=a

g(k):


Za

Zb

g(x)dx = 0;

g(x)dx =

Za

g(x)dx;

 
 :
a
P
1)

g(x)x = 0;

2)  b < a P g(x)x = P g(x)x.


a
b

Zb

g(x)dx +

g(x)dx =

g(x)dx:



b
X
a

g(x)x +


X
b

g(x)x =


X
a

g(x)x:

336

   
 
D

Zx

g(t)dt = g(x):

,


b+1
X
a

g(x)x

b
X
a

g(x)x = (f (b + 1) f (a)) (f (b) f (a)) = f (b + 1) f (b) = g(b):

,  .
k b
P g(k); -
k a
 g(x)
X
g(x)x = f (x);
. . f (x), 
f (x + 1) f (x) = g(x):
   
(, f (x) ),

=

k=b
X

k=a

g(k) =

b+1
X
a

g(x)x = f (b + 1) f (a):

,  
 . ,   , 
 .

  f , f , 
f (x) = f (x + 1) f (x):
 f ,
 f , 
 f (x) = (f (x)):
,
 f (x) = (f (x)) = (f (x + 1) f (x)) =
= (f (x + 2) f (x + 1)) (f (x + 1) f (x)) = f (x + 2) 2f (x + 1) + f (x) :
 n  nf (x) = (n f (x)).  
,  nf (x).
.

337

.5. 

.5.21.   f (x) = x .
.
4

(x ) = (x + 1) x = 3x + 3x + 1:
 (x ) = ((x )) = (3x + 3x + 1) =
= (3(x + 1) + 3(x + 1) + 1) (3x + 3x + 1) = 6x + 6:
 (x ) = ( (x )) = (6x + 6) = (6(x + 1) + 6) (6x + 6) = 6:
 (x ) = ( (x )) = (6) = 0:
2

.5.22. f (x) = ax.


.
(ax ) = ax

+1

ax

= (a 1)ax:

(2x x) = 2x.  n(ax) = (a1)nax,


x
, D(e ) = e ,
 f (x) = 2x
 .
.5.23.  (ax)
.

.  kkPn aqk
=

g(x) = qx . 

=1

f (x) =

kX
=n
k=1

aqk1

qx
;
q1

. .

nX
+1

aqx1 x

qx x =
1

n+1

x
= a qq 1
1

qx
;
q1
1

n
= a qq 11 :

 E ,  E (f (x)) = f (x + 1); I 
I (f (x)) = f (x);
  
(f (x)) = f (x + 1) f (x) = E (f (x)) I (f (x)) = (E I )(f (x)):

338

E = I ,
n(f (x)) = (E I )n(f (x)) = E n (f (x)) n E n (f (x)) +
+ (1)k Cnk E nk (f (x)) + + (1)n E (f (x)) =
= f (x + n) nf (x + n 1) +
+ (1)k Cnk f (x + n k ) + + (1)n f (x);
Cnk = k nnk | . ,
 . C (n; kk),
 ,  | Cn .
   (f (x)),
 (f (x)) = f (x + 4) 4f (x + 3) + 6f (x + 2) 4f (x + 1) + f (x):
 E ,
 .
E 
1. . f g,
a b  E (af + bg) = aE (f ) + bE (g); (af + bg) = a(f ) + b(g).
, : E  = E ; E (a) = a; a = 0.
2. .    .

D(fg) = fD(g) + gD(f ):

(f (x)g(x)) = f (x + 1)g(x + 1) f (x)g(x) =
=f (x + 1)g(x + 1) f (x)g(x + 1) + f (x)g(x + 1) f (x)g(x) =
=g(x + 1)(f (x + 1) f (x)) + f (x)(g(x + 1) g(x)) =
=(f (x))E (g(x)) + f (x)(g(x)) = (f g + Eg f )(x);

(fg) = f (g) + E (g) (f ):
(.23)
3. .  

 
f
D
= gD(f ) g fD(g) :
g




1) f (x) = f (x + 1)g(x) f (x)g(x + 1) =
 fg((xx)) = fg((xx ++ 1)
g(x)
g(x)g(x + 1)
= f (x + 1)g(x) f (x)gg((xx))g+(xf+(x1))g(x) f (x)g(x + 1) =
= g(x)(f (x + 1) fg((xx)))g(xf+(x1))(g(x + 1) g(x)) = g(x)(fg((xx)))g(xf+(x1))(g(x)) ;
0

!(

)!

339

.5. 

(.24)
 fg = g (gf ) E(fg) (g) :
,
(.23) (.24).
 

.5.24.


) (2x + 3x + 4x + 5); ) ((x + 4x + 3)(x + 5)); ) ( x x x ).
. , (x) = (x +1) x = 1, (x ) = (x +1) x =
2x + 1, , (x ) = 3x + 3x + 1.
) (2x + 3x + 4x + 5).
(2x + 3x + 4x + 5) = 2(x ) + 3(x ) + 4(x) + 5(1) =
= 2(3x + 3x + 1) + 3(2x + 1) + 4(1) + 0 = 6x + 12x + 9:
) ((x + 4x + 3)(x + 5)).  (.23), 
((x + 4x + 3)(x + 5)) = (x + 4x + 3) (x + 5) + E (x + 5)(x + 4x + 3) =
= (x + 4x + 3) 1 + ((x + 1) + 5)(2x + 1 + 4)) =
= (x + 4x + 3) + (x + 6)(2x + 5):
) ( x x x ). (.24)


x + 4x + 3
 x + 5 = (x + 5) (x + 4(xx++3)5)E((xx++5)4x + 3) (x + 5) =
+ 4) (x + 4x + 3) 1 =
= (x + 5) (2(xx ++ 15)((
x + 1) + 5)
= (x + 5)(2(xx++5)5)(x (+x 6)+ 4x + 3) :
3

+4 +3
+5

+4

+3

+5


(xn ) |  
(xn ) = (x + 1)n xn = nxn + n(n2 1) xn + + Cnk xnk + + 1;

D(xn ) = nxn :
, f (x) = xn
, ,  ,    . 
,  .
.

340

f (x) = x n , 
.  x > n > 0
 n
x = 1; n = 0;
x n = x (x 1) (x 2) (x n + 1); n > 0:
f (x) = x n   n,
  , . , .
(x n ) = (x + 1) (x) (x 1) (x n + 2) x (x 1) (x 2) (x n + 1) =
= (x (x 1) (x 2) (x n + 2)) ((x + 1) (x n + 1)
= nx (x 1) (x 2) (x n + 2) = nx n :
 ,  n f (x) = x n
, , f (x) = x .
 n
f (x) = an x n + an x n + + a x + a x + a :
 .
.5.25.
f (x) = 4x 5x + 7x + 2:
(

1)

1)

(3)

(f (x)) = (4x


= 4 3x

(3)
(2)

(2)

(2)

(1)

(1)

5x + 7x + 2) = 4(x ) 5(x ) + 7(x ) + (2) =


5 2x + 7 1 + 0 = 12x 10x + 7:
(2)

(1)

(3)

(1)

(2)

(2)

(1)

(1)

 ,
 . 
,  , .
. ,  
f (x) = an xn + an xn + + a x + a x + a
( n > 1)   (x a),
x = a, . . f (a).
 
 |  f (x) = x . ,
, ,
x =a x +a x +a x +a x +a :
 
x = a x(x 1)(x 2)(x 3) + a x(x 1)(x 2) + a x(x 1) + a x + a :
1

(4)

(3)

(2)

(1)

341

.5. 

     x. ,   , :
| ,  | a , a = 0.
x ,  
a (x 1)(x 2)(x 3) + a (x 1)(x 2) + a (x 1) + a ;

x = a (x 1)(x 2)(x 3) + a (x 1)(x 2) + a (x 1) + a :
    | (x 1). :
1,  | a , a = 1.
| x + x + 1,  | a (x 2)(x 3) + a (x 2) + a ,
x + x + 1 = a (x 2)(x 3) + a (x 2) + a :
(x 2). : 7,  | a , a = 7. : | x + 3,  |
a (x 3) + a , x + 3 = a (x 3) + a .
 |  (x 3). :
6,  | a , a = 6. : | 1,
 | a , a = 1. 
x = x + 6x + 7x + x :
,    . , 
  
. 


 x n = nx n , , ,  xnn = x n ;

X
xn
x n x =
;
n+1
   .
n
P
  x k :
k
f (x) = x 
x = x + 6x + 7x + x ;

(4)

(3)

(2)

(1)

( +1)

1)

+1

+1)

=0

n
X

k=0


x=0

x x =
4

nX
+1
x=0

(3)

(5)

(4)

(3)

(4)

(3)

(2)

 n+1

0

(2)

(1)

(x + 6x + 7x + x )x =

x
x
x

+
6
+
7
+
5
4
3
2
1)(3n + 3n 1) :
= n(n + 1)(2n + 30

nX
+1

(4)

(2)

(1)

x(x 1)(2x 1)(3x

30

3x 1  n =

+1

342

 
, n > 0.  . 

xn
x n =
:
(.25)
xn+1
   x n
. n = 1, 

xn
(

.

1)

= x x1 + 1 = 1;
(1)

(0)

 n = 0,

= x x0 + 1 = x +1 1 :
 (.25) ,
1
x m =
(m + x) m ;
m > 1,  . m = 1 
1 = 1 :
x =
(1 + x) (1 + x)
x
(

(0)

1)

1)

(1)

, x k =
(

x k
(

k x)(k) ;
1

( +

k
= x +x k + 1 = (x +1k) k x + 1k + 1 =
= (x + k)(x + k 1 1) (x + 1) x + 1k + 1 =
= (x + k + 1)(x + k)(x1 + k 1) (x + 1) = (x + k 1+ 1) m :
(

1)

( )

  , (x n ), 


1
1
n
(x ) =  (x + n + 1) n (x + n) n =


1
1
= (x + n + 1) (x + n) (x + 2) (x + n) (x + n 1) (x + 1) =


1
1
1
= (x + n) (x + n 1) (x + 2) (x + n + 1) (x + 1) =
(

= (x + n + 1) (x n+ n) (x + 1) = (x + n +n1) n = nx n :

 f (x) = xn , : D(xn) = nxn .
(

1)

+1)

343

.5. 

,  x n
(

x n
(n + 1) :

x n x =
(

+1)


 .   |  .

f g 
(fg) = f (g) + E (g) (f );

X
X
X
(fg)x = f (g)x + E (g) (f )x;
, 
X
X
f (g)x = (fg) E (g) (f )x;
 .
 .

.5.26. S (n) = kPn k2k .


.
=0

P x
x

kX
=n
k=0

= 2x ;

(1)

nX
+1

k2

nX
+1

x2x x;

= x;  

x2x x =

nX
+1

(1)

(2x)x;

  , 
nX
+1

x2x x =

nX
+1

(1)

(1)

n+1

= (x2x)

n+1

(2x)x = (x (2x))

= (n + 1) 2n
S (n) =

nX
+1
0

+1

n
X

k=0

n+2

+ 2;

k2k = (n + 1) 2n

+1

E (2x )(x

(1)

)x =

n+1

(2x )x = (x2x)
+1

nX
+1

n+2

n+1

(2x )
+1

+ 2:

344

.5.27. S (n) = kPn k 3k .


.
P x  .
2

=0

1) 3 x = x .
2) x = x(x 1) + x = x + x .
3) E (3x) = 3x = 3 3x.
,   ,
n
nX
nX 
1
X
k 3k =
x 3x x =
x +x
(3x)x =
2
k

 n
nX
1



1
x

= x + x 2 (3 ) 2 E (3x) x + x x =
nX 
n

= 12 x 3x 32
2x + 1 3xx =
nX 
  3x 
 n
1
3
x
=2 x 3 2
2x + 1  2 x =
nX
n

 n


= 12 x 3x 34 3x(2x + 1) + 43 E (3x) 2x + 1 x =
nX
n

 n
= 12 x 3x 34 3x(2x + 1) + 29 3xx =
n
n

 n
= 12 x 3x 34 3x(2x + 1) + 29 12 (3x) =
= 12 (n + 1) 3n 34 (2n + 3) 3n + 34 + 94 3n 94 =
n
= 3 2 (n n + 1) 32 :

n
X
3n (n n + 1) 3 :
S (n) = k 3k =
2
2
3

(2)

(1)

+1

+1

+1

=0

(2)

(1)

+1

(2)

+1

(1)

(2)

+1

+1

(1)

+1

+1

(1)

+1

+1

+1

(1)

+1

+1

(1)

(1)

+1

+1

+1

(1)

(1)

+1

+1

+1

+1

+1

+1

k=0

 .5.3

.5.3.1.  x 5x.
x
.5.3.2.  2x3+ 1 .
.5.3.3.  x + 7 x.
2

.5. 

345

.5.3.4. f (x) = x :
.5.3.5.
3

f (x) = 2x

.5.3.6. kPn k .
.5.3.7. kPn k 2k .

3x + 5x 1:
2

=0

=0

.5.4.



(a ; a ; a ; : : : ; an; ):
 .
,   , ,
, .    ,
.    , 


X
ak z k ;
(.26)
k
z  .
( G(z))  .  , 
G(z)  (a ; a ; a ; : : : ; an; )
0

=0

G(z ) =

k=0

ak z k :

  .
. ,
,
.  | , G(z),  (a ; a ; a ; : : : ; an; ), |
.
 .  (.26)
  z = 0,
G(z) .   (a ; a ; a ; : : : ; an; ) 
0

346

z = 0. 

1
an = Dn (G(z )) ;
(.27)
n!
z
=0

Dn (G(z)) z   n G(z)
z = 0.
  .
.5.28. 
, 
G(z) = (az + b)n.
. ,   
,  :
D((az + b)n ) = n(az + b)n a;
D ((az + b)n ) = n(n 1)(az + b)n a ;
Dk ((az + b)n ) = n(n 1) (n k + 1)(az + b)nk ak ;  k 6 n;
Dk ((az + b)n ) = 0;  k > n:
 
(.27),

a = bn; a = nabn ; a = n(n 1)a bn ;

1 n(n 1) (n k + 1)a2!k bnk ; k 6 n;


a
=
k

k!

ak = 0; k > n:
,
n(n 1) 2 1
1 n(n 1) (n k + 1) = 1
= n! = Cnk ;
k!
k! (n k)(n k 1) 2 1 k!(n k)!
Cnk | , ,
 n  k.  ,   (a ; a ; a ; : : : ; an; ),

ak = Cnk ak bnk ; k 6 n;
(.28)
ak = 0; k > n:


=0

. G(z) = (z b)n,

ak = Cnk (1)nk bnk ; k 6 n;
ak = 0; k > n:
, G(z) = (1 + z)n,  (.28)

ak = Cnk ; k 6 n;
ak = 0; k > n;

.5. 

347

. . G(z) = (1 + z)n   n  k.

1 ; m > 0;
G(z ) =
(az + b)m

1
(m + 1)(m + 2) (m + k) ak ;
k
k
D (g(z )) = D
=
(
1)k
m
(az + b)
(az + b)m k

1
(m + 1)(m + 2) (m + k) ak = (1)k ak 1 1 2 (m + k) ;
ak = (1)k
k!
bm k
bm k k!
1 2m

+1

+1

+1+

+1+

+1+

ak
ak = (1)k m k Cmm k :
b

(.29)

+1+

, 
1
G(z ) =
(z b)m ;

1
ak = (1)m m k Cmm k :
b
,
1
k
m
G(z ) =
(1 + z)m ak = (1) Cm
,
1
m
G(z ) =
(1 z)m ak = Cm k :
+1

(.30)

+1

+1+

k;

+1

, m = 0 |
1
G(z ) =
(1 + z) ;

ak = (1)k , . . 
, , ,
1
G(z ) =
(1 z)
ak = 1, . .  .
 
1 zn :
G(z ) =
(1 z)
+1

348

,
, ,
,
1 zn = 1 + z + z + + zn:
G(z ) =
(1 z)
,  , : ak = 1  k 6 n; ak = 0  k > n.
 ,  .
 G(z)  (a ; a ;
a ; : : : ; an ; ).  G (z ) = z n G(z ), n > 0  (b ; b ; b ; : : : ; bn; ) 
: bk = 0  k < n; bk = akn  k > n.  
 zn 
n . 

1 zn
G(z ) =
(1 z)
.
, 
  .
 .  (a ; a ;
a ; : : : ; an ; ) (b ; b ; b ; : : : ; bn ; ),  , G (z) G (z), 
( a + d b ; a + d b ; : : : ; an + d bn; : : :)
 G(z)
G(z ) = G (z ) + d G (z ):
+1

+1

, 
,  ,  .  n (
Pn(z))
Pn (z ) = an z n + an z n + + a z + a z + a ;
a ; a ; a ; : : : ; an  , an 6= 0.
, Pn ( ) = 0. ,  Pn(z) =
= (z )Pn (z), Pn (z) | .
r,  Pn (z) = (z )r Pnr (z), Pnr ( ) 6= 0.  n
.

349

.5. 

n . ,
Pn (z ) = an z n + an z n + + a z + a z + a
k ; ; :::; k r ; r ; :::; rk , . .
(r + r + + rk = n), 
Pn (z ) = an (z )r (z )r (z k )rk :
1

R(z) = PPmn zz ;
Pn (z ) Pm (z ) | .
 , 
 . 

. R(z) = PPmn zz 
, 
R(z ) = Pnm (z ) + R (z );
Pnm(z)  n m, R (z) |  .
( )

A
R(z ) =
(z a)m :

R(z )

( )

( )

( )

( )

 .    ,  .      .  .
.    .
 
.

P (z )
R(z ) = n ; m > n;
Pm (z )
 Pm (z) = bmzm + bm zm + + b z + b z + b
k ; ; :::; k r ; r ; :::; rk ,
, 
Pm (z ) = bm (z )r (z )r (z k )rk ;
.

350

R(z) 
P (z )
Pn (z )
R(z ) = n =
=
P (z ) b (z )r (z )r (z )rk
=

A ;r1
A ;r1
(z )r1 + (z )r1
A ;r2
A ;r2
+
r
2
(z ) (z )r2
Ak;rk
Ak;rk
+
r
k
(z k ) (z k )rk
1

+ + (zA; ) +
+ + (zA; ) +
+ + (zAk; ) :
k
1

2 1

1 1

+
   .
.5.29.  (a ; a ; a ; : : : ; an), 
4z z 9 :
G(z ) =
(z + 2)(z + 1)(z 1)

.   . 

4z z 9
A
B
C
(z + 2)(z + 1)(z 1) = (z + 2) + (z + 1) + (z 1) :
  A; B; C .  , (z +2)(z +1)(z 1), . . ,  
, 
4z z 9 = A(z + 1)(z 1) + B(z + 2)(z 1) + C (z + 2)(z + 1): (.31)
(.31)   
z   A, B , C .

A + B + C = 4;
B + 3C = 1;

A 2B + 2C = 9:
, . ,
, 
  . (.31) , z.  z = 2,  9 = 3A, A = 3,
 z = 1, 4 = 2B, , B = 2. z = 1
6 = 6C , C = 1.  ,
4z z 9
3
2
1
(z + 2)(z + 1)(z 1) = (z + 2) + (z + 1) (z 1) :
2

351

.5. 

z , (.29) n  (b ; b ; b ; : : : ; bn; ) bn = n , z , bn = (1)n, z


(.29)  bn = (1). ,
.
.5.30. , 
4z 8
G(z ) =
(z 3)(z 1) :
. , 
A
B
C
4z 8
(z 3)(z 1) = (z 3) + (z 1) + (z 1) :
 
, 
4z 8 = A(z 1) + B(z 3) + C (z 3)(z 1):
(.32)
  z, 
 A, B, C .

A + C = 0;
2A + B 4C = 4;

A 3B + 3C = 8:
, . 
 1.29, (.32) , z. 
z = 3,  4 = 4A, A = 1,  (.32) z = 1
4 = 2B , B = 2.  , C = 1,
4z 8 = 1 + 2 1 :
(z 3)(z 1) (z 3) (z 1) (z 1)
z (.29)  bn = n , z  (b ; b ; b ; : : : ; bn; ) bn = C n = (n + 1). z  .   .
.5.31.  (a ; a ; a ; : : : ; an; ),
 G(z) = z z :
. G(z)
4
G(z ) =
(z (1 + i))(z (1 i)) :
1

+2

1)
2 +1

0
1

+1

3 +1

0
1

1
1+

2 +2

1)2

352


4
A
B
(z (1 + i))(z (1 i)) = (z (1 + i)) + (z (1 i)) :
,  , 
A = 2i, B = 2i,
2i
4
2i
(z (1 + i))(z (1 i)) = (z (1 + i)) + (z (1 i)) :
z i , (.29),  bn = i n ; z i ;
 ( ; ; ; : : : ; n; )
1
n =
(1 i)n :



1
1
i
n
n
an = 2ibn + 2i n = 2i

=
n
n
(1 + i)
(1 i)
2n ((1 i) (1 + i) ):
,






1 + i = 2( os 4 + i sin 4 ); 1 i = 2 os 4 + i sin 4 ;



(1 + i)n = 2 n os(n + 1) 4 + i sin(n + 1) 4 ;





(1 i)n = 2 n os(n + 1) 4 + i sin(n + 1) 4 :
,
  
 
n
i n 
an = n 2
=
2
sin(
n + 1)
2i sin(n + 1)
2
4
4 :
1

(1+ ))

1
(1+ ) +1

(1

))

+1

+1

+1

+1

+1
2

+1

+1
2

+1

+1

+1
2

3
2


   .
,   .
.5.32. an
a = 0;
an = an + n ; n > 1:
.

.  G(z) = nP anzn:

=0

1
2

an = an

+ 21n

.5. 

353

zn   n 1 , 

X
X
1X
1 z n;
an z n =
an z n +
n
2
2
n
n
n
 a = 0,

X
X
an z n =
an z n = G(z ):
1

=1

=1

=1

n=1

n=0

 ,

n=1

X
an z n =
an z n
1

=z

+1

n=0
 n
X
z

n=0

an z n = zG(z );

1 zn =
= z2 1 1 z = z z 2 ;
n
2
2
n
n
.   G(z)
z
1
G(z ) = zG(z )
;
2
z2
,
2z :
G(z ) =
(z 2)
=1

=1

, (.30), 1
n+1
bn = n Cn = n :
2
2
z  ,
  n > 1
n
an = 2bn = n :
2
,  a = 0,  n = 0.
1

z2)2

+1

+2

+2

.5.33.

a = 0;
a = 1;
an = an
0
1

1
8

an

9
32

n + ; n > 2:
3

.  G(z) = nP anzn:

zn   n  2 6 n < .

X
1X
3X
9X
3X
an z n =
an z n
an z n +
nz n +
z n:
4
8
32
8
n
n
n
n
n
=0

=2

=2

=2

=2

=2

354

X
X
n
an z =
an z n a
n=2

X
n=2

X
n=2

X
n=2

n=0

an z n =
1

an z n =
2

nz n

=z
z

zn =

n=1

n=0

n=2

an z n

+1

an z n

+2

nz n1

= G(z) z;

a1 z

n=0

an z n

+1

= zG(z);

= z G(z);
2

X
= z dzd
zn
n
=2

a0 z

= z dzd

1z

= (1z +z2)z ;
3

1 z:
  G(z)
3
1
9(z 2z ) + 3z ;
G(z ) z = zG(z ) z G(z )
4
8
32(1 z) 8(1 z)

11z 34z + 32z


11z 34z + 32z
G(z ) =
4(z 1) (z 6z + 8) = 4(z 1) (z 2)(z 4) :

11z 34z + 32z = A + B + C + D :
(z 1) (z 2)(z 4) (z 1) (z 1) z 2 z 4

11z 34z + 32z = A(z 2)(z 4) + B(z 1)(z 2)(z 4)+
+ C (z 1) (z 4) + D(z 1) (z 2):

  z, 

B + C + D = 11;

A 7B 6C 4D = 34;
6A + 15B + 9C + 5D = 32;

8A 12B 4C 2D = 0:
 .  z = 1, z = 2 z = 4  3A = 9, A = 3; 2C = 16, C = 8;
18D = 288, D = 16.  B = 3. ,
3
3
2
4
G(z ) =
4(z 1) + 4(z 1) z 2 + z 4 ;
 (.30), 
 n  n
3
3
1
1
3 1 1
an = (n + 1) +
4
4 2 4 = 4 n + 2n 4n :
n=2

355

.5. 

.5.34.    -

.


a = 0;
a = 1;

an = an + an ; n > 2:
0
1

.  G(z) = nP anzn,

zn   n  2 6 n < ,


X
X
X
an z n =
an z n + an z n:
=0

n=2

n=2

n=2

 , :

X
X
an z n =
an z n a a z = G(z ) z;
n=2

X
n=2

X
n=2

n=0

an z n =
1

an z n =
2

n=1

X
n=0

an z n

+1

an z n

+2

n=0

an z n

+1

a0 z

=z

= z G(z):

n=0

an z n = zG(z );

 
G(z ) z = zG(z ) + z G(z );
z
G(z ) =
=  z  =
z +z1
2

= 15

1
an =
5

1+ 5
2

1+
2

1+

2n  2n  = 1 1 + 5
n
n
5 2
1 + 5
1 5
!

!n

1 1 5

5 2

!n

.  A = (a ; a ; a ;
: : : ; an ; ) B = (b ; b ; b ; : : : ; bn ; ), 
G (z ) G (z ) .  C = A B   C = ( ; ; ; : : : ; n; ),
.

n =

n
X

k=0

ak bnk :

356

G(z)  C
G(z ) = G (z ) G (z ):
.  B = (b ; b ; b ; : : : ; bn; )
, bn = 1 n, C = A B    A = (a ; a ; a ; : : : ; an; ), . .
n
X
n = ak :
1

k=0

 B, , 
G (z) G (z) = z , , , 
G(z ),  C |  A,
1
G(z ) =
1 z G (z):
 .
 A: (an = n ). | 
G (z)  A, ,

X
G (z ) =
n zn:
n

!
!

X
X
X
d X
d

n
n
n
n
G (z ) =
z nz
=
n z =z n z =z
nz = z
dz
dz
2

=0

n=0

n=1
!!

X
n
z

= z dzd z dzd
n
z+z
= (1 z) :

=1

n=1


= z dzd z dzd


1z



= z dzd

n=1


(1 z) =
2

  C = A B, B = (1; 1; : : : ; 1) 

1
z+z
G(z ) =
1 z G (z) = (1 z) :

z+z
A
B
C
D
G(z ) =
=
+
+
+
(z 1) (z 1) (z 1) (z 1) (z 1) ;
  
z + z = A + B (z 1) + C (z 1) + D(z 1) ;

D = 0;

C 3D = 1;
B 2C + 3D = 1;

A B + C D = 0:
2

.5. 

357

: D = 0, C = 1, B = 3, A = 2,
2 + 3 + 1 :
G(z ) =
(z 1) (z 1) (z 1)
 (.29), 
n
X
n(n + 1)(2n + 1)
sn = k = 2 Cn 3 Cn + Cn =
:
6
k
4

+3

+2

+1

=0

    
.  Cnk | n  k. , n > 0,

Cnk = 0; k < 0; k > n;


n!
; 0 6 k 6 n:
Cnk =
k!(n k)!
,  (1+ z)n  (a ; a ; a ; : : : ; an; : : :), ak = Cnk . ,  k > n
 . 
m r, m + r = n.
G (z) = (1 + z)m 
(b ; b ; b ; : : : ; bk ; : : :), bk = Cmk ,  G (z) = (1 + z)r
 ( ; ; ; : : : ; k ; : : :), k = Crk .

G(z ) = G (z ) G (z ) = (1 + z )m (1 + z )r = (1 + z )m r = (1 + z )n :
 ,
ak = Cnk .  (a ; a ; a ; : : : ; ak ; : : :)
 (b ; b ; b ; : : : ; bk ; : : :) ( ; ; ; : : : ; k ; : : :), k
, k ak = P bl kl :  ,
  .

Cnk =

l=0
k
X
l=0

l k l ;
m
r

n = r + m, 
Crk m =
+

k
X
l=0

l k l ;
m
r

 .
. G (z) = (1+ z)n 
(b ; b ; b ; : : : ; bn; : : :), bk = Cnk .
n
G (z) = (1z)  ( ; ; ; : : : ; k ; : : :),
k = (1)k Cnk .
1

358


G(z ) = G (z )G (z ) = (1 + z )n (1 z )n = (1 z )n :
  (a ; a ; a ;
: : : ; ak ; : : :),
a m = (1)m Cnm ; a m = 0:

k
X
ak = bl kl ;
1

+1

l=0

 a m
2

am=
2

m
X
2

l=0

bl ml =
2

m
X
2

l=0

nl (1) ml Cnml ;
2


m
X
(1)m Cnm = (1)l nl Cnml :
2

l=0

    .
.5.35.  12 ,  1 5 .
.  k    (b ; b ; b ; : : : ; bk ; : : :), bk = 1.
 G (z)
1
G (z ) = 1 + z + z + + z k + =
1 z:
5   ( ; ;
; : : : ; k ; : : :), k = 1, k 5 k = 0  .  G (z)
1
G (z ) = 1 + z + z + + z k + =
1z :
   ,
   , ,  G(z)
1 1 :
G(z ) = G (z ) G (z ) =
1z 1z
 , n   zn. n = 12.
0

10

.6.  

359

  .
, z  :
z = z 1; z = z z ; z = z z ;
, .
12

12

12

12

12

10

 .5.4

.5.4.1. , -

G(z):
() G(z) = 4 1 z ; () G(z) = z 6zz + 8 ;
() G(z) = 9 +1 z ; () G(z) = (z 1) 1(2z + 1) .
.5.4.2.  
:

() aan == 2;3an 2n + 3; n > 0:

a = 2;
() a = 6;
an = 6an 8an + 3n 23n + 36; n > 1:
.5.4.3. 1, 2, 3, 4, 5. ,
,  6, 
. .
2

0
1

.6.  



, 2, 3, 5, 6 7 ,  ,  
21 . 21?  22 ? ,
  | ,
, ,  .
 : , 
,  

360

 ?
   ,
|   , ?
.  , ?  :
 ,  | A = (a ; : : : ; an)
 x = (x ; : : : xn ); xi { 0; 1 }.
xi = 1 , ai i ,
, x = (0; 1; 1; 1; 1)  21 .
x n- , .  , 
() x (0; 1) n- ,
f (x)  .
  . 
A = (a ; : : : ; an ) V .
x = (x ; : : : ; xn), X = x| xi {0; 1} ,
1

f (x) =

n
X
i=1

xi ai ;

x X , f (x) = V ,
.
,   ,
.   x , ,
  2n , n
,  n , | |X | = 2 .
   n.  .   10 ( ),
40 . 40 
400 ,  4   10. . 2 10 , ,
  100000., 28 , . . . , 41
.
   1960-  ,
, .
  .
40

12

.6.  

.6.1.

361

 ,
,  ,  .
, , ,
. 
m-  [18.
m-    (x ; x ; : : : ; xm), mm
x ; x ; : : : ; xm ,  A .   m-
, x, x ; x ; : : : ; xm x.
m- 
x,      , 
m- .
 Am m- -m
, x, y m-  A
 , (x; y)
p
(x; y) = (x y ) + (x y ) + + (xn yn ) :
(.33)
 m-  E m. , , x; y ,
| (x; y), :
1) (x; y) = (y; x);
2) (x; y) 6 (x; z) + (z; y);
3) (x; y) > 0, (x; y) = 0 x = y,
. , ,

(.33) , , ,  E m .
  , m , , [18 [27.
 E , .



E m ,
E m, .
 m- , Ezm:
Ezm = {x| x E m ; x = (x ; x ; : : : ; xm ); xi Z i = 1; m};
Z | .
1

362

, ,  , Ezm,  | | , .
 m- . Y y Ezm, (y ; y ; : : : ; ym)
y x 6 k; y x 6 k; : : : ; ym xm 6 k; yi > xi i = 1; m;
(.34)
m- k
x = (x ; x ; : : : ; xm ), x Ezm, Cubmz(x; k).
   m- 0 = (0; : : : ; 0),
m (0; k ),   . . Cub
z
: kzm = Cubmz(0; k).  , , 1mz | m- ,
| 0 1. n |  1z n
.
, Y Ezm, (y ; y ; : : : ; ym) (x; y) = r,
m-
r x = (x ; x ; : : : ; xm ), x Ezm,
Szm (x; r).
m- ?  , 
,     . (.34)
 k +1 ,
m  Ezm,  , |Cubmz(x; k)m| = (k + 1)m

. , 1z 2m .
, .
1

.6.2. ,  


   ,  ,
 .  , 
m-  
() ,  ,
m- .

.6.  

363

 G
 Ezm. x  G  f (x) : G R, R | .
, [27,
.  |  , , . .
() gi(x) : G R, i = 1; k
gi (x) 6 ai ; ai R; i = 1; k;
 
f (x) min;  gi (x) 6 ai ; ai R; i = 1; k; x G:
(.35)
x, |
,   G,
f (x). (.35) | x, (.35), ,
.
(.35) , 
G, . , 

:
{ , f (x)
gi (x) ;
{ ,
f (x) gi(x) ,
 .
  , G  ,
|  .  .
,  Em  ,
 ,
.  f (x),   G
 , x; y G 
; 0 6 6 1; f ( x + (1 )y ) 6 f (x) + (1 )f (y ):
 .
 .

 .

364


n , n . 
. xi i- , , xi > 1, i = 1; n.
, . ,
fi(xi ), 
  i, .  i | pi, fi (xi ) , ,

fi (xi ) = 1 pxi i :
, 
,  , . , 
    , |
,   ,

 .

n
Y

i=1

fi (xi ) max;

n
X
i=1

ai xi 6 ;

x = (x ; : : : ; xn) Ezn;
1

xi > 1:

,  |     
. , xi xj ; j 6= i. 
,
.
, ,  , . ,  n .
xi | ,  i- , i |

i, i = 1; n.  
n
X
f (x) = i xi :
 .

i=1

   b (),  
n
X
i=1

xi = b:

.6.  

365

i bi,  ,  .  
n
X
xi = b; 0 6 xi 6 bi ; i = 1; n; x Ezn :
f (x) min;
i=1

  (x E n ) | 
,
   ,
. ,  | n-  ,
bi.
 ,  .
   .
m  ,   n ,  n > m.  ,
   .
  ,
. tij |  i  j .
| .
x  Ezn, 
 xi  ,  i. 
 . m  ,
-  ,
1 6 xi 6 m; i = 1; n;
, G 1 = (1; 1; : : : ; 1) n- 
(m 1) | Cubnz(1; m 1).
,  (
)    , 
f (x) = jmax
{ T } min;
;m j
Tj |  j , 
  .

=1

Tj =

n
X
i=1

[xi = j tij ;

 | [k = l = 1, k = l, | 0.
, .

366

.6.3. NP-  

  ,
,    , , 
. , , ,
. , , ai , i = 1; n,
,  Ezn   ,
f (x) =

n
X
i=1

i v(xi ) max;

1 6 xi 6 n

= 1; n;

v(xi ) = axi :

, (n ln n).
 ?

.

1960- P , 
. : P ,
,  O(nk ), n |
, k , n [20. P |
, ,
. P  
   | 
P  .
,  .   |   ,  ?

NP |  . NP, ,   O(nk ).
,  ()   .  ,
  , 

x : f (x) 6 C; x Ezn ;  :
(.36)
gi (x) 6 ai ; ai R; i = 1; k x G:
 ,  x, (.36), ,
.  , ,
f (x) gi (x) ,  n,  , 

.6.  

367

(.36) , , , 
NP.
P NP?
,  (P = NP), .
 , P  NP.  
, NP- . 1971  NP  NP | , ,  ,
NP.
 NPC (NP- omplete ) 
: -,  NP, , -,
 NP. 
NP-  
.   . 
 NP- . 
NP- [20, 
, , [22.
NP-  ,  ,  ,  P = NP . NP- ,  ,   NP, . .  
  .  NP- [27.
,  
 NP- [20,
,   , | NP-.  NP-   P = NP [20, , ,
  
( ).    ,
"- [20    [14, [9.
 NP- , 
 . 
, , [13 [12.
, NP- . 1960-
,
  
 . ,  NPC,

368

.     
 
.
.6.4.


  
1950- | 1960- .  ,  ,
 .
,   ,
NPC. , ,   ( )
,  [27.  ,  .
,   , 
.
,  , , ,
| , 
 .
[22.
,  , . .  ,
, .
  ,  .

 | , ,  ,
, 
 | . British museum te hnique | .   ,  |
 |  ,
, . , ,n , 
n   1z
.
 .

.6.  

369

 . . [27.
 . ,    .    ,
.
  ,
,
,  ,
.    , .  , , 
 . ,
,
. , 
 .

.

Pro edure
Begin
1.
While

 

End.

(
)

begin
2.1.
2.2.
end

,
 .
  .

(while)

  ,
,  , ,
 . , . |
.

. .  
1960- .
., ., . . [7
, NP- ( NPC).
.

370

 ,  ,  .   ,  .

 |  , (  )
 |  .
 ,  ,
,
 .
    .     |   ,  . 
 . 
,  
 , .
  . 1960- [11.  ,  , . .
.

f (x) =

n
X
i=1

gi (xi );

,
 [27.  ,  [11.    ,
n
X
i=1

xi = C;

,   n  ,  , gi(xi ),
i = 1; n xi . f (x) max,
 , , n
 . 
 ,  .   ,   

.6.  

371

 , |  [11.
f (x)  n, C .
   
 {fm( )}, m = 1; n, 0 6 6 C ,
fm ( ) = max
f (x); xm > 0;
xm

m
X

k=1

xk = :

fm( )  ,    m  .
. ,
| gm(0) = 0, m = 1; n, , fm(0) = 0, m = 1; n.
 ,  > 0 f ( ) = g ( ).
   , fm( )
fm ( )  m . xm | ,  m, | ( xm )
  
m 1  .  ,  xm    m 
gm(xm ) + fm ( xm ):
,  xm, , 
 [11.
(
f ( ) = g ( );
fm ( ) = max [gm (xm ) + fm ( xm ); m = 2; n; > 0:
6xm 6
 ,     ,  .
 () . ,
,  
,  .

,
| ( .,  [27, [26).
1

372

.6.5.  


50- XX , . 
, 
    , .
, ,  . ,  
  ,
 .
 ,  ,        ,  
,  , .
     . . [11 [25,  .
 , , 
, 
.
,
  .  , ,
.  , 
  .  , , 
. , |
.
, ,
, ( ) .
, ,  | , . ,
 5 7 10 18,
10   , .
, 
, ,
 ,   
, .
, ,  , |
  ,
 .

.6.  

373

 , 
.  ,  
.      .
   :

Y = {yi }; yi = {vi ; i }; i = 1; n;
yi vi,  , i ,
  .
  V .  yi  .  V yi
:
x = {xi }; x = 1; n;
xi | , . . x Ezn, xi > 0. 
xi = k k  yi V .
 V Y ,  , , ,
  .
:
 .

Pn (x) =

n
X
i=1

 
n
X
i=1

xi i max;

xi vi 6 V:

() , ,  ,
x,  .
,  ,
  :
{ , 
  
;
.

374

{ ,   .
: | , , . ,  , , ,
.
n; V; v ; : : : ; vn, .
 k = Vv ; ,
n
1 X
v = vi
n
1

i=1

 V . , , V ,
, ,  k
() .

 (. .6.4), ,   V , | gi(xi ) = i xi . | ( ), Pn(x),    .
 
, 
 [11.

f (v) = 0;

fm (v ) = max{xm m + fm (v xm vm )};
xm
(.37)
 

m = 1; n; v = 0; V ; xm = 0; 1; : : : ;
:
vk
 ,  
      .
 | ,   
V , 
.
  v yi ,
i = 1; m, m 6 n, xm
v , fm (v )  
.    [11 fm(v) = max
Pm (x);   yi . xm
.

 .

375

.6.  


 (.37).

fn(v)   xnv
v 0 V ( ) Y . ,       , , ,
fn(v)  .
  
.  , 
 V = 10. 
 . .6.1.
 .6.1.


i

vi

    ,    1 10,
 . .6.2. ,
(.37) ,     .
 .6.2.  
v

x1

f1 (v )

x1

x2

f2 (v )

x1

x2

x3

f3 (v )

10

10

11

12

12

13

14

12

15

15

10

15

10

16

10

, ,   ,   | -

376

  .
 .

Pro edure

 

boxV [1::n boxC [1::n


x[1::n; 0::V x1[1::n; 0::V

(
,
| )
(
,
| 
   )

f [0::V

(
| | 
 )

Input

n | 
V | 
boxV [1::n | 
boxC [1::n | 

Begin
for i = 0 to V
begin

 1

( )

x[1; i = i div boxV [1 (  1 i)


x1[1; i = x[1; i
f [i = x[1; i boxC [1

end

for i = 2 to N
begin

(   )

V i = boxV [i
Ci = boxC [i
for v = 0 to V

begin

(  )

maxKol = 0;
maxC = f [v
if V i 6 v then (  i v)

begin

z = v div V i (z |
 i v )
for k = 0 toz ( f )

begin
if (maxC < (Ci k + f [v k V i)) then
begin

end

end

maxC = Ci k + f [v k V i
maxKol = k

end

( 
(end if
6 )

Vi

k)

.6.  

377

(  |
 )

end

for l = 1 to i 1
x[l; v = x1[l; v maxKol V i
end
(for l)

x[i; v = maxKol

(  )

(  )

( 
 )

x1

for l = 1 to V
sum = 0
for j = 1 to i
sum = sum + x[j; l boxC [j
end
j
f [l = sum
end
end
Output
(end for

(end for l)
(   )

f [V |   V
x[1::n; V |  

End

,  ,  
   .

  . , , , , , k 
V .
, 
 (1),  ,   .   ,  , . .6.3.
 ,   ( v) ( z)
V (1) + (1 v + 2 v + + (k 1) v + k) (1) =


kX

(.38)
= (1) (V + k + v i) = (1) V + k + v k (k2 1) ;
i
.

=1

378

 .  k = V=v,  (.38)

V

+ Vv

nV
2v

(1);
2v + 2
,    n , 


 .6.3.



0

2 v



0

...
(k

...

1) v


v1

v =V

1
k


,  | (.37).      .
  .    10
 ,  . .6.1  .11.
.

.11. , -

F3 (10)


x3 =2

x3 =0
x3 =1
F2 (10)

F2 (6)

x2 =3

x2 =0
x2 =1 x2 =2

F1 ( 10 )

F1 (7)

F1(4)

x2 =2

x2 =0

F2(2)
x2 =0

x2 =1

F1(1)

F1 (6)

F1(3)

F1(0)

F1 (2)

.6.  

379

.

Fun tionF (V; x)

( )

V | )
x |  )
(boxV [1::n, boxC [1::n | )
(F | |  
V x )
(
(

Begin
if x = 0
then (
(

= 0)
V = 0)
F = 0 (  -)

|  

x=0

else
begin
if x = 1
then (
begin

|  

x = 1)

k = V=boxV [1
F = k boxC [1 ( . -)

(  )

end
else (
begin

 max F

Max = 0;
k = V div boxV [x
if k = 0

then
F = F (V; x 1)
else
begin
for i = 0 to k
Cost = i boxC [x + F ((V boxV [x i); x 1)
if Cost > Max
then
end
F

Max = Cost
Optx = i

(for i)

= Max( 
)

 
 

end

(if k = 0 else)
x = 1 else)
end (if x = 0 V = 0 else)

end

(if

Optx

380

(  

Return
End

x )

 | F(1000, 15).

  
. , 
. 
R (1,1)=1
, 1
0
 , , , R (2,1)=3
  (1)
0
1
0
 . ,
R (3,1)=6

|   1
0
0
0

R (4,1)=10 0
1
0
0
0
. R(n; k)
R (5,1)=15
, ,
n k.  n k. k = 1 k = 2 
. .12 .13.
.

.12.

=1

R(1,2)=1

R(2,2)=4
0
1

0
R(3,2)=10

0
1

0 1

0
R(4,2)=20

0 1

0 1

0
R(5,2)=35

.13.

= 2.

R(n; k)  ,   . .13.
 , R(n; k) | ,
n k | m = (n + k), 
R(n; k) = Cnnk ;
(.39)
1

.6.  

381

, ,
 
(1) R(n; k) = (Cnnk );
 n   k = n 2,
.
1

m=1
m=2
m=3
m=4
m=5
m=6
m=7

1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1

.14.  | .

.6.6.

., ., . .

[7, [17. 
 [17.
,   ,
, .
| , , 
 . ,
 ,   . 
 , , 
| .
 , , , 
| .
, , . , |
,   .
 n . | ,
 . 
, n 1 , . n 2, . . .
, 
(n 1)! ,  .
 .

382


,   |
   n .  C ,
| ij ( , )   i j .
, ij = ji , i 6= j , i; j = 1; n,
. .  , , . 
ii = , i = 1; n ( ,
?).

 () ,
,  , (
) C .
,  
,  .
n
. 1.  Ezn
, , 
. |  ,
, , 
 x, . n n (n 1) = n n |
.  x
 0 1, , , x 1nz n. n , x
n , .  ,  |    (xi > 0)
n, .  (. .6.1)
| Szn n(0; n). , 
,  ,   x,
.

. N |
N = {i| i = 1; n};
M |
M = {i| i = 1; n n};
R |  . 
v
M
N N; v(i) = (k; l);
.

.

383

.6.  

i
 | (k; l),

M
R ; (i) = v i = kl ;
()   .
,

+

( )

f (x) =

2
nX
n

i=1

(i) xi ; f (x) min;

2
nP
n

xi { 0; 1 };
xi = n; x Szn n (0; n) ;
i
n , x; .
2

=1


.
2.  Ezn . ,
 x, | (. ). ,  Ezn
 . ,   ,
.
   
. (k; l), l > k  k; k + 1; : : : ; l, ,  (l k + 1)!.
 (2; n) | |(2; n)| = (n2+1)! =
= (n 1)!  |
n . |  
, .
, , 
(2; n)  , , 
 , , .
 ,  x  Ezn |
n, 
(2; n), 
xi { 2; n }; i = 1; n 1; xi 6= xj ;  i 6= j; x (2; n):
(.40)
x  
(2; n) zn (2; n). 
x  Ezn , (.40)? ,   , 
x |  n.  , x   Ezn
1

384


v
u n
uX
t
i2
i=2

n (n + 1) (2n + 1)

1; x Szn (0; r );
6
,  , 
.5.
, |    , 

R ; (i; j ) = ij ; (i; i) = ;
N N

  , , .
  Ezn 

r=

f (x) = (1; x

) + (xn ; 1) +

xi ; xi+1 ;
i=1
x1 ; : : : ; xn zn1 ; n
1

x=(

nX
2

f (x) min;

)
(2 ):
, ,
 .

   |  . 
(   ),  ,  |   .  , 
 .

, ,  . |
.    |  .
 .
  ,
, . .
 R (n 1)! n . , ,  ,
(k; l). ,
: , , ,
 , , , , . (k; l) | , ,  ,
.

385

.6.  

R {k; l} {k; l}. {k; l}


R, (k; l), . .  ,
{k; l} | .
,  |  , 
,  n .
. . .6.4  
.
 , . , 
(3; 5), .
.   ,  . .15. ,
1.
- , {3; 5} 
, {3; 5} | ,
, .
 .6.4.

25

40

31

27

17

30

25

19

15

50

24

22

10

 , {3; 5} ,
R.  | (2; 1)
5. {3; 5} 
, (2; 1),  ,
.   . .15.
.15.

47

R-

49

62
{3,5}

{3,5}

{2,1}

{2,1}

 , , , 

386

. , 2 . .15 
,  (3; 5)  (2; 1).  , 
   .
 ,  .
,  . | ,
 , . ,
 .
. ,  
Ct. , ,   , , Ct,
  , . . ,
, .
   .  :
1. 
( )
. ,
| ,
,  .
2. h - ,  h .
,
h.  ( ) . t |   C .
t  z(t) = P ij .
i;j )t

C  C  ( ), t  C , 

z (t) = h + z (t);
z(t) | t C .
   :  
hi .  .
hi = 0, -

.6.  

387

,  :
X
hi :
h=

 C .
. .6.5   . hi
(  ).
 h = 25 + 5 + 1 + 6 + 7 + 3 = 47, ,
R 47, . .
z (t) = h + z (t) > h = 47;
z(t) > 0 t   C .
. .15. , ,  , , 
 ( ,  ).
 |   . .
 .6.5.

25

40

31

27

h1

= 25

17

30

25

h2

=5

19

15

h3

=1

50

24

h4

=6

22

10

h5

=7

h6

=0

h7

=0

h8

=0

h9

=3

h10

=0

 (3; 5) {3; 5}.


 (5; 3), (3; 5) (5; 3) ,  . (5; 3) ,  = . 3 5
 {3; 5},  3 5.
 , . .6.5,  {3; 5},  . .6.6.
 ,  . .6.7
h = 15.  {3; 5}
47+15=62, {3; 5} . .15.
53

388

 .6.6.

 .6.7.

{3; 5}

15

12

22

44

18

{3; 5}

22

41

h3

15

h = 12

=3

{3; 5}  .
(3; 5) ,   =
,  . .6.5. {3; 5}
- 3 - 5.
3, (3; 5), 2,
5 0. ,
{3; 5} 47 + 2 + 0 = 49 (. .15).
 {3; 5} . , ,
{ k; l },  . ,
{3; 5} , 62,
 {3; 5},
, {3; 5} .  {3; 5}
 49 6 Ct 6 62.
,
, ,  
, 
() ,  .
X |  , (k; l) | 
 , ,  X ,
Y Y . Y  X , 
(k; l), Y |  X , 
(k; l). Y Y w(Y ) w(Y ) . ,
z ,  z = .
35

Pro edure
Input
Begin
1.
2.
3.
While (w(X ) < z0)

X=R

.6.  

begin
4.
(k; l)
5.
w(Y)
6.
w(Y )
if
then
begin
7.
if (w(Y ) < z0)
then
begin
z 0 = w(Y )
end (if (w(Y ) < z0)
end
8.
X
9.
end
w(X ) < z 0

389

Y
Y

= 2)

( )

(if)

(while

End

C,

z 0

 
,
.
 1. , ,
 .  |
 | , .
   .
 2. |    ;
.
 3.  .  ,
. 
.  .
 4. , (k; l)
 Y Y ,  X . (k; l)  ,
,    Y ,  Y . 
 .

390

,  Y ,  n . 
(k; l)? 
C , X , 
( , C  ).
, , ,
 , .
,  , Y = {k; l}
. (k; l) kl = 0,  , , Y

w(Y ) = w(X ) + min il + min kj :
j; j 6 l
i; i6 k
, (k; l), kl = 0
C , |
w(Y ).   4
=

Pro edure
Begin
(
S

(i; j )

|
, ,

.
ij
,

[i; j = 0
D = min (

[i; j )
+
min ( j , [i; j )
)
1. Dij (i; j ) S
2. (k; l)
Dkl = max(Dij ) (i; j ) S
i

End
 5.  , 
Y , X .
Y
w(Y ) = w(X ) + Dkl ;
Dkl  4.
 6. Y , X , 
X , (k; l),  4.
, Y
, | , ,
 , .  .

Pro edure
begin
1.

.6.  

391

if
(k; l)
X
then
begin
2.
p
q
3. [p; q =
end
4.
h=
5.
w(Y ) = w(X ) + h
end
 7. ,   ,
(
,
 
)

   
.
.

, 
. , 
, Y ,
.
n , 2 2, n 2
Y ,  Y
,   , 
.  , ,
.
 8.  X ,  . .
, ,
, . .| 
.
 9.  X ,  | 
X .
 , . 
  .
  (. .16)
,   .

? , , ,
 . | ,
, . , . .
 |   (n) ,  n |
, n .   .

392

, 
 n,
. -
 .  .
R 47

{2,1}

62

74
{4,1}

50
{2,1}

62
{4,1}

68

53

{4,5}

{4,5}
65
{1,4}

64
{1,4}

.16. , 
. .6.4

  , 
, , ,  50 . ,  ,  NPC.
 ,    ()  
.
 .6

.6.1.  22 , -

, 2, 3, 5, 6 7 .
 , ?




.6.2.    | V  | vi. ,

393

.6.  

, 
 , 
, .
.6.3. ,  . .6.2, ,   |

,  ,  , 10
 .
.6.4. ,
 
| k = 3.
. .13.
.6.5.  , f (14)  , ,  . .11. 
 .
3

vi

.6.6.  -

,

 Ezn n. ,  xi = 1,
. , ,
  n , ,  .
.6.7.   Ezn n   M | ,
n , |
  
M = Cnn n ;
  n  n n  .
 (n 1)!=M |
.  1, :
ln(1 x) x, 0 6 x 1.
.6.8. ,  {k; l} 
 n ?
2

394

.6.9.  -

. ,
, ,
,  ? 
.


[1 Garnier, R. and Taylor, J. (1992) Dis rete Mathemati s for New Te hnology ,
Bristol: Institute of Physi s Publishing.
[2 Gersting, J. L. (1999) Mathemati al Stru tures for Computer S ien e , 4th edn,
San Fran is o: W. H. Freeman.
[3 Johnsonbaugh, R. (2001) Dis rete Mathemati s , 5th edn, New Jersey: Prenti e
Hall.
[4 Rosen, K. H. (1998) Dis rete Mathemati s and Its Appli ations , New York:
M Graw-Hill.
[5 Ross, K.A. and Wright, C.R. B. (1999) Dis rete Mathemati s , 4th edn, New
Jersey: Prenti e Hall.
[6 Truss, J. K. (1999) Dis rete Mathemati s for Computer S ientists , 2nd edn,
Harlow: Addison-Wesley.
[7 Little R. D. C., Murty K. G., Sweeney D. W., Karel C. An Algorithm for the
Traveling Salesman Problem . Oper. Res., 11: 979{989 (1963) (IM).
[8 . : . .
.: . 2003.
[9 .., ..  
// . 2003. 11. . 24 { 29.
[10 .,  ., . : .
.: | .: , 2001 .
[11 ., .  : . . .: , -
, 1965.
[12 . .
(http://edu.yar.ru/russian/pedbank/sor-pro/bondarenko).
[13 . .
 . : , 1995.
[14 .., .., .. :
 
// . . 2003. 2. 24 .
[15 ., . . .: ,
1987. | 120 .
[16 ., ., . .
: . . .: , 1998.
[17 ., . .
.: , 1981.

396

[18 . ., . ., . . .
.: . - , 1979.
[19 .  .  1, 2, 3. 3- . . .:
. . .: . , 2001 .
[20 ., ., . :  . .:
, 2001 .
[21 . . . .: ,
2002.
[22 . . 2-  .
.: , 2004.
[23 ..,  . . . .: ,
1992.
[24 . .  . .: ,
2001.
[25 . ., . ., . C., . .

 // Exponenta Pro . 2004.
2(6). . 64{70.
[26 . .   ,
.: , 1995.
[27 .., .., ..
 . .: , 1982.
[28 . . . .: , 1986.


, 12
, 181
, 167
, 167
 , 169

, 174
, 172
, 146
, 99
, 57
, 77
, 197
, 195
, 93

, 196
, 195
, 171
, 156
, 142
, 143
, 150
, 87
, 120
, 120
, 120

, 27
, 27
, 26

, 26
, 24
, 162

, 162
12, 142
, 146
, 148
, 150, 181
, 70
, 148
, 143
, 146
, 142
, 98
, 136
, 56
, 55
, 152
, 165
, 157
, 163
, 155
, 157
, 153
, 154
, 157
, 80

, 198
, 25, 194

, 190
, 48
, 171
, 149
 , 153
, 27
, 52
, 75

398

, 97
, 143
, 99
, 78
, 166
, 167
, 167
, 172
, 25, 194
, 155

, 128
, 130
, 161
, 81
, 156
, 93
, 25
, 25
, 144
, 71
, 182
, 176
, 143
, 197
, 44
, 97
, 61
, 48
, 80
, 54

, 80
, 97
, 97
, 97
, 47
 , 15

, 15
, 17
 , 15
, 16
 , 46
, 70, 171
, 185
, 185
, 171
, 155
, 55
, 73
, 68
, 73
, 73
, 73
, 77
, 24, 194
, 47
, 143
, 144
, 156
, 157
, 157
, 46
 , 199
 , 185
, 185
 , 137

, 174
 , 136
 , 80
, 40
 , 63
, 27
, 39
, 80
 , 80
 , 32
, 32

, 87
, 190
 , 55
, 14
, 172
, 46
, 77

, 121
, 121
, 182
, 142
, 143
, 143
, 49
, 87
, 142

, 121
, 121

, 189
 , 143
, 57
 , 150
, 155
, 99
, 24
, 36
 , 46
, 52
, 128
, 189
 , 55
, 39
, 40

, 129
 , 137
, 205
, 55, 96
, 99
, 99
, 99

, 137
, 99
, 102
, 102
, 136
, 99
, 116
 , 137
, 57
, 110
, 17, 145
, 148
, 142
, 80
, 46
, 46
, 46
, 46
, 146
 , 63
, 44

, 197
, 77

, 91

399



.: (495) 234-01-10
e-mail: knigi@technosphera.ru
:



http://www.technosphera.ru


2-,
..
..
..
..
70 100/16. .
Computer modern LaTeX
.. 25. 1000 ., .
1, 65 /2

, . , .16, .2
-
420066 . , . , 2.