<s>
In	O
mathematics	O
,	O
Gaussian	B-Algorithm
elimination	I-Algorithm
,	O
also	O
known	O
as	O
row	B-Algorithm
reduction	I-Algorithm
,	O
is	O
an	O
algorithm	O
for	O
solving	O
systems	O
of	O
linear	O
equations	O
.	O
</s>
<s>
It	O
consists	O
of	O
a	O
sequence	O
of	O
operations	O
performed	O
on	O
the	O
corresponding	O
matrix	B-Architecture
of	O
coefficients	O
.	O
</s>
<s>
This	O
method	O
can	O
also	O
be	O
used	O
to	O
compute	O
the	O
rank	O
of	O
a	O
matrix	B-Architecture
,	O
the	O
determinant	O
of	O
a	O
square	B-Algorithm
matrix	I-Algorithm
,	O
and	O
the	O
inverse	O
of	O
an	O
invertible	O
matrix	B-Architecture
.	O
</s>
<s>
To	O
perform	O
row	B-Algorithm
reduction	I-Algorithm
on	O
a	O
matrix	B-Architecture
,	O
one	O
uses	O
a	O
sequence	O
of	O
elementary	O
row	O
operations	O
to	O
modify	O
the	O
matrix	B-Architecture
until	O
the	O
lower	O
left-hand	O
corner	O
of	O
the	O
matrix	B-Architecture
is	O
filled	O
with	O
zeros	O
,	O
as	O
much	O
as	O
possible	O
.	O
</s>
<s>
Using	O
these	O
operations	O
,	O
a	O
matrix	B-Architecture
can	O
always	O
be	O
transformed	O
into	O
an	O
upper	B-Algorithm
triangular	I-Algorithm
matrix	I-Algorithm
,	O
and	O
in	O
fact	O
one	O
that	O
is	O
in	O
row	O
echelon	O
form	O
.	O
</s>
<s>
Once	O
all	O
of	O
the	O
leading	O
coefficients	O
(	O
the	O
leftmost	O
nonzero	O
entry	O
in	O
each	O
row	O
)	O
are	O
1	O
,	O
and	O
every	O
column	O
containing	O
a	O
leading	O
coefficient	O
has	O
zeros	O
elsewhere	O
,	O
the	O
matrix	B-Architecture
is	O
said	O
to	O
be	O
in	O
reduced	O
row	O
echelon	O
form	O
.	O
</s>
<s>
For	O
example	O
,	O
in	O
the	O
following	O
sequence	O
of	O
row	O
operations	O
(	O
where	O
two	O
elementary	O
operations	O
on	O
different	O
rows	O
are	O
done	O
at	O
the	O
first	O
and	O
third	O
steps	O
)	O
,	O
the	O
third	O
and	O
fourth	O
matrices	O
are	O
the	O
ones	O
in	O
row	O
echelon	O
form	O
,	O
and	O
the	O
final	O
matrix	B-Architecture
is	O
the	O
unique	O
reduced	O
row	O
echelon	O
form	O
.	O
</s>
<s>
Using	O
row	O
operations	O
to	O
convert	O
a	O
matrix	B-Architecture
into	O
reduced	O
row	O
echelon	O
form	O
is	O
sometimes	O
called	O
Gauss	B-Algorithm
–	I-Algorithm
Jordan	I-Algorithm
elimination	I-Algorithm
.	O
</s>
<s>
In	O
this	O
case	O
,	O
the	O
term	O
Gaussian	B-Algorithm
elimination	I-Algorithm
refers	O
to	O
the	O
process	O
until	O
it	O
has	O
reached	O
its	O
upper	B-Algorithm
triangular	I-Algorithm
,	O
or	O
(	O
unreduced	O
)	O
row	O
echelon	O
form	O
.	O
</s>
<s>
For	O
computational	O
reasons	O
,	O
when	O
solving	O
systems	O
of	O
linear	O
equations	O
,	O
it	O
is	O
sometimes	O
preferable	O
to	O
stop	O
row	O
operations	O
before	O
the	O
matrix	B-Architecture
is	O
completely	O
reduced	O
.	O
</s>
<s>
The	O
process	O
of	O
row	B-Algorithm
reduction	I-Algorithm
makes	O
use	O
of	O
elementary	O
row	O
operations	O
,	O
and	O
can	O
be	O
divided	O
into	O
two	O
parts	O
.	O
</s>
<s>
The	O
second	O
part	O
(	O
sometimes	O
called	O
back	O
substitution	O
)	O
continues	O
to	O
use	O
row	O
operations	O
until	O
the	O
solution	O
is	O
found	O
;	O
in	O
other	O
words	O
,	O
it	O
puts	O
the	O
matrix	B-Architecture
into	O
reduced	O
row	O
echelon	O
form	O
.	O
</s>
<s>
Another	O
point	O
of	O
view	O
,	O
which	O
turns	O
out	O
to	O
be	O
very	O
useful	O
to	O
analyze	O
the	O
algorithm	O
,	O
is	O
that	O
row	B-Algorithm
reduction	I-Algorithm
produces	O
a	O
matrix	B-Architecture
decomposition	O
of	O
the	O
original	O
matrix	B-Architecture
.	O
</s>
<s>
The	O
elementary	O
row	O
operations	O
may	O
be	O
viewed	O
as	O
the	O
multiplication	O
on	O
the	O
left	O
of	O
the	O
original	O
matrix	B-Architecture
by	O
elementary	O
matrices	O
.	O
</s>
<s>
Alternatively	O
,	O
a	O
sequence	O
of	O
elementary	O
operations	O
that	O
reduces	O
a	O
single	O
row	O
may	O
be	O
viewed	O
as	O
multiplication	O
by	O
a	O
Frobenius	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
Then	O
the	O
first	O
part	O
of	O
the	O
algorithm	O
computes	O
an	O
LU	O
decomposition	O
,	O
while	O
the	O
second	O
part	O
writes	O
the	O
original	O
matrix	B-Architecture
as	O
the	O
product	O
of	O
a	O
uniquely	O
determined	O
invertible	O
matrix	B-Architecture
and	O
a	O
uniquely	O
determined	O
reduced	O
row	O
echelon	O
matrix	B-Architecture
.	O
</s>
<s>
There	O
are	O
three	O
types	O
of	O
elementary	O
row	O
operations	O
which	O
may	O
be	O
performed	O
on	O
the	O
rows	O
of	O
a	O
matrix	B-Architecture
:	O
</s>
<s>
If	O
the	O
matrix	B-Architecture
is	O
associated	O
to	O
a	O
system	O
of	O
linear	O
equations	O
,	O
then	O
these	O
operations	O
do	O
not	O
change	O
the	O
solution	O
set	O
.	O
</s>
<s>
For	O
each	O
row	O
in	O
a	O
matrix	B-Architecture
,	O
if	O
the	O
row	O
does	O
not	O
consist	O
of	O
only	O
zeros	O
,	O
then	O
the	O
leftmost	O
nonzero	O
entry	O
is	O
called	O
the	O
leading	O
coefficient	O
(	O
or	O
pivot	O
)	O
of	O
that	O
row	O
.	O
</s>
<s>
If	O
this	O
is	O
the	O
case	O
,	O
then	O
matrix	B-Architecture
is	O
said	O
to	O
be	O
in	O
row	O
echelon	O
form	O
.	O
</s>
<s>
So	O
the	O
lower	O
left	O
part	O
of	O
the	O
matrix	B-Architecture
contains	O
only	O
zeros	O
,	O
and	O
all	O
of	O
the	O
zero	O
rows	O
are	O
below	O
the	O
non-zero	O
rows	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
following	O
matrix	B-Architecture
is	O
in	O
row	O
echelon	O
form	O
,	O
and	O
its	O
leading	O
coefficients	O
are	O
shown	O
in	O
red	O
:	O
</s>
<s>
A	O
matrix	B-Architecture
is	O
said	O
to	O
be	O
in	O
reduced	O
row	O
echelon	O
form	O
if	O
furthermore	O
all	O
of	O
the	O
leading	O
coefficients	O
are	O
equal	O
to	O
1	O
(	O
which	O
can	O
be	O
achieved	O
by	O
using	O
the	O
elementary	O
row	O
operation	O
of	O
type	O
2	O
)	O
,	O
and	O
in	O
every	O
column	O
containing	O
a	O
leading	O
coefficient	O
,	O
all	O
of	O
the	O
other	O
entries	O
in	O
that	O
column	O
are	O
zero	O
(	O
which	O
can	O
be	O
achieved	O
by	O
using	O
elementary	O
row	O
operations	O
of	O
type	O
3	O
)	O
.	O
</s>
<s>
The	O
table	O
below	O
is	O
the	O
row	B-Algorithm
reduction	I-Algorithm
process	O
applied	O
simultaneously	O
to	O
the	O
system	O
of	O
equations	O
and	O
its	O
associated	O
augmented	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
In	O
practice	O
,	O
one	O
does	O
not	O
usually	O
deal	O
with	O
the	O
systems	O
in	O
terms	O
of	O
equations	O
,	O
but	O
instead	O
makes	O
use	O
of	O
the	O
augmented	B-Algorithm
matrix	I-Algorithm
,	O
which	O
is	O
more	O
suitable	O
for	O
computer	O
manipulations	O
.	O
</s>
<s>
The	O
row	B-Algorithm
reduction	I-Algorithm
procedure	O
may	O
be	O
summarized	O
as	O
follows	O
:	O
eliminate	O
from	O
all	O
equations	O
below	O
,	O
and	O
then	O
eliminate	O
from	O
all	O
equations	O
below	O
.	O
</s>
<s>
This	O
will	O
put	O
the	O
system	O
into	O
triangular	B-Algorithm
form	I-Algorithm
.	O
</s>
<s>
Once	O
is	O
also	O
eliminated	O
from	O
the	O
third	O
row	O
,	O
the	O
result	O
is	O
a	O
system	O
of	O
linear	O
equations	O
in	O
triangular	B-Algorithm
form	I-Algorithm
,	O
and	O
so	O
the	O
first	O
part	O
of	O
the	O
algorithm	O
is	O
complete	O
.	O
</s>
<s>
Instead	O
of	O
stopping	O
once	O
the	O
matrix	B-Architecture
is	O
in	O
echelon	O
form	O
,	O
one	O
could	O
continue	O
until	O
the	O
matrix	B-Architecture
is	O
in	O
reduced	O
row	O
echelon	O
form	O
,	O
as	O
it	O
is	O
done	O
in	O
the	O
table	O
.	O
</s>
<s>
The	O
process	O
of	O
row	O
reducing	O
until	O
the	O
matrix	B-Architecture
is	O
reduced	O
is	O
sometimes	O
referred	O
to	O
as	O
Gauss	B-Algorithm
–	I-Algorithm
Jordan	I-Algorithm
elimination	I-Algorithm
,	O
to	O
distinguish	O
it	O
from	O
stopping	O
after	O
reaching	O
echelon	O
form	O
.	O
</s>
<s>
The	O
method	O
of	O
Gaussian	B-Algorithm
elimination	I-Algorithm
appears	O
–	O
albeit	O
without	O
proof	O
–	O
in	O
the	O
Chinese	O
mathematical	O
text	O
Chapter	O
Eight	O
:	O
Rectangular	O
Arrays	O
of	O
The	O
Nine	O
Chapters	O
on	O
the	O
Mathematical	O
Art	O
.	O
</s>
<s>
The	O
notes	O
were	O
widely	O
imitated	O
,	O
which	O
made	O
(	O
what	O
is	O
now	O
called	O
)	O
Gaussian	B-Algorithm
elimination	I-Algorithm
a	O
standard	O
lesson	O
in	O
algebra	O
textbooks	O
by	O
the	O
end	O
of	O
the	O
18th	O
century	O
.	O
</s>
<s>
Some	O
authors	O
use	O
the	O
term	O
Gaussian	B-Algorithm
elimination	I-Algorithm
to	O
refer	O
only	O
to	O
the	O
procedure	O
until	O
the	O
matrix	B-Architecture
is	O
in	O
echelon	O
form	O
,	O
and	O
use	O
the	O
term	O
Gauss	B-Algorithm
–	I-Algorithm
Jordan	I-Algorithm
elimination	I-Algorithm
to	O
refer	O
to	O
the	O
procedure	O
which	O
ends	O
in	O
reduced	O
echelon	O
form	O
.	O
</s>
<s>
The	O
name	O
is	O
used	O
because	O
it	O
is	O
a	O
variation	O
of	O
Gaussian	B-Algorithm
elimination	I-Algorithm
as	O
described	O
by	O
Wilhelm	O
Jordan	O
in	O
1888	O
.	O
</s>
<s>
Jordan	O
and	O
Clasen	O
probably	O
discovered	O
Gauss	B-Algorithm
–	I-Algorithm
Jordan	I-Algorithm
elimination	I-Algorithm
independently	O
.	O
</s>
<s>
Historically	O
,	O
the	O
first	O
application	O
of	O
the	O
row	B-Algorithm
reduction	I-Algorithm
method	O
is	O
for	O
solving	O
systems	O
of	O
linear	O
equations	O
.	O
</s>
<s>
To	O
explain	O
how	O
Gaussian	B-Algorithm
elimination	I-Algorithm
allows	O
the	O
computation	O
of	O
the	O
determinant	O
of	O
a	O
square	B-Algorithm
matrix	I-Algorithm
,	O
we	O
have	O
to	O
recall	O
how	O
the	O
elementary	O
row	O
operations	O
change	O
the	O
determinant	O
:	O
</s>
<s>
If	O
Gaussian	B-Algorithm
elimination	I-Algorithm
applied	O
to	O
a	O
square	B-Algorithm
matrix	I-Algorithm
produces	O
a	O
row	O
echelon	O
matrix	B-Architecture
,	O
let	O
be	O
the	O
product	O
of	O
the	O
scalars	O
by	O
which	O
the	O
determinant	O
has	O
been	O
multiplied	O
,	O
using	O
the	O
above	O
rules	O
.	O
</s>
<s>
A	O
variant	O
of	O
Gaussian	B-Algorithm
elimination	I-Algorithm
called	O
Gauss	B-Algorithm
–	I-Algorithm
Jordan	I-Algorithm
elimination	I-Algorithm
can	O
be	O
used	O
for	O
finding	O
the	O
inverse	O
of	O
a	O
matrix	B-Architecture
,	O
if	O
it	O
exists	O
.	O
</s>
<s>
If	O
is	O
an	O
square	B-Algorithm
matrix	I-Algorithm
,	O
then	O
one	O
can	O
use	O
row	B-Algorithm
reduction	I-Algorithm
to	O
compute	O
its	O
inverse	O
matrix	B-Architecture
,	O
if	O
it	O
exists	O
.	O
</s>
<s>
First	O
,	O
the	O
identity	B-Algorithm
matrix	I-Algorithm
is	O
augmented	O
to	O
the	O
right	O
of	O
,	O
forming	O
an	O
block	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
Now	O
through	O
application	O
of	O
elementary	O
row	O
operations	O
,	O
find	O
the	O
reduced	O
echelon	O
form	O
of	O
this	O
matrix	B-Architecture
.	O
</s>
<s>
The	O
matrix	B-Architecture
is	O
invertible	O
if	O
and	O
only	O
if	O
the	O
left	O
block	O
can	O
be	O
reduced	O
to	O
the	O
identity	B-Algorithm
matrix	I-Algorithm
;	O
in	O
this	O
case	O
the	O
right	O
block	O
of	O
the	O
final	O
matrix	B-Architecture
is	O
.	O
</s>
<s>
For	O
example	O
,	O
consider	O
the	O
following	O
matrix	B-Architecture
:	O
</s>
<s>
To	O
find	O
the	O
inverse	O
of	O
this	O
matrix	B-Architecture
,	O
one	O
takes	O
the	O
following	O
matrix	B-Architecture
augmented	O
by	O
the	O
identity	O
and	O
row-reduces	O
it	O
as	O
a	O
3×6	O
matrix	B-Architecture
:	O
</s>
<s>
One	O
can	O
think	O
of	O
each	O
row	O
operation	O
as	O
the	O
left	O
product	O
by	O
an	O
elementary	O
matrix	B-Architecture
.	O
</s>
<s>
This	O
procedure	O
for	O
finding	O
the	O
inverse	O
works	O
for	O
square	B-Algorithm
matrices	I-Algorithm
of	O
any	O
size	O
.	O
</s>
<s>
The	O
Gaussian	B-Algorithm
elimination	I-Algorithm
algorithm	O
can	O
be	O
applied	O
to	O
any	O
matrix	B-Architecture
.	O
</s>
<s>
This	O
echelon	O
matrix	B-Architecture
contains	O
a	O
wealth	O
of	O
information	O
about	O
:	O
the	O
rank	O
of	O
is	O
5	O
,	O
since	O
there	O
are	O
5	O
nonzero	O
rows	O
in	O
;	O
the	O
vector	O
space	O
spanned	O
by	O
the	O
columns	O
of	O
has	O
a	O
basis	O
consisting	O
of	O
its	O
columns	O
1	O
,	O
3	O
,	O
4	O
,	O
7	O
and	O
9	O
(	O
the	O
columns	O
with	O
in	O
)	O
,	O
and	O
the	O
stars	O
show	O
how	O
the	O
other	O
columns	O
of	O
can	O
be	O
written	O
as	O
linear	O
combinations	O
of	O
the	O
basis	O
columns	O
.	O
</s>
<s>
This	O
is	O
a	O
consequence	O
of	O
the	O
distributivity	O
of	O
the	O
dot	O
product	O
in	O
the	O
expression	O
of	O
a	O
linear	O
map	O
as	O
a	O
matrix	B-Architecture
.	O
</s>
<s>
The	O
number	O
of	O
arithmetic	O
operations	O
required	O
to	O
perform	O
row	B-Algorithm
reduction	I-Algorithm
is	O
one	O
way	O
of	O
measuring	O
the	O
algorithm	O
's	O
computational	O
efficiency	O
.	O
</s>
<s>
For	O
example	O
,	O
to	O
solve	O
a	O
system	O
of	O
equations	O
for	O
unknowns	O
by	O
performing	O
row	O
operations	O
on	O
the	O
matrix	B-Architecture
until	O
it	O
is	O
in	O
echelon	O
form	O
,	O
and	O
then	O
solving	O
for	O
each	O
unknown	O
in	O
reverse	O
order	O
,	O
requires	O
divisions	O
,	O
multiplications	O
,	O
and	O
subtractions	O
,	O
for	O
a	O
total	O
of	O
approximately	O
operations	O
.	O
</s>
<s>
This	O
is	O
the	O
case	O
when	O
the	O
coefficients	O
are	O
represented	O
by	O
floating-point	B-Algorithm
numbers	I-Algorithm
or	O
when	O
they	O
belong	O
to	O
a	O
finite	O
field	O
.	O
</s>
<s>
However	O
,	O
there	O
is	O
a	O
variant	O
of	O
Gaussian	B-Algorithm
elimination	I-Algorithm
,	O
called	O
the	O
Bareiss	B-Algorithm
algorithm	I-Algorithm
,	O
that	O
avoids	O
this	O
exponential	O
growth	O
of	O
the	O
intermediate	O
entries	O
and	O
,	O
with	O
the	O
same	O
arithmetic	O
complexity	O
of	O
,	O
has	O
a	O
bit	O
complexity	O
of	O
.	O
</s>
<s>
These	O
large	O
systems	O
are	O
generally	O
solved	O
using	O
iterative	B-Algorithm
methods	I-Algorithm
.	O
</s>
<s>
To	O
put	O
an	O
matrix	B-Architecture
into	O
reduced	O
echelon	O
form	O
by	O
row	O
operations	O
,	O
one	O
needs	O
arithmetic	O
operations	O
,	O
which	O
is	O
approximately	O
50%	O
more	O
computation	O
steps	O
.	O
</s>
<s>
One	O
possible	O
problem	O
is	O
numerical	B-Algorithm
instability	I-Algorithm
,	O
caused	O
by	O
the	O
possibility	O
of	O
dividing	O
by	O
very	O
small	O
numbers	O
.	O
</s>
<s>
If	O
,	O
for	O
example	O
,	O
the	O
leading	O
coefficient	O
of	O
one	O
of	O
the	O
rows	O
is	O
very	O
close	O
to	O
zero	O
,	O
then	O
to	O
row-reduce	O
the	O
matrix	B-Architecture
,	O
one	O
would	O
need	O
to	O
divide	O
by	O
that	O
number	O
.	O
</s>
<s>
Gaussian	B-Algorithm
elimination	I-Algorithm
is	O
numerically	B-Algorithm
stable	I-Algorithm
for	O
diagonally	B-Algorithm
dominant	I-Algorithm
or	O
positive-definite	B-Algorithm
matrices	I-Algorithm
.	O
</s>
<s>
For	O
general	O
matrices	O
,	O
Gaussian	B-Algorithm
elimination	I-Algorithm
is	O
usually	O
considered	O
to	O
be	O
stable	O
,	O
when	O
using	O
partial	O
pivoting	O
,	O
even	O
though	O
there	O
are	O
examples	O
of	O
stable	O
matrices	O
for	O
which	O
it	O
is	O
unstable	O
.	O
</s>
<s>
Gaussian	B-Algorithm
elimination	I-Algorithm
can	O
be	O
performed	O
over	O
any	O
field	O
,	O
not	O
just	O
the	O
real	O
numbers	O
.	O
</s>
<s>
Buchberger	O
's	O
algorithm	O
is	O
a	O
generalization	O
of	O
Gaussian	B-Algorithm
elimination	I-Algorithm
to	O
systems	O
of	O
polynomial	O
equations	O
.	O
</s>
<s>
The	O
choice	O
of	O
an	O
ordering	O
on	O
the	O
variables	O
is	O
already	O
implicit	O
in	O
Gaussian	B-Algorithm
elimination	I-Algorithm
,	O
manifesting	O
as	O
the	O
choice	O
to	O
work	O
from	O
left	O
to	O
right	O
when	O
selecting	O
pivot	O
positions	O
.	O
</s>
<s>
Computing	O
the	O
rank	O
of	O
a	O
tensor	B-Device
of	O
order	O
greater	O
than	O
2	O
is	O
NP-hard	O
.	O
</s>
<s>
Therefore	O
,	O
if	O
,	O
there	O
cannot	O
be	O
a	O
polynomial	O
time	O
analog	O
of	O
Gaussian	B-Algorithm
elimination	I-Algorithm
for	O
higher-order	O
tensors	B-Device
(	O
matrices	O
are	O
array	B-Data_Structure
representations	O
of	O
order-2	O
tensors	B-Device
)	O
.	O
</s>
<s>
As	O
explained	O
above	O
,	O
Gaussian	B-Algorithm
elimination	I-Algorithm
transforms	O
a	O
given	O
matrix	B-Architecture
into	O
a	O
matrix	B-Architecture
in	O
row-echelon	O
form	O
.	O
</s>
<s>
In	O
the	O
following	O
pseudocode	B-Language
,	O
A[ i	O
,	O
j ]	O
denotes	O
the	O
entry	O
of	O
the	O
matrix	B-Architecture
in	O
row	O
and	O
column	O
with	O
the	O
indices	O
starting	O
from1	O
.	O
</s>
<s>
The	O
transformation	O
is	O
performed	O
in	O
place	O
,	O
meaning	O
that	O
the	O
original	O
matrix	B-Architecture
is	O
lost	O
for	O
being	O
eventually	O
replaced	O
by	O
its	O
row-echelon	O
form	O
.	O
</s>
<s>
Such	O
a	O
partial	O
pivoting	O
may	O
be	O
required	O
if	O
,	O
at	O
the	O
pivot	O
place	O
,	O
the	O
entry	O
of	O
the	O
matrix	B-Architecture
is	O
zero	O
.	O
</s>
<s>
In	O
any	O
case	O
,	O
choosing	O
the	O
largest	O
possible	O
absolute	O
value	O
of	O
the	O
pivot	O
improves	O
the	O
numerical	B-Algorithm
stability	I-Algorithm
of	O
the	O
algorithm	O
,	O
when	O
floating	B-Algorithm
point	I-Algorithm
is	O
used	O
for	O
representing	O
numbers	O
.	O
</s>
<s>
Upon	O
completion	O
of	O
this	O
procedure	O
the	O
matrix	B-Architecture
will	O
be	O
in	O
row	O
echelon	O
form	O
and	O
the	O
corresponding	O
system	O
may	O
be	O
solved	O
by	O
back	O
substitution	O
.	O
</s>
