**This method is a modified version of LU factorization method to solve linear equations. This method is known as the square root method.**

__DERIVATION__

Since this is a positive definite hence,

**Now, according to Cholesky, there exists a lower triangular matrix L such that **

Then

Hence

**The above method can be written where A can be decomposed into upper triangular matrix as:**

__Input:__

A matrix

__OUTPUT:__

Lower triangular matrix and its transpose

__PROCESS:__

```
Step 1: [taking inputs from user]
Read n [the order of the matrix]
for i = 0 to n - 1 repeat
for j = 0 to n - 1 repeat
Read arr[i][j])
[End of ‘for’ loop]
[End of ‘for’ loop]
Step 2: [Cholesky method]
for i = 0 to n - 1 repeat
for j = 0 to n - 1 repeat
Set l[i][j] ← 0
[End of ‘for’ loop]
[End of ‘for’ loop]
for i = 0 to n - 1 repeat
for j = 0 to i repeat
Set s ← 0
if j = I then
for k = 0 to j - 1 repeat
Set s ← s + (l[j][k] × l[j][k])
[End of ‘for’ loop]
Set l[j][j] ← square root of(arr[j][j] - s)
else
for k = 0 to j - 1 repeat
Set s ← s + (l[i][k] × l[j][k])
[End of ‘for’ loop]
Set l[i][j] ← (arr[i][j] - s) / l[j][j]
[End of ‘if’]
[End of ‘for’ loop]
[End of ‘for’ loop]
for i = 0 to n - 1 repeat
for j = 0 to n - 1 repeat
print l[i][j])
[End of ‘for’ loop]
Move to next line
[End of ‘for’ loop]
for i = 0 to n - 1 repeat
for j = 0 to n - 1 repeat
print l[j][i])
[End of ‘for’ loop]
Move to next line
[End of ‘for’ loop]
[End of Cholesky method]
```

__ADVANTAGES__

**1.** It solves the equations faster than the LU decomposition method of solving linear equations.

**2.** It is very useful to solve linear equations with symmetric positive and definite matrices.

__DISADVANTAGES__

**1.** It can decompose only the symmetric positive definite matrices.

__APPLICATIONS__

**1.** It is commonly used in the Monte Carlo method to solve simulating systems with multiple correlated variables.

**2.** It is used to solve linear equations.

**3.** It can also be used in Kalman filters and matrix inversion.

Contributed by