1
$\begingroup$

I have this $44$ dimensional parametric matrix ($\{x,d,b,t\}\in\mathbb{R}$) and I want to compute its determinant.

Questions:

  1. Is it possible to predict how much time it will take to give a result by Det[M]?
  2. Is it possible to decompose the matrix (as a multiplication of simpler matrices) so that computing its determinant is faster? Can this be done using automated functionality provided by Mathematica?
M:={{-E^(-((I x)/2)) (1 + x), E^((I x)/2) (-1 + x), 0, 
  0, -E^(I b - (2 I d \[Pi])/11 - I x) (-1 + x), 
  E^(-(2/11) I d \[Pi] + I (b + x)) (1 + x), 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 0}, {0, 0, 1 + x, 
  1 - x, -E^(I b - (2 I d \[Pi])/11 - I x) (1 + x), 
  E^(-(2/11) I d \[Pi] + I (b + x)) (-1 + x), 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 0}, {0, 0, -1 + x, -1 - x, 1 + x, 1 - x, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {-E^(-((I x)/2)) (-1 + x), 
  E^((I x)/2) (1 + x), 0, 0, -1 + x, -1 - x, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 
  0}, {E^((I x)/2) (-1 + x), -E^(-((I x)/2)) (1 + x), 0, 0, 0, 0, 
  E^((4 I d \[Pi])/11 + I (-b + x)) (1 + x), 
  E^((4 I d \[Pi])/11 - I (b + x)) (1 - x), 0, 0, 0, 0, 0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 
  E^((4 I d \[Pi])/11 + I (-b + x)) (-1 + x), 
  E^((4 I d \[Pi])/11 - I (b + x)) (-1 - x), 0, 
  0, -E^(-((I x)/2)) (-1 + x), E^((I x)/2) (1 + x), 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   0, 0, 0}, {0, 0, 0, 0, 0, 0, 1 - x, 1 + x, 0, 
  0, -E^(-((I x)/2)) (1 + x), E^((I x)/2) (-1 + x), 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   0, 0, 0}, {E^((I x)/2) (1 + x), -E^(-((I x)/2)) (-1 + x), 0, 0, 0, 
  0, -1 - x, -1 + x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 
  0, 0, 0, 0, 0, 0, -E^(-((I x)/2)) (1 + x), E^((I x)/2) (-1 + x), 0, 
  0, -E^(I b - (6 I d \[Pi])/11 - I x) (-1 + x), 
  E^(-(6/11) I d \[Pi] + I (b + x)) (1 + x), 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  E^((I x)/2) (1 + x), -E^(-((I x)/2)) (-1 + x), -E^(
    I b - (6 I d \[Pi])/11 - I x) (1 + x), 
  E^(-(6/11) I d \[Pi] + I (b + x)) (-1 + x), 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  E^((I x)/2) (-1 + x), -E^(-((I x)/2)) (1 + x), 1 + x, 1 - x, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, -E^(-((I x)/2)) (-1 + x), 
  E^((I x)/2) (1 + x), 0, 0, -1 + x, -1 - x, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0}, {0, 0, 0, 0, 0, 0, 0, 0, 
  E^((I x)/2) (-1 + x), -E^(-((I x)/2)) (1 + x), 0, 0, 0, 0, 0, 0, 
  E^((8 I d \[Pi])/11 + I (-b + x)) (1 + x), 
  E^((8 I d \[Pi])/11 - I (b + x)) (1 - x), 0, 0, 0, 0, 0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, -E^(-((I x)/2)) (-1 + x), 
  E^((I x)/2) (1 + x), E^((8 I d \[Pi])/11 + I (-b + x)) (-1 + x), 
  E^((8 I d \[Pi])/11 - I (b + x)) (-1 - x), 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -E^(-((I x)/2)) (1 + x), 
  E^((I x)/2) (-1 + x), 1 - x, 1 + x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0,
   0, E^((I x)/2) (1 + x), -E^(-((I x)/2)) (-1 + x), 0, 0, 0, 0, 0, 
  0, -1 - x, -1 + x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, -E^(I b - (10 I d \[Pi])/11 - I x) (-1 + x), 
  E^(-(10/11) I d \[Pi] + I (b + x)) (1 + x), -E^(-((I x)/2)) (1 + x),
   E^((I x)/2) (-1 + x), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  E^((I x)/2) (1 + x), -E^(-((I x)/2)) (-1 + x), 0, 
  0, -E^(I b - (10 I d \[Pi])/11 - I x) (1 + x), 
  E^(-(10/11) I d \[Pi] + I (b + x)) (-1 + x), 0, 0, 0, 0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 
  E^((I x)/2) (-1 + x), -E^(-((I x)/2)) (1 + x), 0, 0, 1 + x, 1 - x, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, -1 + x, -1 - x, -E^(-((I x)/2)) (-1 + x), E^((I x)/2) (1 + x), 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  E^((I x)/2) (-1 + x), -E^(-((I x)/2)) (1 + x), 
  E^((12 I d \[Pi])/11 + I (-b + x)) (1 + x), 
  E^((12 I d \[Pi])/11 - I (b + x)) (1 - x), 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  E^((12 I d \[Pi])/11 + I (-b + x)) (-1 + x), 
  E^((12 I d \[Pi])/11 - I (b + x)) (-1 - x), 0, 
  0, -E^(-((I x)/2)) (-1 + x), E^((I x)/2) (1 + x), 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 - x, 1 + x, 0, 
  0, -E^(-((I x)/2)) (1 + x), E^((I x)/2) (-1 + x), 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 
  E^((I x)/2) (1 + x), -E^(-((I x)/2)) (-1 + x), -1 - x, -1 + x, 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, -E^(-((I x)/2)) (1 + x), E^((I x)/2) (-1 + x), 0, 
  0, -E^(I b - (14 I d \[Pi])/11 - I x) (-1 + x), 
  E^(-(14/11) I d \[Pi] + I (b + x)) (1 + x), 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  E^((I x)/2) (1 + x), -E^(-((I x)/2)) (-1 + x), -E^(
    I b - (14 I d \[Pi])/11 - I x) (1 + x), 
  E^(-(14/11) I d \[Pi] + I (b + x)) (-1 + x), 0, 0, 0, 0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  E^((I x)/2) (-1 + x), -E^(-((I x)/2)) (1 + x), 1 + x, 1 - x, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -E^(-((I x)/2)) (-1 + x), 
  E^((I x)/2) (1 + x), 0, 0, -1 + x, -1 - x, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, -E^(I b - (18 I d \[Pi])/11 - I x) (-1 + x), 
  E^(-(18/11) I d \[Pi] + I (b + x)) (1 + x), -E^(-((I x)/2)) (1 + x),
   E^((I x)/2) (-1 + x), 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  E^((I x)/2) (1 + x), -E^(-((I x)/2)) (-1 + x), 0, 
  0, -E^(I b - (18 I d \[Pi])/11 - I x) (1 + x), 
  E^(-(18/11) I d \[Pi] + I (b + x)) (-1 + x), 0, 0, 0, 0, 0, 0, 0, 
  0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 
  E^((I x)/2) (-1 + x), -E^(-((I x)/2)) (1 + x), 0, 0, 1 + x, 1 - x, 
  0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, -1 + x, -1 - x, -E^(-((I x)/2)) (-1 + x), E^((I x)/2) (1 + x), 0,
   0, 0, 0, 0, 0}, {0, 0, -E^(I (t - x)) (1 + x), 
  E^(I (t + x)) (-1 + x), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, E^(I (b - x)) (1 - x), E^(I (b + x)) (1 + x)}, {0, 0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  E^((I x)/2) (1 + x), -E^(-((I x)/2)) (-1 + x), 0, 
  0, -E^(I (b - x)) (1 + x), E^(I (b + x)) (-1 + x)}, {0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  E^((I x)/2) (-1 + x), -E^(-((I x)/2)) (1 + x), 0, 0, 1 + x, 
  1 - x}, {0, 0, E^(I (t - x)) (1 - x), E^(I (t + x)) (1 + x), 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1 + x, -1 - x}, {0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  E^((I x)/2) (-1 + x), -E^(-((I x)/2)) (1 + x), 0, 0, 0, 0, 0, 0, 
  E^((16 I d \[Pi])/11 + I (-b + x)) (1 + x), 
  E^((16 I d \[Pi])/11 - I (b + x)) (1 - x), 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -E^(-((I x)/2)) (-1 + x), 
  E^((I x)/2) (1 + x), E^((16 I d \[Pi])/11 + I (-b + x)) (-1 + x), 
  E^((16 I d \[Pi])/11 - I (b + x)) (-1 - x), 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -E^(-((I x)/2)) (1 + x), 
  E^((I x)/2) (-1 + x), 1 - x, 1 + x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, E^((I x)/2) (1 + x), -E^(-((I x)/2)) (-1 + x), 0, 0, 0, 0, 
  0, 0, -1 - x, -1 + x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 
  E^((I x)/2) (-1 + x), -E^(-((I x)/2)) (1 + x), 0, 0, 
  E^((20 I d \[Pi])/11 + I (-b + x)) (1 + x), 
  E^((20 I d \[Pi])/11 - I (b + x)) (1 - x), 0, 0}, {0, 0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -E^(-((I x)/2)) (-1 + x), 
  E^((I x)/2) (1 + x), E^((20 I d \[Pi])/11 + I (-b + x)) (-1 + x), 
  E^((20 I d \[Pi])/11 - I (b + x)) (-1 - x), 0, 0}, {0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -E^(-((I x)/2)) (1 + x), 
  E^((I x)/2) (-1 + x), 1 - x, 1 + x, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
   0, 0, 0, 0, 0, E^((I x)/2) (1 + x), -E^(-((I x)/2)) (-1 + x), 0, 
  0, -1 - x, -1 + x, 0, 0}}

$\endgroup$
7
  • 1
    $\begingroup$ how much time it will take to give a result by Det[M] I think the best known algorithm is $O(n^{2.372...})$ where $n$ is the size of the matrix. $\endgroup$
    – Nasser
    Commented Oct 24, 2022 at 16:33
  • 2
    $\begingroup$ Is it possible to decompose the matrix (as a multiplication of simpler matrices) so that computing its determinant is faster? I think this is now a math question so might be better ask at the math forum. $\endgroup$
    – Nasser
    Commented Oct 24, 2022 at 16:36
  • $\begingroup$ @Nasser Thanks for your comments; as for your first comment then what is $\mathcal{O}(44^{2.372})$? As for the second comment, I thought maybe there is a Mathematica command for the decomposition of matrices. $\endgroup$
    – charmin
    Commented Oct 24, 2022 at 18:09
  • 1
    $\begingroup$ I am not sure it will make it faster if you change your one matrix, with multiplication of number of $m$ matrices instead and then find determinant of each of these and multiply the determinants. Since time to find the determinant is function of size of the matrix, and each one of the $m$ matrices has to be $n$ also, then this might actually be slower to do. But may be someone at math group knows more about this. As for the order, this is big O, it just says this is how you would expect the time to increase as a function of changing $n$. It does not give an actual time or anything like that. $\endgroup$
    – Nasser
    Commented Oct 24, 2022 at 19:37
  • 1
    $\begingroup$ Define the two permutations p1={33,36,34,35,42,43,41,44,29,32,30,31,38,39,37,40,25,28,26,27,22,23,21,24,17,20,18,19,14,15,13,16,9,12,10,11,6,7,5,8,1,4,2,3} and p2={3,4,43,44,39,40,41,42,37,38,35,36,31,32,33,34,25,26,29,30,27,28,23,24,21,22,19,20,15,16,17,18,9,10,13,14,11,12,7,8,1,2,5,6}. Define X=M[[p1,p2]]. If you display X, you will see that it has a simpler structure than M (also try ListPlot[Map[First,ArrayRules[X]]]). Note that X and M have the same determinant, because p1 and p2 are even permutations. I do not know how to calculate the determinant of X however. $\endgroup$
    – user293787
    Commented Oct 25, 2022 at 15:17

1 Answer 1

1
$\begingroup$

Not an answer but an elaboration on my comment above.

One can use

MatrixPlot[M]

to see the sparse structure of M:

enter image description here

Define the even permutations

p1={33,36,34,35,42,43,41,44,29,32,30,31,38,39,37,40,25,28,26,27,22,23,21,24,17,20,18,19,14,15,13,16,9,12,10,11,6,7,5,8,1,4,2,3};
p2={3,4,43,44,39,40,41,42,37,38,35,36,31,32,33,34,25,26,29,30,27,28,23,24,21,22,19,20,15,16,17,18,9,10,13,14,11,12,7,8,1,2,5,6};

and set X=M[[p1,p2]]. Note that $\det M = \det X$, hence our goal is to compute $\det X$.

Using

MatrixPlot[X]

we get

enter image description here

In fact, the matrix $X$ has the following structure: $$ X = \begin{pmatrix} A_1 & B_1 & 0 & \cdots & 0 & 0 \\ 0 & A_2 & B_2 & \cdots & 0 & 0\\ 0 & 0 & A_3 & \cdots & 0 & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots\\ 0 & 0 & 0 & \cdots & A_{n-1} & B_{n-1} \\ B_n & 0 & 0 & \cdots & 0 & A_n \end{pmatrix} $$ where each $A_i$ and each $B_i$ is a $2\times 2$ matrix, and where $n = 22$.

The determinant of such a matrix has the following formula, if the $A_i$ are invertible: $$ \det X = \det(A_1) \det(A_2) \cdots \det(A_n) \det\Big( 1 - (-1)^n A_1^{-1} B_1 A_2^{-1} B_2 \cdots A_n^{-1} B_n \Big) $$ This can be obtained by applying the block matrix determinant formula repeatedly. Alternatively, to convince oneself that this formula is correct, one can use the Mathematica code given below. It is easy to calculate the $\det(A_i)$, but the difficult part is $$ \det\Big( 1 - (-1)^n A_1^{-1} B_1 A_2^{-1} B_2 \cdots A_n^{-1} B_n \Big) $$ This is the determinant of a $2\times 2$ matrix, easy in principle, but in OPs case where the entries are symbolic, it is not so easy.

Code to check the formula for $\det X$.

n=22;
Clear[A,B];
A[i_]:=A[i]=RandomInteger[{-10,10},{2,2}];
B[i_]:=B[i]=RandomInteger[{-10,10},{2,2}];
Det[ArrayFlatten[Table[Switch[Mod[i-j,n],0,A[i],n-1,B[i],_,0],{i,1,n},{j,1,n}]]]===Product[Det[A[i]],{i,1,n}]*Det[IdentityMatrix[2]-(-1)^n*Dot@@Table[Inverse[A[i]].B[i],{i,1,n}]]
$\endgroup$
2
  • $\begingroup$ Thanks. How did you obtain $p_1$ and $p_2$? $\endgroup$
    – charmin
    Commented Oct 25, 2022 at 16:55
  • 1
    $\begingroup$ I first looked at ListPlot[Most[Map[First,ArrayRules[M]]]]. I then used the code G=Most[Map[First,ArrayRules[M]]]; next1[{x1_,x2_,y1_,y2_}]:=With[{X=Cases[G,{x1|x2,Except[y1|y2]}]}, Join[DeleteDuplicates[X[[;;,1]]],DeleteDuplicates[X[[;;,2]]]]]; next2[{x1_,x2_,y1_,y2_}]:=With[{X=Cases[G,{Except[x1|x2],y1|y2}]}, Join[DeleteDuplicates[X[[;;,1]]],DeleteDuplicates[X[[;;,2]]]]]; next[{x1_,x2_,y1_,y2_}]:=next2[next1[{x1,x2,y1,y2}]]; GX=NestList[next,{33,36,3,4},21]; {Flatten[GX[[;;,{1,2}]]],Flatten[GX[[;;,{3,4}]]]}. I am not going to explain how it works. $\endgroup$
    – user293787
    Commented Oct 25, 2022 at 17:26

Your Answer

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

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