Consistent systems:
Inconsistent systems:
Free Variable:
Rankof a Matrix:
VECTOR %*% VECTOR:
The vector must satisfy this condition:
ncol(VECTOR_1) == nrow(VECTOR_2)
COMPUTATIONALLY:
MATRIX %*% VECTOR:
The vector must satisfy this condition:
length(VECTOR) == ncol(MATRIX)
COMPUTATIONALLY:
Geometrically, Ax is some linear-transformation of the vector x due to A
MATRIX %*% VECTOR in terms of COL OF A:
Ax where x is unknown, is:
Ax = (x_1 * v_1) + (x_2* v_2) + … + (x_col* v_col)
COMPUTATIONALLY:
Linear Combinations:
A vector 𝑏 is a linear combination of the columns of a matrix 𝐴 (or individual vectors = col) summed.
Meaning for every augmented matrix (system of linear equations), there exists the matrix form which separates the matrix and vector of unknowns equal to a matrix of the solutions of each linear equation.
Q1:
# HOW MANY SOLUTIONS DOES EACH SYSTEM HAVE?
#1a: NO SOLUTION
#1b: 1 SOLUTION
#1b: INF SOLUTIONS
Q2:
# Rank(A) == ?
mat <- rbind(1:3, c(0,1,2), c(0,0,1))
mat #rank must be 3 or less
## [,1] [,2] [,3]
## [1,] 1 2 3
## [2,] 0 1 2
## [3,] 0 0 1
mat[1, ] <- mat[1, ] - (2 * mat[2,])
mat[1, ] <- mat[1, ] + mat[3, ]
mat[2, ] <- mat[2, ] - (2 * mat[3, ])
cat("rref: ")
## rref:
mat
## [,1] [,2] [,3]
## [1,] 1 0 0
## [2,] 0 1 0
## [3,] 0 0 1
#Notice 3 1's, Therefore, rank == 3
rank <- qr(mat)$rank
cat("rank: ", rank)
## rank: 3
Q3:
# Rank(A) == ?
mat <- matrix(rep(1,9), nrow = 3)
mat
## [,1] [,2] [,3]
## [1,] 1 1 1
## [2,] 1 1 1
## [3,] 1 1 1
mat[1, ] <- mat[1, ] - mat[2, ]
mat[2, ] <- mat[2, ] - mat[3, ]
mat[1, ] <- mat[3, ]
mat[3, ] <- mat[2, ]
cat("\n rref: ")
##
## rref:
mat
## [,1] [,2] [,3]
## [1,] 1 1 1
## [2,] 0 0 0
## [3,] 0 0 0
rank <- qr(mat)$rank
cat("rank: ", rank)
## rank: 1
Q4:
# Rank(A) == ?
mat <- matrix(1:9, nrow = 3, byrow = FALSE)
mat
## [,1] [,2] [,3]
## [1,] 1 4 7
## [2,] 2 5 8
## [3,] 3 6 9
mat[2, ] <- mat[2, ] - (2 * mat[1, ])
mat[3, ] <- mat[3, ] - (3 * mat[1, ])
mat[2, ] <- mat[2, ] / -3
mat[3, ] <- mat[3, ] / -6
mat[1, ] <- mat[1, ] - (4 * mat[2, ])
mat[3, ] <- mat[3, ] - mat[2, ]
cat("\n rref: ")
##
## rref:
mat # rank == 2
## [,1] [,2] [,3]
## [1,] 1 0 -1
## [2,] 0 1 2
## [3,] 0 0 0
rank <- qr(mat)$rank
cat("rank: ", rank)
## rank: 2
Q13:
# Matrix vector multiplication:
mat <- cbind(c(1,2), c(2,4))
vec <- c(7,11)
identical(mat %*% vec, as.matrix(c(7 + 22, 14 + (11 * 4))))
## [1] TRUE
1.3, Q5:
\[ \text{Augmented matrix form:} \quad \left[\begin{array}{ccc} 1 & 2 & 7 \\ 3 & 1 & 11 \end{array}\right] \]
\[ \text{vector form:} \quad \begin{bmatrix} 1 \\ 3 \end{bmatrix} x_1 + \begin{bmatrix} 2 \\ 1 \end{bmatrix} x_2 = \begin{bmatrix} 7 \\ 11 \end{bmatrix} \]
1.3, Q14:
# Matrix vector multiplication:
mat <- rbind(c(1,2,3), c(2,3,4))
vec <- c(-1,2,1)
identical(mat %*% vec,rbind(c(-1 + 4 + 3), c(-2 + 6 + 4)))
## [1] TRUE