Message Boards Message Boards

GROUPS:

Calculate the value of a Determinant

Posted 16 days ago
248 Views
|
9 Replies
|
2 Total Likes
|

In Mathematica, we can find the value of a determinant by the built-in function Det, but how can I find a value of a determinant like this one?

$$\left| \begin{array}{ccccc} 1 & x & x^2 & \cdots & x^{n-1} \\ 1 & a_1 & a_1^2 & \cdots & a_1^{n-1} \\ \vdots & \vdots & \vdots & & \vdots \\ 1 & a_{n-1} & a_{n-1}^2 & \cdots & a_{n-1}^{n-1} \\ \end{array} \right|$$ That seems to have some problems.

9 Replies

This question in vague. What "problems" are you seeing? Provide details with code.

I don't know the code, I am looking for the codes which can calculate the determinant.

I am afraid there is no simple closed expression for the determinant:

mm[n_] :=  Table[If[i == 1, x^j, a[i - 1, j]^j], {i, 1, n}, {j, 0, n - 1}]
mm[3] // MatrixForm
Collect[Det[mm[4]], x]

It's a Vandermonde matrix. The determinant is the product of differences between elements in the second column (subtracting lower-row elements from higher.)

That's true,but I want to know how can I calculate its value in Mathematica.

Make your matrix

mm[n_] :=  Table[If[i == 1, x^j, a[i - 1, i]^j], {i, 1, n}, {j, 0, n - 1}]
mm[3] // MatrixForm

and calculate its determinant

det[m_] := Product[
  (m[[j, 2]] - m[[i, 2]]), {i, 1, Length[m] - 1}, {j, i + 1,  Length[m]}]

Example

det[mm[5]] - Det[mm[5]] // Expand

The det-method is (of course) considerably faster

Timing[det[mm[10]];]
Timing[Det[mm[10]];]

But it can't calculate mm[n],can it?

What result do you expect, if you are not providing the actual matrix input?

Are you kidding? What do you expect? The general determinant is

Product [  (m[[ j, 2 ]] - m[[ i, 2 ]]), {i, 1, Length[ m ] - 1}, {j, i + 1,  Length[ m ]} ]

What do you want to calculate then ?

You must at least specify n.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract