Category Archives: Linear Algebra

The Matrix of The Meru Prastaar And LU Factorisation

– Chandrahas M. Halai

The elements of this matrix are the binary coefficients hence this matrix is popularly called the Pascal’s Matrix. But I will call it the matrix of the Meru Prastaar, as Pingala’s Meru Prastaar predates Pascal’s Triangle by at least 1800 years. Refer my earlier article:

https://chandrahasblogs.wordpress.com/2020/10/04/meru-prastaar-%E0%A4%AE%E0%A5%87%E0%A4%B0%E0%A5%81-%E0%A4%AA%E0%A5%8D%E0%A4%B0%E0%A4%B8%E0%A5%8D%E0%A4%A4%E0%A4%BE%E0%A4%B0%E0%A4%83/

As can be seen from the above matrix equation the matrix of the Meru Prastaar can be factorised into two matrices which are also matrices of the Meru Prastaar, lower and upper.

A non-singular square matrix can be factorised into lower and upper triangular matrices. This can be achieved by reducing the matrix into its row echelon form.

Let us factorise a 3×3 non-singular matrix into lower and upper triangular matrices and understand this.

Let 

We begin the process by eliminating the element . We achieve this by multiplying matrix A by eliminating matrix . To understand this refer my article:

https://chandrahasblogs.wordpress.com/2021/05/28/inverting-the-matrix/

We have


Now, let us eliminate the element by multiplying with matrix .


Now, let us eliminate the element by multiplying with matrix .


We now have


Here, U represents the upper triangular matrix.


Let be the composite elimination matrix and be the composite inverse matrix.


The inverse of a matrix undoes what the matrix does. Hence inverse of is


In the same way, we have


and


Therefore now, we have the inverse matrix


The elimination matrix is will be a lower triangular matrix hence it is represented by L. We have


We have


Coming back to the matrix of the Meru Prastaar, when we carry out the factorisation procedure on it we get:


Replying to the Secret Message

– Chandrahas M. Halai

This is in continuation of my earlier article

https://chandrahasblogs.wordpress.com/2021/04/26/this-is-a-secret-message/.

Pankaj wants to send an encrypted message to Chandrahas. He encrypts the message matrix by multiplying it with his code matrix and then sends it to Chandrahas.

Let us say that Pankaj wants to send the message:


Pankaj will do the first level encryption by replacing the characters in the message by the corresponding numbers. Thus, now he will have the following message matrix:


Pankaj will now multiply the message matrix with his code matrix as given below:


He then sends the encoded message matrix to Chandrahas.

Chandrahas decrypts the message he receives by multiplying it with his key matrix. Chandrahas’ key matrix is actually the inverse of the code matrix used by Pankaj. Thus, Chandrahas’ key matrix is:


Multiplying the encoded message matrix with Chandrahas’ key matrix we get the message matrix:


Then, Chandrahas will replace the numbers with equivalent characters to get the message.


Now, Chandrahas wants to send an encrypted reply to Pankaj.


Chandrahas will now replace all the characters with equivalent numbers to get the message matrix for his reply.


What will Chandrahas use as a code matrix to encrypt his reply and what will Pankaj use as a key to decrypt it?

The key matrix used by Chandrahas is the inverse of the code matrix used by Pankaj. Putting, it another way, they are inverses of each other. Hence, Chandrahas can use his key matrix as the code matrix to encrypt his reply and Pankaj can use his code matrix to decrypt the reply from Chandrahas.

Chandrahas will multiply his message matrix with his key matrix to encode it.


Chandrahas sends this encoded reply matrix to Pankaj.


Pankaj receives the encoded reply matrix from Chandrahas. To decode it he will now multiply it with his code matrix to decode it as shown below:


Pankaj will now replace the numbers in the message matrix with equivalent characters to get the reply message from Chandrahas as shown below:

Vandermonde’s Matrix, Part 2

– Chandrahas M. Halai

This is in continuation of my earlier article:

https://chandrahasblogs.wordpress.com/2021/06/09/vandermondes-matrix-and-polynomial-interpolation/

Let us fit a Quartic (fourth degree) polynomial to the given data points:

(0, -1), (1, 0), (2, 5), (3, 14) and (4, 27).

The Vandermonde matrix for the above data points will be:


Solving this we get


Hence, the governing polynomial function for the experiment is given by


When we try to overfit a higher degree polynomial to the given data points, the coefficients of higher degrees of x will turn out to be 0.

Vandermonde’s Matrix and Polynomial Interpolation

– Chandrahas M. Halai

You have conducted an experiment or done some tests on engineering systems and you now have data. Let us represent the data as (x1, y1), (x2, y2), (x3, y3), …, (xn, yn). Here xk represents the independent variable, the quantity you can adjust and yk is the dependent variable, the data you are going to read from the experimental setup.

What if we want to know the value of the dependent variable corresponding to the value of the independent variable between two recorded data points?

Every physics phenomena or engineering system is described by its underlying mathematical model (equation describing the relation between various quantities).

We can fit a polynomial curve passing through all the data points. Once, you get the polynomial function for the curve you can calculate the value of the dependent variable for any value of the independent variable lying between two recorded data points.

But how do you get the polynomial function for the curve that passes through the given data points?

The procedure for getting the function is called polynomial curve-fitting. And when you calculate the value of the function between two data points it is called Polynomial Interpolation.

Let,


represent the polynomial function.

To get the function we need to find out the coefficients of the polynomial. For this let us create a system of n Linear equations, one for each data point.


Let us write this in the matrix form:


The solution of the above linear system will give us the coefficients of the polynomial function.

The coefficient matrix in the above matrix equation is known as the Vandermonde Matrix. The elements in the row of a Vandermonde matrix are in geometric progression.

Let us understand this method of polynomial interpolation by solving an example.

Let us say that an experiment gives us four data points – (1, 4), (2, 19), (3, 60) and (4, 139). We want to the value of dependent variable at 2.5?

Let us fit a cubic polynomial to these data points. Let,


represent the cubic polynomial function. We need to find the coefficients a0, a1, a2 and a3. Since we have four data points we can create a system consisting of four linear equations in four unknowns.


That is,


Similarly, we have


Let us now write this in a matrix form:


Solving this we get


Hence, the governing polynomial function for the experiment is given by



Now to find the value of y at x = 2.5, we have


If we want to fit polynomial of higher degree we will need a larger matrix. But a larger matrix will lead to accumulation of round-off errors and the matrix will become ill conditioned. Hence, this method of polynomial interpolation is not used beyond cubic polynomials.