Sponsored links: Algebra eBooks
 

Related

eigenvalues-matrix-transpose

L:matrix([1,0,0],[1,1...

T:transpose(L);

A:L.T;

Calculate

genmatrix

n:10;

for i: 1 thru n do ...

genmatrix(M,n,n);

Calculate

and-cardinality-every-integer_partitions-integerp-lambda-primep-subset

xprimep(x) := integer...

k: subset (integer_pa...

cardinality (k);

Calculate

genmatrix

H[I,J]:=1/(I+J-1);

genmatrix(H,12,13);

Calculate

eigenvalues-matrix

A:matrix([-1, 1/x],[1...

eigenvalues(A);

Calculate

eigenvalues-eigenvectors-matrix

L:matrix([2*c1,-c1,0,...

eigenvalues(L);

eigenvectors(L);

Calculate

and-equal-part-reveal

ans: ((equal(x , ( (%...

reveal(ans,1);

part(ans,1);

Calculate

eigenvalues-eigenvectors-matrix

x: matrix ([0,1], [-5...

eigenvalues(x);

eigenvectors(x);

Calculate

and-cardinality-every-integer_partitions-integerp-lambda-subset

s: integer_partitions...

cardinality (s);

xprimep(x) := intege...

Calculate

genmatrix-invert-lambda-random

a:genmatrix(lambda([x...

b:invert(a);

a.b;

Calculate

[and,eigenvalues,genmatrix]

Run Example
(%i1)n:4;
(%o1)                                  4
(%i2) h1[i,j]:= if mod(i-j,n)=0 or mod(i-j,n)=1 then 1 else 0;
(%o2) h1     := if (mod(i - j, n) = 0) or (mod(i - j, n) = 1) then 1 else 0
        i, j
(%i3) M1:genmatrix (h1,n,n);
                                [ 1  0  0  1 ]
                                [            ]
                                [ 1  1  0  0 ]
(%o3)                           [            ]
                                [ 0  1  1  0 ]
                                [            ]
                                [ 0  0  1  1 ]
(%i4)  eivals(M1);
                                   [ 1  0  0  1 ]
                                   [            ]
                                   [ 1  1  0  0 ]
(%o4)                       eivals([            ])
                                   [ 0  1  1  0 ]
                                   [            ]
                                   [ 0  0  1  1 ]
(%i5) h2[i,j]:= if mod(i-j,n)=0 or mod(j-i,n)=2 then 1 else 0;
(%o5) h2     := if (mod(i - j, n) = 0) or (mod(j - i, n) = 2) then 1 else 0
        i, j
(%i6) M2:genmatrix (h2,n,n);
                                [ 1  0  1  0 ]
                                [            ]
                                [ 0  1  0  1 ]
(%o6)                           [            ]
                                [ 1  0  1  0 ]
                                [            ]
                                [ 0  1  0  1 ]
(%i7)  eivals(M2);
                                   [ 1  0  1  0 ]
                                   [            ]
                                   [ 0  1  0  1 ]
(%o7)                       eivals([            ])
                                   [ 1  0  1  0 ]
                                   [            ]
                                   [ 0  1  0  1 ]
(%i8) h3[i,j]:= if mod(i-j,n)=0 or mod(i-j,n)=3 then 1 else 0;
(%o8) h3     := if (mod(i - j, n) = 0) or (mod(i - j, n) = 3) then 1 else 0
        i, j
(%i9) M3:genmatrix (h3,n,n);
                                [ 1  1  0  0 ]
                                [            ]
                                [ 0  1  1  0 ]
(%o9)                           [            ]
                                [ 0  0  1  1 ]
                                [            ]
                                [ 1  0  0  1 ]
(%i10)  eivals(M3);
                                   [ 1  1  0  0 ]
                                   [            ]
                                   [ 0  1  1  0 ]
(%o10)                      eivals([            ])
                                   [ 0  0  1  1 ]
                                   [            ]
                                   [ 1  0  0  1 ]
(%i11) h12[i,j]:=if ((mod(i-j,n)=0 or mod(i-j,n)=1) and (j <
= n) and (i <
=n)) or ((mod(i-j,n)=0 or mod(i-j,n)=2) and (j >
 n) and (i >
n)) then 1 else 0;
(%o11) h12     := if (((mod(i - j, n) = 0) or (mod(i - j, n) = 1)) and (j <= n)
          i, j
 and (i <= n)) or (((mod(i - j, n) = 0) or (mod(i - j, n) = 2)) and (j > n) and (i > 
n))
 then 1 else 0
(%i12) M12:genmatrix(h12,2*n,2*n);
                          [ 1  0  0  1  0  0  0  0 ]
                          [                        ]
                          [ 1  1  0  0  0  0  0  0 ]
                          [                        ]
                          [ 0  1  1  0  0  0  0  0 ]
                          [                        ]
                          [ 0  0  1  1  0  0  0  0 ]
(%o12)                    [                        ]
                          [ 0  0  0  0  1  0  1  0 ]
                          [                        ]
                          [ 0  0  0  0  0  1  0  1 ]
                          [                        ]
                          [ 0  0  0  0  1  0  1  0 ]
                          [                        ]
                          [ 0  0  0  0  0  1  0  1 ]
(%i13)  eigenvalues(M12);
(%o13)              [[1 - %i, %i + 1, 2, 0], [1, 1, 3, 3]]
(%i14) 
Run Example
n:4;
(%o1)                                  4
(%i2) h1[i,j]:= if mod(i-j,n)=0 or mod(i-j,n)=1 then 1 else 0;
(%o2) h1     := if (mod(i - j, n) = 0) or (mod(i - j, n) = 1) then 1 else 0
        i, j
(%i3) M1:genmatrix (h1,n,n);
                                [ 1  0  0  1 ]
                                [            ]
                                [ 1  1  0  0 ]
(%o3)                           [            ]
                                [ 0  1  1  0 ]
                                [            ]
                                [ 0  0  1  1 ]
(%i4)  eigenvalues(M1);
(%o4)               [[1 - %i, %i + 1, 2, 0], [1, 1, 1, 1]]
(%i5) h2[i,j]:= if mod(i-j,n)=0 or mod(j-i,n)=2 then 1 else 0;
(%o5) h2     := if (mod(i - j, n) = 0) or (mod(j - i, n) = 2) then 1 else 0
        i, j
(%i6) M2:genmatrix (h2,n,n);
                                [ 1  0  1  0 ]
                                [            ]
                                [ 0  1  0  1 ]
(%o6)                           [            ]
                                [ 1  0  1  0 ]
                                [            ]
                                [ 0  1  0  1 ]
(%i7)  eigenvalues(M2);
(%o7)                          [[2, 0], [2, 2]]
(%i8) h3[i,j]:= if mod(i-j,n)=0 or mod(i-j,n)=3 then 1 else 0;
(%o8) h3     := if (mod(i - j, n) = 0) or (mod(i - j, n) = 3) then 1 else 0
        i, j
(%i9) M3:genmatrix (h3,n,n);
                                [ 1  1  0  0 ]
                                [            ]
                                [ 0  1  1  0 ]
(%o9)                           [            ]
                                [ 0  0  1  1 ]
                                [            ]
                                [ 1  0  0  1 ]
(%i10)  eigenvalues(M3);
(%o10)              [[1 - %i, %i + 1, 2, 0], [1, 1, 1, 1]]
(%i11) h12[i,j]:=if ((mod(i-j,n)=0 or mod(i-j,n)=1) and (j <
= n) and (i <
=n)) or ((mod(i-j,n)=0 or mod(i-j,n)=2) and (j >
 n) and (i >
n)) then 1 else 0;
(%o11) h12     := if (((mod(i - j, n) = 0) or (mod(i - j, n) = 1)) and (j <= n)
          i, j
 and (i <= n)) or (((mod(i - j, n) = 0) or (mod(i - j, n) = 2)) and (j > n) and (i > 
n))
 then 1 else 0
(%i12) M12:genmatrix(h12,2*n,2*n);
                          [ 1  0  0  1  0  0  0  0 ]
                          [                        ]
                          [ 1  1  0  0  0  0  0  0 ]
                          [                        ]
                          [ 0  1  1  0  0  0  0  0 ]
                          [                        ]
                          [ 0  0  1  1  0  0  0  0 ]
(%o12)                    [                        ]
                          [ 0  0  0  0  1  0  1  0 ]
                          [                        ]
                          [ 0  0  0  0  0  1  0  1 ]
                          [                        ]
                          [ 0  0  0  0  1  0  1  0 ]
                          [                        ]
                          [ 0  0  0  0  0  1  0  1 ]
(%i13)  eigenvalues(M12);
(%o13)              [[1 - %i, %i + 1, 2, 0], [1, 1, 3, 3]]
(%i14) h13[i,j]:=if ((mod(i-j,n)=0 or mod(i-j,n)=1) and (j <
= n) and (i <
=n)) or ((mod(i-j,n)=0 or mod(i-j,n)=3) and (j >
 n) and (i >
n)) then 1 else 0;
(%o14) h13     := if (((mod(i - j, n) = 0) or (mod(i - j, n) = 1)) and (j <= n)
          i, j
 and (i <= n)) or (((mod(i - j, n) = 0) or (mod(i - j, n) = 3)) and (j > n) and (i > 
n))
 then 1 else 0
(%i15) M13:genmatrix(h13,2*n,2*n);
                          [ 1  0  0  1  0  0  0  0 ]
                          [                        ]
                          [ 1  1  0  0  0  0  0  0 ]
                          [                        ]
                          [ 0  1  1  0  0  0  0  0 ]
                          [                        ]
                          [ 0  0  1  1  0  0  0  0 ]
(%o15)                    [                        ]
                          [ 0  0  0  0  1  1  0  0 ]
                          [                        ]
                          [ 0  0  0  0  0  1  1  0 ]
                          [                        ]
                          [ 0  0  0  0  0  0  1  1 ]
                          [                        ]
                          [ 0  0  0  0  1  0  0  1 ]
(%i16)  eigenvalues(M13);
(%o16)              [[1 - %i, %i + 1, 2, 0], [2, 2, 2, 2]]
(%i17) h23[i,j]:=if ((mod(i-j,n)=0 or mod(i-j,n)=2) and (j <
= n) and (i <
=n)) or ((mod(i-j,n)=0 or mod(i-j,n)=3) and (j >
 n) and (i >
n)) then 1 else 0;
(%o17) h23     := if (((mod(i - j, n) = 0) or (mod(i - j, n) = 2)) and (j <= n)
          i, j
 and (i <= n)) or (((mod(i - j, n) = 0) or (mod(i - j, n) = 3)) and (j > n) and (i > 
n))
 then 1 else 0
(%i18) M23:genmatrix(h23,2*n,2*n);
                          [ 1  0  1  0  0  0  0  0 ]
                          [                        ]
                          [ 0  1  0  1  0  0  0  0 ]
                          [                        ]
                          [ 1  0  1  0  0  0  0  0 ]
                          [                        ]
                          [ 0  1  0  1  0  0  0  0 ]
(%o18)                    [                        ]
                          [ 0  0  0  0  1  1  0  0 ]
                          [                        ]
                          [ 0  0  0  0  0  1  1  0 ]
                          [                        ]
                          [ 0  0  0  0  0  0  1  1 ]
                          [                        ]
                          [ 0  0  0  0  1  0  0  1 ]
(%i19)  eigenvalues(M23);
(%o19)              [[1 - %i, %i + 1, 2, 0], [1, 1, 3, 3]]
(%i20) 
Run Example
n:4;
(%o1)                                  4
(%i2) h1[i,j]:= if mod(i-j,n)=0 or mod(i-j,n)=1 then 1 else 0;
(%o2) h1     := if (mod(i - j, n) = 0) or (mod(i - j, n) = 1) then 1 else 0
        i, j
(%i3) M1:genmatrix (h1,n,n);
                                [ 1  0  0  1 ]
                                [            ]
                                [ 1  1  0  0 ]
(%o3)                           [            ]
                                [ 0  1  1  0 ]
                                [            ]
                                [ 0  0  1  1 ]
(%i4) eigenvalues(M1);
(%o4)               [[1 - %i, %i + 1, 2, 0], [1, 1, 1, 1]]
(%i5) h2[i,j]:= if mod(i-j,n)=0 or mod(j-i,n)=2 then 1 else 0;
(%o5) h2     := if (mod(i - j, n) = 0) or (mod(j - i, n) = 2) then 1 else 0
        i, j
(%i6) M2:genmatrix (h2,n,n);
                                [ 1  0  1  0 ]
                                [            ]
                                [ 0  1  0  1 ]
(%o6)                           [            ]
                                [ 1  0  1  0 ]
                                [            ]
                                [ 0  1  0  1 ]
(%i7) eivals(M2);
(%o7)                          [[2, 0], [2, 2]]
(%i8) h3[i,j]:= if mod(i-j,n)=0 or mod(i-j,n)=3 then 1 else 0;
(%o8) h3     := if (mod(i - j, n) = 0) or (mod(i - j, n) = 3) then 1 else 0
        i, j
(%i9) M3:genmatrix (h3,n,n);
                                [ 1  1  0  0 ]
                                [            ]
                                [ 0  1  1  0 ]
(%o9)                           [            ]
                                [ 0  0  1  1 ]
                                [            ]
                                [ 1  0  0  1 ]
(%i10) eivals(M3);
(%o10)              [[1 - %i, %i + 1, 2, 0], [1, 1, 1, 1]]
(%i11) h12[i,j]:=if ((mod(i-j,n)=0 or mod(i-j,n)=1) and (j-i <
 n)) or ((mod(i-j,n)=0 or mod(i-j,n)=2) and (i-j >
 n)) then 1 else 0;
(%o11) h12     := if (((mod(i - j, n) = 0) or (mod(i - j, n) = 1))
          i, j
 and (j - i < n)) or (((mod(i - j, n) = 0) or (mod(i - j, n) = 2)) and (i - j > 
n))
 then 1 else 0
(%i12) M12:genmatrix(h12,2*n,2*n);
                          [ 1  0  0  1  0  0  0  0 ]
                          [                        ]
                          [ 1  1  0  0  1  0  0  0 ]
                          [                        ]
                          [ 0  1  1  0  0  1  0  0 ]
                          [                        ]
                          [ 0  0  1  1  0  0  1  0 ]
(%o12)                    [                        ]
                          [ 1  0  0  1  1  0  0  1 ]
                          [                        ]
                          [ 1  1  0  0  1  1  0  0 ]
                          [                        ]
                          [ 1  1  1  0  0  1  1  0 ]
                          [                        ]
                          [ 0  1  1  1  0  0  1  1 ]
(%i13) 
[addcol,addrow,diff,do,ev,genmatrix,invert,kill,load,matrix,plot2d,romberg,sqrt,submatrix] [addcol,addrow,diff,ev,genmatrix,invert,kill,length,lmax,lmin,load,matrix,plot2d,romberg,sqrt,submatrix] [and,apply,cardinality,every,integer_partitions,integerp,lambda,map,subset] [and,cardinality,every,integer_partitions,integerp,lambda,primep,subset] [and,cardinality,every,integer_partitions,integerp,lambda,subset] [and,eigenvalues,genmatrix] [and,false,or] [and,false] [and,or,true] [and,or] [and,pi] [and,true] [and] [at,eigenvalues,invert,jacobian] [binomial,block,delta,determinant,do,expand,genmatrix,hipow,kron_delta,makelist,part,print,return,subst] [binomial,block,delta,determinant,do,expand,genmatrix,kron_delta,return] [binomial,delta,genmatrix,kron_delta] [block,genmatrix,if,print,random,return,while] [block,genmatrix,if,random,return,while] [block,genmatrix,if,random,return] [block,genmatrix,print,random,return] [ceiling,col,do,endcons,float,genmatrix,kill,makelist,min,permanent,print,random,row,sort,sqrt,transpose] [ceiling,do,float,genmatrix,kill,permanent,print,random,row,sqrt] [cos,eigenvalues,invert,matrix,numer,sin,transpose,true] [determinant,eigenvalues,eigenvectors,ident,invert,matrix,rank,submatrix,transpose] [determinant,eigenvalues,eigenvectors,ident,load,matrix,ratsimp,solve,sqrt,transpose] [determinant,eigenvalues,factor,matrix] [determinant,genmatrix] [diff,eigenvalues,matrix] [eigenvalues,eigenvectors,invert,matrix] [eigenvalues,eigenvectors,lambda,matrix] [eigenvalues,eigenvectors,load,matrix,ratsimp,sqrt,transpose] [eigenvalues,eigenvectors,load,matrix,sqrt,transpose] [eigenvalues,eigenvectors,load,matrix,sqrt] [eigenvalues,eigenvectors,matrix] [eigenvalues,ev,matrix,ratsimp,solve,sqrt] [eigenvalues,float,matrix] [eigenvalues,hessian,sqrt] [eigenvalues,hessian] [eigenvalues,invert,matrix] [eigenvalues,load,matrix,solve] [eigenvalues,load,matrix] [eigenvalues,matrix,transpose] [eigenvalues,matrix] [genmatrix,if,lambda] [genmatrix,lambda] [genmatrix,matrix,sum] [genmatrix,numer,permanent,random,row,sqrt] [genmatrix,random] [genmatrix]

Related Help

Help for And

Help for Eigenvalues

Help for Genmatrix