3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

JuliaでVandermonde行列式を計算してみる

Posted at

Vandermonde行列式

以下のように定義される行列をVandermonde行列[1]といいます.

A=\left(\begin{array}{cccc}1&1&\cdots&1\\x_1&x_2&\cdots&x_n\\\vdots&\vdots&\ddots&\vdots\\x_1^{n-1}&x_2^{n-1}&\cdots&x_n^{n-1}\end{array}\right)

Vandermonde行列の行列式は各行の公比の差積に等しく,以下のように表されます.

det(V)=\prod_{1\leq{i}<j\leq{n}}(x_j-x_i)=(-1)^{n(n-1)/2}\prod_{1\leq{i}<j\leq{n}}(x_i-x_j)

(証明)
帰納法によって証明する.

(i) $n=2$のとき

A=\left|\begin{array}{cc}1&1\\x_1&x_2\end{array}\right|=x_2-x_1

より成り立つ.

(ii) $n=k-1$のときに成り立つと仮定する.$n=k$のときを考えると,その行列式は

det(A)=\left|\begin{array}{cccc}1&1&\cdots&1\\x_1&x_2&\cdots&x_k\\x_1^2&x_2^2&\cdots&x_k^2\\\vdots&\vdots&\ddots&\vdots\\x_1^{k-1}&x_2^{k-1}&\cdots&x_k^{k-1}\end{array}\right|

これから,$2\sim{k-1}$行までの各行を$x_1$倍して次の行から引くと,

det(A)=\left|\begin{array}{cccc}1&1&\cdots&1\\0&x_2-x_1&\cdots&x_k-x_1\\0&x_2(x_2-x_1)&\cdots&x_k(x_k-x_1)\\\vdots&\vdots&\ddots&\vdots\\0&x_2^{k-2}(x_2-x_1)&\cdots&x_k^{k-2}(x_k-x_1)\end{array}\right|\\=\left|\begin{array}{ccc}x_2-x_1&\cdots&x_k-x_1\\x_2(x_2-x_1)&\cdots&x_k(x_k-x_1)\\\vdots&\ddots&\vdots\\x_2^{k-2}(x_2-x_1)&\cdots&x_k^{k-2}(x_k-x_1)\end{array}\right|\\=(x_2-x_1)\cdots(x_k-x_1)\left|\begin{array}{ccc}1&\cdots&1\\x_2&\cdots&x_k\\\vdots&\ddots&\vdots\\x_2^{k-2}&\cdots&x_k^{k-2}\end{array}\right|\\=(x_2-x_1)\cdots(x_k-x_1)\prod_{1\leq{i}<j\leq{k-1}}(x_j-x_i)\\=\prod_{1\leq{i}<j\leq{k}}(x_j-x_i)

以上より,証明された.

実際にプログラムによって実験して,上の関係が成り立つことを確認してみます.
対象のVandermonde行列式を,

det(A)=\left|\begin{array}{cccc}1&1&1&1\\2&3&5&4\\4&9&25&16\\8&27&125&64\end{array}\right|

として,Vandermonde行列式の式およびJuliaの関数による行列式の出力を比較します.

Juliaで実験


  
using LinearAlgebra

A = [1 1 1 1;
     2 3 5 4;
     4 9 25 16;
     8 27 125 64]

function vandermonde(A)
    det = 1
    for j in 2:4
        for i in 1:j-1
            det *= (A[2,j]-A[2,i])
        end
    end

    det
end

println("vandermonde: ", vandermonde(A))
println("det(A): ", det(A))

出力例

vandermonde: -12
det(A): -11.999999999999993

References

3
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?