3
$\begingroup$

How can I construct this matrix? enter image description here

$\endgroup$
1
  • 2
    $\begingroup$ Have you tried ToeplitzMatrix? $\endgroup$ Jun 17, 2023 at 20:07

1 Answer 1

6
$\begingroup$
tm[r_Integer, n_Integer] := ToeplitzMatrix @
  PadRight[(-1)^Reverse[Range[r + 1]- Boole[EvenQ @ r]] 
   Binomial[2 r, Reverse @ Range[0, r]], n + 1]

Examples:

TeXForm @ MatrixForm @ tm[2,5]

$\left( \begin{array}{cccccc} 6 & -4 & 1 & 0 & 0 & 0 \\ -4 & 6 & -4 & 1 & 0 & 0 \\ 1 & -4 & 6 & -4 & 1 & 0 \\ 0 & 1 & -4 & 6 & -4 & 1 \\ 0 & 0 & 1 & -4 & 6 & -4 \\ 0 & 0 & 0 & 1 & -4 & 6 \\ \end{array} \right)$

TeXForm @ MatrixForm @ tm[3, 7]

$\left( \begin{array}{cccccccc} 20 & -15 & 6 & -1 & 0 & 0 & 0 & 0 \\ -15 & 20 & -15 & 6 & -1 & 0 & 0 & 0 \\ 6 & -15 & 20 & -15 & 6 & -1 & 0 & 0 \\ -1 & 6 & -15 & 20 & -15 & 6 & -1 & 0 \\ 0 & -1 & 6 & -15 & 20 & -15 & 6 & -1 \\ 0 & 0 & -1 & 6 & -15 & 20 & -15 & 6 \\ 0 & 0 & 0 & -1 & 6 & -15 & 20 & -15 \\ 0 & 0 & 0 & 0 & -1 & 6 & -15 & 20 \\ \end{array} \right)$

$\endgroup$

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.