3
$\begingroup$

Here are two examples:

RowReduce[{{3, 1, a}, {2, 1, b}}]

evaluates to

{{1, 0, a - b}, {0, 1, -2 a + 3 b}}

but

RowReduce[{{1, 2, 3, a}, {4, 5, 6, b}, {7, 8, 9, c}}]

evaluates to

{{1, 0, -1, 0}, {0, 1, 2, 0}, {0, 0, 0, 1}}

The result is independent of a, b and c.

Since I want to know the steps of reduction, I add a, b and c for bookkeeping. But it does not work in the second example. Is anything wrong or is any way to keep track of the steps of reduction?

$\endgroup$
  • 1
    $\begingroup$ Here's a hint: Solve[{x + 2 y + 3 z == a, 4 x + 5 y + 6 z == b, 7 x + 8 y + 9 z == c}, {x, y, z}] results in {}. $\endgroup$ – JohnD Dec 13 '12 at 18:30
2
$\begingroup$

I'm not sure if your ultimate goal is a record of all of the row operations required to put a matrix in reduced row echelon form or if you want to figure out for what right-hand sides $\mathbf{b}=(a,b,c)$ does $A\mathbf{x}=\mathbf{b}$ have a solution.

For the latter,

RowReduce[{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}]

which results in

{{1, 0, -1}, {0, 1, 2}, {0, 0, 0}}

Thus, $z$ is a free variable, $y=-2z$, and $x=z$. So only right-hand sides of the form $\mathbf{b}=\begin{bmatrix}1\\-2\\1\end{bmatrix}d$ where $d$ is any constant will work.

For the former, that is a different conversation altogether. The LU decomposition of $A$ deals with this.

$\endgroup$
  • $\begingroup$ Thanks JohnD I think I try to solve something like x+2y+3z==Integers 4x+5y+6z==Integers 7x+8y+9z==Integers I do the Gaussian elimination without normalizing the leading coefficient in each row to 1 and get {{1,2,3},{0,-3,-6},{0,0,0}} So I will have x+2y+3z==Integers 3(y+2z)==Integers But RowReduce[{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}] will result in {{1, 0, -1}, {0, 1, 2}, {0, 0, 0}} That is why I include {a,b,c} to keep track to the multiplicative constants. Do you know how to do rowreduce without normalizing each equation or ways to solve equations up to integers by mathematica? $\endgroup$ – Charles Dec 13 '12 at 19:53
  • $\begingroup$ So you want to solve equations where the right-hand side is constrained to integer values or when the unknowns (here, $x,y,z$) are constrained to integer values? $\endgroup$ – JohnD Dec 13 '12 at 20:27
  • $\begingroup$ The right-hand side is integer valued. No constraints on variables. $\endgroup$ – Charles Dec 13 '12 at 20:30
  • $\begingroup$ Well, from the answer above, $A\mathbf{x}=\mathbf{b}$ is only solvable for right-hand sides of the form $\mathbf{b}=(1,-2,1)d$, $d\in\mathbb{R}$. So if you only want integer right-hand sides, take $d\in\mathbb{Z}$. $\endgroup$ – JohnD Dec 13 '12 at 20:49
  • 3
    $\begingroup$ If you want to work over the integers use HermiteDecomposition instead of RowReduce. Your example: {uu, hh} = HermiteDecomposition[{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}] {{{1, 0, 0}, {4, -1, 0}, {1, -2, 1}}, {{1, 2, 3}, {0, 3, 6}, {0, 0, 0}}} The first part of the result gives the transformation matrix. $\endgroup$ – Daniel Lichtblau Dec 13 '12 at 20:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.