You are on page 1of 15

ORIGIN := 1

.
:
1. ().
, , .
2. . .
.


, m n :
Y ( A , X ) :=

for i 1 .. cols( A)
rows( A)

Y
i

i, j

j=1

Y
a i,j - , xj, yi - , y
x. .
A xj
yi.
, .
, ,
. yi
a i,j xj
.
a i,j 0. ,
i xj yi x1, ... ,xj-1, xj+1, xn :
X :=
j

-1
A

i, j

i, 1

X + .... + A
1

i , j -1

j -1

-Y +A
i

i , j+1

j+1

+ .... + A

i, n

xj ,
i, i ,
, , yi xj
.

A:
b

s, t

:=

1
a
a
a
a

i,j - ""
, s,t

if s = t t = j

i, j

a
a

i,t

if s = i t j

i, j

s,i

if s i , t = j

i, j

-a

s,t i, j

s, j i,t

if s j t j

i, j


a i,j. , ;
,
. , ,
.
" ":
1: a i,j 1;
2: ;
3: ;
4: as,t ,
a s,ta i,j - a s,ja i,t
5: a i,j
, 5 :
Step_1( A , B , i , j ) :=

i, j

Step_2( A , B , i , j ) :=

for s 1 .. cols( A)
B

i,s

-A

i, s

if s j

B
Step_3( A , B , i , j ) :=

for t 1 .. rows( A)
B

t, j

t, j

Step_5( A , B , i , j ) :=

for t 1 .. rows( A)

if t i

for s 1 .. cols( A)

t,s

B
Step_4( A , B , i , j ) :=

for t 1 .. rows( A)
for s 1 .. cols( A)
B
B

t,s

t,s

i, j

-A

i, s

t, j

if [ ( s j) ( t i ) ]

t,s

i, j

:
y1( x1 , x2) := 2 x1 - 3 x2
y2( x1 , x2) := -4 x1 + 3 x2
C A:
A :=

2 -3

-4 3

B :=

0 0

0 0

2 i=1, j=1
1:

B := Step_1 ( A , B , 1 , 1 )

B=

1 0

0 0

2:

B := Step_2 ( A , B , 1 , 1 )

B=

1 3

0 0

3:

B := Step_3 ( A , B , 1 , 1 )

B=

1 3

-4 0

4:

B := Step_4 ( A , B , 1 , 1 )

B=

1 3

-4 -6

5:

B := Step_5 ( A , B , 1 , 1 )

B=

0.5 1.5

-2 -3

:
x1 :=

1
2

y1 +

3
2

x2

y2 := -2 y1 - 3 x2
- A2,2
A := B

B :=

0 0

0 0

1:

B := Step_1 ( A , B , 2 , 2 )

B=

0 0

0 1

2:

B := Step_2 ( A , B , 2 , 2 )

B=

0 0

2 1

3:

B := Step_3 ( A , B , 2 , 2 )

B=

0 1.5

2 1

4:

B := Step_4 ( A , B , 2 , 2 )

B=

1.5 1.5

2 1

5:

B := Step_5 ( A , B , 2 , 2 )

B=

-0.5 -0.5

-0.667 -0.333

:
x1( y1 , y2) := B
x2( y1 , y2) := B

1, 1
2, 1

y1 + B
y1 + B

y2

1, 2

y2

2, 2


, ,

X := x1 B , B
1

X := x2 B , B
2

X=

B :=

4

6

-5

-4.667

( 1 2)
Y := y2(X , X )
2
1 2
Y := y1 X , X
1

Y=

4

6

V := Y - B

V=

-1.776 10- 15

- 15
1.776 10

,
: B

:

Jordan_Iskl( A , i , j ) :=

n rows( A)
m cols( A)
razr A

i, j

for t 1 .. n
for s 1 .. m
A

t,s

t,s

razr - A

i,s

t, j

if [ ( s j ) ( t i) ]

for s 1 .. m
A

i,s

i, j

-A

i, s

for s 1 .. m
for t 1 .. n
A

t,s

t,s

razr

A
, :

2.565 -3.767 4.678


A0 := -6.134 9.245
0

-0.576 4.576 2.765


A := A0

5.878

B := 3.786

1.456

A := Jordan_Iskl( A , 1 , 1 )

0.39 1.469 -1.824

A = -2.391 0.237 11.187

-0.225 3.73 3.815

A := Jordan_Iskl( A , 2 , 2 )

15.24 6.21 -71.29

A = 10.111 4.228 -47.301

37.491 15.771 -172.62

A := Jordan_Iskl( A , 3 , 3 )

0.413
-0.244 -0.304

0.162
0.093
0.274
A=

0.217 0.091 -5.793 10- 3

X := A B

-1.984
X = -0.907

1.614

V := B - A0 X

-8.882 10- 14

V = 2.132 10- 13

1.097 10- 13


:
.

.
4 :
1. (

aij = 0 ).

bi ,
. bi = 0 ,
( x1 ,..., xn ) .

2.

x i1 ,..., x ik , bi xi1 ,..., xik .

x i1 ,..., xik , ,

x j , .

.
3. , 2,
,

x j

x j . , ,

x j . - .

4.
. , ,
.
( 5=6), .
, .

,
:
( "" )

JordanU( A , B) :=

ORIGIN 0
n rows( A)
m cols( A)
for j 0 .. m - 1
C concat( "X" , num2str ( j ) )
j

iskl 0
for j 0 .. m - 1
i0

while ( i < n) A

i, j

( i))

= 0 IsString B

ii+1
continue if i = n
razr A

i, j

for t 0 .. n - 1
for s 0 .. m - 1
A

t,s

t, s

razr - A

i, s

t, j

if [ ( s j ) ( t i) ]

for s 0 .. m - 1
A

i,s

i, j

-A

i,s

for s 0 .. m - 1
for t 0 .. n - 1

t,s

buf C
C B
j

t,s

razr

B buf
i

iskl 1
if iskl = 0
for i 0 .. n - 1
iskl 1 if B 0
i

return "No solution" if iskl = 1


return C
for i 0 .. n - 1
s ""
x0
for j 0 .. m - 1

( j) Ai , j 0
(

if IsString C

( )

(
( i , j ) , "*" , C j ) if Ai , j > 0
s concat( s , " - " , num2str ( -A ) , "*" , C ) otherwise
i, j
j
x x + A C if IsString(C )
i, j j
j
s concat s , " + " , num2str A

D x if s = ""
i

D concat( num2str ( x) , s) otherwise


i

for i 0 .. n - 1

( i)

if IsString B

return "No solution" if B D


i

D C
i

for i n.. m - 1 if rows( D ) < m


D C
i

return D
: :

3
1

A := 0
0

1 0 0 0 1
2 1 0 0
1 1 1 0
0 1 0 1
0 0 1 1

1
1

4
4

B1 := 3
2

1

4.1
3.9

B2 := 3.1
2.1

0.9

"1.14285714285714 - 0.285714285714286*X5"
"0.571428571428573 - 0.142857142857143*X5"

"1.71428571428571 - 0.428571428571428*X5"

JordanU( A , B1) =
"0.714285714285715 - 0.428571428571429*X5"
"0.285714285714286 - 0.571428571428572*X5"

"X5"

"1.25714285714286 - 0.285714285714286*X5"
"0.328571428571429 - 0.142857142857143*X5"

"1.98571428571429 - 0.428571428571428*X5"

JordanU( A , B2) =
"0.785714285714286 - 0.428571428571429*X5"
"0.114285714285714 - 0.571428571428572*X5"

"X5"

1
1

A := 0
0

1 1 1
0 0
1 0
0 1
0 0

0
0

1
4

B1 := 3
2

1

JordanU( A , B1) = "No solution"


, n
:
= ( n*n ),
-
, ..

a11 K a1n

A= K K K
a

m1 K a mn

1 0 K 0

0 1 K 0
E =
K K K K

0 0 K 1

b11 K b1r

B = K K K

b
n1 K bnr

1 - A,B E

b11 1

A * K = K,
b 0
n1

b12 0

A * K = K, K ,
b 0
n2

b1n 0

A * K = K.
b 1
nn

2 - AB = E
,
n .
, :

1
0
0
0
0

2
1
0
0
0

1
3
1
0
0

0
2
2
1
0

1
1
1
5
2

x11

x12

x13

x14

x15

x 21

x 22

x 23

x 24

x 25

x31

x32

x 33

x 34

x35

x 41

x 42

x 43

x 44

x 45

x51

x52

x 53

x 54

x55

, ,
, :

1
0
0
0
0

0
1
0
0
0

0
0
1
0
0

0
0
0
1
0

0
0
0
0
1

x11

x 21

x 31

x 41

x 51

x12

x 22

x 32

x 42

x 52

x13

x 23

x 33

x 43

x 53

x14

x 24

x 34

x 44

x 54

x15
1
0
0
0
0

x 25
2
1
0
0
0

x 35
1
3
1
0
0

x 45
0
2
2
1
0

x 55
1
1
1
5
2

;
; -
, - , .
; , -
. .
:
("pivot"),
. .
, , (,
, ). ,
, :
A

i, j

i, j

pivot + A

i,k

k, j


"pivot".
"" E X,
. , ,
E X .
.

JordanInv( A) :=

m rows( A)
n cols( A)
for k 1 .. m
pivot A

k, k

k, k

for i 1 .. n
A

k, i

k, i

( -1 ) if i k

for i 1 .. m
for j 1 .. n
A

i, j

i, j

pivot + A

i, k

k, j

if i k j k

for i 1 .. m
for j 1 .. n
A

i, j

i, j

pivot

A
:

1
0
A_ :=
1
1

2 4 8

3 9 27
1 1 1
1 0 0

A2_inv := JordanInv( A_)

1.636 -0.545 -0.818 0.182


0
1
0
0
A2_inv =
-0.864 -0.545 1.182 -0.318
0.227 0.091 -0.364 0.136

1
0
A_ A2_inv =
0
0

1.636 -0.545 -0.818 0.182

1
0
0
-1 0
A_
=
-0.864 -0.545 1.182 -0.318
0.227 0.091 -0.364 0.136

0 0 0

1 0 0
0 1 0

0 0 1

, ,
, .

x 51
x 52
x 53
x 54
x 55