Cs301 Midterm Preparation
Cs301 Midterm Preparation
Question 1:
that
⃗ + 𝑣 ) = 𝑇(𝑢)
𝑇(𝑢 ⃗⃗⃗⃗ , 𝑤ℎ𝑒𝑟𝑒 𝐴 = [3 1] ,
⃗⃗⃗⃗ + 𝑇(𝑣) 𝑢
2 3
⃗ = [ ],𝑣 = [ ]
0 1 1 1
Solution:
2 3 5
𝑢
⃗ +𝑣 =[ ]+[ ]=[ ]
1 1 2
⃗ + 𝑣) = 𝐴(𝑢
𝑇(𝑢 ⃗ + 𝑣)
3 1 5 17
=[ ][ ] = [ ]
0 1 2 2
⃗⃗⃗⃗ = 𝐴(𝑢 3 1 2
Now 𝑇(𝑢) ⃗)=[ ][ ]
0 1 1
7
=[ ]
1
⃗⃗⃗⃗ = [3 1] [3] = [10]
𝑇(𝑣)
0 1 1 1
−2 4 1 3
If 𝐴 = [ ] 𝑎𝑛𝑑 𝐵 = [ ], then check either B is a multiplicative inverse of A or
3 −1 4 −1
not?
Solution:
−2 4 1 3 −2 + 16 −10
LHS= 𝐴𝐵 = [ ][ ]=[ ]
3 −1 4 −1 3−4 9+1
14 −10
=[ ]
−1 10
1 3 −2 4 −2 + 9 4 − 3
RHS= 𝐵𝐴 = [ ][ ]=[ ]
4 −1 3 −1 −8 − 3 16 + 1
7 1
=[ ]
−11 17
Since 𝐴𝐵 ≠ 𝐼 ≠ 𝐵𝐴, therefore, B is not a multiplicative inverse of A.
Question 3:
Solution:
Since 𝐴𝑥 = 𝑏⃗ 𝑎𝑠 𝐴 = 𝐿𝑈, 𝑠𝑜
⃗⃗⃗⃗ = 𝑏⃗
(𝐿𝑈)𝑥 = 𝑏⃗ 𝑜𝑟 𝐿(𝑈𝑥)
1 2 𝑥 4
[ ] [𝑦] = [ ]
0 1 3
𝑥 + 2𝑦 4
[ ]=[ ]
𝑦 3
Thus 𝑦 = 3 𝑎𝑛𝑑 𝑥 + 2(3) = 4 𝑖𝑚𝑝𝑙𝑖𝑒𝑠 𝑥 = −2
Hence, the solution of the above linear system is
𝑥 = −2, 𝑦 = 3
Question 4:
Compute the two iterations for the following system of equations by using Jacobi’s method:
.
Solution:
Iteration 1:
25 + x 2
0
1
x 1
=
10
=(25 + 0) / 10 = 2.5
43 − x1
0
1
x 2
=
8
= (43) / 8 = 5.375
so
= (2.5,5.375)
(1)
x
Iteration 2:
25 + x 2
1
=
2
x 1
10
= (20 +5.375) / 10 = 3.0375
43 − x1
1