exo1.mw

> restart;

Exercice 1

question a)

> taille:=proc(A) supposons A de taille n*p
local t,u,n,p;

  t:=[op(2,evalm(A))];
renvoi [1..n,1..p]
  n:=op(2,t[1]);p:=op(2,t[2]);

  [n,p];

end:

 

> question b)

> En notant A=(a(ij));B=(b(ij));AB=(c(ij));

A = a(ij)

B = b(ij)

AB = c(ij)

> On a c(ij)=Sum(a(ik)*b(kj),k=1..p);

c(ij) = Sum(a(ik)*b(kj), k = 1 .. p)

> produit:=proc(A,B)
local k,C,n,p,q,i,j,t;

t:=taille(A); n:=t[1]; p:=t[2];

t:=taille(B); q:=t[2];

if (t[1]<>p) then RETURN(IMPOSSIBLE); fi;

C:=array(1..n,1..q);

for i from 1 to n do

 for j from 1 to q do

  C[i,j]:=add(A[i,k]*B[k,j],k=1..p);

 od;

od;

RETURN(evalm(C));

end:

> question c)

> MatPermut:=proc(i,j,n)
local k,l,P;

P:=array(1..n,1..n);

for k from 1 to n do
k est l'indice de ligne
 for l from 1 to n do
l est l'indice de colonne
  P[k,l]:=0;  
tous les coefficients de la ligne k sont nulls
 od;

 P[k,k]:=1;
sauf celui d'indice k
od;

 
On a a obtenu jusqu'ici la matrice identité
 P[i,i]:=0;P[j,j]:=0;P[i,j]:=1;P[j,i]:=1;
On modifie 4 de ses coefficients
evalm(P);

end:  

> P:=MatPermut(1,3,3);A:=array(1..3,1..3,[[a1,b1,c1],[a2,b2,c2],[a3,b3,c3]]);

P := matrix([[0, 0, 1], [0, 1, 0], [1, 0, 0]])

A := matrix([[a1, b1, c1], [a2, b2, c2], [a3, b3, c3]])

> PA:=produit(P,A);

PA := matrix([[a3, b3, c3], [a2, b2, c2], [a1, b1, c1]])

> AP:=produit(A,P);

AP := matrix([[c1, b1, a1], [c2, b2, a2], [c3, b3, a3]])

Conclusion: le produit par la matrice de permutation, correspond ŕ la permutation des lignes lorqu'elle est le facteur de gauche, ou la permutation des colonnes lorqu'elle est le facteur de droite

>

> question d)

> MatDilat:=proc(a,j,n)
local k,l,P;

P:=array(1..n,1..n);

for k from 1 to n do

 for l from 1 to n do

  P[k,l]:=0;

 od;

 P[k,k]:=1;

od;

  
On a a obtenu jusqu'ici la matrice identité
 P[j,j]:=a;
On modifie un coefficient
evalm(P);

end:

> Di:=MatDilat(x,2,3);
DA:=produit(Di,A);

Di := matrix([[1, 0, 0], [0, x, 0], [0, 0, 1]])

DA := matrix([[a1, b1, c1], [x*a2, x*b2, x*c2], [a3, b3, c3]])

> AD:=produit(A,Di);

AD := matrix([[a1, b1*x, c1], [a2, x*b2, c2], [a3, b3*x, c3]])

> Conclusion: le produit par la matrice de dilatation, correspond ŕ la dilatation des lignes lorqu'elle est le facteur de gauche, ou la dilatation des colonnes lorqu'elle est le facteur de droite

> question e)

> MatTransvect:=proc(i,a,j,n)
local k,l,P;

P:=array(1..n,1..n);

for k from 1 to n do

 for l from 1 to n do

  P[k,l]:=0;

 od;

 P[k,k]:=1;

od;

On a a obtenu jusqu'ici la matrice identité
 P[i,j]:=a;
On modifie un coefficient
evalm(P);

end:

> T:=MatTransvect(3,x,2,3);
TA:=produit(T,A);

T := matrix([[1, 0, 0], [0, 1, 0], [0, x, 1]])

TA := matrix([[a1, b1, c1], [a2, b2, c2], [x*a2+a3, x*b2+b3, x*c2+c3]])

> AT:=produit(A,T);

AT := matrix([[a1, b1+c1*x, c1], [a2, b2+x*c2, c2], [a3, b3+c3*x, c3]])

> Conclusion: le produit par la matrice de transvection, correspond ŕ la transvection des lignes lorqu'elle est le facteur de gauche, ou la transvection des colonnes lorqu'elle est le facteur de droite