Lecture Notes
Semester 1
Vector and Matrix Theory
Exam Problems

Exam Problems


The Complete Solution to Ax=bAx = b

💡
The Complete Solution to Ax=b (45 points)\text{\textbf{The Complete Solution to $Ax = b$ (45 points)}}

Suppose that we have a matrix AA given by:

A=[v1Tv2Tv3Tv4Tv5T]A = \begin{bmatrix} v_{1}^T & v_{2}^T & v_{3}^T & v_{4}^T & v_{5}^T \end{bmatrix}

where v1,v2,v3,v4,v5v_1, v_2, v_3, v_4, v_5 are the columns of AA defined as follows:

v1=[1β53β54β5]v2=[2β46β48β4]v3=[3β39β31β3]v4=[1β22β23β2]v5=[2β15β17β1]\begin{align*} v_1 &= \begin{bmatrix} 1\beta_5 & 3\beta_5 & 4\beta_5\end{bmatrix}\\ v_2 &= \begin{bmatrix} 2\beta_4 & 6\beta_4 & 8\beta_4\end{bmatrix}\\ v_3 &= \begin{bmatrix} 3\beta_3 & 9\beta_3 & 1\beta_3\end{bmatrix}\\ v_4 &= \begin{bmatrix} 1\beta_2 & 2\beta_2 & 3\beta_2\end{bmatrix}\\ v_5 &= \begin{bmatrix} 2\beta_1 & 5\beta_1 & 7\beta_1\end{bmatrix} \end{align*}

where β1,β2,β3,β4,β5\beta_1, \beta_2, \beta_3, \beta_4, \beta_5 are arbitrary natural numbers from Nomor Induk Universitas.

  1. Determine the Reduced Row Echelon Form of AA.

  2. Determine the basis of C(A)C(A) from the columns of AA and what is the dimension of C(A)C(A)?

  3. Determine the Nullspace N(A)N(A) from the columns of AA and what is the dimension of N(A)N(A)?

  4. Suppose that you are given the following vector bib_i:

    • b1=[1β24β25β2]b_1 = \begin{bmatrix} 1\beta_2 & 4\beta_2 & 5\beta_2 \end{bmatrix}
    • b2=[2β14β15β1]b_2 = \begin{bmatrix} 2\beta_1 & 4\beta_1 & 5\beta_1 \end{bmatrix}

    Which bib_i leads to solvable Ax=biAx = b_i? and why?

  5. Determine the complete solution x=xp+xnx = x_p + x_n for Ax=bAx = b using the correct bib_i from the previous question.

  6. Gunakan hasil dari soal nomor 2 untuk mencari matriks proyeksi PP ke C(A)C(A).

  7. Tentukan vektor proyeksi dari bib_i ke C(A)C(A), yaitu PbiPb_i.

Answer:

🚫

Konstanta βi\beta_i irrelevan dengan operasi baris!

Perhatikan contoh berikut:

Rowa=u(βi)rowav(βi)rowbRowa=βi(u rowav rowb)\begin{align*} \text{Row}_a &= u(\beta_i)\text{row}_a - v(\beta_i)\text{row}_b\\ \text{Row}_a &= \beta_i (u\ \text{row}_a - v\ \text{row}_b) \end{align*}
  1. Bentuk matriks AA adalah sebagai berikut:

    A=[123123692548137][β5β4β3β2β1]A = \begin{bmatrix} 1 & 2 & 3 & 1 & 2\\ 3 & 6 & 9 & 2 & 5\\ 4 & 8 & 1 & 3 & 7 \end{bmatrix} \begin{bmatrix} \beta_5\\ \beta_4 \\ \beta_3 \\ \beta_2 \\ \beta_1 \end{bmatrix}

    Bentuk rref nya adalah:

    rref(A)=[120010010000011]\text{rref}(A) = \begin{bmatrix} 1 & 2 & 0 & 0 & 1\\ 0 & 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 1 & 1 \end{bmatrix}

    dengan matriks EE:

    E=[8/113/113/111/111/111/11310]E = \begin{bmatrix} 8/11 & -3/11 & 3/11 \\ 1/11 & 1/11 & -1/11 \\ 3 & -1 & 0 \end{bmatrix}
  2. Basis dari C(A)C(A) adalah kolom-kolom dari AA yang memiliki pivot, yaitu kolom 1, 3, dan 4. Sehingga basisnya adalah:

    β5[134],β3[391],β2[123]\beta_5 \begin{bmatrix} 1\\ 3\\ 4 \end{bmatrix}, \beta_3 \begin{bmatrix} 3\\ 9\\ 1 \end{bmatrix}, \beta_2 \begin{bmatrix} 1\\ 2\\ 3 \end{bmatrix}

    Dimensi dari C(A)C(A) adalah 3.

  3. Nullspace N(A)N(A) adalah kolom-kolom dari AA yang tidak memiliki pivot, yaitu kolom 2 dan 5. Sehingga basisnya adalah:

    β4[268],β1[257]\beta_4 \begin{bmatrix} 2\\ 6\\ 8 \end{bmatrix}, \beta_1 \begin{bmatrix} 2\\ 5\\ 7 \end{bmatrix}

    Dimensi dari N(A)N(A) adalah 2.

  4. Perhatikan bahwa rref(A)\text{rref}(A) memiliki 3 pivot, dan komponennya berdimensi tiga. Sehingga Ax=bAx = b memiliki solusi unik untuk setiap kemungkinan bb. Jadi, kedua bib_i dapat diselesaikan.

  5. Solusi lengkap dari Ax=bAx = b adalah:

    • Untuk b1b_1: x=xp+xnx = x_p + x_n:

      [R b1]=[120012001000000111]\begin{align*} [R \ b_1] = \begin{bmatrix} 1 & 2 & 0 & 0 & 1 & 2\\ 0 & 0 & 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 1 & 1 & -1 \end{bmatrix} \end{align*} x=xp+xnx=[20010]xp+β2[21000]+β1[10011]xn\begin{align*} x &= x_p + x_n \\ x&= \underbrace{\begin{bmatrix} 2\\ 0\\ 0\\ -1\\ 0 \end{bmatrix}}_{x_p} + \underbrace{\beta_2\begin{bmatrix} -2\\ 1\\ 0\\ 0\\ 0 \end{bmatrix} + \beta_1\begin{bmatrix} -1\\ 0\\ 0\\ -1\\ 1 \end{bmatrix}}_{x_n} \end{align*}
    • Untuk b2b_2: x=xp+xnx = x_p + x_n:

      [R b2]=[120013/11001001/11000112]\begin{align*} [R \ b_2] = \begin{bmatrix} 1 & 2 & 0 & 0 & 1 & -3/11\\ 0 & 0 & 1 & 0 & 0 & 1/11\\ 0 & 0 & 0 & 1 & 1 & 2 \end{bmatrix} \end{align*} x=xp+xnx=[3/1101/1120]xp+β2[21000]+β1[10011]xn\begin{align*} x &= x_p + x_n \\ x&= \underbrace{\begin{bmatrix} -3/11\\ 0\\ 1/11\\ 2\\ 0 \end{bmatrix}}_{x_p} + \underbrace{\beta_2\begin{bmatrix} -2\\ 1\\ 0\\ 0\\ 0 \end{bmatrix} + \beta_1\begin{bmatrix} -1\\ 0\\ 0\\ -1\\ 1 \end{bmatrix}}_{x_n} \end{align*}

Least Squares Approximation and Gram-Schmidt Process

💡
Least Squares Approximation and Gram-Schmidt Process (40 points)\text{\textbf{Least Squares Approximation and Gram-Schmidt Process (40 points)}}

Consider a simple heating system consisting of a voltage source, a coil, and cooling liquid.

Basic principle: The coil is connected to the voltage source v(t)v(t) which delivers electric power to heat the coil to temperature y(t)y(t). The coil submerged in the cooling liquid with temperature r(t)r(t). The electric energy is proportional to v2(t)v^2(t).

You want to model the heating system in the following form:

y(t)=av2(t)+by(t1)+cr(t1)y(t) = av^2(t) + by(t - 1) + cr(t - 1)

where a,b,ca, b, c are unknown constants.

  1. [8 points] Consider you have taken the following measurements for every 0.5 second for 2 seconds:

    tt (second)v(t)v(t) (volt)y(t)y(t) (degree Celcius)r(t)r(t) (degree Celcius)
    00v(0)v(0)y(0)y(0)r(0)r(0)
    0.50.5v(0.5)v(0.5)y(0.5)y(0.5)r(0.5)r(0.5)
    11v(1)v(1)y(1)y(1)r(1)r(1)
    1.51.5v(1.5)v(1.5)y(1.5)y(1.5)r(1.5)r(1.5)
    22v(2)v(2)y(2)y(2)r(2)r(2)

    Show that this problem can be written in the form of Y=AxY = Ax where YY is the vector of y(t)y(t), AA is the matrix of v2(t)v^2(t), y(t1)y(t - 1), and r(t1)r(t - 1), and xx is the vector of aa, bb, and cc.

  2. [6 points] Consider you are now given numerical data as follows.

    Determine the matrix AA in equation Y=AxY = Ax and calculate the approximation of xx using the least squares method!

    tt (second)v(t)v(t) (volt)y(t)y(t) (degree Celcius)r(t)r(t) (degree Celcius)
    0020β120\beta_130β230\beta_230β330\beta_3
    0.50.520.5β120.5\beta_132β232\beta_230.1β330.1\beta_3
    1119.5β119.5\beta_131.5β231.5\beta_230.5β330.5\beta_3
    1.51.518.5β118.5\beta_131β231\beta_231.2β331.2\beta_3
    2219β119\beta_130.5β230.5\beta_231.3β331.3\beta_3
  3. [6 points] Determine the projection YY onto C(A)C(A) and what is the projection matrix PP in this case?

  4. [5 points] What is the squared error incurred by the approximate solution xx?

  5. [8 points] Perform QRQR decomposition using Gram-Schmidt process for the matrix AA above.

  6. [7 points] Repeat the last square appproximation using the QRQR decomposition instead of AA to determine xx. What is the projection matrix in this case?

Answer:

  1. Bentuk matriks AA adalah sebagai berikut:

    A=[v2(t)y(t1)r(t1)]A = \begin{bmatrix} v^2(t) & y(t - 1) & r(t - 1) \end{bmatrix}

    Bentuk vektor YY adalah sebagai berikut:

    Y=[y(t)]Y = \begin{bmatrix} y(t) \end{bmatrix}

    Bentuk vektor xx adalah sebagai berikut:

    x=[abc]x = \begin{bmatrix} a\\ b\\ c \end{bmatrix}

    Sehingga, Y=AxY = Ax:

    [y(t)]=[v2(t)y(t1)r(t1)][abc]\begin{bmatrix} y(t) \end{bmatrix} = \begin{bmatrix} v^2(t) & y(t - 1) & r(t - 1) \end{bmatrix} \begin{bmatrix} a\\ b\\ c \end{bmatrix}
  2. Bentuk matriks AA adalah sebagai berikut:

    A=[420.25β1230β230β3380.25β1232β230.1β3342.25β1231.5β230.5β3361β1231β231.2β3]A = \begin{bmatrix} 420.25\beta_1^2 & 30\beta_2 & 30\beta_3\\ 380.25\beta_1^2 & 32\beta_2 & 30.1\beta_3\\ 342.25\beta_1^2 & 31.5\beta_2 & 30.5\beta_3\\ 361\beta_1^2 & 31\beta_2 & 31.2\beta_3\\ \end{bmatrix}

    Bentuk vektor YY adalah sebagai berikut:

    Y=[32β231.5β231β230.5β2]Y = \begin{bmatrix} 32\beta_2\\ 31.5\beta_2\\ 31\beta_2\\ 30.5\beta_2 \end{bmatrix}

    Bentuk vektor xx adalah sebagai berikut:

    x=[abc]x = \begin{bmatrix} a\\ b\\ c \end{bmatrix}

    Sehingga, Y=AxY = Ax:

    [32β231.5β231β230.5β2]=[420.25β1230β230β3380.25β1232β230.1β3342.25β1231.5β230.5β3361β1231β231.2β3][abc]\begin{bmatrix} 32\beta_2\\ 31.5\beta_2\\ 31\beta_2\\ 30.5\beta_2 \end{bmatrix} = \begin{bmatrix} 420.25\beta_1^2 & 30\beta_2 & 30\beta_3\\ 380.25\beta_1^2 & 32\beta_2 & 30.1\beta_3\\ 342.25\beta_1^2 & 31.5\beta_2 & 30.5\beta_3\\ 361\beta_1^2 & 31\beta_2 & 31.2\beta_3\\ \end{bmatrix} \begin{bmatrix} a\\ b\\ c \end{bmatrix}

    Kita dapat faktorkan dulu nilai βi\beta_i karena tidak relevan

    [3231.53130.5]=[420.253030380.253230.1342.2531.530.53613131.2][abc]\begin{bmatrix} 32\\ 31.5\\ 31\\ 30.5 \end{bmatrix} = \begin{bmatrix} 420.25 & 30 & 30\\ 380.25 & 32 & 30.1\\ 342.25 & 31.5 & 30.5\\ 361 & 31 & 31.2 \end{bmatrix} \begin{bmatrix} a\\ b\\ c \end{bmatrix}

    Persamaan Y=AxY = Ax jelas tidak dapat diselesaikan, oleh karena itu kedua sisi persamaan dikalikan dengan ATA^T.

    [420.25380.25342.25361303231.5313030.130.531.2][420.253030380.253230.1342.2531.530.53613131.2][abc]=[420.25380.25342.25361303231.5313030.130.531.2][3231.53130.5]\begin{bmatrix} 420.25 & 380.25 & 342.25 & 361\\ 30 & 32 & 31.5 & 31\\ 30 & 30.1 & 30.5 & 31.2 \end{bmatrix} \begin{bmatrix} 420.25 & 30 & 30\\ 380.25 & 32 & 30.1\\ 342.25 & 31.5 & 30.5\\ 361 & 31 & 31.2 \end{bmatrix} \begin{bmatrix} a\\ b\\ c \end{bmatrix} = \begin{bmatrix} 420.25 & 380.25 & 342.25 & 361\\ 30 & 32 & 31.5 & 31\\ 30 & 30.1 & 30.5 & 31.2 \end{bmatrix} \begin{bmatrix} 32\\ 31.5\\ 31\\ 30.5 \end{bmatrix}

    Sehingga, kita dapatkan:

    [568656.187546747.37545754.8546747.3753877.253791.1545754.853791.153709.7][abc]=[47046.12538903805.25]\begin{bmatrix} 568656.1875 & 46747.375 & 45754.85\\ 46747.375 & 3877.25 & 3791.15\\ 45754.85 & 3791.15 & 3709.7 \end{bmatrix} \begin{bmatrix} a\\ b\\ c \end{bmatrix} = \begin{bmatrix} 47046.125\\ 3890\\ 3805.25 \end{bmatrix}

    Dengan menggunakan metode eliminasi Gauss, kita dapatkan:

    x^=[abc]=[9.8828541.25113165.07612]\hat{x} = \begin{bmatrix} a\\ b\\ c \end{bmatrix} = \begin{bmatrix} -9.88285\\ -41.25113\\ 165.07612 \end{bmatrix}