## Matrix Multiplication in Discrete mathematics## MatrixIn discrete mathematics, we can deal with a lot of concepts with the help of matrices. A matrix is used to contain the rectangular array of numbers, and all these numbers, expressions, or symbols will be arranged in the form of rows and columns. There are several operations that can be performed on matrices, like subtraction, multiplication, addition, etc. In this section, we are going to learn about how to multiply two matrices, its formula, algorithms, examples of matrix multiplication, and many more. ## Matrix multiplicationA French mathematician Jacques Philippe Marie Binet was introduced the concept of matrix multiplication in 1812. In discrete mathematics, matrix multiplication can be described as an operation that is performed in matrices. Suppose we have two matrices, A and B. We can multiply these matrices if and only if both the matrices are compatible. Multiplication of a matrix can also be described as a binary operation that provides us a matrix with the help of multiplication of two given matrices. In the below section, we will learn about the rules of matrix multiplication. ## What is matrix MultiplicationThe matrix multiplication is known as a binary operation which generates a matrix as an output when we multiply two matrices. If the given matrices are compatible, only then we will be able to multiply the matrices. Just like the arithmetic multiplication, the matrix multiplication will not be commutative, which indicates that the multiplication of matrices A and B provides us AB, which cannot be equal to BA in case of matrix multiplication, i.e., AB ≠ BA. If there are two matrices, A and B, and the number of columns in matrix A and the number of rows in matrix B are similar to each other, then these matrices will be known as compatible. That means the matrices A and B will be compatible if matrix A contains an order m∗n and matrix B contains an order n∗p. Suppose we have two matrices, A and B. When we multiply them, then we will get AB in the result. If there is a matrix A, which is an m∗n matrix, and another matrix B which is an n∗p matrix, then the multiplication of these matrices will be matrix C which is in the order m∗p. ## Definition of Matrix multiplicationWe can also call matrix multiplication as a matrix product. If there are two matrices and we multiply them, then the resultant matrix will be a single matrix. Matrix multiplication is a type of binary operation. Suppose there are two matrices, A and B, then we can use the following way to indicate the product of these two matrices A and B: X = AB The product of two matrices is also known as the dot product of two matrices. ## Matrix multiplication by ScalarScalar multiplication can be defined as a multiplication of an integer with a matrix. We know that a matrix can be described as an array of numbers. It is used to have rows and columns. If we have a matrix and we multiply it by a scalar value, then that multiplication will be known as scalar multiplication. There can be one more case where we can multiply the two matrices. We will understand the process of doing this with the help of an example. In the following way, we can define the multiplication of a matrix by a scalar: Suppose there is a matrix A = [a
Now we will get the following matrix by multiplying each element of A by 4 like this: So we get this matrix after multiplying the given matrix by the scalar value 4. ## Matrix multiplication conditionWe can perform the multiplication operation of two given matrices only if the number of columns in 1 ## NotationIf there is a matrix A, which is an a∗b matrix, and another matrix B which is a b∗c matrix, then the multiplication of A and B can be described as follows: X = AB Here matrix X is used to indicate the resultant matrix, which has an m∗n dimension.
We will use an example to understand the matrix multiplication formula, which is described as follows: Suppose there are two matrices, A and B, in such a way that The resultant matrix C = AB can be indicated in the following way: Here C is the resultant matrix which is get by multiplication of matrix A∗B. Suppose C has two elements, x and y. Then C For x = 1....a and y = 1....c ## How to Multiply matricesWith the help of a technique, we can learn the process of multiplication of matrices, i.e., the first rows will be multiplied by each and every element of columns, and after that, the rows will be filled up. With the help of following steps, we will learn how we can perform matrix multiplication:
Suppose we have two matrices, A and B, where A is an a∗b matrix and B is a b∗c matrix. The multiplication of both matrices will be indicated by matrix C in the following way: C = AB Suppose matrix C contains elements x and y. It will be defined as: C For x = 1....a and y = 1....c Now we will use the following example to understand the above steps for multiplication of matrices.
Hence the result of this multiplication is described as follows: In the above output matrix, we can see that when we multiply the element of 1 - First, we will choose the elements of i
^{th}row of 1^{st}matrix. - After that, we will choose the elements of j
^{th}column of 2^{nd}matrix. - Now, we will multiply the corresponding elements.
- Lastly, we will add the sum of all the products.
## Algorithm of Matrix multiplicationIn case of matrix multiplication, we have four types of algorithms, which are described as follows: - Sub-cubic algorithm
- Divide and conquer algorithm
- Parallel and distributed algorithm
- Iterative algorithm
These algorithms are mostly used in a lot of programming languages, like Java, C, etc, to perform online multiplications. There are some most common matrix multiplications, i.e., 2∗2, 3∗3, 4∗4, etc. The operations of multiplication, subtraction, and addition will be performed on a matrix in the same way as we perform them on real or rational numbers. Matrix multiplication is a type of operation which is used in linear algebra. The matrices are used to contain a lot of applications. With the help of matrix multiplication, we can show linear mapping, which includes scalar addition and multiplication. On meshes, we can also determine a wide range of algorithms. With the help of this type of algorithm, we can minimize the inherent inefficiency of the standard array algorithm. In this case, there can be a delay in the arrival of data from two different matrices. ## Rules of Matrix multiplicationAs we know that if two matrices are compatible, only then we will be able to multiply those matrices. That means the number of columns in the first matrix and the number of rows in the seconds must be similar to each other for the multiplication of matrices. If there is a matrix A which is an m∗n matrix, and another matrix B which is an n∗p matrix, then the order of multiplication of these matrices will m∗p. The rules and properties of matrix multiplication can be written in the following way with the help of above defined formula and procedure: - We can define the multiplication of two matrices, A and B if the number of columns in A and the number of rows in B are similar to each other.
- If we define the AB, then we will not require defining BA.
- If we have defined both AB and BA, it will not require AB = BA.
- If we get a zero matrix as the result of multiplication of two matrices, then it will not be required that one of the matrices is a zero matrix.
- If there are two square matrices, A and B, which have the same number of orders, then both AB and BA are defined.
- If we try to multiply a 4∗3 matrix by a 3∗4 matrix, then that matrix will be a valid matrix, which provides us a matrix of order 4∗4.
- If there are two compatible matrices, 7∗1 and 1∗2, then the multiplication of these matrices will be a 7∗1 matrix.
- There is no possibility of doing the multiplication of a 4∗3 matrix and a 2∗3 matrix.
## 2∗2 matrix multiplicationThe process of doing the 2∗2 matrix and the process of doing matrix multiplication of any order will be the same. To do this multiplication, we will first use the first matrix and multiply each element of each row of this matrix by the elements of each column in the second matrix. Lastly, we will do the addition of these products. The multiplication of two 2∗2 matrices will generate the result in the form of a 2∗2 matrix. Suppose there are two 2∗2 matrices, A and B, and we will do the multiplication of these matrices in the following way. The A and B matrices are described as follows: Now we will calculate each element of the product matrix AB in the following way: AB AB AB AB Hence, the multiplication matrix is described as follows: ## 3∗3 Matrix MultiplicationWith the help of matrix multiplication formula, we can perform the 3∗3 matrix multiplication. This is because any two 3∗3 matrices are compatible. The process of doing the 3∗3 matrix and the process of doing matrix multiplication of any order will be the same. The multiplication of two 3∗3 matrices will generate the result in the form of a 3∗3 matrix. In this matrix, we can see that the matrices contain the same dimension. That's why the resultant matrix will also contain the same dimension 3∗3.
Now we will calculate each element of the product matrix AB in the following way: AB AB AB AB AB AB AB AB AB Hence, the multiplication matrix is described as follows: ## Properties of Matrix multiplicationThere are some properties contained by the matrix multiplication, which are described as follows:
The matrix multiplication does not contain the commutative property. The commutative law contains the following relation in the matrix multiplication: AB ≠ BA If we are doing the multiplication of two matrices, then the order will matter a lot. Now we will prove this with the help of an example which is described as follows:
Suppose there are two matrices, A and B where Then the multiplication of A∗B is described as follows: But, the multiplication of B∗A is described as follows: We can see that the matrix AB ≠ BA Hence, the multiplication of two matrices cannot have the commutative property.
Suppose there are three matrices, A, B, and C. The associative law contains the following relation in the matrix multiplication: (AB)C = A(BC) Now we will prove this with the help of an example which is described as follows: Suppose there are three matrices, A, B, and C where Now we will first solve the LHS(left-hand side) part of the equation, i.e., (AB)C Now we will first solve the RHS(right-hand side) part of the equation, i.e., A(BC) We can see that the LHS is equal to the RHS. Hence, the multiplication of three matrices will have the associative property.
According to the distributive law, if there are two numbers that are added together and if we multiply them by a number, then the result of this multiplication and the result of doing each multiplication of the matrices separately will be the same. Suppose there are three matrices, A, B, and C. The distributive law contains the following relation in the matrix multiplication: A(B+C) = AB + AC
The identity law contains the following relation in the matrix multiplication: I = I.A = A Here, A is used to indicate the n∗n matrix, and I is used to indicate an identity matrix of order n. Suppose there is a matrix A and an identity matrix I, which contains the following values:
In case of matrix multiplication, if there are two matrices m∗n and m∗a, then the product of these matrices will be m∗a matrix. For example: If there is a matrix A which is a 2∗3 matrix, and another matrix B, which is a 3∗4 matrix, then the multiplication of these matrices AB will be 2∗4 matrices.
Suppose there are two matrices, A and B. We can get the transpose of a product of these two matrices with the help of doing the multiplication of transpose of individual matrices in reverse order. The symbol T is used to indicate the transpose. The transpose of A and B is described as follows: (A∗B)
If there are two complex entries, A and B, in this case, (AB)
If there are two matrices, A and B, then the product of these matrices with the scalar value c will be distributed as follows: c(AB) = (cA)B = A(Bc)
Suppose there is a zero matrix, and if we multiply it by a given matrix, then we get the zero matrix as a resultant matrix. Suppose there is a zero matrix and a matrix A where The product of matrix A and zero matrices is described as follows: The resulting matrix will be a zero matrix, which is described as follows: ## Important PointsThere are some important points that we should know while learning matrix multiplications. These points are described as follows: - If we want to multiply the matrices, then these matrices must be compatible.
- With the help of following rule, we can get the order of a product matrix:
If there is a matrix A which is an m∗n matrix, and another matrix B which is an n∗p matrix, then the order of multiplication of these matrices will m∗p. - With the help of row-by-column multiplication, we can indicate the multiplication of matrices.
Matrix multiplication is used to contain a lot of examples, and some of them are described as follows:
Hence the multiplication of these matrices is described as follows:
From example 1 and example 2, we can see that As we know that value of BA is: And AB ≠ BA, so the matrix multiplication is not commutative.
Matrix A is used to contain the order 4∗1 Matrix B is used to contain the order 1∗3. We can do the multiplication of AB only when the number of column in A and the number of rows in B is similar to each other. With the help of rules of matrix multiplication, we will get the resultant matrix as an order 4∗3. We cannot define the multiplication of BA. This is because the number of columns in B and the number of rows in A are not similar to each other. Now we know that one of the multiplications cannot be defined, and the multiplication of AB is not necessarily equal to the multiplication of BA. Hence the matrix multiplication is not commutative. Hence the product AB can be defined, but the product of BA cannot be defined. |

For Videos Join Our Youtube Channel: Join Now

- Send your Feedback to [email protected]