# Determinant and inverse of a “stars and stripes” matrix

This is a variant of another MO question. Consider the matrix $$M_n:=\begin{bmatrix}c_1& a & b&a& \ddots & a \\ b & c_2 & a& b&\ddots & b\\ a & b & c_3&a & \ddots & a \\b& a & b & c_4 & \ddots & \ddots\\ \ddots & \ddots & \ddots & \ddots & \ddots &a \\ b & a & b & \ddots &b& c_n \end{bmatrix}_{n\times n}$$ (This is for even $n$; for odd $n$, the NE corner will be $b$ and the SW $a$.)

I couldn't resist to choose the title as is, even though of course the stripes don't run the American way (because we want matrices of full rank...) but rather along the diagonals, consisting alternatingly of $a$'s or of $b$'s.

Question 1. Is there still a nice closed formula for the determinant $\det(M_n)$?
Question 2. Is there still a nice expression for the inverse $M_n^{-1}$?

Things do not fall as nicely into place as in the original question. If $v$ denotes the all-1-vector, the matrices $M_n-av^Tv$ and $M_n-bv^Tv$ still have half of their off-diagonal entries vanishing; but their inverses don't. Also for $n\ge4$, the determinant is no more symmetric in all the $c_i$, but at least in $c_i\leftrightarrow c_{n+1-i}$. Even in the case of all $c_i$ equal, i.e. a special kind of Toeplitz matrix, this seems tricky for general $n$.

• Try arranging the a's and b's into 4 homogeneous blocks and see where the c's end up. Gerhard "She Sells Seashells By Seashore" Paseman, 2017.03.25. – Gerhard Paseman Mar 25 '17 at 16:41
• @GerhardPaseman Why 4? – Wolfgang Mar 25 '17 at 16:49
• Because it looks like [ A B , B A ] with some c's sprinkled in, after you are done. Every row and column is about half a and half b. Gerhard "Wants Some Half And Half" Paseman, 2017.03.25. – Gerhard Paseman Mar 25 '17 at 16:52
• I see, you mean arranging even/odd rows and columns together, don't you? Then each block will resemble the matrix of the previous thread. This looks like a good idea... – Wolfgang Mar 25 '17 at 17:15
• forgot to add @GerhardPaseman :) – Wolfgang Mar 25 '17 at 18:44

If the matrix were symmetric and all the $c_j$'s constant, i.e. $$M_n':=\begin{bmatrix}c& a & b&a& \ddots & a \\ a & c & a& b&\ddots & b\\ b & a & c&a & \ddots & a \\a& b & a & c & \ddots & \ddots\\ \ddots & \ddots & \ddots & \ddots & \ddots &a \\ a & b & a & \ddots &a& c \end{bmatrix}_{n\times n}$$ (this is for even $n$; for odd $n$, the NE and the SW corners are both $b$), then $$\det(M_n')=(c-b)^{n-2}\left( \left(c+\left\lfloor\frac{n-2}2\right\rfloor b\right) \left(c+\left\lceil\frac{n-2}2\right\rceil b\right)-\left\lfloor\frac{n^2}4\right\rfloor a^2\right).$$ Here $\lfloor x\rfloor$ and $\lceil x\rceil$ are the floor and ceiling functions, respectively.