Objectif# --------
# Savoir reconnaitre les types de matrices, leurs dimensions, et faire
# les operations de base (addition, scalaire, multiplication), transposee.
#
# Ce qu on te demande typiquement
# -------------------------------
# - Donner l'ordre d'une matrice (m x n).
# - Verifier si A+B est possible; si A*B est possible (dimensions).
# - Calculer A+B, k*A (scalaire), A*B, A^T; reconnaitre identite/symetrique.
#
# Formules importantes
# --------------------
# - Ordre : A est m x n (m lignes, n colonnes).
# - Addition/soustraction : possible seulement si memes dimensions.
# - Scalaire : (kA)_{ij} = k * A_{ij}.
# - Produit : si A(mxn) et B(nxp), alors C = A*B est m x p avec
# C_{ij} = somme_{k=1..n} A_{ik} * B_{kj}.
# - Non-commutativite : en general AB != BA.
# - Transposee : (A^T)_{ij} = A_{ji}; (AB)^T = B^T A^T.
# - Identite I : AI = IA = A.
# - Symetrique : A = A^T (forcément carree).
#
# Methode pas-a-pas (produit A*B)
# -------------------------------
# 1) Verifie dimensions : A(mxn) * B(nxp) -> OK si colonnes de A = lignes de B.
# 2) Pour chaque case C[i,j] : prends la ligne i de A et la colonne j de B.
# 3) Multiplie terme a terme et additionne.
# 4) Repeter pour toutes les positions.
#
# Petit exemple
# -------------
# A = [ [1, 2], [3, 4] ] (2x2)
# B = [ [-1, 0], [5, 2] ] (2x2)
# A + B = [ [1+(-1), 2+0], [3+5, 4+2] ] = [ [0, 2], [8, 6] ]
# AB :
# C[1,1] = 1*(-1) + 2*5 = -1 + 10 = 9
# C[1,2] = 1*0 + 2*2 = 0 + 4 = 4
# C[2,1] = 3*(-1) + 4*5 = -3 + 20 = 17
# C[2,2] = 3*0 + 4*2 = 0 + 8 = 8
# Donc AB = [ [9, 4], [17, 8] ]
# Transposee : A^T = [ [1, 3], [2, 4] ]
During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:
Ensure the proper functioning of the site (essential cookies); and
Track your browsing to send you personalized communications if you have created a professional account on the site and can be contacted (audience measurement cookies).
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.