Linear Algebra Notes
Matrices and Systems of Equations
Introduction
- In 1949, economist Wassily Leontief created a model of equations to understand the interdependence between different sectors of an economy.
- His original problem involved 500 equations with 500 unknowns, which was computationally intensive for the time, so he reduced it to 42 equations and 42 unknowns.
- Solving the reduced problem required 56 hours of computation.
- Leontief's model was a system of linear equations, where unknown quantities are related through linear combinations.
- The goal was to solve the equations simultaneously to find the unknown values that satisfy the system.
- Linear models have become vital in various fields like physics, mathematics, engineering, biology, and social sciences due to their simplicity and increased computational capacity.
- Systems of linear equations represent mathematical models where several unknown quantities are related linearly through various equations.
- These equations are solved simultaneously to find the values that satisfy all the equations at the same time.
- Examples of applications include:
- Water supply networks: Determining pressures and flow rates to plan expansion and ensure proper water distribution.
- Structural calculations: Modeling and analyzing the resistance and behavior of structures under different loads and forces.
- Chemical reactions: Determining the amounts of substances present before and after a reaction.
- Electrical networks: Analyzing the current and voltage at different points.
- Logistics: Planning and optimizing the production and transportation of goods.
- Transportation: Planning and optimizing routes, schedules, and vehicle usage.
- Classification problems: Grouping elements based on their characteristics.
- Image processing: Reconstructing images or creating graphical animations.
- Finance: Optimizing portfolios and valuing financial options.
- Modeling physical phenomena: Simulating the movement of bodies in space and fluid flow in pipes.
- Game theory: Modeling interactions between economic agents.
- Modeling biological systems: Simulating population dynamics and interactions between species.
- Design of mechanical, electrical, and electronic systems; signal processing.
Systems of Linear Equations
- Definition 1.1 (System of Linear Equations): A linear equation in the variables can be expressed as a linear combination equal to a constant, :
- The variables are multiplied by constants (coefficients ) and summed.
- The independent term and coefficients can be real or complex.
- A system of linear equations is a collection of one or more equations involving the same variables:
- If the independent terms are all zero (), the system is homogeneous.
- Example 1.1 (Water Supply Network): In a water supply network with 4 nodes, the flow through each pipe is determined by establishing equilibrium at each node (flow in = flow out). Example is shown to derive the equations.
Solution of a System of Equations
- Definition 1.2 (Solution of a System of Linear Equations): A list of values that satisfies all equations in the system.
- A system can have:
- No solution (incompatible).
- Exactly one solution (compatible determined).
- Infinitely many solutions (compatible indeterminate).
- Definition 1.3 (Equivalent Systems of Linear Equations): Two systems are equivalent if they have the same set of solutions.
- Theorem 1.1: Basic operations that produce equivalent systems include:
- Multiplying an equation by a non-zero constant.
- Adding or subtracting equations.
- Replacing an equation with a linear combination of the other equations.
2x2 Systems
- Linear equations with two variables represent lines in the plane.
- Systems of two equations with two unknowns can represent:
- Parallel lines (incompatible, no solution).
- Intersecting lines (compatible determined, one solution).
- Overlapping lines (compatible indeterminate, infinite solutions).
- Examples with equations and graphs are given for each case.
Matrix Representation of a System
- A linear system of equations with variables can be represented by a matrix of coefficients (size ):
- Using the vector of independent terms and the vector of variables , the system can be written as , where and are the columns of matrix .
- Definition 1.4 (Product of a Matrix by a Vector):
- The augmented matrix combines the coefficient matrix and the vector of independent terms:
- Definition 1.5 (Rank of a Matrix): The rank of a matrix is the maximum number of linearly independent rows or columns.
- Definition 1.6: The number of degrees of freedom is given by .
Compatibility of a System
- The system of equations can be expressed as a linear combination of the columns of the coefficient matrix:
- The vector of independent terms, , is a linear combination of the columns of .
- The solution consists of the coefficients that allow obtaining as a linear combination of the columns of .
- The system is compatible if is a linear combination of the columns of .
- Theorem 1.2 (Rouche-Frobenius): A system of linear equations , where is an matrix, is compatible if the rank of equals the rank of the augmented matrix. If they coincide and the rank is (the number of unknowns), the system is compatible determined.
Solving Linear Systems
Gaussian Elimination
- Gaussian elimination transforms the original system into an equivalent one with an upper triangular coefficient matrix (coefficients below the diagonal are zero).
- Starting from the last rows, the variables are easily solved to obtain the solution.
- Permissible operations include:
- Interchanging equations.
- Multiplying an equation by a non-zero constant.
- Replacing an equation with a linear combination of itself and another equation.
- The operations are performed on the augmented matrix.
- Example 1.2 (Compatible Determined System): Example of solving a 3x3 system using gaussian elimination, showing steps on the augmented matrix and the resulting unique solution .
- Example 1.3 (Compatible Indeterminate System): Example of solving a 3x3 system with infinite solutions, showing steps on the augmented matrix and the resulting solution set depending on a parameter : .
- Example 1.4 (Incompatible System): Example of solving a 3x3 system with no solution, showing steps on the augmented matrix and the resulting contradiction .
Gauss-Jordan Elimination
- Gauss-Jordan elimination makes zeros above and below the diagonal until a reduced echelon matrix is reached.
- Definition 1.7 (Echelon Form): A rectangular matrix is in echelon form if:
- All non-zero rows are above rows of all zeros.
- The leading entry of a row is to the right of the leading entry of the row above it.
- Entries below a leading entry are zero.
- If a matrix in echelon form also satisfies:
- The leading entry of each non-zero row is 1.
- Each leading 1 is the only non-zero entry in its column.
Then it is in reduced echelon form.
- The leading entries form a staircase pattern.
- Every matrix is row equivalent to a unique reduced echelon matrix.
- Definition 1.8 (Pivot): A pivot is a non-zero number on the main diagonal used to create zeros below it.
- Example 1.5 (Water Supply Network Solution): Solving the system from Example 1.1 using Gauss-Jordan to derive the general solution depending on parameter :
Matrices
- Matrices are fundamental in linear algebra and used in science, engineering, computing, and other fields.
- A matrix is an ordered collection of numbers arranged in rows and columns, used to represent systems of linear equations, linear transformations, data, and other mathematical objects.
- Definition 1.9 (Matrix): A matrix stores data in a rectangular form using rows and columns. If is an row and column matrix, we denote it by , where is the coefficient in row , column .
Matrix Operations
Sum
- Definition 1.10 (Sum): If and are matrices of the same dimensions, the sum is .
- Example 1.6 (Matrix Sum): Calculating the total sales of a company by adding the sales from two warehouses, represented by matrices and .
Scalar Product
- Definition 1.11 (Scalar Product): If is a matrix and is a scalar (R or C), the product of a matrix by a scalar is .
- Example 1.7 (Scalar Product): Increasing salaries of employees by 10% using scalar product on the matrix of salaries .
Properties of Matrix Operations
- Theorem 1.3: If , , and are matrices of the same dimension, with scalars and , then:
- Commutative: .
- Associative: .
- Additive identity: , where is the zero matrix.
- Distributive: .
- Distributive: .
- Associative: .
Matrix Product
- Definition 1.12 (Matrix Product): Given matrices and such that the number of columns of equals the number of rows of , the product is defined as , where the columns are the product of matrix with the columns of (as in Definition 1.5). The element of the product is .
- Example 1.8 (Transformations in the Plane): The effect of some matrices on vectors in the plane:
- The matrix calculates the symmetric vector with respect to the x-axis.
- The matrix calculates the symmetric vector with respect to the y-axis.
- To obtain the symmetric point with respect to the origin, multiply:
- The matrix calculates the symmetric vector with respect to the x-axis.
Properties of the Matrix Product
- Theorem 1.4: If , , and are matrices (with suitable dimensions for the operations) and is a scalar, then:
- .
- .
- .
- .
- The matrix product is not commutative ().
Special Matrices
- Definition 1.13:
- Identity: A square matrix with ones on the diagonal and zeros elsewhere.
- Zero: A matrix where all coefficients are zero.
- Transpose: Given an matrix , its transpose is an matrix whose columns are the rows of .
- Orthogonal: A matrix is orthogonal if .
- Symmetric: A matrix such that (coefficients coincide).
- Identity: A square matrix with ones on the diagonal and zeros elsewhere.
- Theorem 1.5: If is an matrix, then:
- , where is the n-sized identity matrix.
- , where is the m-sized identity matrix.
Elementary Matrices
- Operations in Gaussian elimination can be performed by multiplying by elementary matrices, obtained from the identity matrix by:
- : Interchanging rows and .
- : Multiplying row by .
- : Adding times row to row .
- Example 1.9: Effects from premultiplying matrix A by elementary matrices:
- Swapping two rows.
- Multiplying a row by a scalar.
- Adding a multiple of one row to another row.
- Elementary matrices that premultiply a matrix perform the same row operations used to construct the elementary matrix. Post-multiplication performs column operations.
- Gaussian elimination becomes a sequence of elementary matrices premultiplying the augmented matrix.
- Definition 1.14 (Euclidean Scalar Product): Given vectors and , the Euclidean scalar product is .
- The element of the matrix product is the scalar product of the -th row of and the -th column of .
- Definition 1.15 (Power of a Matrix): If is a square matrix and a positive integer, then means multiplying k copies of . .
- Example 1.10 (Bird Population): Shows example of modeling a bird population with two age groups by expressing current and next-year populations with matrix operations
- Theorem 1.6: Given suitably sized matrices , and compatible for multiplication:
- .
- .
- .
Matrix Inverse
- Definition 1.16 (Matrix Inverse): Given a square matrix , its inverse, denoted , is a matrix such that . If is orthogonal (), then .
- Definition 1.17 (Invertible Matrix): An matrix is invertible if its inverse exists. If it exists, it is unique. A non-invertible matrix is singular, otherwise, it is non-singular.
- Theorem 1.7: If is an invertible matrix, the following statements are equivalent:
- The system has a unique solution, .
- The homogeneous system has the unique solution .
- The rows and columns of are linearly independent.
- Theorem 1.8:
- If is invertible, so is , and .
- If and are invertible and have compatible dimensions, then .
- If is invertible, so is , and .
- If is invertible, .
- Example 1.11 (Electrical Circuit): Example of equations derived from Ohm and Kirchhoff laws and then used for expressing the solution matrix notation
Finding Inverse using Gaussian Elimination
- For an invertible coefficient matrix from Example 1.11, the inverse is calculated by applying Gaussian elimination until reaching the identity matrix, performing the same operations on the identity matrix to obtain the inverse.
Alternative Formulas to Calculate the Inverse
- For a 2x2 matrix , if , then .
- The term is the determinant of the matrix.
Determinants
Introduction
- In linear algebra history, determinants appeared for resolution of system of equations even before the matrix concept.
- Defined as a number associated with a square matrix, allowing us to check for invertibility or not. Vital in the resolution and interpretation of linear system of equations.
Determinant of a Matrix
- From solving a 2-equation 2-unknown system. If ,
- After Gauss elimination, we can see now the solution is:
- Note that there is single solution if .
- Definition 2.1: Given a matrix A, The determinant is.
- Definition 2.2: For any matrix A, define it's minor associated with , denoted by , which is the determinant of the submatrix , obtained by removing the i row and j column.
- and is called Cofactor
- The definition allows defining it recursively of ANY square matrix:
- Definition 2.3: A determinant of A is the sum of entries of any row of A multiplied by the cofactors, , or the sum of any column
- Example 2.1 In the previous example of electrical circuit, can verify it is invertible because determinant is not zero: |A| = 8 !=0 (development with first row cofactors)
- To compute determinants of 3 by 3 can use Sarrus rule. for any then
Additional Properties
- If A is Diagonal, then the Determinant is just the diagonal elements multiplied.
- If A is a squared matrix, then:
- If a multiple is added to a row the determinant does not change.
- If two rows are swapped, then determinant times -1.
- If any row is multiplied by a constant, then the determinant is multiplied by the constant.
- Also
- If another B exists $det(AB) = det(A)det(B)
- But
- Given an scalar rho,
More Theorems
- Squared Matrix A is invertible if and only if the Determinant is Not Zero
- If A is a Squared matrix and if one of those conditions is valid, then the Determinant equals 0 :
- The row is fully zero.
- Two Rows equal.
- One row as linear combination of the rest of rows.
- Example 2.2 A message is encoded numerically. Use Matrix multiplication to hide the message.
Rank Of a Matrix
- Definition 2.4: The range is the biggest size minor after trying the non-null minors submatrix
- Theorem 2.5: Range does not change if:
- Rows or Columns are interchanged.
- Rows or Columns are transposed.
- Row/Column times scalar number.
- Row/Column sum of the Row/Column times scalar number..
Computing the Range
- Orlado's Method.
- Gauss triangulation.
Use for Inverses With Determinants
- Definition 2.5: Given A, its adjoint matrix .
- Theorem 2.6: Given A, then the Invert is
Vectorial Spaces
Introduction
- Vector operations can be represented as directions with Length and Direction.
Operations such as sums and scaling functions (multiplying the vector with a scalar number are defined - Definition 3.1 Vectorial Space : Given a set V operations internal + and external *. Such that an element in K(R or C) times V results again in V, then it says V is a vectorial space or vector space, where:
- Respecting Internal Operation (+) :
u+velement of V ;u + v = v + u;u+(v+w) = (u+v)+w
V has a Zero such thatu+0=ufor all Elements in V, V has a negative such thatu + (-u) = 0 - Respecting External Operation (*) :
a * uis in Va *(u + v) = a * u + a * v;(a + B)* u = a * u + B * ua(B * u) = (aB)*u
The Neutral elements results again in u,1 * u = u, The opposed of elements.
- Respecting Internal Operation (+) :
- A Vectorial space always has One 0 and just One opposed element
Examples and Non-Examples
- Example 3.1: Real Numbers N-tuple with sum and Scalar Product, Complex numbers (same), Also the set fo Matrix mXn has vector behavior, Polynomials of Grade minor than or Equal to 2, or Continuos functions on a point a/b .
- Example 3.2: Matrix 2X2 is not valid, Polynomias Grade EQUAL to 2 NOT valid.
The zero is no valid.
Sub-Spaces
- Definition 3.2: A not empty V subset of, where the Internal Sum and External escalar product are defined is a sub-space if they have vectorial Space with the SAME operations.
- Checking Vectorial Space W!=0, W is subspace of V if, If
u,vinside W, thenu + Vin W, If inside W scalara*uinside W.
Zero Siempre in subspace, If a vector and its opposite exist in the subspace then by add they give zero. - Example 3.3: Test if W is a subspace in R3. A test example. Comply those two theoream valid then W is Subspace.
Theorem3.2 The generated combination for ANY number of vectors inside a vectorial Space ,is still a vectorial Sub-space.
Nul Space
Example 3.7 A flux across streets needs solving:
System description - Question- What King of Solutions has this system? What grades of freedom ,And what if you let variables free?.
-Its solution results in the next vectorial subSpace.
Definition 3.3 The nul spacio of a matrix of dimensions m x n, N ul(A), are all the set of a Homogeneus system Ax =0
Theorem 3.3 Te nul spacio of a matrix has dimension m x n, N ul(A), is a vectorial subSpace f Kn
Linear Dependency
- **Definition 3.4 Combination lineal de vectores **. A Vector inside V is combination lineal.
v = r1u1 + r2 u2... - Definition 3.5 vectores Lineal Independientes They are lineally independent if, in any combination lineal that equals the zero vector ,the sole possible results are Zero Coefficient.
- If not this way, those are define s Lineal Dependency.
Base and Dimensions
- Definition 3.6 Generator System. Are those that form a Base, when a vector is combination Lineal.
- Definition 3.7 Base. Set fo Vectors inside vectorial space called System, when
Are independent. Generate
Then any generator vector to find a BAse is needed find the Higher number of independent Vectors
Theorem 3.4 Any basis inside some vectorial space, has a Same Number of Vectors ,all this
Definition 3.8 The canonical Base of vectorial Space ,such base is:
Definition 3.9 Coordinates. For vectorial V, If B vectors are Base ,and V can be described Thenpits coordinates given B
If you have and, you need a Base, it requires finding what maximal independents vectors exist. and calculate de Range with new vetors, adding.
, If any, that is not, add others vectos find the Lineal independents for generate the B.
Intersections and adds Inside vectoriale Space.
- Add : vector that is described sum in subspaces. for those Subdpace if any, It will give its generating set,
- Sum:. Find independent base there inside the sum set, has high independents.