Given a matrix [a], how to get matrices [b] and [c] based on the following two rules?

  1. rule [a]->[b]: Strike out corresponding term in [a] and take product of the remaining two terms in the same column.
  2. rule [a]->[c]: Strike out the row and column containing the corresponding term in [a] and take sum of cross products in the 2×2 matrix remaining.

x,y,z can be replaced with 1,2,3; For example, $a_{xy},a_{yz}$ can be replaced with a12,a23; [a] can be replace with:

a = {{a11, a12, a13}, {a21, a22, a23}, {a31, a32, a33}}

Thank you

Matrix [a]

enter image description here

Matrix [b]

enter image description here

Matrix [c]

enter image description here


1 Answer 1

amat = Array[a, {3, 3}]

(* {{a[1, 1], a[1, 2], a[1, 3]}, 
    {a[2, 1], a[2, 2], a[2, 3]}, 
    {a[3, 1],  a[3, 2], a[3, 3]}} *)

For the first item, if you have no zero elements, then...

Map[Times @@ #/# &, Transpose@amat] // TeXForm

$$ \left( \begin{array}{ccc} a(2,1) a(3,1) & a(1,1) a(3,1) & a(1,1) a(2,1) \\ a(2,2) a(3,2) & a(1,2) a(3,2) & a(1,2) a(2,2) \\ a(2,3) a(3,3) & a(1,3) a(3,3) & a(1,3) a(2,3) \\ \end{array} \right) $$

If you have zero elements, then do this.

Transpose@Map[Table[Times @@ Delete[#, i], {i, 3}] &, Transpose@amat]

For the other, what you are asking for is similar to a minor. Use the generalized version of the function...first define a function that takes a 2x2 matrix and determines something similar to the cross product, but all positive terms.

f[m_] := m[[1, 1]] m[[2, 2]] + m[[1, 2]] m[[2, 1]]

Then call Minors passing f[ ] to be used on the submatrices instead of Det. Note we have to explicitly fix size of the submatrices. Also, see help on Minors to get the submatrices with the right rows and columns deleted.

Map[Reverse, Minors[amat, 2, f], {0, 1}]

$$ \left( \begin{array}{ccc} a(2,3) a(3,2)+a(2,2) a(3,3) & a(2,3) a(3,1)+a(2,1) a(3,3) & a(2,2) a(3,1)+a(2,1) a(3,2) \\ a(1,3) a(3,2)+a(1,2) a(3,3) & a(1,3) a(3,1)+a(1,1) a(3,3) & a(1,2) a(3,1)+a(1,1) a(3,2) \\ a(1,3) a(2,2)+a(1,2) a(2,3) & a(1,3) a(2,1)+a(1,1) a(2,3) & a(1,2) a(2,1)+a(1,1) a(2,2) \\ \end{array} \right) $$

  • 1
    $\begingroup$ I also thought first that it were about the minors; it is not. It think cross product means of a $2 times 2$ matrix in this context refers to $q_{11} q_{22} + q_{12} q_{21}$. $\endgroup$ Apr 1, 2020 at 17:38
  • $\begingroup$ Ahh, yup. Updated the answer, can still use the Minors function to handle the bookkeeping. $\endgroup$
    – MikeY
    Apr 1, 2020 at 18:57
  • 1
    $\begingroup$ Ah, Minors allows a third argument. That's great to know! $\endgroup$ Apr 1, 2020 at 18:59
  • 1
    $\begingroup$ @MikeY, Henrik Schumacher. Thank you, it's a perfect solution. $\endgroup$
    – likehust
    Apr 2, 2020 at 2:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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