Esercizi sulle Operazioni tra Matrici

Esercizi sulle Operazioni tra Matrici Esercizi sulle Operazioni tra Matrici
Esercizi sulle Operazioni tra Matrici

Versione italiana

Esercizi sulle Operazioni tra Matrici

Concetti Chiave

  1. Definizione di Matrice:
    Una matrice è un insieme di numeri disposti in righe e colonne. Una matrice di dimensione m \times nm×nm \times n ha mmm righe e nnn colonne.

  2. Tipi di Operazioni tra Matrici:

    • Somma di Matrici: Due matrici possono essere sommate se hanno le stesse dimensioni. La somma si ottiene sommando gli elementi corrispondenti.
    • Differenza di Matrici: Simile alla somma, la differenza si ottiene sottraendo gli elementi corrispondenti.
    • Prodotto di Matrici: Il prodotto di due matrici AAA (dimensione m \times nm×nm \times n) e BBB (dimensione n \times pn×pn \times p) è una matrice CCC (dimensione m \times pm×pm \times p) i cui elementi sono dati da:
      C_{ij} = \sum_{k=1}^{n} A_{ik} B_{kj}
      Cij=k=1nAikBkjC_{ij} = \sum_{k=1}^{n} A_{ik} B_{kj}
    • Prodotto per uno Scalare: Moltiplicare una matrice per uno scalare significa moltiplicare ogni elemento della matrice per quel numero.
  3. Matrice Identità:
    La matrice identità I_nInI_n è una matrice quadrata di dimensione nnn con 1 sulla diagonale principale e 0 altrove. Ha la proprietà che, per ogni matrice AAA di dimensione n \times nn×nn \times n:

    A \cdot I_n = I_n \cdot A = A
    AIn=InA=AA \cdot I_n = I_n \cdot A = A

Esercizi

Esercizio 1: Somma di Matrici

Problema: Calcola la somma delle matrici AAA e BBB dove:

A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, \quad B = \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}
A=(1234),B=(5678)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, \quad B = \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}

Soluzione:

  1. Somma gli elementi corrispondenti:
    A + B = \begin{pmatrix} 1 + 5 & 2 + 6 \\ 3 + 7 & 4 + 8 \end{pmatrix} = \begin{pmatrix} 6 & 8 \\ 10 & 12 \end{pmatrix}
    A+B=(1+52+63+74+8)=(681012)A + B = \begin{pmatrix} 1 + 5 & 2 + 6 \\ 3 + 7 & 4 + 8 \end{pmatrix} = \begin{pmatrix} 6 & 8 \\ 10 & 12 \end{pmatrix}

Esercizio 2: Differenza di Matrici

Problema: Calcola la differenza delle matrici AAA e BBB dove:

A = \begin{pmatrix} 9 & 8 \\ 7 & 6 \end{pmatrix}, \quad B = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}
A=(9876),B=(1234)A = \begin{pmatrix} 9 & 8 \\ 7 & 6 \end{pmatrix}, \quad B = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}

Soluzione:

  1. Sottrai gli elementi corrispondenti:
    A - B = \begin{pmatrix} 9 - 1 & 8 - 2 \\ 7 - 3 & 6 - 4 \end{pmatrix} = \begin{pmatrix} 8 & 6 \\ 4 & 2 \end{pmatrix}
    AB=(91827364)=(8642)A - B = \begin{pmatrix} 9 - 1 & 8 - 2 \\ 7 - 3 & 6 - 4 \end{pmatrix} = \begin{pmatrix} 8 & 6 \\ 4 & 2 \end{pmatrix}

Esercizio 3: Prodotto di Matrici

Problema: Calcola il prodotto delle matrici AAA e BBB dove:

A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, \quad B = \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}
A=(1234),B=(5678)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, \quad B = \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}

Soluzione:

  1. Calcola il prodotto:
    C = A \cdot B = \begin{pmatrix} 1 \cdot 5 + 2 \cdot 7 & 1 \cdot 6 + 2 \cdot 8 \\ 3 \cdot 5 + 4 \cdot 7 & 3 \cdot 6 + 4 \cdot 8 \end{pmatrix}
    C=AB=(15+2716+2835+4736+48)C = A \cdot B = \begin{pmatrix} 1 \cdot 5 + 2 \cdot 7 & 1 \cdot 6 + 2 \cdot 8 \\ 3 \cdot 5 + 4 \cdot 7 & 3 \cdot 6 + 4 \cdot 8 \end{pmatrix}
    = \begin{pmatrix} 5 + 14 & 6 + 16 \\ 15 + 28 & 18 + 32 \
    \end{pmatrix}
    =(5+146+1615+2818+32 )= \begin{pmatrix} 5 + 14 & 6 + 16 \\ 15 + 28 & 18 + 32 \ \end{pmatrix}
    = \begin{pmatrix} 19 & 22 \\ 43 & 50 \end{pmatrix}
    =(19224350)= \begin{pmatrix} 19 & 22 \\ 43 & 50 \end{pmatrix}

Esercizio 4: Prodotto di una Matrice per uno Scalare

Problema: Calcola il prodotto della matrice AAA per lo scalare k = 3k=3k = 3 dove:

A = \begin{pmatrix} 4 & -2 \\ 1 & 0 \end{pmatrix}
A=(4210)A = \begin{pmatrix} 4 & -2 \\ 1 & 0 \end{pmatrix}

Soluzione:

  1. Moltiplica ogni elemento della matrice per 333:
    kA = 3 \cdot A = \begin{pmatrix} 3 \cdot 4 & 3 \cdot -2 \\ 3 \cdot 1 & 3 \cdot 0 \end{pmatrix} = \begin{pmatrix} 12 & -6 \\ 3 & 0 \end{pmatrix}
    kA=3A=(34323130)=(12630)kA = 3 \cdot A = \begin{pmatrix} 3 \cdot 4 & 3 \cdot -2 \\ 3 \cdot 1 & 3 \cdot 0 \end{pmatrix} = \begin{pmatrix} 12 & -6 \\ 3 & 0 \end{pmatrix}

Esercizio 5: Verifica della Proprietà della Matrice Identità

Problema: Verifica che la matrice identità III moltiplicata per la matrice AAA restituisce AAA stessa, dove:

I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}, \quad A = \begin{pmatrix} 2 & 3 \\ 4 & 5 \end{pmatrix}
I=(1001),A=(2345)I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}, \quad A = \begin{pmatrix} 2 & 3 \\ 4 & 5 \end{pmatrix}

Soluzione:

  1. Calcola il prodotto I \cdot AIAI \cdot A:
    I \cdot A = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} \cdot \begin{pmatrix} 2 & 3 \\ 4 & 5 \end{pmatrix}
    IA=(1001)(2345)I \cdot A = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} \cdot \begin{pmatrix} 2 & 3 \\ 4 & 5 \end{pmatrix}
    = \begin{pmatrix} 1 \cdot 2 + 0 \cdot 4 & 1 \cdot 3 + 0 \cdot 5 \\ 0 \cdot 2 + 1 \cdot 4 & 0 \cdot 3 + 1 \cdot 5 \end{pmatrix} = \begin{pmatrix} 2 & 3 \\ 4 & 5 \end{pmatrix}
    =(12+0413+0502+1403+15)=(2345)= \begin{pmatrix} 1 \cdot 2 + 0 \cdot 4 & 1 \cdot 3 + 0 \cdot 5 \\ 0 \cdot 2 + 1 \cdot 4 & 0 \cdot 3 + 1 \cdot 5 \end{pmatrix} = \begin{pmatrix} 2 & 3 \\ 4 & 5 \end{pmatrix}
    • Quindi, I \cdot A = AIA=AI \cdot A = A.

Esercizio 6: Somma di Matrici di Dimensioni Diverse (Errore)

Problema: Prova a sommare le matrici AAA e BBB dove:

A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, \quad B = \begin{pmatrix} 5 & 6 & 7 \\ 8 & 9 & 10 \end{pmatrix}
A=(1234),B=(5678910)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, \quad B = \begin{pmatrix} 5 & 6 & 7 \\ 8 & 9 & 10 \end{pmatrix}

Soluzione:

  1. Nota che le matrici AAA e BBB hanno dimensioni diverse (AAA è 2 \times 22×22 \times 2 e BBB è 2 \times 32×32 \times 3).
  2. Non è possibile sommarle, quindi l'operazione è non definita.

English version

Matrix Operations Exercises

Key Concepts

  1. Definition of Matrix:
    A matrix is ​​a set of numbers arranged in rows and columns. A matrix of size m \times nm×nm \times n has mmm rows and nnn columns.

  2. Types of Matrix Operations:

  • Matrix Addition: Two matrices can be added if they have the same dimensions. The sum is obtained by adding the corresponding elements.
  • Matrix Difference: Similar to the addition, the difference is obtained by subtracting the corresponding elements.
  • Matrix Product: The product of two matrices AAA (size m \times nm×nm \times n) and BBB (size n \times pn×pn \times p) is a matrix CCC (size m \times pm×pm \times p) whose elements are given by:
C_{ij} = \sum_{k=1}^{n} A_{ik} B_{kj}
Cij=k=1nAikBkjC_{ij} = \sum_{k=1}^{n} A_{ik} B_{kj}
  • Scalar Product: Multiplying a matrix by a scalar means multiplying each element of the matrix by that number.
  1. Identity Matrix:
    The identity matrix I_nInI_n is a square matrix of size nnn with 1 on the main diagonal and 0 elsewhere. It has the property that, for any matrix AAA of size n \times nn×nn \times n:
A \cdot I_n = I_n \cdot A = A
AIn=InA=AA \cdot I_n = I_n \cdot A = A

Exercises

Exercise 1: Matrices Sum

Problem: Calculate the sum of matrices AAA and BBB where:

A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, \quad B = \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}
A=(1234),B=(5678)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, \quad B = \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}

Solution:

  1. Add the corresponding elements:
A + B = \begin{pmatrix} 1 + 5 & 2 + 6 \\ 3 + 7 & 4 + 8 \end{pmatrix} = \begin{pmatrix} 6 & 8 \\ 10 & 12 \end{pmatrix}
A+B=(1+52+63+74+8)=(681012)A + B = \begin{pmatrix} 1 + 5 & 2 + 6 \\ 3 + 7 & 4 + 8 \end{pmatrix} = \begin{pmatrix} 6 & 8 \\ 10 & 12 \end{pmatrix}

Exercise 2: Difference of Matrices

Problem: Calculate the difference of matrices AAA and BBB where:

A = \begin{pmatrix} 9 & 8 \\ 7 & 6 \end{pmatrix}, \quad B = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}
A=(9876),B=(1234)A = \begin{pmatrix} 9 & 8 \\ 7 & 6 \end{pmatrix}, \quad B = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}

Solution:

  1. Subtract the corresponding elements:
A - B = \begin{pmatrix} 9 - 1 & 8 - 2 \\ 7 - 3 & 6 - 4 \end{pmatrix} = \begin{pmatrix} 8 & 6 \\ 4 & 2 \end{pmatrix}
AB=(91827364)=(8642)A - B = \begin{pmatrix} 9 - 1 & 8 - 2 \\ 7 - 3 & 6 - 4 \end{pmatrix} = \begin{pmatrix} 8 & 6 \\ 4 & 2 \end{pmatrix}

Exercise 3: Product of Matrices

Problem: Calculate the product of matrices AAA and BBB where:

A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, \quad B = \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}
A=(1234),B=(5678)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, \quad B = \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}

Solution:

  1. Calculate the product:
C = A \cdot B = \begin{pmatrix} 1 \cdot 5 + 2 \cdot 7 & 1 \c dot 6 + 2 \cdot 8 \\ 3 \cdot 5 + 4 \cdot 7 & 3 \cdot 6 + 4 \cdot 8 \end{pmatrix}
C=AB=(15+271d¸ot6+2835+4736+48)C = A \cdot B = \begin{pmatrix} 1 \cdot 5 + 2 \cdot 7 & 1 \c dot 6 + 2 \cdot 8 \\ 3 \cdot 5 + 4 \cdot 7 & 3 \cdot 6 + 4 \cdot 8 \end{pmatrix}
= \begin{pmatrix} 5 + 14 & 6 + 16 \\ 15 + 28 & 18 + 32 \ \end{pmatrix}
=(5+146+1615+2818+32 )= \begin{pmatrix} 5 + 14 & 6 + 16 \\ 15 + 28 & 18 + 32 \ \end{pmatrix}
= \begin{pmatrix} 19 & 22 \\ 43 & 50 \end{pmatrix}
=(19224350)= \begin{pmatrix} 19 & 22 \\ 43 & 50 \end{pmatrix}

Exercise 4: Product of a Matrix and a Scalar

Problem: Calculate the product of the matrix AAA and the scalar k = 3k=3k = 3 where:

A = \begin{pmatrix} 4 & -2 \\ 1 & 0 \end{pmatrix}
A=(4210)A = \begin{pmatrix} 4 & -2 \\ 1 & 0 \end{pmatrix}

Solution:

  1. Multiply each element of the matrix by 333:
kA = 3 \cdot A = \begin{pmatrix} 3 \cdot 4 & 3 \cdot -2 \\ 3 \cdot 1 & 3 \cdot 0 \end{pmatrix} = \begin{pmatrix} 12 & -6 \\ 3 & 0 \end{pmatrix}
kA=3A=(34323130)=(12630)kA = 3 \cdot A = \begin{pmatrix} 3 \cdot 4 & 3 \cdot -2 \\ 3 \cdot 1 & 3 \cdot 0 \end{pmatrix} = \begin{pmatrix} 12 & -6 \\ 3 & 0 \end{pmatrix}

Exercise 5: Verification of the Property of Identity Matrix

Problem: Verify that the identity matrix III multiplied by the matrix AAA returns AAA itself, where:

I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}, \quad A = \begin{pmatrix} 2 & 3 \\ 4 & 5 \end{pmatrix}
I=(1001),A=(2345)I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}, \quad A = \begin{pmatrix} 2 & 3 \\ 4 & 5 \end{pmatrix}

Solution:

  1. Compute the product I \cdot AIAI \cdot A:
I \cdot A = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} \cdot \begin{pmatrix} 2 & 3 \\ 4 & 5 \end{pmatrix}
IA=(1001)(2345)I \cdot A = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} \cdot \begin{pmatrix} 2 & 3 \\ 4 & 5 \end{pmatrix}
= \begin{pmatrix} 1 \cdot 2 + 0 \cdot 4 & 1 \cdot 3 + 0 \cdot 5 \\ 0 \cdot 2 + 1 \cdot 4 & 0 \cdot 3 + 1 \cdot 5 \end{pmatrix} = \begin{pmatrix} 2 & 3 \\ 4 & 5 \end{pmatrix}
=(12+0413+0502+1403+15)=(2345)= \begin{pmatrix} 1 \cdot 2 + 0 \cdot 4 & 1 \cdot 3 + 0 \cdot 5 \\ 0 \cdot 2 + 1 \cdot 4 & 0 \cdot 3 + 1 \cdot 5 \end{pmatrix} = \begin{pmatrix} 2 & 3 \\ 4 & 5 \end{pmatrix}
  • So, I \cdot A = AIA=AI \cdot A = A.

Exercise 6: Adding Matrices of Different Sizes (Error)

Problem: Try adding matrices AAA and BBB where:

A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, \quad B = \begin{pmatrix} 5 & 6 & 7 \\ 8 & 9 & 10 \end{pmatrix}
A=(1234),B=(5678910)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, \quad B = \begin{pmatrix} 5 & 6 & 7 \\ 8 & 9 & 10 \end{pmatrix}

Solution:

  1. Note that matrices AAA and BBB have different sizes (AAA is 2 \times 22×22 \times 2 and BBB is 2 \times 32×32 \times 3).
  2. You cannot add them, so the operation is undefined.

Commenti