From 8572b3062e503c215e8d11d202f6ee8fd2e42cf6 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Fri, 12 Sep 2025 17:18:49 +0200 Subject: [PATCH] Fix linear algebra folder structure --- .../{general => }/assets/meme.png | Bin .../linear-algebra/{general => }/linAlg.pdf | Bin .../linear-algebra/{general => }/linAlg.tex | 0 .../{general => }/parts/basics.tex | 0 .../{general => }/parts/determinant.tex | 0 .../parts/eigenvalues-vectors.tex | 0 .../{general => }/parts/exercises.tex | 0 .../{general => }/parts/orthogonality.tex | 0 .../{general => }/parts/solving-sle.tex | 0 .../{general => }/parts/subspaces.tex | 0 .../{general => }/parts/svd.tex | 0 .../linear-algebra/recursive-sequences.md | 269 ------------------ 12 files changed, 269 deletions(-) rename semester1/linear-algebra/{general => }/assets/meme.png (100%) rename semester1/linear-algebra/{general => }/linAlg.pdf (100%) rename semester1/linear-algebra/{general => }/linAlg.tex (100%) rename semester1/linear-algebra/{general => }/parts/basics.tex (100%) rename semester1/linear-algebra/{general => }/parts/determinant.tex (100%) rename semester1/linear-algebra/{general => }/parts/eigenvalues-vectors.tex (100%) rename semester1/linear-algebra/{general => }/parts/exercises.tex (100%) rename semester1/linear-algebra/{general => }/parts/orthogonality.tex (100%) rename semester1/linear-algebra/{general => }/parts/solving-sle.tex (100%) rename semester1/linear-algebra/{general => }/parts/subspaces.tex (100%) rename semester1/linear-algebra/{general => }/parts/svd.tex (100%) delete mode 100755 semester1/linear-algebra/recursive-sequences.md diff --git a/semester1/linear-algebra/general/assets/meme.png b/semester1/linear-algebra/assets/meme.png similarity index 100% rename from semester1/linear-algebra/general/assets/meme.png rename to semester1/linear-algebra/assets/meme.png diff --git a/semester1/linear-algebra/general/linAlg.pdf b/semester1/linear-algebra/linAlg.pdf similarity index 100% rename from semester1/linear-algebra/general/linAlg.pdf rename to semester1/linear-algebra/linAlg.pdf diff --git a/semester1/linear-algebra/general/linAlg.tex b/semester1/linear-algebra/linAlg.tex similarity index 100% rename from semester1/linear-algebra/general/linAlg.tex rename to semester1/linear-algebra/linAlg.tex diff --git a/semester1/linear-algebra/general/parts/basics.tex b/semester1/linear-algebra/parts/basics.tex similarity index 100% rename from semester1/linear-algebra/general/parts/basics.tex rename to semester1/linear-algebra/parts/basics.tex diff --git a/semester1/linear-algebra/general/parts/determinant.tex b/semester1/linear-algebra/parts/determinant.tex similarity index 100% rename from semester1/linear-algebra/general/parts/determinant.tex rename to semester1/linear-algebra/parts/determinant.tex diff --git a/semester1/linear-algebra/general/parts/eigenvalues-vectors.tex b/semester1/linear-algebra/parts/eigenvalues-vectors.tex similarity index 100% rename from semester1/linear-algebra/general/parts/eigenvalues-vectors.tex rename to semester1/linear-algebra/parts/eigenvalues-vectors.tex diff --git a/semester1/linear-algebra/general/parts/exercises.tex b/semester1/linear-algebra/parts/exercises.tex similarity index 100% rename from semester1/linear-algebra/general/parts/exercises.tex rename to semester1/linear-algebra/parts/exercises.tex diff --git a/semester1/linear-algebra/general/parts/orthogonality.tex b/semester1/linear-algebra/parts/orthogonality.tex similarity index 100% rename from semester1/linear-algebra/general/parts/orthogonality.tex rename to semester1/linear-algebra/parts/orthogonality.tex diff --git a/semester1/linear-algebra/general/parts/solving-sle.tex b/semester1/linear-algebra/parts/solving-sle.tex similarity index 100% rename from semester1/linear-algebra/general/parts/solving-sle.tex rename to semester1/linear-algebra/parts/solving-sle.tex diff --git a/semester1/linear-algebra/general/parts/subspaces.tex b/semester1/linear-algebra/parts/subspaces.tex similarity index 100% rename from semester1/linear-algebra/general/parts/subspaces.tex rename to semester1/linear-algebra/parts/subspaces.tex diff --git a/semester1/linear-algebra/general/parts/svd.tex b/semester1/linear-algebra/parts/svd.tex similarity index 100% rename from semester1/linear-algebra/general/parts/svd.tex rename to semester1/linear-algebra/parts/svd.tex diff --git a/semester1/linear-algebra/recursive-sequences.md b/semester1/linear-algebra/recursive-sequences.md deleted file mode 100755 index d63b1c3..0000000 --- a/semester1/linear-algebra/recursive-sequences.md +++ /dev/null @@ -1,269 +0,0 @@ -Yes, you're right! The next step is to diagonalize the matrix, which involves calculating the **eigenvalues** and **eigenvectors** of the transformation matrix \( T \). Once you do that, you can express the recurrence as a closed-form formula for \( a_n \). - -Let's break down the steps involved: - -### Step 1: Find the eigenvalues of the matrix - -You want to find the eigenvalues \( \lambda \) of the matrix \( T \): - -\[ -T = \begin{bmatrix} 2 & 3 \\ 1 & 0 \end{bmatrix} -\] - -Eigenvalues are found by solving the characteristic equation: - -\[ -\text{det}(T - \lambda I) = 0 -\] - -where \( I \) is the identity matrix. First, compute the determinant of \( T - \lambda I \): - -\[ -T - \lambda I = \begin{bmatrix} 2 - \lambda & 3 \\ 1 & -\lambda \end{bmatrix} -\] - -Now, compute the determinant: - -\[ -\text{det}(T - \lambda I) = (2 - \lambda)(-\lambda) - (3)(1) = -2\lambda + \lambda^2 - 3 -\] - -Simplify the equation: - -\[ -\lambda^2 - 2\lambda - 3 = 0 -\] - -Now, solve this quadratic equation for \( \lambda \): - -\[ -\lambda = \frac{-(-2) \pm \sqrt{(-2)^2 - 4(1)(-3)}}{2(1)} = \frac{2 \pm \sqrt{4 + 12}}{2} = \frac{2 \pm \sqrt{16}}{2} = \frac{2 \pm 4}{2} -\] - -Thus, the two eigenvalues are: - -\[ -\lambda_1 = \frac{2 + 4}{2} = 3 \quad \text{and} \quad \lambda_2 = \frac{2 - 4}{2} = -1 -\] - -### Step 2: Find the eigenvectors - -Now that you have the eigenvalues \( \lambda_1 = 3 \) and \( \lambda_2 = -1 \), you need to find the corresponding eigenvectors. - -#### Eigenvector for \( \lambda_1 = 3 \): - -Solve \( (T - 3I) \mathbf{v} = 0 \), where \( \mathbf{v} \) is the eigenvector corresponding to \( \lambda_1 \). - -\[ -T - 3I = \begin{bmatrix} 2 - 3 & 3 \\ 1 & -3 \end{bmatrix} = \begin{bmatrix} -1 & 3 \\ 1 & -3 \end{bmatrix} -\] - -Now solve the system: - -\[ -\begin{bmatrix} -1 & 3 \\ 1 & -3 \end{bmatrix} \begin{bmatrix} v_1 \\ v_2 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \end{bmatrix} -\] - -This gives the system: - -\[ -- v_1 + 3 v_2 = 0 -\] -\[ -v_1 - 3 v_2 = 0 -\] - -Both equations are equivalent, so we have: - -\[ -v_1 = 3 v_2 -\] - -Thus, the eigenvector corresponding to \( \lambda_1 = 3 \) is: - -\[ -\mathbf{v}_1 = \begin{bmatrix} 3 \\ 1 \end{bmatrix} -\] - -#### Eigenvector for \( \lambda_2 = -1 \): - -Solve \( (T + I) \mathbf{v} = 0 \), where \( \mathbf{v} \) is the eigenvector corresponding to \( \lambda_2 \). - -\[ -T + I = \begin{bmatrix} 2 + 1 & 3 \\ 1 & 0 + 1 \end{bmatrix} = \begin{bmatrix} 3 & 3 \\ 1 & 1 \end{bmatrix} -\] - -Now solve the system: - -\[ -\begin{bmatrix} 3 & 3 \\ 1 & 1 \end{bmatrix} \begin{bmatrix} v_1 \\ v_2 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \end{bmatrix} -\] - -This gives the system: - -\[ -3 v_1 + 3 v_2 = 0 -\] -\[ -v_1 + v_2 = 0 -\] - -From the second equation, we have \( v_1 = -v_2 \). So, the eigenvector corresponding to \( \lambda_2 = -1 \) is: - -\[ -\mathbf{v}_2 = \begin{bmatrix} -1 \\ 1 \end{bmatrix} -\] - -### Step 3: Diagonalize the matrix - -Now that we have the eigenvalues and eigenvectors, we can diagonalize the matrix \( T \). - -Let \( P \) be the matrix formed by the eigenvectors as columns: - -\[ -P = \begin{bmatrix} 3 & -1 \\ 1 & 1 \end{bmatrix} -\] - -The inverse of \( P \) is computed as follows (using the formula for the inverse of a 2x2 matrix): - -\[ -P^{-1} = \frac{1}{\text{det}(P)} \begin{bmatrix} 1 & 1 \\ -1 & 3 \end{bmatrix} -\] - -where \( \text{det}(P) = (3)(1) - (-1)(1) = 3 + 1 = 4 \), so: - -\[ -P^{-1} = \frac{1}{4} \begin{bmatrix} 1 & 1 \\ -1 & 3 \end{bmatrix} -\] - -The diagonal matrix \( D \) will have the eigenvalues on the diagonal: - -\[ -D = \begin{bmatrix} 3 & 0 \\ 0 & -1 \end{bmatrix} -\] - -Thus, \( T \) can be written as: - -\[ -T = P D P^{-1} -\] - -### Step 4: Express the closed-form solution - -Now, to compute \( a_n \), we can use the diagonalization of \( T \): - -\[ -\mathbf{v}_n = T^{n-1} \mathbf{v}_1 = P D^{n-1} P^{-1} \mathbf{v}_1 -\] - -The term \( D^{n-1} \) is easy to compute because \( D \) is diagonal: - -\[ -D^{n-1} = \begin{bmatrix} 3^{n-1} & 0 \\ 0 & (-1)^{n-1} \end{bmatrix} -\] - -Thus, the closed-form formula for \( a_n \) is obtained by applying the matrix multiplication: - -\[ -\mathbf{v}_n = P \begin{bmatrix} 3^{n-1} & 0 \\ 0 & (-1)^{n-1} \end{bmatrix} P^{-1} \mathbf{v}_1 -\] - -By carrying out these matrix multiplications (which can be done step by step), you'll arrive at a direct formula for \( a_n \), which is a linear combination of the terms involving powers of \( 3 \) and \( (-1)^{n-1} \). - -To rewrite the closed-form solution for \( a_n \) without using vectors or matrices, we need to compute the expression directly in terms of \( n \) and use the properties of the eigenvalues and eigenvectors. - -Let's break down the steps to arrive at a direct formula for \( a_n \). - -### Step 1: General Formula Structure - -From the diagonalization of the matrix \( T \), we have: - -\[ -\mathbf{v}_n = P D^{n-1} P^{-1} \mathbf{v}_1 -\] - -where \( P = \begin{bmatrix} 3 & -1 \\ 1 & 1 \end{bmatrix} \), \( D = \begin{bmatrix} 3 & 0 \\ 0 & -1 \end{bmatrix} \), and \( \mathbf{v}_1 = \begin{bmatrix} a_1 \\ a_0 \end{bmatrix} \). - -After performing the matrix multiplication and solving for the values of \( a_n \), we can arrive at a **direct expression** for \( a_n \). - -### Step 2: Compute \( a_n \) in Terms of Eigenvalues - -Since \( T^{n-1} \) is diagonalizable, we know that \( D^{n-1} \) is simply: - -\[ -D^{n-1} = \begin{bmatrix} 3^{n-1} & 0 \\ 0 & (-1)^{n-1} \end{bmatrix} -\] - -Now, we need to express the evolution of the state vector without matrices. The formula for \( a_n \) will be a combination of the eigenvalues \( \lambda_1 = 3 \) and \( \lambda_2 = -1 \), weighted by the initial values \( a_1 \) and \( a_0 \). - -To get the value of \( a_n \), we need to express the result of \( P^{-1} \mathbf{v}_1 \) in a way that we can compute directly. - -### Step 3: Use the Initial Conditions - -The initial conditions give us the starting values of \( a_1 \) and \( a_0 \), and we use the fact that the matrix multiplication \( P D^{n-1} P^{-1} \mathbf{v}_1 \) essentially results in the following: - -\[ -a_n = \alpha_1 3^{n-1} + \alpha_2 (-1)^{n-1} -\] - -where \( \alpha_1 \) and \( \alpha_2 \) are constants determined by the initial conditions. Let's compute these coefficients using \( \mathbf{v}_1 = \begin{bmatrix} a_1 \\ a_0 \end{bmatrix} \). - -### Step 4: Solve for the Coefficients \( \alpha_1 \) and \( \alpha_2 \) - -We know that \( \mathbf{v}_n = P D^{n-1} P^{-1} \mathbf{v}_1 \), and we can solve this system by applying the initial conditions. For the recurrence \( a_n = 2a_{n-1} + 3a_{n-2} \), this gives the following two linear equations: - -1. \( \alpha_1 3^0 + \alpha_2 (-1)^0 = a_0 \) (this gives the equation for \( a_0 \)) -2. \( \alpha_1 3^1 + \alpha_2 (-1)^1 = a_1 \) (this gives the equation for \( a_1 \)) - -These equations are: - -\[ -\alpha_1 + \alpha_2 = a_0 -\] -\[ -3 \alpha_1 - \alpha_2 = a_1 -\] - -### Step 5: Solve the System of Equations - -We can now solve this system of two linear equations for \( \alpha_1 \) and \( \alpha_2 \). Add the two equations: - -\[ -(\alpha_1 + \alpha_2) + (3 \alpha_1 - \alpha_2) = a_0 + a_1 -\] -\[ -4 \alpha_1 = a_0 + a_1 -\] -\[ -\alpha_1 = \frac{a_0 + a_1}{4} -\] - -Substitute \( \alpha_1 = \frac{a_0 + a_1}{4} \) into \( \alpha_1 + \alpha_2 = a_0 \): - -\[ -\frac{a_0 + a_1}{4} + \alpha_2 = a_0 -\] -\[ -\alpha_2 = a_0 - \frac{a_0 + a_1}{4} = \frac{3a_0 - a_1}{4} -\] - -### Step 6: Write the General Formula for \( a_n \) - -Now we substitute \( \alpha_1 \) and \( \alpha_2 \) back into the formula for \( a_n \): - -\[ -a_n = \alpha_1 3^{n-1} + \alpha_2 (-1)^{n-1} -\] -\[ -a_n = \frac{a_0 + a_1}{4} 3^{n-1} + \frac{3a_0 - a_1}{4} (-1)^{n-1} -\] - -This is the closed-form formula for \( a_n \), which you can now use to compute \( a_n \) directly for any \( n \), given the initial conditions \( a_0 \) and \( a_1 \). - -### Final Formula: - -\[ -a_n = \frac{a_0 + a_1}{4} 3^{n-1} + \frac{3a_0 - a_1}{4} (-1)^{n-1} -\] - -This formula allows you to compute \( a_n \) directly without needing to iterate through the recurrence!