algebre.py

Created by famille-bvc

Created on May 31, 2022

2.83 KB


//   définition d'une matrice

(-1 3)=> dimension(1,2) et d12= 3

////////////////////////////////
//   addition de matrices 

matrices de mêmes dimensions 
(sinon => pas définie)

(-2 3)+(3 -1) = (1 2)

////////////////////////////////
//   produit matriciel 

il faut que dim b=c (a,b)*(c,d)
(sinon => pas définie)

////////////////////////////////
//  transposée 

=> ligne devient colonne

////////////////////////////////
//   matrice d'identité 

I2 = (1 0)   I3 = (1 0 0)
     (0 1)        (0 1 0)
                  (0 0 1)
                  
////////////////////////////////
//   matrice inverse 

B inverse de A si AB = In

AA^-1 = A^-1A = I

////////////////////////////////
//   matrice nilpotentes

Une matrice est Nilpotente si il
existe p tel que A^p = 0
=> si Nilp alors pas inversible

////////////////////////////////
//   déterminant

si det(A) != 0 => inversible

// matrice 2x2:
  
   (a b)   |a b|
det(c d) = |c d| = ad-bc

// matrice 3x3:
  
On attribue le signe  |+ - +|
+ ou - a chaque coef  |- + -|
du tableau suivant    |+ - +|

ex :
  
|2  1   2|    |1 2|  |2 2|  |2 1|
|6- 1+ 1-|= -6|5 3|+1|4 3|-1|4 5|
|4  5   3|

= -6*(-7) +  1*(-2) - 1*6 = 34 

// matrices triangulaires:

produit de sa diagonale 

ex : |2  0 0|
     |5 -1 0| det = 2*(-1)*4 = 8
     |7 -6 4|

// autres règles:
  
Si on permutes deux lignes d'une 
matrice son det est multi par -1.

Det transposée de M = det M
det(^t M) = det(M).

////////////////////////////////
//   comatrices

(-1)^i+j

ex:(4 -2)  cofacteur de 3 :
   (3 -6)  (-1)^2+1*|-2|
          =-1*(-2) =2
com => remplace tout par cofact

// propriété

A inversible si
         1
A^-1 = ------*^t*com(A)
       det(A)
       
// regle

    (a b)           (+d -c)
A = (c d)  com(A) = (-b +a)

// inverser avec la prop

calc det(A)
calc com(A)
calc ^t * com(A) (transp de com)
remplacer dans la formule 

on peut finir par verifier 
en multipliant A par A^-1 = In

// inverser avec  la meth prati-
que d'inv des M de grandes dim

A|In => In|A^-1

pivot de gosse jusqu'a obtenir
une matrice d'id à gauche

// résolution d'un système d'eq
linéaire

  (a1,1 a1,j a1,n)   (x1)   (b1)
A=(ai,1 ai,j ai,n) X=(xj) B=(bj)
  (an,1 an,j an,n)   (xn)   (bn)

AX=B s'écrit
(a1,1*x1 + a1,j*xj +... = b1)
(ai,1*x1 + ai,j*xj +... = bi)
(an,1*x1 + an,j*xj +... = bn)
si A inversible alors X=A^-1*B

///////////////////////////////
// methode de cramer

on pose Δ = det(A)
sol uniq si Delta != 0

si Δ!=0 uniq sol =(x1,x2,...,xn)
où xj = Δj/Δ avec jE{1,...,n}

Δj det obtenu en remplaçant la
j-ième colonne de Δ par le
second membre.

ex: 2x - 3y = 7
    4x + 3y = 12
    
          |2 -3|
on pose Δ=|4  3|=18 donc S(x,y)
        |7 -3|
x=Δx/Δ= |12 3|   59   19
        ------ = -- = --
          18     18    6
          
        |2  7|
y=Δy/Δ= |4 12|  - 4   -2
        ------ = -- = --
          18     18    9
          

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.