SIT292 - Linear Algebra for Data Analysis Problem Solving Task 2
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
SIT292 - Linear Algebra for Data Analysis
Problem Solving Task 2
Trimester 2, 2022
1 Section A - Complete all problems
Each question is worth 5 marks and will be graded based on correctness of solution, explanation, and understanding demonstrated.
The additional Quality of explanation and use of notation mark will be assessed against the following standards:
Mark Description
5 Exceptional
4 Clear explanations and fluent use of notation
2-3 Overall comprehensible explanations and mostly free of notation errors
1 Lacking in clarity, detail, or significant misunderstandings with regard to notation
0 Very little shown in terms of explanation
1. Linear independence and rank
Consider 4 column vectors: and , with x,y,z ∈ R.
i. Identify values of x,y,z such that the four vectors are linearly independent. Be sure to provide reasoning (e.g., along the lines of the statement in 4.1.4 of the Study Guide) and demonstrate that linear independence is satisfied.
ii. Identify values of x,y,z such that the four vectors are linearly dependent, but any three of the vectors taken together are linearly independent.
iii. In part (ii), showing the rank of the 4 × 4 matrix formed from your vectors to be 3 would not generally be a sufficient argument. Why not?
5 marks
2. Calculating an inverse matrix
Consider the following system Ax = b:
「(l)1 2(0) 1 x = 「(l)−10(5)
i. Calculate the cofactors Cij for each entry in the matrix A and hence find adj(A).
ii. Calculate the determinant of A and hence use A−1 to solve for x. 5 marks
3. Systems of Linear Equations
For the following system of equations,
x1 + 2x2 − x3 = 5
x2 + 3x3 = −2
−x1 − 6x2 − 11x3 = 3
i. Represent the system as an augmented matrix, and then solve the system using the following Steps:
Step 1 - Use multiples of Row 1 to eliminate the x3 entries in rows 2, 3 and 4. Step 2 - Use Row 2 to eliminate the x2 entry in rows 3 and 4.
Step 3 - Set x1 as the free variable and then express each of x2 ,x3 in terms of x1 .
ii. Set x1 to any integer in [2, 5] and then to any integer in [−5, −2] and verify that this results in a valid solution to the system using matrix multiplication.
iii. Justify the existence of unique/infinite solutions using the concept of matrix rank.
5 marks
4. Gaussian Elimination
Use Gaussian Elimination to reduce the following system of equations to row-echelon form, hence solve for x1 ,x2 ,x3 ,x4 .
2x1 − 5x2 + 2x4 = −3
8x1 − 20x2 + 3x3 = −21
−4x1 + 10x2 + 3x3 − 4x4 = 1
5 marks
5. Gauss-Jordan Elimination
Consider the following matrix, A:
A = l」
「3 −1 1
i. Use the Gauss-Jordan elimination method (Starting with the augmented matrix [A|I]) to find the inverse A−1 .
ii. Hence find the matrix B such that AB = l」
「9 2 .
5 marks
6. Eigenvectors and Eigenvalues For the following matrix A: A = l 0(1) 「−1 |
0 3 0 |
|
i. Calculate A「(l) and A「(l) , then comment on whether or not these vectors are eigenvectors of A. If they are, give the corresponding eigenvalues.
ii. Find the characteristic equation using the form
D(λ) = b3 λ3 + b2 λ2 + b1 λ + b0
and calculating the coefficients b0 ,b1 ,b2 ,b3 using the formulas on page 17 of the study guide (Topic 6 – and e.g., see online module 6.3. b2 = −tr(A) in this case).
iii. Now identify the characteristic equation D(λ) in factorised form by first expanding the determinant |λI − A|. (Hint: you should be able to factor out one of the (λ − aii) factors first, and then expand and factorise the resulting quadratic equation)
iv. Use the factorised form of D(λ) to identify the eigenvalues of A, and then solve (λI−A)x = 0 to find all eigenvectors not identified in part (i).
5 marks
7. Matrix Similarity
i. For the matrices A and B provided below, based solely on the determinants and characteristic equations, comment on whether or not it might be possible that a matrix P exists such that P−1 AP = B . (You do not need to find the matrix P)
A = [1(3)
5(3)] ,
B = [0(3)
2]
ii. The following two matrices are similar. Find the matrices P and P −1 such that P−1 AP = B
A = [2(2) 4(0)] , B = ]
iii. Give one further example of a matrix C that is similar to A and B .
5 marks
8. Diagonalisation
Consider the matrix
A = 6(14) 1
−12
−10
2
J
3
i. Determine the characteristic equation D(λ) for A.
ii. Show that D(−1) = 0 and use this information to factorise the characteristic equation using polynomial division and find the remaining eigenvalues. Comment on whether or not we can tell if A is diagonalisable at this stage.
iii. Find the corresponding eigenvectors.
iv. Construct P from the eigenvectors, then find P −1 (either using Gauss-Jordan elimination or the cofactors method) and then check P−1 AP to verify the correctness of your solutions.
5 marks
2 Section B - Choose 3 out of 5
Choose 3 of the following problems (if you complete more than 3, only the first three appearing in your work will be assessed). Each question is worth 5 marks and will be graded based on correctness of solution, explanation, and understanding demonstrated.
The Quality of explanation and use of notation mark will be assessed against the same standards as for Section A:
Mark Description
5 Exceptional
4 Clear explanations and fluent use of notation
2-3 Overall comprehensible explanations and mostly free of notation errors
1 Lacking in clarity, detail, or significant misunderstandings with regard to notation
0 Very little shown in terms of explanation
1. Orthogonal Matrices
i. Identify a set of values a,b,c such that the columns of the following matrix are mutually orthogonal.
A = l 1(2) 「b ii. Calculate AA⊤ |
−1 c −1 |
2」 −5 |
iii. Use your answer in (i) to determine an orthogonal matrix B and verify that B⊤ = B−1
5 marks
2. Writing Eigenvector Examples
Using random matrices for practicing eigenvector and eigenvalue questions will often result in non-integer values that are confusing and tedious to calculate. Use the following to reverse engineer a question.
i. Give three simple, linearly independent column vectors x1 , x2 , x3 ∈ R3 . Ensure that they each have at least 2 non-zero entries, and that one of your values is negative. (these are your eigenvectors)
ii. Pick three eigenvalues, λ 1 ,λ2 ,λ3 . Use integer values, and have one of your λi such that λi < 0.
iii. We know that Ax = λx for each of your eigenvectors. Hence set up a system AX = B where X = [x1x2x3] is the matrix with your eigenvectors as columns, and solve for A.
3. Balancing Traffic Flow
Consider the directed graph below showing hourly traffic in and out of 4 intersections. The variables x1 ,x2 ,x3 ,x4 indicate the amount of traffic travelling between intersections.
200
100
1
D
4
C
x3
300
200
i. For each vertex, we assume that the flow of traffic into the vertex (along edges directly connected to the vertex only) is equal to the flow of traffic away from the vertex. Write an equation modeling the flow of traffic for each vertex in terms of the variables x1 ,x2 ,x3 ,x4 .
ii. Based on the four equations from (i), solve the system. Interpret your solution in context.
4. LU form of matrices
i. Use the LU decomposition method to find L and U for the following matrix (without using software or a graphics a calculator).
l 」
=
「
Note: Sometimes it is easier to calculate L and U without re-writing partial matrices as separate steps. You can set out your working, e.g. as:
l 2(1) 1 A = 2 |
0(1) 3(0)」 l = 0 1 |
0 |
0 0 |
|
|
1 0 0 |
1 0 |
」 = |
and then just provide some annotations below as you fill out the entries. enough working to demonstrate that you can follow the process.
ii. After you have LU , calculate the determinant using determinant property (ii) of 3.2.4 in the Study Guide)
You just need to show
properties (i.e., using
l 2(4) 」 l2(4) 」
iii. Suppose Ax = 「3 . Solve for x by first solving Ly = 「3 for y and then using this vector to solve Ux = y for x.
5 marks
5. Triangularisation with an orthogonal matrix
Example 7.9 in the Study Guide (pages 21-23 of Topic 7) shows the triangularisation procedure for a matrix. Consider the following matrix A, which also has eigenvalues 1, 1 and 5.
A = l 」
「−1 −1 2
i. Construct a matrix S such that it is an orthogonal matrix with the first column corresponding
with the eigenvector l 」0(1)
ii. Show that for the resulting matrix, S−1 AS = ], the 2 × 2 matrix A1 has eigenvalues
1 and 5 by determining and then simplifying its characteristic equation.
iii. Find the eigenvector from A1 corresponding with λ = 1 and then construct an orthogonal 2 × 2 matrix Q where the first column is based on your eigenvector. Hence construct the matrix
R = l 0(1 0 0) 」
「 0 Q .
iv. Calculate P = SR. Show that P is an orthogonal matrix and verify that P−1 AP is upper triangular.
5 marks
3 Section C - Choose 1 out of 3
Choose 1 of the following problems (if you complete more than 1, only the first submitted will be as- sessed). Write up your solution and results so that it could be understood by someone else completing SIT292, including all required working, investigations and relevant observations. Make connections with the unit material where appropriate and provide references for any external resources used. High quality partial solutions and explorations can also receive high marks.
You will be given a mark out of 10 according to the following standards:
Mark Description
9-10 Exceptional
7-8 Solution or partial solution is clearly presented with
sound understanding and insight demonstrated.
4-6 Solution demonstrates engagement with the problem,
good understanding and little in the way of misunderstandings
or reasoning errors.
2-3 Misunderstandings or errors in reasoning apparent in solution
provided. Some understanding demonstrated.
0-1 Not attempted or little to no understanding demonstrated.
1. From Theorem 7.1 in the study guide (and Corollary 1), we know that if we have n distinct eigenvalues for a n × n matrix, then we will be able to find linearly independent eigenvectors and hence diagonalise the matrix.
i. For a 2 × 2 matrix [c(a) d(b)], algebraically determine conditions that would lead to (a) distinct eigenvalues, (b) a repeated eigenvalue with only one non-linearly independent vector, and (c) a repeated eigenvalue with two linearly independent vectors.
ii. Hence provide original examples of each type.
iii. Can you find any similar conditions for the different cases for a 3 × 3 matrix?
10 marks
2. Use the R code below to generate and plot a random 2D dataset. You can use R / R studio, or you can also copy then replace the code in one of the code windows in the online modules (a separate .txt file will be available in the assignment folder for this question so that you can
copy and paste it)
x <- rnorm(1000,0,2) y <- rnorm(1000,0,2/3) data <- cbind(x,y) ang <- pi/8
# generate normally distr . x-data, mean=0, sd = 2 # generate normally distr . y-data, mean=0, sd = 2/3 # combine x and y data together
# set an angle of rotation
# rotate the data
for(i in 1:nrow(data)) {
data[i,] <- matrix(
c(cos(ang),sin(ang),-sin(ang),cos(ang)),
nrow=2,ncol=2) %*% matrix(data[i,],nrow=2)
}
plot(data) # generate plot of the data after rotation
cov(data) # calculate the covariance matrix
i. Take a screenshot of the plot and write down the values of the covariance matrix.
ii. Approximate the covariance matrix as [1(3) 1(1)] and find the eigenvalues and eigenvectors.
iii. Add arrows to the plot representing your two eigenvectors.
vi. Adapt the code to make your own example with differently distributed data and follow steps i-iii. Comment on any relationship(s) you observe between the covariance matrix values and the eigenvectors.
10 marks
3. (This option requires you to be able to differentiate exponential functions and hence will be easier if you have completed SIT194 and SIT291).
Eigenvectors can be used to solve systems of differential equations. For example, let y be a
column vector whose entries are functions of t, i.e. y = ]. The system of differential
equations:
= ay1 (t) + by2 (t)
= cy1 (t) + dy2 (t)
or in matrix form,
= [c(a) d(b)] y
has the general solution
y = k1 eλ 1 tx1 + k2 eλ2 tx2
where λ1 ,λ2 are the eigenvalues and x1 , x2 are the eigenvectors of the matrix [c(a) d(b)].
i. Find the eigenvalues and eigenvectors of [1(3) 1(1)].
ii. Choose k1 = 1 and k2 = −1 and verify that the solution solves the system of differential equations.
iii. Determine the values of k1 and k2 if we are given the initial conditions that
y(0) = ] = [ ]2(1) .
iv. Use the same method to find the general solution to the following second order differential equation. Check that your solution seems correct by setting k1 = k2 = 1 and subbing into the equation.
y\\ − 5y + 4y\ = 0
(Hint: you can set your two functions as y1 (t) = y(t) and y2 (t) = y\ (t) and then express y\\ (t) in terms of y1 and y2 – this should allow you to set up the system in the form above and obtain the general solution.)
10 marks
2022-09-24