Chapitre 1125 minIntermédiaire
Exercices d'examen corrigés
Par Josselyn C., prof de BTS SIO. Mis à jour le .
Exercice 1 : Addition et scalaire
Soit A = [2 -1 ; 3 4] et B = [1 5 ; -2 0]. Calculer 2A + 3B.
Correction :
Etape 1 : calculer 2A.
2A = [ 2 x 2 2 x (-1) ] = [ 4 -2 ]
[ 2 x 3 2 x 4 ] [ 6 8 ]
Etape 2 : calculer 3B.
3B = [ 3 x 1 3 x 5 ] = [ 3 15 ]
[ 3 x (-2) 3 x 0 ] [ -6 0 ]
Etape 3 : additionner.
2A + 3B = [ 4 + 3 -2 + 15 ] = [ 7 13 ]
[ 6 + (-6) 8 + 0 ] [ 0 8 ]
Exercice 2 : Multiplication 2 x 2
Soit A = [3 1 ; 2 4] et B = [1 -2 ; 0 5]. Calculer AB et BA. Verifier que AB est different de BA.
Correction :
Calcul de AB :
c₁₁ = 3 x 1 + 1 x 0 = 3 + 0 = 3
c₁₂ = 3 x (-2) + 1 x 5 = -6 + 5 = -1
c₂₁ = 2 x 1 + 4 x 0 = 2 + 0 = 2
c₂₂ = 2 x (-2) + 4 x 5 = -4 + 20 = 16
AB = [ 3 -1 ]
[ 2 16 ]
Calcul de BA :
c₁₁ = 1 x 3 + (-2) x 2 = 3 - 4 = -1
c₁₂ = 1 x 1 + (-2) x 4 = 1 - 8 = -7
c₂₁ = 0 x 3 + 5 x 2 = 0 + 10 = 10
c₂₂ = 0 x 1 + 5 x 4 = 0 + 20 = 20
BA = [ -1 -7 ]
[ 10 20 ]
AB est different de BA. La multiplication matricielle n'est pas commutative.
Exercice 3 : Determinant 2 x 2
Calculer le determinant de M = [4 -3 ; 6 2].
Correction :
det(M) = 4 x 2 - (-3) x 6
= 8 - (-18)
= 8 + 18
= 26
Exercice 4 : Determinant 3 x 3 par Sarrus
Calculer le determinant de :
A = [ 2 1 3 ]
[ 0 -1 4 ]
[ 1 2 1 ]
Correction :
Diagonales descendantes :
D₁ = 2 x (-1) x 1 = -2
D₂ = 1 x 4 x 1 = 4
D₃ = 3 x 0 x 2 = 0
Diagonales montantes :
D₄ = 3 x (-1) x 1 = -3
D₅ = 2 x 4 x 2 = 16
D₆ = 1 x 0 x 1 = 0
det(A) = (-2) + 4 + 0 - (-3) - 16 - 0
= -2 + 4 + 0 + 3 - 16 - 0
= 5 - 16
= -11
Exercice 5 : Inverse d'une matrice 2 x 2
Calculer l'inverse de A = [5 2 ; 3 1]. Verifier.
Correction :
Determinant :
det(A) = 5 x 1 - 2 x 3 = 5 - 6 = -1
Inverse :
A⁻¹ = (1/(-1)) x [ 1 -2 ]
[ -3 5 ]
A⁻¹ = [ -1 2 ]
[ 3 -5 ]
Verification A x A⁻¹ :
c₁₁ = 5 x (-1) + 2 x 3 = -5 + 6 = 1
c₁₂ = 5 x 2 + 2 x (-5) = 10 - 10 = 0
c₂₁ = 3 x (-1) + 1 x 3 = -3 + 3 = 0
c₂₂ = 3 x 2 + 1 x (-5) = 6 - 5 = 1
A x A⁻¹ = [ 1 0 ] = I₂. Verifie.
[ 0 1 ]
Exercice 6 : Systeme 2 x 2 par inversion
Resoudre le systeme :
{ 5x + 2y = 12
{ 3x + y = 7
Correction :
Matrice A = [5 2 ; 3 1], B = [12 ; 7].
D'apres l'exercice 5, A⁻¹ = [-1 2 ; 3 -5].
X = A⁻¹ x B :
x = (-1) x 12 + 2 x 7 = -12 + 14 = 2
y = 3 x 12 + (-5) x 7 = 36 - 35 = 1
Solution : x = 2, y = 1.
Verification : 5(2) + 2(1) = 10 + 2 = 12. Correct. 3(2) + 1 = 7. Correct.
Exercice 7 : Systeme 2 x 2 par Cramer
Resoudre le systeme :
{ 4x - 3y = 1
{ 2x + 5y = 19
Correction :
det(A) = 4 x 5 - (-3) x 2 = 20 + 6 = 26
det(A₁) = det[ 1 -3 ] = 1 x 5 - (-3) x 19 = 5 + 57 = 62
[ 19 5 ]
det(A₂) = det[ 4 1 ] = 4 x 19 - 1 x 2 = 76 - 2 = 74
[ 2 19 ]
x = 62 / 26 = 31/13
y = 74 / 26 = 37/13
Verification : 4 x (31/13) - 3 x (37/13) = 124/13 - 111/13 = 13/13 = 1. Correct.
Exercice 8 : Pivot de Gauss 3 x 3
Resoudre le systeme par le pivot de Gauss :
{ x + y + z = 6
{ 2x + 3y + z = 14
{ x + 2y - z = 2
Correction :
Matrice augmentee :
[ 1 1 1 | 6 ] L₁
[ 2 3 1 | 14 ] L₂
[ 1 2 -1 | 2 ] L₃
L₂ ← L₂ - 2L₁ :
2 - 2x1 = 0, 3 - 2x1 = 1, 1 - 2x1 = -1, 14 - 2x6 = 2
L₃ ← L₃ - L₁ :
1 - 1 = 0, 2 - 1 = 1, -1 - 1 = -2, 2 - 6 = -4
[ 1 1 1 | 6 ] L₁
[ 0 1 -1 | 2 ] L₂
[ 0 1 -2 | -4 ] L₃
L₃ ← L₃ - L₂ :
0 - 0 = 0, 1 - 1 = 0, -2 - (-1) = -1, -4 - 2 = -6
[ 1 1 1 | 6 ] L₁
[ 0 1 -1 | 2 ] L₂
[ 0 0 -1 | -6 ] L₃
Remontee :
De L₃ : -z = -6, donc z = 6.
De L₂ : y - z = 2, donc y - 6 = 2, donc y = 8.
De L₁ : x + y + z = 6, donc x + 8 + 6 = 6, donc x = 6 - 14 = -8.
Solution : x = -8, y = 8, z = 6.
Verification equation 2 : 2(-8) + 3(8) + 6 = -16 + 24 + 6 = 14. Correct. Verification equation 3 : (-8) + 2(8) - 6 = -8 + 16 - 6 = 2. Correct.
Exercice 9 : Puissance de matrice et graphe
Soit le graphe oriente de matrice d'adjacence :
M = [ 0 1 0 ]
[ 0 0 1 ]
[ 1 1 0 ]
a) Combien de chemins de longueur 2 vont du sommet 3 au sommet 1 ? b) Calculer M² et repondre.
Correction :
Calcul de M² = M x M :
c₁₁ = 0x0 + 1x0 + 0x1 = 0
c₁₂ = 0x1 + 1x0 + 0x1 = 0
c₁₃ = 0x0 + 1x1 + 0x0 = 1
c₂₁ = 0x0 + 0x0 + 1x1 = 1
c₂₂ = 0x1 + 0x0 + 1x1 = 1
c₂₃ = 0x0 + 0x1 + 1x0 = 0
c₃₁ = 1x0 + 1x0 + 0x1 = 0
c₃₂ = 1x1 + 1x0 + 0x1 = 1
c₃₃ = 1x0 + 1x1 + 0x0 = 1
M² = [ 0 0 1 ]
[ 1 1 0 ]
[ 0 1 1 ]
Reponse a) : le coefficient m²₃₁ = 0. Il n'existe aucun chemin de longueur 2 du sommet 3 au sommet 1.
Reponse b) : m²₃₃ = 1 signifie qu'il existe 1 chemin de longueur 2 du sommet 3 a lui-meme (3 -> 1 -> ... non, verifions : 3 -> 2 -> 3 ? arc 3->2 existe (m₃₂=1), arc 2->3 existe (m₂₃=1). Oui, le chemin 3 -> 2 -> 3 est de longueur 2).
Exercice 10 : Chaine de Markov
Une machine peut etre dans deux etats : Fonctionnement (F) ou Panne (P). La matrice de transition est :
F P
T = [ 0.9 0.1 ] F
[ 0.6 0.4 ] P
Initialement, la machine est en fonctionnement : P₀ = [1 0].
a) Quelle est la distribution apres 1 etape ? b) Quelle est la distribution apres 2 etapes ? c) Determiner la distribution stationnaire.
Correction :
a) P₁ = P₀ x T :
composante F : 1 x 0.9 + 0 x 0.6 = 0.9
composante P : 1 x 0.1 + 0 x 0.4 = 0.1
P₁ = [0.9 0.1]
b) P₂ = P₁ x T :
composante F : 0.9 x 0.9 + 0.1 x 0.6 = 0.81 + 0.06 = 0.87
composante P : 0.9 x 0.1 + 0.1 x 0.4 = 0.09 + 0.04 = 0.13
P₂ = [0.87 0.13]
c) Distribution stationnaire pi = [pi_F, pi_P] telle que pi x T = pi.
pi_F = 0.9 pi_F + 0.6 pi_P
pi_F - 0.9 pi_F = 0.6 pi_P
0.1 pi_F = 0.6 pi_P
pi_F = 6 pi_P
Avec pi_F + pi_P = 1 :
6 pi_P + pi_P = 1
7 pi_P = 1
pi_P = 1/7
pi_F = 6/7
Distribution stationnaire : pi = [6/7, 1/7], soit environ [0.857, 0.143].
Interpretation : a long terme, la machine est en fonctionnement environ 85.7% du temps.
Exercice 11 : Determinant et inversibilite
Pour quelles valeurs de k la matrice suivante est-elle inversible ?
A = [ k 2 ]
[ k+1 k ]
Correction :
A est inversible si et seulement si det(A) est different de 0.
det(A) = k x k - 2 x (k+1)
= k² - 2k - 2
Resolvons k² - 2k - 2 = 0.
Discriminant :
Delta = (-2)² - 4 x 1 x (-2) = 4 + 8 = 12
k = (2 + racine(12)) / 2 ou k = (2 - racine(12)) / 2
= (2 + 2 racine(3)) / 2 = (2 - 2 racine(3)) / 2
= 1 + racine(3) = 1 - racine(3)
Conclusion : A est inversible pour tout k different de 1 + racine(3) et 1 - racine(3).
Exercice 12 : Inverse 3 x 3 et systeme
Resoudre le systeme en utilisant la matrice inverse :
{ 2x + y = 5
{ x + 2z = 5
{ y + z = 3
Correction :
Matrice A et vecteur B :
A = [ 2 1 0 ] B = [ 5 ]
[ 1 0 2 ] [ 5 ]
[ 0 1 1 ] [ 3 ]
Etape 1 : det(A) par Sarrus.
D₁ = 2 x 0 x 1 = 0
D₂ = 1 x 2 x 0 = 0
D₃ = 0 x 1 x 1 = 0
D₄ = 0 x 0 x 0 = 0
D₅ = 2 x 2 x 1 = 4
D₆ = 1 x 1 x 1 = 1
det(A) = 0 + 0 + 0 - 0 - 4 - 1 = -5
Etape 2 : cofacteurs.
C₁₁ = (+1) x det[ 0 2 ] = 0 x 1 - 2 x 1 = -2
[ 1 1 ]
C₁₂ = (-1) x det[ 1 2 ] = (-1) x (1 x 1 - 2 x 0) = (-1) x 1 = -1
[ 0 1 ]
C₁₃ = (+1) x det[ 1 0 ] = 1 x 1 - 0 x 0 = 1
[ 0 1 ]
C₂₁ = (-1) x det[ 1 0 ] = (-1) x (1 x 1 - 0 x 1) = (-1) x 1 = -1
[ 1 1 ]
C₂₂ = (+1) x det[ 2 0 ] = 2 x 1 - 0 x 0 = 2
[ 0 1 ]
C₂₃ = (-1) x det[ 2 1 ] = (-1) x (2 x 1 - 1 x 0) = (-1) x 2 = -2
[ 0 1 ]
C₃₁ = (+1) x det[ 1 0 ] = 1 x 2 - 0 x 0 = 2
[ 0 2 ]
C₃₂ = (-1) x det[ 2 0 ] = (-1) x (2 x 2 - 0 x 1) = (-1) x 4 = -4
[ 1 2 ]
C₃₃ = (+1) x det[ 2 1 ] = 2 x 0 - 1 x 1 = -1
[ 1 0 ]
Matrice des cofacteurs et transposee :
Com(A) = [ -2 -1 1 ]
[ -1 2 -2 ]
[ 2 -4 -1 ]
Com(A)ᵀ = [ -2 -1 2 ]
[ -1 2 -4 ]
[ 1 -2 -1 ]
Inverse :
A⁻¹ = (1/(-5)) x [ -2 -1 2 ] [ 2/5 1/5 -2/5 ]
[ -1 2 -4 ] = [ 1/5 -2/5 4/5 ]
[ 1 -2 -1 ] [ -1/5 2/5 1/5 ]
Etape 3 : X = A⁻¹ x B.
x = (2/5) x 5 + (1/5) x 5 + (-2/5) x 3
= 10/5 + 5/5 - 6/5
= (10 + 5 - 6) / 5
= 9/5
y = (1/5) x 5 + (-2/5) x 5 + (4/5) x 3
= 5/5 - 10/5 + 12/5
= (5 - 10 + 12) / 5
= 7/5
z = (-1/5) x 5 + (2/5) x 5 + (1/5) x 3
= -5/5 + 10/5 + 3/5
= (-5 + 10 + 3) / 5
= 8/5
Solution : x = 9/5, y = 7/5, z = 8/5.
Verification equation 1 : 2(9/5) + 7/5 = 18/5 + 7/5 = 25/5 = 5. Correct. Verification equation 2 : 9/5 + 2(8/5) = 9/5 + 16/5 = 25/5 = 5. Correct. Verification equation 3 : 7/5 + 8/5 = 15/5 = 3. Correct.
Exercice 13 : Multiplication et transposee
Soit A = [1 2 ; 3 4] et B = [0 1 ; -1 2]. Verifier que (AB)ᵀ = BᵀAᵀ.
Correction :
Calcul de AB :
c₁₁ = 1 x 0 + 2 x (-1) = 0 - 2 = -2
c₁₂ = 1 x 1 + 2 x 2 = 1 + 4 = 5
c₂₁ = 3 x 0 + 4 x (-1) = 0 - 4 = -4
c₂₂ = 3 x 1 + 4 x 2 = 3 + 8 = 11
AB = [ -2 5 ]
[ -4 11 ]
Transposee :
(AB)ᵀ = [ -2 -4 ]
[ 5 11 ]
Maintenant calculons BᵀAᵀ :
Bᵀ = [ 0 -1 ] Aᵀ = [ 1 3 ]
[ 1 2 ] [ 2 4 ]
BᵀAᵀ :
c₁₁ = 0 x 1 + (-1) x 2 = 0 - 2 = -2
c₁₂ = 0 x 3 + (-1) x 4 = 0 - 4 = -4
c₂₁ = 1 x 1 + 2 x 2 = 1 + 4 = 5
c₂₂ = 1 x 3 + 2 x 4 = 3 + 8 = 11
BᵀAᵀ = [ -2 -4 ]
[ 5 11 ]
On verifie bien que (AB)ᵀ = BᵀAᵀ.
Exercice 14 : Matrice d'adjacence et chemins
Soit un graphe oriente a 4 sommets {1, 2, 3, 4} de matrice d'adjacence :
M = [ 0 1 0 1 ]
[ 0 0 1 0 ]
[ 1 0 0 0 ]
[ 0 0 1 0 ]
a) Dessiner le graphe. b) Calculer M² et en deduire le nombre de chemins de longueur 2 du sommet 1 au sommet 3.
Correction :
a) Arcs du graphe :
- 1 -> 2 (m₁₂ = 1)
- 1 -> 4 (m₁₄ = 1)
- 2 -> 3 (m₂₃ = 1)
- 3 -> 1 (m₃₁ = 1)
- 4 -> 3 (m₄₃ = 1)
b) Calcul de M² = M x M :
m²₁₁ = 0x0 + 1x0 + 0x1 + 1x0 = 0
m²₁₂ = 0x1 + 1x0 + 0x0 + 1x0 = 0
m²₁₃ = 0x0 + 1x1 + 0x0 + 1x1 = 0 + 1 + 0 + 1 = 2
m²₁₄ = 0x1 + 1x0 + 0x0 + 1x0 = 0
m²₂₁ = 0x0 + 0x0 + 1x1 + 0x0 = 1
m²₂₂ = 0x1 + 0x0 + 1x0 + 0x0 = 0
m²₂₃ = 0x0 + 0x1 + 1x0 + 0x1 = 0
m²₂₄ = 0x1 + 0x0 + 1x0 + 0x0 = 0
m²₃₁ = 1x0 + 0x0 + 0x1 + 0x0 = 0
m²₃₂ = 1x1 + 0x0 + 0x0 + 0x0 = 1
m²₃₃ = 1x0 + 0x1 + 0x0 + 0x1 = 0
m²₃₄ = 1x1 + 0x0 + 0x0 + 0x0 = 1
m²₄₁ = 0x0 + 0x0 + 1x1 + 0x0 = 1
m²₄₂ = 0x1 + 0x0 + 1x0 + 0x0 = 0
m²₄₃ = 0x0 + 0x1 + 1x0 + 0x1 = 0
m²₄₄ = 0x1 + 0x0 + 1x0 + 0x0 = 0
M² = [ 0 0 2 0 ]
[ 1 0 0 0 ]
[ 0 1 0 1 ]
[ 1 0 0 0 ]
Reponse : m²₁₃ = 2. Il existe 2 chemins de longueur 2 du sommet 1 au sommet 3 :
- Chemin 1 : 1 -> 2 -> 3
- Chemin 2 : 1 -> 4 -> 3
Exercice 15 : Systeme 3 x 3 complet par Gauss
Resoudre par le pivot de Gauss :
{ 2x + y - z = 1
{ x - y + 2z = 5
{ 3x + 2y + z = 8
Correction :
Matrice augmentee :
[ 2 1 -1 | 1 ] L₁
[ 1 -1 2 | 5 ] L₂
[ 3 2 1 | 8 ] L₃
Pour simplifier, echangeons L₁ et L₂ (pour avoir un pivot de 1) :
[ 1 -1 2 | 5 ] L₁
[ 2 1 -1 | 1 ] L₂
[ 3 2 1 | 8 ] L₃
L₂ ← L₂ - 2L₁ :
2 - 2x1 = 0
1 - 2x(-1) = 1 + 2 = 3
-1 - 2x2 = -1 - 4 = -5
1 - 2x5 = 1 - 10 = -9
L₃ ← L₃ - 3L₁ :
3 - 3x1 = 0
2 - 3x(-1) = 2 + 3 = 5
1 - 3x2 = 1 - 6 = -5
8 - 3x5 = 8 - 15 = -7
[ 1 -1 2 | 5 ] L₁
[ 0 3 -5 | -9 ] L₂
[ 0 5 -5 | -7 ] L₃
L₃ ← L₃ - (5/3)L₂ :
0 - (5/3) x 0 = 0
5 - (5/3) x 3 = 5 - 5 = 0
-5 - (5/3) x (-5) = -5 + 25/3 = -15/3 + 25/3 = 10/3
-7 - (5/3) x (-9) = -7 + 45/3 = -7 + 15 = 8
[ 1 -1 2 | 5 ] L₁
[ 0 3 -5 | -9 ] L₂
[ 0 0 10/3 | 8 ] L₃
Remontee :
De L₃ : (10/3)z = 8, donc z = 8 x (3/10) = 24/10 = 12/5.
De L₂ : 3y - 5z = -9, donc 3y - 5 x (12/5) = -9, donc 3y - 12 = -9, donc 3y = 3, donc y = 1.
De L₁ : x - y + 2z = 5, donc x - 1 + 2 x (12/5) = 5, donc x - 1 + 24/5 = 5, donc x = 5 + 1 - 24/5 = 6 - 24/5 = 30/5 - 24/5 = 6/5.
Solution : x = 6/5, y = 1, z = 12/5.
Verification equation 1 : 2(6/5) + 1 - (12/5) = 12/5 + 5/5 - 12/5 = 5/5 = 1. Correct. Verification equation 2 : (6/5) - 1 + 2(12/5) = 6/5 - 5/5 + 24/5 = 25/5 = 5. Correct. Verification equation 3 : 3(6/5) + 2(1) + (12/5) = 18/5 + 10/5 + 12/5 = 40/5 = 8. Correct.
Exercice 16 : Transformation geometrique
On applique la rotation de 90 degres au triangle de sommets A(1, 0), B(2, 1), C(0, 3). Determiner les coordonnees des sommets transformes.
Correction :
Matrice de rotation de 90 degres :
R = [ 0 -1 ]
[ 1 0 ]
Sommet A(1, 0) :
[ 0 -1 ] [ 1 ] [ 0 x 1 + (-1) x 0 ] [ 0 ]
[ 1 0 ] [ 0 ] = [ 1 x 1 + 0 x 0 ] = [ 1 ]
A' = (0, 1).
Sommet B(2, 1) :
[ 0 -1 ] [ 2 ] [ 0 x 2 + (-1) x 1 ] [ -1 ]
[ 1 0 ] [ 1 ] = [ 1 x 2 + 0 x 1 ] = [ 2 ]
B' = (-1, 2).
Sommet C(0, 3) :
[ 0 -1 ] [ 0 ] [ 0 x 0 + (-1) x 3 ] [ -3 ]
[ 1 0 ] [ 3 ] = [ 1 x 0 + 0 x 3 ] = [ 0 ]
C' = (-3, 0).
Exercice 17 : Matrice de transition et PageRank
Quatre pages web A, B, C, D sont liees ainsi :
- A pointe vers B et C
- B pointe vers D
- C pointe vers A et D
- D pointe vers A
a) Ecrire la matrice de transition. b) A partir de P₀ = [1/4, 1/4, 1/4, 1/4], calculer P₁.
Correction :
a) Matrice de transition :
A B C D
T = [ 0 1/2 1/2 0 ] A (2 liens sortants)
[ 0 0 0 1 ] B (1 lien sortant)
[ 1/2 0 0 1/2 ] C (2 liens sortants)
[ 1 0 0 0 ] D (1 lien sortant)
b) P₁ = P₀ x T :
Composante A :
(1/4) x 0 + (1/4) x 0 + (1/4) x (1/2) + (1/4) x 1
= 0 + 0 + 1/8 + 1/4
= 1/8 + 2/8
= 3/8
Composante B :
(1/4) x (1/2) + (1/4) x 0 + (1/4) x 0 + (1/4) x 0
= 1/8 + 0 + 0 + 0
= 1/8
Composante C :
(1/4) x (1/2) + (1/4) x 0 + (1/4) x 0 + (1/4) x 0
= 1/8
Composante D :
(1/4) x 0 + (1/4) x 1 + (1/4) x (1/2) + (1/4) x 0
= 0 + 1/4 + 1/8 + 0
= 2/8 + 1/8
= 3/8
P₁ = [3/8, 1/8, 1/8, 3/8].
La page A et la page D ont les scores les plus eleves, ce qui est coherent car elles recoivent le plus de liens entrants.