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

1 1.

: . .
.
. .

2 1
: . .
. .
. - .

?
.
1) , ..
;
2) .
. f(x)=0.
1) , "
F(x)=0 (1) -
y=F(x) y=0, y=F(x) OX
, .
y=F(x) (1) f1(x)=f2(x).
y1=f1(x) y2=f2(x) , OX ,
".
2) . " : F(x),
F(x)=0, [a;b] , ..
F(a)*F(b)<0, , , ".
" F(x) , [a,b] (F(a)*F(b)>0) .

[A;B],
. [A;B] F(x) ,
F(a)*F(b)<0. [a;b],
.
F(x), x=A,
h. F(x)*F(x+h)<0, [x;x+h]
.

() . ,
( ) , .
, ,
.
.
. ,
(10-3), ,
.

F(xk)=0, xk- .


. ,
.

[a;b]. .

"
,
.
:


, F(x)=0
". " , :
x=(an+bn)/2 (7)".
. f() =0 [a,
b].
, ..
. f(x)*f(x)<0 a0.
, y=F(x).
1M2 c 1(a, F(a)) M2(b, F(b)).
1M2 OX x1.
M3(X1 ,F(x1 )),
x2. .


(n) , ,
b, lim xn = x
f(x) = 0, .
? (x - xn)<|f(xn)/f(xn)|
.
,
y=F(x) x=xn
.
f(x)*f(x)>0 .

(n+1)
, 1, 2 -
, 0. - .
? (xn - )<|f(xn)/f()|
.
,

,
a11 0 ( ).
1 ,
, ,
21/11, ,
31/11 ...
:

, ,
a11 0
,
22(1) ( a22(1) 0)
, , , (m-1)
.

.
, .
xm. xm (m-1)
xm-1. xm-1 xm (m-2) xm-2.
, x1 .
,
.
.



F:yi=ij*xj+i n- x(x1,
x2xn) Y(y1, y2yn).

n-
(0), (1)
() (x x ). .
.
n-
, .. n-
.
X(x1, x2xn) Y(y1, y2, yn) .
:
1)1(x, y)=maxj|xj-yj| = maxij|ij|, <1,
2)2(x, y)=j|xj-yj|
= maxji|ij|, <1,
3)3(x, y)=(j(xj-yj)2)
= (ij|ij2|), <1,
.
.
? (x(k+1), x(k))<=((1-)*)/.

.
.
(bn-an)>=2 . x= (an+bn)/2, = (bn-an)/2.

1 2.
: . , .
. .
, -
\
V ( - )
V+ - - V
V* - - V,
G(VT,
VN, P, S)
- (, ), - ()
VT - ( , ,
; - )
VN ( , - , ,
; \ 1 -)

- - - . - - -
-, .
0. - -
- -.
, V+, V*
- .
1. - ()
1212
1,2 V*
VN
c V+
- - - , cV+, ||||
- ,
\ ,
.
, \
.
- -, - .
2. -
, VN, cV+ cV*
- .
.
3.
\ - :
- \
, VN, VT*
- - : ,
, , ..
- - => -
. - - , .

3 2
: . .
. . . .
- - - , , -
. , ,
. - -, ., -,
- -,
. - , . -. - - -, ; - -, -
-. - - . -
- - -.

* Procedure ( );
label & const & type & var & procedure & function & begin & & end;
* Function ( ): ;
label & const & type & var & procedure & function & begin & -, 1,
- - & end.
(UNIT) PASCAL - - -.
- \ , \ \
- .
- - . PASCAL
. - - , - -.
PASCAL: , , , .
, -
. \ :
1. - - ,
2. \ ,
- :
UNIT < >; & INTERFACE & < > & IMPLEMENTATION &
< > & BEGIN & < > & END.
- - INTERFACE.
(, ,
), IMPLEMENTATION
-, .
. \
BEGIN - BEGIN END.
-, -. - -
- - . , \
, - , ..
Unit FileText; & Interface & Procedure Print(s:string); & Implementation & var f:text; const
name = 'output.txt'; Procedure Print; begin & WriteLn(f, s); & end; & {
} & begin & assign(f, name); & rewrite(f); & { } & end.

3 1
: .

x
x

xn
1
2
y
y

yn
1
2
. .

4 1
: . .
. .
. .
.

:
.
- , -
. - -
-
- : y=ax+b,y=ax^2+bx+c, y=ax^m,
y=ae^(mx), y=a ln(bx), y=a/x +b (). - (y1,y2,,yn).
- y=F(x),

( y1, y 2,..., yn ).

( y1 y1) 2 + ( y 2 y 2) 2 + ... + ( yn yn) 2 = ( yi yi) 2 .

i =1
- ,
n
2
() min.
(1).

( yi yi)

min.

i =1
: - y=F(x), , (1) min.
-: F(x,a,b)=0. , (a,b)=(yi F(xi,a,b)2) min.(2)

= 0 - .
b

=0
a

= ( yi ( axi + b) 2 )a = 2 ( yi (axi + b)) xi,


a
i =1

= ( yi ( axi + b) 2 )b = 2 ( yi (axi + b))1,


b
i =1
F(x,a,b)= ax+b. a,b-?

. ,
.
, - . . . ., .
- - . . .
- . . . - . .
, .
, . () ,
1- () ,
,
. , 2
\ . ,
\ 1 - (())
, ,
. ()=m/n - 2 - 2
..= - . - n
, m1 , m2 k
(+) = m(A+B)/n = (m1+m2-k)/n = m1/n+m2/n-k/n = P(A)+P(B)P(AB) . . - (+)=()+().-: (+) = ()+()-(AB).
=> AB => P(AB)=0
1. - - -
(1+2++An) = (1)+P(2)++P(An) 2. 1, 2, , An -
, - 1: (1)+(2)++(An)=1
3. - 1: ()+(-)=1.- ..
.. . ()+(-)= (+-).. +- -
.=1=> ()+(-)=1
- , - 1-
,
- , -, , -
(P(A|B))
- - - 1 - ,
-, 1- (AB)= () (A|B) -:
n . m1 , m2 k
(AB) P(A)=m1/n P(B)=m2/n P(AB)=k/n P(B|A)=k/ m1
P(A)P(B|A)==(AB)
, (AB)=()(A|B) => P(A)P(B|A)=()(A|B) 1. - 2 - - - .. . (A|B)=
(B)=> (AB)= (A) (B)2. 1, 2, , An , P(12
An)=P(1)P(2|1)P(3|1 2)...P(n|12 An-1)

( yi ( axi + b)) xi = 0
=>

( yi (axi + b)) = 0

xi2 a + xi b = xi y i : n( )
=>

xi a + b = y i : n
M x 2 a + M x b = M xy

M xa + b = M y
Mx- xi.

My =

M x2 =

1
1
2
xi , M x = n xi,
n

1
1
yi, M xy = xiyi.

n
n

Y=ax+b- .
- ,
- .

2 2
. . .
. .
. . .
. -
, . - . - , , ,
.. :1. - -; 2.
- -;3.
/; 4. : /; 5. .
3 : 1. 2. 3.
(1) var f: Text, (2) - var f: File of < >, (3) var f: File
- :
Append - - - Assign
Reset Eoln
Read- 1
-, . -; Readln - + .
; Seek - ; Write- >
; WriteLn - , Write ;
Reset- - Rewrite Close
Rename Erase Eof
IOResult ,
-

, 1
-. , , -
( -1) -.
\ - +1.
. ., - , \
.
- , \
-.
, - .
n , 1 1 n.
, \ ,
0 1, 1
2 , , n-1 -
n.
:
* FileSize(var f):Longint - -
* FilePos(var f ):Longint - f
* Seek(var f; N:Longint) -
* Truncate(var f ) -
()
var f1,f2:text; st,name:string;
begin
writeln(' ');readln(name);
assign(f1,name); reset(f1);
if IOResult=0 then begin
assign(f2,'temp.dat'); rewrite(f2);
while not EOF(f1) do begin
if seekeoln(f1) then readln(f1,st)
else begin
readln(f1,st); writeln(f2,st);
end;
end;
close(f1); close(f2); erase(f1); rename(f2,name);
end
lse writeln(' ');
end.

4 2
Haskell. . .
. .
Haskell. .
. -
-, , -. , \ , -
.
[a, b, c]
Haskell - - . , - - ,
(5::Integer)
. - .
\ . -, -
.
-.
(X|X<-XS) X, XS (X<-XS - )
(X|X<-XS, X>m, X<n) X, XS, X>m X<n
[1, 2, ..]
- , 1 .
- 1 2 -.
- \ - , -
.
- - -
.
. -
add :: Integer -> Integer -> Integer
add x y = x+y (add 5 7)
Haskell. -
.
-
-. Haskell -, -
. - - - -
, |
sign x | x>0 = 1
| x==0 =0
| x<0 =-1
- .. -. .
- , , -
- -.
- , - case
Function x1 x2 xn = case(x1, x2, ..., xn) of
(p11, p21, ..., pk1) -> Expression1
...
(p1n, p2n, ..., pkn) -> Expressionn
_ - , - .
if Exp1 then Exp2 else Exp3
case (Exp1) of
(true) -> Exp2
(false) -> Exp3
Exp1 Bool, Exp2 Exp3 .
Haskell 2 - - : 1 (
let) 2 ( where)
- - -, ,
-.
. - . , -
ad hoc, . ,
:
1. 1,2,3 ,

2.
3. .
Haskell .
.
( ), .

5 1
: . .
.
. .
, - \
, , . C
, - -
- ... - - \ -
.. - -.- 1.
: :
X x1
x2
..
xn-1
xn
.
P p
p
..
pn-1
pn
.
1
2
P(X=xi)=pi - , X xi pi . pi =1
.. {=1}..{=i}- .
- n - - .
. - .- .. n
,. :0,1,..n (=m)=n(m)=Cnmpmqn-m(- )
X 0
1
..
n
.
P
Pn(
Pn(
..
Pn(
0)
1)
.
n)
n->+8 p->0 n*p==const>0, - -, - -
-(=m)= (m/m!)*e-^-
m=0,1,..n 2. (xi; pi),


3. . 1 2 - \ . .
- -
- F(x), .
x
- - X - F(x),
x, , X
, x F(x)=P(X<x)

1. 0F(x)1 2. F(x) 3. F(+)=1
4. F(-)=0 5. F(x) x
, . -

-
M(x)=x1p1+x2p2+...+xnpn
M(x)=(-; +) xf(x)dx, x
.
1) M(c)= 2) M(cX)=cM(X) 3) M(X+Y)=M(X)+M(Y)
4) M(XY)=M(X)M(Y), X, Y C .
. D(x)=M((x-M(x))2)
D(x)=M(x2-M2(x)) : D(x)=(k=1..n)[xk-M(x)]2pk
D(x)=(k=1..n)xk2pk-M2(x)
: D(x)=(-; +)(x-M(x))2f(x)dx
D(x)=(-;
2
2
+)x f(x)dx-M (x)
- : 1) D(c)=0
2) D(cX)=c2D(X) 3) D(X+Y)=D(X)+D(Y), X, Y
(X)=D(X)
,

. , .
7 2
: .
.
. .

, - -,
.
:1. , - -

5 2
: .
. .
-,
. - .
- -.
- ||-
- - - 50
.: 1 - , .. - -
2 - . ,
- - , ,
\ - 3 ||- - -
-
=> , , ..
, \ .(
(: , , ), -
. - .
- .
, - , , -,
- - .)
(),
. .. ,
( - -. -
- , 1 ,
.)
: , ,
.?: .

1. - ,
2. ,
3. - -

4. ,


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

6 2
: - ().
. . .
. . .
-, - -
, -
:

2. -,

3. -,
=> - -- ,

2 : 1. .
- - ( - ,- )
2. . ( )
=> C , - \

- - (, ,
), -

. ||-, -

=>
C

-
(). ,
- ||- -, -
, -
,
-
(, ,
. .)
(ROM). -
,
,
1. .
host ( - ),
-
2. . - , - -

3. UNIX' .
UNIX, - -,

4. WindowsNT

1.
2. - -

3. ,
- WIN32
4. ,
, -
Windows CE, -

1.
2. .
.
3 \ ,

, ,
- -,


Pascal - Object
Type _ = object & ; & ; & End;
Var _: _

Pascal \ .
:
1. Public ,
2. Private -

- -. - - ,
- \ : ,
1.
.
2. - ,

3. - ,
-: 0 ,

- -
. , \
- -

type donkey = object (animals)
x:integer; y:integer; t:string;
function run(m:string):boolean;
procedure show;
procedure hide;
end;
var a1, a2, a3: donkey;

7 1
: .
.
,

< x1 , x 2 ,..., x n >

.
,
.
.
,
.
1)

2)

3)

4)

6 1
: .
. . .
. .

5)

6)

7)

:
1) ,
( ).
() ,

F 1 0 = 0F 0 = F FF = F F F =FG
F 1 = FF 1 =
F = GF

;
8)

9)

10)

11)

12)

.
(G
)H
HF) (=G( F

HG
) )=FG
H
F GH
FH = ( F G )(
F H ) ,
F G =FG(GH
F ) F=( FG
, .

;
13)

14)

15)

16)

17)

18)

F ( F G )F=FFG =FFF = 0F F =
FG
1 = F FGG = F G

19)

F =F

20)

21)

G = ( F G )(G F )
F G = F F
G

;
.
, , ,
.
G (: ),

.

X , Y , X Y , X Y X Z ,
XY X Y 1 , X Y .
. F G ,
F .
,

H 1 ( H 2 H 3 ) , H 1 H 2 H 1 H 3 .


. , 21,

X Y

( X Y )(Y X ) .

20

F1 = (( X Y )(Y X )) X

. 17,

F2 = ( X Y Y X ) X

F3 = ( X Y Y X ) X



[a;b].
.

F4

2)

YXX

X Y ( 5). , F4
F5 = X Y .

F5 , F4

3)
.

15 3 0,

XYX

:
1)

. . ,

2: , p = p(x)
,
, 1) 2) .
. f(x) -
x ,
x, :

(: )

X 1 , X 2 ,..., X n

, :

F = F ( X 1 , X 2 ,..., X n ) , ..
X 1 , X 2 ,..., X n ;
1)

2)

, ..

F = C1 C 2 ... C k , C1 , C 2 ,..., C k

;
3)

4)

Xi

Xi

i = 1, 2, ..., n ;

XY

XY X Y

XY X Z

XYX X Y

XY X YYX

XY

1:
, ,

2 .
3

F3 . F4 = X Y X Y X X

(1)
1: (1) ,
.

18
( 19),


. - .
,
,
,
. .

2:
, -

2) () (
).
()
,

3) [a;b] ( [a;b]
). [a;b]

1. 21 20
. 2. 17 - 19
. 3.

F = ( X Y ) X

,
.

,
,
.

.
x ,
P(x<=X<=x+Dx)=f(x)Dx+(Dx). ,
(Dx) F(x)Dx.