I'm trying to set up a change of basis matrix from the base V -> W with the RowReduce function that's built into Mathematica. I am then supposed to verify the result by taking the product of the change of basis matrix and multiplying it with the co-ordinate vector for x. You can see the Bases and the vector x below.

So, my question is, how do I setup the change of basis matrix and then verify it, with just the RowReduce function? Thanks in advance.

V = {{1, 3}, {4, 6}}
W = {{4, 6}, {2, 5}} 

x = {6, 6}
  • 1
    $\begingroup$ Pleeeease. Don't use MatrixForm in computations. See here why. Moreover, it would be appreciated if you would post copyable Mathematica code instead of images. $\endgroup$ Dec 27 '18 at 13:29
  • 1
    $\begingroup$ @HenrikSchumacher I'll edit the post then :) $\endgroup$
    – jhndoe2
    Dec 27 '18 at 13:31

This might give you an idea... I merge V and W into one matrix with ArrayFlatten and apply Gaussian elimination by RowReduce.

V = {{1, 3}, {4, 6}};
W = {{4, 6}, {2, 5}};
B = RowReduce[ArrayFlatten[{{V, W}}]][[All, 3 ;;]]
V.B == W

{{-3, -(7/2)}, {7/3, 19/6}}


  • $\begingroup$ Ah, smart. Wasn't thinking about how you could compare the two functions that easily. Just one question though. What does the ArrayFlatten, and the [[All, 3 ;;]] commands mean? Thank you very much for your answer. $\endgroup$
    – jhndoe2
    Dec 27 '18 at 13:34
  • $\begingroup$ ArrayFlatten can merge block matrices to a single matrix. And A[[All, 3 ;;]] reads off the columns 3 to Dimensions[A][[2]] of a matrix A. See the documentation of Part and Span for details. $\endgroup$ Dec 27 '18 at 13:36
  • $\begingroup$ Ah, now I get it. Thank you so much. If i were to calculate the change of basis matrix from W -> V, using the Inverse function, would I first take the inverse of W, and then multiply W^1 * V? $\endgroup$
    – jhndoe2
    Dec 27 '18 at 13:51
  • $\begingroup$ You're welcome. I'd rather use V.Inverse[W] or W.Inverse[V] depending on which direction you would like to have. $\endgroup$ Dec 27 '18 at 14:04
  • $\begingroup$ Well, I'd like to know the change of basis matrix from the base W -> V, so how would the function look like? $\endgroup$
    – jhndoe2
    Dec 27 '18 at 14:16

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.