$\text{Determine the } LDL^t \text{factorization of the positive definite matrix} \\ A= \begin{bmatrix} 4 & -1 & 1 \\ -1 & 4.25 & 2.75 \\ 1 & 2.75 & 3.5 \\ \end{bmatrix}$
In order to solve this problem I used the $LDL^t$ algorithm from here LDL Factorization
$L = zeros(3,3), D= zeros(3,1) \\ i =1..n \\ d(1) = A(1,1) = 4 \\ \text{For j = i+1 = 2 to 3} \\ L(2,1) = \frac{A(2,1)}{d(1)} = -\frac{1}{4} \\ j =3, i =1 \\ L(3,1) = \frac{A(3,1)}{D(1)} = \frac{1}{4} \\ L(3,2) = \frac{A(3,2) = A(3,2)- \Sigma^{1}_{k=1} L(3,1)\cdot L(2,1)\cdot(D(1))}{D(2) } = \frac{(2.75- (1/4) (-1/4)(4))}{4} = \frac{3}{4}\\ D(2)= A(2,2)- \Sigma^1_{j=1}L(2,1)^2(D(1)) =4.25-((-1/4)^2(4)= 4\\ D(3) = A(3,3) - (L(3,1)^2 \cdot D(1) + L(3,2)^2 \cdot D(2))= 3.5- ((1/4)^2(4))+ (3/4)^2(4) = 1 \\ \text{Lower Triangular }= \begin{bmatrix}
1 & 0 & 0 \\
-\frac{1}{4} & 1 & 0 \\
\frac{1}{4} &\frac{3}{4} & 1 \\
\end{bmatrix} , \text{Upper Triangular} =\begin{bmatrix}
4 & -1 & 1 \\
0 & 4.0& 3.0\\
0 & 0 & 1.0\\
\end{bmatrix} \\ \text{ and we have } A= LDL^T \\ \begin{bmatrix}
4 & -1 & 1 \\
-1 & 4.25 & 2.75 \\
1 & 2.75 & 3.5 \\
\end{bmatrix} = \begin{bmatrix}
1 & 0 & 0 \\
-\frac{1}{4} & 1 & 0 \\
\frac{1}{4} &\frac{3}{4} & 1 \\
\end{bmatrix} \begin{bmatrix}
4 & 0 & 0 \\
0 & 4 & 0 \\
0 &0 & 1 \\
\end{bmatrix} \begin{bmatrix}
1 & -\frac{1}{4} & \frac{1}{4} \\
0 & 1 &\frac{3}{4} \\
0 &0 & 1 \\
\end{bmatrix} \\ $
Did I make any mistakes with the algorithm that solved the problem? The only mistake I might have made is when to increment the i in the nested loop.