Unit 1 - Notes

QTT201 8 min read

Unit 1: Matrix

1. Uses of Matrix in Business

A matrix is a rectangular array of numbers, symbols, or expressions, arranged in rows and columns. Matrices provide a powerful tool for organizing data, performing complex calculations, and modeling business problems.

  • Data Storage and Management: Matrices are used to store and represent large sets of data in a compact and organized manner.

    • Example: A company can represent its quarterly sales for three different products across four regions in a 3x4 matrix.
      TEXT
                    Region 1  Region 2  Region 3  Region 4
              Prod A   [ 150       200       175       180 ]
              Prod B   [ 100       210       190       160 ]
              Prod C   [ 250       225       240       230 ]
              
  • Solving Systems of Linear Equations: Business problems involving multiple variables and constraints (e.g., resource allocation, production planning) can be modeled as systems of linear equations and solved efficiently using matrix methods like the inverse matrix method or Cramer's rule.

    • Example: A company produces two products, X and Y, using two machines, M1 and M2.
      • Product X requires 2 hours on M1 and 1 hour on M2.
      • Product Y requires 1 hour on M1 and 3 hours on M2.
      • M1 is available for 10 hours, M2 for 12 hours.
      • This can be represented as: 2x + y = 10 and x + 3y = 12, which can be solved using matrices.
  • Costing and Pricing: Matrices can be used to calculate total costs and revenues.

    • Example: If a contractor builds three types of houses and the material requirements (steel, wood, glass) for each are stored in a matrix, the total cost can be found by multiplying this matrix by a column matrix of material prices.
  • Input-Output Analysis (Leontief Model): This economic model uses matrices to analyze the interdependence of different sectors or industries in an economy. It helps determine the total output required from each industry to satisfy both final consumer demand and inter-industry demand.

  • Inventory and Production Management: Matrices can track inventory levels for multiple products across different warehouses and help plan production schedules.

2. Types of Matrices

Based on Dimensions

  1. Row Matrix: A matrix with only one row.

    • Example: A = [1 5 -9 3] is a 1x4 row matrix.
  2. Column Matrix: A matrix with only one column.

    • Example:
      TEXT
              B = [ 2 ]
                  [ 8 ]
                  [-1 ]
              

      is a 3x1 column matrix.
  3. Rectangular Matrix: A matrix where the number of rows (m) is not equal to the number of columns (n).

    • Example:
      TEXT
              C = [ 1 2 3 ]
                  [ 4 5 6 ]
              

      is a 2x3 rectangular matrix.
  4. Square Matrix: A matrix where the number of rows is equal to the number of columns (m = n). This is called a matrix of order 'n'.

    • Example:
      TEXT
              D = [ 1 2 3 ]
                  [ 4 5 6 ]
                  [ 7 8 9 ]
              

      is a square matrix of order 3. The elements where the row and column number are the same (1, 5, 9) form the main diagonal or principal diagonal.

Based on Elements

  1. Zero or Null Matrix (O): A matrix where all elements are zero.

    • Example:
      TEXT
              O = [ 0 0 0 ]
                  [ 0 0 0 ]
              
  2. Diagonal Matrix: A square matrix where all non-diagonal elements are zero.

    • Example:
      TEXT
              E = [ 5 0 0 ]
                  [ 0 2 0 ]
                  [ 0 0 -1]
              
  3. Scalar Matrix: A diagonal matrix where all the principal diagonal elements are the same.

    • Example:
      TEXT
              F = [ 7 0 0 ]
                  [ 0 7 0 ]
                  [ 0 0 7 ]
              
  4. Identity or Unit Matrix (I): A scalar matrix where all the principal diagonal elements are 1. It is the multiplicative identity for matrices, meaning AI = IA = A.

    • Example (I₃, Identity matrix of order 3):
      TEXT
              I = [ 1 0 0 ]
                  [ 0 1 0 ]
                  [ 0 0 1 ]
              
  5. Upper Triangular Matrix: A square matrix where all elements below the main diagonal are zero.

    • Example:
      TEXT
              G = [ 1 9 4 ]
                  [ 0 5 2 ]
                  [ 0 0 3 ]
              
  6. Lower Triangular Matrix: A square matrix where all elements above the main diagonal are zero.

    • Example:
      TEXT
              H = [ 1 0 0 ]
                  [ 6 5 0 ]
                  [ 2 8 3 ]
              

3. Operations of Matrices

Equality of Matrices

Two matrices A and B are equal if and only if they satisfy two conditions:

  1. They have the same order (same number of rows and columns).
  2. Each corresponding element is equal (i.e., aᵢⱼ = bᵢⱼ for all i and j).
  • Example: Find x, y, and z if A = B.
    TEXT
        A = [ x+1   5 ]      B = [ 4   5 ]
            [  3   z-2]          [ 3  y+1]
        
    • x + 1 = 4 => x = 3
    • z - 2 = y + 1
    • 5 = 5 (corresponds)
    • 3 = 3 (corresponds)
    • Since we have two variables in one equation, we need more information. Let's assume a typo and B = [[4, 5], [3, 7]]. Then z-2 = 7 => z = 9.

Addition and Subtraction of Matrices

  • Condition: Matrices can only be added or subtracted if they have the same order.

  • Process: Add or subtract the corresponding elements.

  • Example (Addition):

    TEXT
        A = [ 1 2 3 ]      B = [ 9 8 7 ]
            [ 4 5 6 ]          [ 6 5 4 ]
    
        A + B = [ 1+9  2+8  3+7 ] = [ 10 10 10 ]
                [ 4+6  5+5  6+4 ]   [ 10 10 10 ]
        

  • Example (Subtraction):

    TEXT
        A = [ 8 6 ]      B = [ 3 1 ]
            [ 7 5 ]          [ 2 4 ]
    
        A - B = [ 8-3  6-1 ] = [ 5 5 ]
                [ 7-2  5-4 ]   [ 5 1 ]
        

Scalar Multiplication of Matrices

  • Process: To multiply a matrix by a scalar (a single number), multiply every element in the matrix by that scalar.

  • Example:

    TEXT
        A = [ 3  1 -2 ]
            [ 0  5  4 ]
    
        Let k = 4. Then kA = 4A.
    
        4A = [ 4*3  4*1  4*(-2) ] = [ 12  4  -8 ]
             [ 4*0  4*5   4*4  ]   [  0 20  16 ]
        

Multiplication of Matrices

  • Condition: The product AB of two matrices A and B is defined only if the number of columns in matrix A is equal to the number of rows in matrix B.

    • If A is an m x n matrix and B is an n x p matrix, their product AB will be an m x p matrix.
  • Process (Row-by-Column): The element in the i-th row and j-th column of the product matrix AB is obtained by multiplying each element of the i-th row of A by the corresponding element of the j-th column of B and summing the results.

  • Example 1 (2x2):

    TEXT
        A = [ 1 2 ]      B = [ 5 6 ]
            [ 3 4 ]          [ 7 8 ]
        (A is 2x2, B is 2x2, so AB will be 2x2)
    
        AB = [ (1*5 + 2*7)  (1*6 + 2*8) ]
             [ (3*5 + 4*7)  (3*6 + 4*8) ]
    
           = [ (5 + 14)  (6 + 16) ] = [ 19 22 ]
             [ (15 + 28) (18 + 32) ]   [ 43 50 ]
        

  • Example 2 (3x3):

    TEXT
        A = [ 1 2 3 ]      B = [ 9 8 7 ]
            [ 4 5 6 ]          [ 6 5 4 ]
            [ 7 8 9 ]          [ 3 2 1 ]
        (A is 3x3, B is 3x3, so AB will be 3x3)
    
        AB =
        [ (1*9+2*6+3*3) (1*8+2*5+3*2) (1*7+2*4+3*1) ]
        [ (4*9+5*6+6*3) (4*8+5*5+6*2) (4*7+5*4+6*1) ]
        [ (7*9+8*6+9*3) (7*8+8*5+9*2) (7*7+8*4+9*1) ]
    
           =
        [ (9+12+9)   (8+10+6)   (7+8+3)   ]
        [ (36+30+18) (32+25+12) (28+20+6)  ]
        [ (63+48+27) (56+40+18) (49+32+9)  ]
    
           =
        [ 30  24  18 ]
        [ 84  69  54 ]
        [ 138 114 90 ]
        

  • Important Note: Matrix multiplication is not commutative, which means in general, AB ≠ BA.

4. Transpose of a Matrix

  • Definition: The transpose of a matrix A, denoted as Aᵀ or A', is formed by interchanging its rows and columns.

  • If A is an m x n matrix, then Aᵀ will be an n x m matrix.

  • Example 1 (Rectangular):

    TEXT
        A = [ 1 2 3 ]      Aᵀ = [ 1 4 ]
            [ 4 5 6 ]           [ 2 5 ]
                                [ 3 6 ]
        

  • Example 2 (Square):

    TEXT
        B = [ 1 5 9 ]      Bᵀ = [ 1 6 2 ]
            [ 6 7 3 ]           [ 5 7 8 ]
            [ 2 8 4 ]           [ 9 3 4 ]
        

5. Determinant of a Matrix

  • Definition: The determinant is a unique scalar value associated with a square matrix. It is denoted by det(A) or |A|.
  • A determinant of 0 implies the matrix is singular. A non-zero determinant implies the matrix is non-singular.

Determinant of a 2x2 Matrix

For a matrix A = [[a, b], [c, d]], the determinant is:
|A| = ad - bc

  • Example:
    TEXT
        A = [ 4 5 ]
            [ 2 3 ]
    
        |A| = (4 * 3) - (5 * 2) = 12 - 10 = 2
        

Determinant of a 3x3 Matrix

For a matrix A = [[a, b, c], [d, e, f], [g, h, i]], the determinant can be found by expanding along the first row:
|A| = a * |e f| - b * |d f| + c * |d e|
|h i| |g i| |g h|

|A| = a(ei - fh) - b(di - fg) + c(dh - eg)

  • Example:

    TEXT
        A = [ 1 2 3 ]
            [ 0 4 5 ]
            [ 1 0 6 ]
        

    Expand along the first row:
    |A| = 1 * |4 5| - 2 * |0 5| + 3 * |0 4|
    |0 6| |1 6| |1 0|

    |A| = 1 * ((4*6) - (5*0)) - 2 * ((0*6) - (5*1)) + 3 * ((0*0) - (4*1))
    |A| = 1 * (24 - 0) - 2 * (0 - 5) + 3 * (0 - 4)
    |A| = 1 * (24) - 2 * (-5) + 3 * (-4)
    |A| = 24 + 10 - 12
    |A| = 22

6. Minor, Cofactors, Adjoint Matrix

These are essential steps for finding the inverse of a 3x3 matrix.

Minor

The minor of an element aᵢⱼ (denoted Mᵢⱼ) is the determinant of the submatrix formed by deleting the i-th row and j-th column.

  • Example: Using matrix A from the determinant example above:
    TEXT
        A = [ 1 2 3 ]
            [ 0 4 5 ]
            [ 1 0 6 ]
        
    • Minor of a₁₁ (element 1): M₁₁ = |4 5| = (4*6 - 5*0) = 24
      |0 6|
    • Minor of a₁₂ (element 2): M₁₂ = |0 5| = (0*6 - 5*1) = -5
      |1 6|
    • Minor of a₃₂ (element 0): M₃₂ = |1 3| = (1*5 - 3*0) = 5
      |0 5|

Cofactors

The cofactor of an element aᵢⱼ (denoted Cᵢⱼ) is the minor multiplied by (-1)ⁱ⁺ʲ. This results in a "checkerboard" pattern of signs.
Cᵢⱼ = (-1)ⁱ⁺ʲ * Mᵢⱼ

  • Sign Pattern for a 3x3 Matrix:

    TEXT
        [ + - + ]
        [ - + - ]
        [ + - + ]
        

  • Example: Continuing with matrix A:

    • C₁₁ = (+1) * M₁₁ = 1 * 24 = 24
    • C₁₂ = (-1) * M₁₂ = -1 * (-5) = 5
    • C₁₃ = (+1) * M₁₃ = 1 * |0 4| = -4
      |1 0|
  • Cofactor Matrix (C): A matrix formed by all the cofactors.
    For matrix A, the full cofactor matrix is:

    TEXT
        C = [ 24   5  -4 ]
            [-12   3   2 ]
            [ -2  -5   4 ]
        

Adjoint Matrix

The adjoint of a matrix A (denoted adj(A)) is the transpose of its cofactor matrix.

  • Example: Using the cofactor matrix C from above:
    TEXT
        adj(A) = Cᵀ = [ 24 -12  -2 ]
                       [  5   3  -5 ]
                       [ -4   2   4 ]
        

7. Inverse of a Matrix

  • Definition: The inverse of a non-singular square matrix A, denoted A⁻¹, is the matrix such that A * A⁻¹ = A⁻¹ * A = I.
  • Condition: The inverse exists only if the matrix is non-singular, i.e., det(A) ≠ 0.

Formula for the Inverse

A⁻¹ = (1 / det(A)) * adj(A)

Inverse of a 2x2 Matrix (Shortcut)

For A = [[a, b], [c, d]]:

  1. Swap the elements on the main diagonal (a and d).
  2. Change the signs of the other two elements (b and c).
  3. Multiply the resulting matrix by 1 / (ad-bc).

A⁻¹ = (1 / (ad-bc)) * [[d, -b], [-c, a]]

  • Example:
    TEXT
        A = [ 4 5 ]
            [ 2 3 ]
        
    1. det(A) = (4*3) - (5*2) = 2 (non-zero, so inverse exists)
    2. A⁻¹ = (1/2) * [ 3 -5 ] = [ 3/2 -5/2 ]
      [ -2 4 ] [ -1 2 ]

Inverse of a 3x3 Matrix (Full Procedure)

Steps:

  1. Calculate the determinant det(A). If it is 0, stop. The inverse does not exist.
  2. Find the matrix of cofactors, C.
  3. Find the adjoint matrix, adj(A), by transposing C.
  4. Apply the formula: A⁻¹ = (1 / det(A)) * adj(A).
  • Example: Find the inverse of the matrix A we have been using.

    TEXT
        A = [ 1 2 3 ]
            [ 0 4 5 ]
            [ 1 0 6 ]
        

    Step 1: Find the Determinant
    We already calculated det(A) = 22. Since it's not zero, the inverse exists.

    Step 2: Find the Cofactor Matrix
    We already calculated this:

    TEXT
        C = [ 24   5  -4 ]
            [-12   3   2 ]
            [ -2  -5   4 ]
        

    Step 3: Find the Adjoint Matrix
    We already calculated this by transposing C:

    TEXT
        adj(A) = [ 24 -12  -2 ]
                 [  5   3  -5 ]
                 [ -4   2   4 ]
        

    Step 4: Apply the Formula
    A⁻¹ = (1 / 22) * adj(A)

    TEXT
        A⁻¹ = (1/22) * [ 24 -12  -2 ]
                       [  5   3  -5 ]
                       [ -4   2   4 ]
    
             = [ 24/22  -12/22  -2/22 ]
               [  5/22    3/22  -5/22 ]
               [ -4/22    2/22   4/22 ]
    
        (Simplifying the fractions)
             = [ 12/11  -6/11  -1/11 ]
               [  5/22   3/22  -5/22 ]
               [ -2/11   1/11   2/11 ]