m = {{2, 6, 4}, {2, 6, 5}, {-3, 6, 6}};

Consider I’m doing calculation by hand.

I want to collect the multiple 6 of second column, how to do that?

I’d like the result something like the following. The main purpose is to show the solution steps(in Notebook or Latex)

det(m)=6 det(214215−316);\begin{align*}det(m)=6~det\left(\begin{array}{ccc} 2& 1 & 4 \\ 2 & 1 & 5 \\ -3 & 1 & 6 \\\end{array}\right);\end{align*}

Maybe something collect[m] function, and generate all possible results?

or

det(m)=2 det(132265−366);\begin{align*}det(m)=2~det\left(\begin{array}{ccc} 1 & 3& 2\\ 2 & 6& 5 \\ -3 & 6& 6 \\\end{array}\right);\end{align*}

=================

@Nasser Maybe something collect[m] function, and generate all possible results?

– HyperGroups

Aug 29 ’13 at 14:16

2

Do you know how to multiply matrices by scalars? Your expectation is not compatibile with standard conventions but rather completely unnatural.

– Artes

Aug 29 ’13 at 14:22

1

@Artes multiply matrices is not the same as multiply a determinant?

– HyperGroups

Aug 29 ’13 at 14:24

@Nasser sorry, I need your comments, they are useful to improve my question.

– HyperGroups

Aug 29 ’13 at 14:24

1

@HyperGroups If you need a determinant you should explicitely write det(matrix)det(matrix)

– Artes

Aug 29 ’13 at 14:26

=================

1 Answer

1

=================

in two steps:

m={{1,6,4},{2,6,5},{-3,6,6}};

MatrixForm[Apply[Times,GCD@@@m]] * MatrixForm[rm= (#/GCD@@#)&/@m ]

MatrixForm[Apply[Times,GCD@@@Transpose[rm]]] * MatrixForm[Transpose[(#/GCD@@#)&/@Transpose[rm]] ]

in one step:

MatrixForm[Apply[Times,GCD@@@m] *

Apply[Times,GCD@@@Transpose[(#/GCD@@#)&/@m]]] * MatrixForm[Transpose[(#/GCD@@#)&/@Transpose[(#/GCD@@#)&/@m] ]]

Welcome to SE! GCD is a good idea.

– HyperGroups

Aug 29 ’13 at 14:48