Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
1  
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 {}. –  JohnD Dec 13 '12 at 18:30
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
    
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? –  Charles Dec 13 '12 at 19:53
    
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? –  JohnD Dec 13 '12 at 20:27
    
The right-hand side is integer valued. No constraints on variables. –  Charles Dec 13 '12 at 20:30
    
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}$. –  JohnD Dec 13 '12 at 20:49
2  
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. –  Daniel Lichtblau Dec 13 '12 at 20:55
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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