easiest way to construct the following determinantDefining a big matrix for iterative algorithmSolving determinant of a Kronecker product of matrices gives a numerical error - why?construct matrix by applying derivatives to another matrixStrange determinant resultCalculation of a matrix determinant for general matrix sizeDeterminant of the symbolic matrix is giving very large expressionDeterminant of matrix with asymptotic expansion

Why is weak Kőnig's lemma weaker than Kőnig's lemma?

Can abstractions and good code practice in embedded C++ eliminate the need for the debugger?

An outdated version of bash was detected on your system! when updating sdkman

Feasibility of keeping an Electrical Bike in poor (wet) storage conditions

FIDE Laws of Chess pre-2017

How to wire for AC mains voltage relay, when printer board is connected to AC-charging laptop computer?

Why is the Duration of Time spent in the Dayside greater than that of the Night side of the Moon for Chandrayaan-2 Orbiter?

Why do we worry about overfitting even if "all models are wrong"?

Energy cost of C−N rotation in hydroxamate group

Is there a way to download the box art for games?

Single word for delaying an unpleasant task

Making recursion optional: Bad practice?

Mechanics to keep mobs and environment alive without using tons of memory?

Did Catherine the Great really call for the abolition of serfdom?

Why is it “Cat in the Hat”?

Is it possible to see mercury transit "clearly" by the naked eye?

The correct capital G and J in cursive

Will being an emotionally numb 14 year-old prevent me from eventually being a pilot?

Should plywood be missing on my roof?

Is it usual for a US president to make specific comments about a UK Prime Minister's suitability during a general election?

A concrete example of the deficiency of triangulated categories?

(Re-)entering UK academic system after a long time abroad

What happens if a country signs mutual defense treaties with several countries who later go to war with each other?

Are the graphical depictions in docs drawed in manual labour?



easiest way to construct the following determinant


Defining a big matrix for iterative algorithmSolving determinant of a Kronecker product of matrices gives a numerical error - why?construct matrix by applying derivatives to another matrixStrange determinant resultCalculation of a matrix determinant for general matrix sizeDeterminant of the symbolic matrix is giving very large expressionDeterminant of matrix with asymptotic expansion






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;

.everyonelovesstackoverflowposition:absolute;height:1px;width:1px;opacity:0;top:0;left:0;pointer-events:none;








2














$begingroup$


What is the easiest way to construct the following determinant?enter image description here]



p is variable, I want to vary value of p each time and get the appropriate determinant.










share|improve this question










$endgroup$





















    2














    $begingroup$


    What is the easiest way to construct the following determinant?enter image description here]



    p is variable, I want to vary value of p each time and get the appropriate determinant.










    share|improve this question










    $endgroup$

















      2












      2








      2


      1



      $begingroup$


      What is the easiest way to construct the following determinant?enter image description here]



      p is variable, I want to vary value of p each time and get the appropriate determinant.










      share|improve this question










      $endgroup$




      What is the easiest way to construct the following determinant?enter image description here]



      p is variable, I want to vary value of p each time and get the appropriate determinant.







      matrix






      share|improve this question














      share|improve this question











      share|improve this question




      share|improve this question










      asked Oct 15 at 5:06









      WisdomWisdom

      948 bronze badges




      948 bronze badges























          3 Answers
          3






          active

          oldest

          votes


















          4
















          $begingroup$

          One way to do it would be



          mat[p_] := SparseArray[
          i_, i_ :> B[i - 1],
          i_, j_ /; i == j + 1 :> A[j - 1],
          i_, j_ /; i == j - 1 :> CC[j - 1]
          ,
          p + 1
          ]
          Det@mat[p]


          For example



          With[p = 2,
          SparseArray[
          i_, i_ :> B[i - 1],
          i_, j_ /; i == j + 1 :> A[j - 1],
          i_, j_ /; i == j - 1 :> CC[j - 1]
          ,
          p + 1
          ]
          ]
          Det@%



          $left(
          beginarrayccc
          B(0) & textCC(1) & 0 \
          A(0) & B(1) & textCC(2) \
          0 & A(1) & B(2) \
          endarray
          right)$



          B[0] B[1] B[2] - A[0] B[2] CC[1] - A[1] B[0] CC[2]




          But the computation time quickly increases with p since the elements are symbolic. For example, with p = 17,



          With[p = 17,
          SparseArray[
          i_, i_ :> B[i - 1],
          i_, j_ /; i == j + 1 :> A[j - 1],
          i_, j_ /; i == j - 1 :> CC[j - 1]
          ,
          p + 1
          ]
          ] // Det // RepeatedTiming // First



          2.7




          But, if the elements are numeric quantities,



          SeedRandom[1234]
          With[p = 17,
          SparseArray[
          i_, i_ :> RandomReal[],
          i_, j_ /; i == j + 1 :> RandomReal[],
          i_, j_ /; i == j - 1 :> RandomReal[]
          ,
          p + 1
          ]
          ] // Det // RepeatedTiming // First



          0.0020




          the calculation is no problem.






          share|improve this answer










          $endgroup$














          • $begingroup$
            thanks a lot. In fact A,B and C are some functions which become determined by initial values.
            $endgroup$
            – Wisdom
            Oct 15 at 6:14


















          4
















          $begingroup$

          Since you indicate you're interested only in the determinant, a recursive procedure is faster:



          ClearAll[det];
          det[0] = 1;
          det[1] = b[0];
          mem : det[p_] := mem = b[p - 1] det[p - 1] - a[p - 2] c[p - 1] det[p - 2];

          d1 = det[15]; // AbsoluteTiming
          d2 = Det@sa[15]; // AbsoluteTiming (* sa[p] = SparseArray solution (I used @kglr's) *)
          d1 - d2 // Simplify
          (*
          0.000188, Null
          0.391194, Null
          0
          *)


          The results are memoized, so that if you need to compute the determinant for another value of p, the new result is built on top of any previous computations. As long as storing the results is not a problem (in terms of RAM), it should make things faster.






          share|improve this answer










          $endgroup$














          • $begingroup$
            You'd think this method would be built into M somewhere, but I can't find it.
            $endgroup$
            – Michael E2
            Oct 15 at 21:30


















          3
















          $begingroup$

          An alternative, and faster, way to construct the SparseArray using Band:



          sa[n_] := SparseArray[
          Band[1, 1] -> Array[b, n, 0],
          Band[2, 1] -> Array[a, n - 1, 0],
          Band[1, 2] -> Array[c, n - 1],
          n, n]

          sa[10] // MatrixForm // TeXForm



          $left(
          beginarraycccccccccc
          b(0) & c(1) & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \
          a(0) & b(1) & c(2) & 0 & 0 & 0 & 0 & 0 & 0 & 0 \
          0 & a(1) & b(2) & c(3) & 0 & 0 & 0 & 0 & 0 & 0 \
          0 & 0 & a(2) & b(3) & c(4) & 0 & 0 & 0 & 0 & 0 \
          0 & 0 & 0 & a(3) & b(4) & c(5) & 0 & 0 & 0 & 0 \
          0 & 0 & 0 & 0 & a(4) & b(5) & c(6) & 0 & 0 & 0 \
          0 & 0 & 0 & 0 & 0 & a(5) & b(6) & c(7) & 0 & 0 \
          0 & 0 & 0 & 0 & 0 & 0 & a(6) & b(7) & c(8) & 0 \
          0 & 0 & 0 & 0 & 0 & 0 & 0 & a(7) & b(8) & c(9) \
          0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & a(8) & b(9) \
          endarray
          right)$







          share|improve this answer










          $endgroup$










          • 1




            $begingroup$
            Originally I thought to use your Band method (from the other very similar question recently), but didn't think to create the element vectors.
            $endgroup$
            – That Gravity Guy
            Oct 15 at 21:21












          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "387"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );














          draft saved

          draft discarded
















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f207905%2feasiest-way-to-construct-the-following-determinant%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown


























          3 Answers
          3






          active

          oldest

          votes








          3 Answers
          3






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4
















          $begingroup$

          One way to do it would be



          mat[p_] := SparseArray[
          i_, i_ :> B[i - 1],
          i_, j_ /; i == j + 1 :> A[j - 1],
          i_, j_ /; i == j - 1 :> CC[j - 1]
          ,
          p + 1
          ]
          Det@mat[p]


          For example



          With[p = 2,
          SparseArray[
          i_, i_ :> B[i - 1],
          i_, j_ /; i == j + 1 :> A[j - 1],
          i_, j_ /; i == j - 1 :> CC[j - 1]
          ,
          p + 1
          ]
          ]
          Det@%



          $left(
          beginarrayccc
          B(0) & textCC(1) & 0 \
          A(0) & B(1) & textCC(2) \
          0 & A(1) & B(2) \
          endarray
          right)$



          B[0] B[1] B[2] - A[0] B[2] CC[1] - A[1] B[0] CC[2]




          But the computation time quickly increases with p since the elements are symbolic. For example, with p = 17,



          With[p = 17,
          SparseArray[
          i_, i_ :> B[i - 1],
          i_, j_ /; i == j + 1 :> A[j - 1],
          i_, j_ /; i == j - 1 :> CC[j - 1]
          ,
          p + 1
          ]
          ] // Det // RepeatedTiming // First



          2.7




          But, if the elements are numeric quantities,



          SeedRandom[1234]
          With[p = 17,
          SparseArray[
          i_, i_ :> RandomReal[],
          i_, j_ /; i == j + 1 :> RandomReal[],
          i_, j_ /; i == j - 1 :> RandomReal[]
          ,
          p + 1
          ]
          ] // Det // RepeatedTiming // First



          0.0020




          the calculation is no problem.






          share|improve this answer










          $endgroup$














          • $begingroup$
            thanks a lot. In fact A,B and C are some functions which become determined by initial values.
            $endgroup$
            – Wisdom
            Oct 15 at 6:14















          4
















          $begingroup$

          One way to do it would be



          mat[p_] := SparseArray[
          i_, i_ :> B[i - 1],
          i_, j_ /; i == j + 1 :> A[j - 1],
          i_, j_ /; i == j - 1 :> CC[j - 1]
          ,
          p + 1
          ]
          Det@mat[p]


          For example



          With[p = 2,
          SparseArray[
          i_, i_ :> B[i - 1],
          i_, j_ /; i == j + 1 :> A[j - 1],
          i_, j_ /; i == j - 1 :> CC[j - 1]
          ,
          p + 1
          ]
          ]
          Det@%



          $left(
          beginarrayccc
          B(0) & textCC(1) & 0 \
          A(0) & B(1) & textCC(2) \
          0 & A(1) & B(2) \
          endarray
          right)$



          B[0] B[1] B[2] - A[0] B[2] CC[1] - A[1] B[0] CC[2]




          But the computation time quickly increases with p since the elements are symbolic. For example, with p = 17,



          With[p = 17,
          SparseArray[
          i_, i_ :> B[i - 1],
          i_, j_ /; i == j + 1 :> A[j - 1],
          i_, j_ /; i == j - 1 :> CC[j - 1]
          ,
          p + 1
          ]
          ] // Det // RepeatedTiming // First



          2.7




          But, if the elements are numeric quantities,



          SeedRandom[1234]
          With[p = 17,
          SparseArray[
          i_, i_ :> RandomReal[],
          i_, j_ /; i == j + 1 :> RandomReal[],
          i_, j_ /; i == j - 1 :> RandomReal[]
          ,
          p + 1
          ]
          ] // Det // RepeatedTiming // First



          0.0020




          the calculation is no problem.






          share|improve this answer










          $endgroup$














          • $begingroup$
            thanks a lot. In fact A,B and C are some functions which become determined by initial values.
            $endgroup$
            – Wisdom
            Oct 15 at 6:14













          4














          4










          4







          $begingroup$

          One way to do it would be



          mat[p_] := SparseArray[
          i_, i_ :> B[i - 1],
          i_, j_ /; i == j + 1 :> A[j - 1],
          i_, j_ /; i == j - 1 :> CC[j - 1]
          ,
          p + 1
          ]
          Det@mat[p]


          For example



          With[p = 2,
          SparseArray[
          i_, i_ :> B[i - 1],
          i_, j_ /; i == j + 1 :> A[j - 1],
          i_, j_ /; i == j - 1 :> CC[j - 1]
          ,
          p + 1
          ]
          ]
          Det@%



          $left(
          beginarrayccc
          B(0) & textCC(1) & 0 \
          A(0) & B(1) & textCC(2) \
          0 & A(1) & B(2) \
          endarray
          right)$



          B[0] B[1] B[2] - A[0] B[2] CC[1] - A[1] B[0] CC[2]




          But the computation time quickly increases with p since the elements are symbolic. For example, with p = 17,



          With[p = 17,
          SparseArray[
          i_, i_ :> B[i - 1],
          i_, j_ /; i == j + 1 :> A[j - 1],
          i_, j_ /; i == j - 1 :> CC[j - 1]
          ,
          p + 1
          ]
          ] // Det // RepeatedTiming // First



          2.7




          But, if the elements are numeric quantities,



          SeedRandom[1234]
          With[p = 17,
          SparseArray[
          i_, i_ :> RandomReal[],
          i_, j_ /; i == j + 1 :> RandomReal[],
          i_, j_ /; i == j - 1 :> RandomReal[]
          ,
          p + 1
          ]
          ] // Det // RepeatedTiming // First



          0.0020




          the calculation is no problem.






          share|improve this answer










          $endgroup$



          One way to do it would be



          mat[p_] := SparseArray[
          i_, i_ :> B[i - 1],
          i_, j_ /; i == j + 1 :> A[j - 1],
          i_, j_ /; i == j - 1 :> CC[j - 1]
          ,
          p + 1
          ]
          Det@mat[p]


          For example



          With[p = 2,
          SparseArray[
          i_, i_ :> B[i - 1],
          i_, j_ /; i == j + 1 :> A[j - 1],
          i_, j_ /; i == j - 1 :> CC[j - 1]
          ,
          p + 1
          ]
          ]
          Det@%



          $left(
          beginarrayccc
          B(0) & textCC(1) & 0 \
          A(0) & B(1) & textCC(2) \
          0 & A(1) & B(2) \
          endarray
          right)$



          B[0] B[1] B[2] - A[0] B[2] CC[1] - A[1] B[0] CC[2]




          But the computation time quickly increases with p since the elements are symbolic. For example, with p = 17,



          With[p = 17,
          SparseArray[
          i_, i_ :> B[i - 1],
          i_, j_ /; i == j + 1 :> A[j - 1],
          i_, j_ /; i == j - 1 :> CC[j - 1]
          ,
          p + 1
          ]
          ] // Det // RepeatedTiming // First



          2.7




          But, if the elements are numeric quantities,



          SeedRandom[1234]
          With[p = 17,
          SparseArray[
          i_, i_ :> RandomReal[],
          i_, j_ /; i == j + 1 :> RandomReal[],
          i_, j_ /; i == j - 1 :> RandomReal[]
          ,
          p + 1
          ]
          ] // Det // RepeatedTiming // First



          0.0020




          the calculation is no problem.







          share|improve this answer













          share|improve this answer




          share|improve this answer










          answered Oct 15 at 5:51









          That Gravity GuyThat Gravity Guy

          3,0411 gold badge6 silver badges17 bronze badges




          3,0411 gold badge6 silver badges17 bronze badges














          • $begingroup$
            thanks a lot. In fact A,B and C are some functions which become determined by initial values.
            $endgroup$
            – Wisdom
            Oct 15 at 6:14
















          • $begingroup$
            thanks a lot. In fact A,B and C are some functions which become determined by initial values.
            $endgroup$
            – Wisdom
            Oct 15 at 6:14















          $begingroup$
          thanks a lot. In fact A,B and C are some functions which become determined by initial values.
          $endgroup$
          – Wisdom
          Oct 15 at 6:14




          $begingroup$
          thanks a lot. In fact A,B and C are some functions which become determined by initial values.
          $endgroup$
          – Wisdom
          Oct 15 at 6:14













          4
















          $begingroup$

          Since you indicate you're interested only in the determinant, a recursive procedure is faster:



          ClearAll[det];
          det[0] = 1;
          det[1] = b[0];
          mem : det[p_] := mem = b[p - 1] det[p - 1] - a[p - 2] c[p - 1] det[p - 2];

          d1 = det[15]; // AbsoluteTiming
          d2 = Det@sa[15]; // AbsoluteTiming (* sa[p] = SparseArray solution (I used @kglr's) *)
          d1 - d2 // Simplify
          (*
          0.000188, Null
          0.391194, Null
          0
          *)


          The results are memoized, so that if you need to compute the determinant for another value of p, the new result is built on top of any previous computations. As long as storing the results is not a problem (in terms of RAM), it should make things faster.






          share|improve this answer










          $endgroup$














          • $begingroup$
            You'd think this method would be built into M somewhere, but I can't find it.
            $endgroup$
            – Michael E2
            Oct 15 at 21:30















          4
















          $begingroup$

          Since you indicate you're interested only in the determinant, a recursive procedure is faster:



          ClearAll[det];
          det[0] = 1;
          det[1] = b[0];
          mem : det[p_] := mem = b[p - 1] det[p - 1] - a[p - 2] c[p - 1] det[p - 2];

          d1 = det[15]; // AbsoluteTiming
          d2 = Det@sa[15]; // AbsoluteTiming (* sa[p] = SparseArray solution (I used @kglr's) *)
          d1 - d2 // Simplify
          (*
          0.000188, Null
          0.391194, Null
          0
          *)


          The results are memoized, so that if you need to compute the determinant for another value of p, the new result is built on top of any previous computations. As long as storing the results is not a problem (in terms of RAM), it should make things faster.






          share|improve this answer










          $endgroup$














          • $begingroup$
            You'd think this method would be built into M somewhere, but I can't find it.
            $endgroup$
            – Michael E2
            Oct 15 at 21:30













          4














          4










          4







          $begingroup$

          Since you indicate you're interested only in the determinant, a recursive procedure is faster:



          ClearAll[det];
          det[0] = 1;
          det[1] = b[0];
          mem : det[p_] := mem = b[p - 1] det[p - 1] - a[p - 2] c[p - 1] det[p - 2];

          d1 = det[15]; // AbsoluteTiming
          d2 = Det@sa[15]; // AbsoluteTiming (* sa[p] = SparseArray solution (I used @kglr's) *)
          d1 - d2 // Simplify
          (*
          0.000188, Null
          0.391194, Null
          0
          *)


          The results are memoized, so that if you need to compute the determinant for another value of p, the new result is built on top of any previous computations. As long as storing the results is not a problem (in terms of RAM), it should make things faster.






          share|improve this answer










          $endgroup$



          Since you indicate you're interested only in the determinant, a recursive procedure is faster:



          ClearAll[det];
          det[0] = 1;
          det[1] = b[0];
          mem : det[p_] := mem = b[p - 1] det[p - 1] - a[p - 2] c[p - 1] det[p - 2];

          d1 = det[15]; // AbsoluteTiming
          d2 = Det@sa[15]; // AbsoluteTiming (* sa[p] = SparseArray solution (I used @kglr's) *)
          d1 - d2 // Simplify
          (*
          0.000188, Null
          0.391194, Null
          0
          *)


          The results are memoized, so that if you need to compute the determinant for another value of p, the new result is built on top of any previous computations. As long as storing the results is not a problem (in terms of RAM), it should make things faster.







          share|improve this answer













          share|improve this answer




          share|improve this answer










          answered Oct 15 at 21:24









          Michael E2Michael E2

          160k13 gold badges219 silver badges519 bronze badges




          160k13 gold badges219 silver badges519 bronze badges














          • $begingroup$
            You'd think this method would be built into M somewhere, but I can't find it.
            $endgroup$
            – Michael E2
            Oct 15 at 21:30
















          • $begingroup$
            You'd think this method would be built into M somewhere, but I can't find it.
            $endgroup$
            – Michael E2
            Oct 15 at 21:30















          $begingroup$
          You'd think this method would be built into M somewhere, but I can't find it.
          $endgroup$
          – Michael E2
          Oct 15 at 21:30




          $begingroup$
          You'd think this method would be built into M somewhere, but I can't find it.
          $endgroup$
          – Michael E2
          Oct 15 at 21:30











          3
















          $begingroup$

          An alternative, and faster, way to construct the SparseArray using Band:



          sa[n_] := SparseArray[
          Band[1, 1] -> Array[b, n, 0],
          Band[2, 1] -> Array[a, n - 1, 0],
          Band[1, 2] -> Array[c, n - 1],
          n, n]

          sa[10] // MatrixForm // TeXForm



          $left(
          beginarraycccccccccc
          b(0) & c(1) & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \
          a(0) & b(1) & c(2) & 0 & 0 & 0 & 0 & 0 & 0 & 0 \
          0 & a(1) & b(2) & c(3) & 0 & 0 & 0 & 0 & 0 & 0 \
          0 & 0 & a(2) & b(3) & c(4) & 0 & 0 & 0 & 0 & 0 \
          0 & 0 & 0 & a(3) & b(4) & c(5) & 0 & 0 & 0 & 0 \
          0 & 0 & 0 & 0 & a(4) & b(5) & c(6) & 0 & 0 & 0 \
          0 & 0 & 0 & 0 & 0 & a(5) & b(6) & c(7) & 0 & 0 \
          0 & 0 & 0 & 0 & 0 & 0 & a(6) & b(7) & c(8) & 0 \
          0 & 0 & 0 & 0 & 0 & 0 & 0 & a(7) & b(8) & c(9) \
          0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & a(8) & b(9) \
          endarray
          right)$







          share|improve this answer










          $endgroup$










          • 1




            $begingroup$
            Originally I thought to use your Band method (from the other very similar question recently), but didn't think to create the element vectors.
            $endgroup$
            – That Gravity Guy
            Oct 15 at 21:21















          3
















          $begingroup$

          An alternative, and faster, way to construct the SparseArray using Band:



          sa[n_] := SparseArray[
          Band[1, 1] -> Array[b, n, 0],
          Band[2, 1] -> Array[a, n - 1, 0],
          Band[1, 2] -> Array[c, n - 1],
          n, n]

          sa[10] // MatrixForm // TeXForm



          $left(
          beginarraycccccccccc
          b(0) & c(1) & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \
          a(0) & b(1) & c(2) & 0 & 0 & 0 & 0 & 0 & 0 & 0 \
          0 & a(1) & b(2) & c(3) & 0 & 0 & 0 & 0 & 0 & 0 \
          0 & 0 & a(2) & b(3) & c(4) & 0 & 0 & 0 & 0 & 0 \
          0 & 0 & 0 & a(3) & b(4) & c(5) & 0 & 0 & 0 & 0 \
          0 & 0 & 0 & 0 & a(4) & b(5) & c(6) & 0 & 0 & 0 \
          0 & 0 & 0 & 0 & 0 & a(5) & b(6) & c(7) & 0 & 0 \
          0 & 0 & 0 & 0 & 0 & 0 & a(6) & b(7) & c(8) & 0 \
          0 & 0 & 0 & 0 & 0 & 0 & 0 & a(7) & b(8) & c(9) \
          0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & a(8) & b(9) \
          endarray
          right)$







          share|improve this answer










          $endgroup$










          • 1




            $begingroup$
            Originally I thought to use your Band method (from the other very similar question recently), but didn't think to create the element vectors.
            $endgroup$
            – That Gravity Guy
            Oct 15 at 21:21













          3














          3










          3







          $begingroup$

          An alternative, and faster, way to construct the SparseArray using Band:



          sa[n_] := SparseArray[
          Band[1, 1] -> Array[b, n, 0],
          Band[2, 1] -> Array[a, n - 1, 0],
          Band[1, 2] -> Array[c, n - 1],
          n, n]

          sa[10] // MatrixForm // TeXForm



          $left(
          beginarraycccccccccc
          b(0) & c(1) & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \
          a(0) & b(1) & c(2) & 0 & 0 & 0 & 0 & 0 & 0 & 0 \
          0 & a(1) & b(2) & c(3) & 0 & 0 & 0 & 0 & 0 & 0 \
          0 & 0 & a(2) & b(3) & c(4) & 0 & 0 & 0 & 0 & 0 \
          0 & 0 & 0 & a(3) & b(4) & c(5) & 0 & 0 & 0 & 0 \
          0 & 0 & 0 & 0 & a(4) & b(5) & c(6) & 0 & 0 & 0 \
          0 & 0 & 0 & 0 & 0 & a(5) & b(6) & c(7) & 0 & 0 \
          0 & 0 & 0 & 0 & 0 & 0 & a(6) & b(7) & c(8) & 0 \
          0 & 0 & 0 & 0 & 0 & 0 & 0 & a(7) & b(8) & c(9) \
          0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & a(8) & b(9) \
          endarray
          right)$







          share|improve this answer










          $endgroup$



          An alternative, and faster, way to construct the SparseArray using Band:



          sa[n_] := SparseArray[
          Band[1, 1] -> Array[b, n, 0],
          Band[2, 1] -> Array[a, n - 1, 0],
          Band[1, 2] -> Array[c, n - 1],
          n, n]

          sa[10] // MatrixForm // TeXForm



          $left(
          beginarraycccccccccc
          b(0) & c(1) & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \
          a(0) & b(1) & c(2) & 0 & 0 & 0 & 0 & 0 & 0 & 0 \
          0 & a(1) & b(2) & c(3) & 0 & 0 & 0 & 0 & 0 & 0 \
          0 & 0 & a(2) & b(3) & c(4) & 0 & 0 & 0 & 0 & 0 \
          0 & 0 & 0 & a(3) & b(4) & c(5) & 0 & 0 & 0 & 0 \
          0 & 0 & 0 & 0 & a(4) & b(5) & c(6) & 0 & 0 & 0 \
          0 & 0 & 0 & 0 & 0 & a(5) & b(6) & c(7) & 0 & 0 \
          0 & 0 & 0 & 0 & 0 & 0 & a(6) & b(7) & c(8) & 0 \
          0 & 0 & 0 & 0 & 0 & 0 & 0 & a(7) & b(8) & c(9) \
          0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & a(8) & b(9) \
          endarray
          right)$








          share|improve this answer













          share|improve this answer




          share|improve this answer










          answered Oct 15 at 20:54









          kglrkglr

          225k10 gold badges254 silver badges511 bronze badges




          225k10 gold badges254 silver badges511 bronze badges










          • 1




            $begingroup$
            Originally I thought to use your Band method (from the other very similar question recently), but didn't think to create the element vectors.
            $endgroup$
            – That Gravity Guy
            Oct 15 at 21:21












          • 1




            $begingroup$
            Originally I thought to use your Band method (from the other very similar question recently), but didn't think to create the element vectors.
            $endgroup$
            – That Gravity Guy
            Oct 15 at 21:21







          1




          1




          $begingroup$
          Originally I thought to use your Band method (from the other very similar question recently), but didn't think to create the element vectors.
          $endgroup$
          – That Gravity Guy
          Oct 15 at 21:21




          $begingroup$
          Originally I thought to use your Band method (from the other very similar question recently), but didn't think to create the element vectors.
          $endgroup$
          – That Gravity Guy
          Oct 15 at 21:21


















          draft saved

          draft discarded















































          Thanks for contributing an answer to Mathematica Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f207905%2feasiest-way-to-construct-the-following-determinant%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown









          Popular posts from this blog

          Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

          Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

          Tom Holland Mục lục Đầu đời và giáo dục | Sự nghiệp | Cuộc sống cá nhân | Phim tham gia | Giải thưởng và đề cử | Chú thích | Liên kết ngoài | Trình đơn chuyển hướngProfile“Person Details for Thomas Stanley Holland, "England and Wales Birth Registration Index, 1837-2008" — FamilySearch.org”"Meet Tom Holland... the 16-year-old star of The Impossible""Schoolboy actor Tom Holland finds himself in Oscar contention for role in tsunami drama"“Naomi Watts on the Prince William and Harry's reaction to her film about the late Princess Diana”lưu trữ"Holland and Pflueger Are West End's Two New 'Billy Elliots'""I'm so envious of my son, the movie star! British writer Dominic Holland's spent 20 years trying to crack Hollywood - but he's been beaten to it by a very unlikely rival"“Richard and Margaret Povey of Jersey, Channel Islands, UK: Information about Thomas Stanley Holland”"Tom Holland to play Billy Elliot""New Billy Elliot leaving the garage"Billy Elliot the Musical - Tom Holland - Billy"A Tale of four Billys: Tom Holland""The Feel Good Factor""Thames Christian College schoolboys join Myleene Klass for The Feelgood Factor""Government launches £600,000 arts bursaries pilot""BILLY's Chapman, Holland, Gardner & Jackson-Keen Visit Prime Minister""Elton John 'blown away' by Billy Elliot fifth birthday" (video with John's interview and fragments of Holland's performance)"First News interviews Arrietty's Tom Holland"“33rd Critics' Circle Film Awards winners”“National Board of Review Current Awards”Bản gốc"Ron Howard Whaling Tale 'In The Heart Of The Sea' Casts Tom Holland"“'Spider-Man' Finds Tom Holland to Star as New Web-Slinger”lưu trữ“Captain America: Civil War (2016)”“Film Review: ‘Captain America: Civil War’”lưu trữ“‘Captain America: Civil War’ review: Choose your own avenger”lưu trữ“The Lost City of Z reviews”“Sony Pictures and Marvel Studios Find Their 'Spider-Man' Star and Director”“‘Mary Magdalene’, ‘Current War’ & ‘Wind River’ Get 2017 Release Dates From Weinstein”“Lionsgate Unleashing Daisy Ridley & Tom Holland Starrer ‘Chaos Walking’ In Cannes”“PTA's 'Master' Leads Chicago Film Critics Nominations, UPDATED: Houston and Indiana Critics Nominations”“Nominaciones Goya 2013 Telecinco Cinema – ENG”“Jameson Empire Film Awards: Martin Freeman wins best actor for performance in The Hobbit”“34th Annual Young Artist Awards”Bản gốc“Teen Choice Awards 2016—Captain America: Civil War Leads Second Wave of Nominations”“BAFTA Film Award Nominations: ‘La La Land’ Leads Race”“Saturn Awards Nominations 2017: 'Rogue One,' 'Walking Dead' Lead”Tom HollandTom HollandTom HollandTom Hollandmedia.gettyimages.comWorldCat Identities300279794no20130442900000 0004 0355 42791085670554170004732cb16706349t(data)XX5557367