Subtraction of matrices of different sizes. Adding and subtracting matrices online

Matrix addition$ A $ and $ B $ is an arithmetic operation, as a result of which the matrix $ C $ should be obtained, each element of which is equal to the sum of the corresponding elements of the matrices being added:

$$ c_(ij) = a_(ij) + b_(ij) $$

More details The formula for adding two matrices looks like this:

$$ A + B = \begin(pmatrix) a_(11) & a_(12) & a_(13) \\ a_(21) & a_(22) & a_(23) \\ a_(31) & a_( 32) & a_(33) \end(pmatrix) + \begin(pmatrix) b_(11) & b_(12) & b_(13) \\ b_(21) & b_(22) & b_(23) \\ b_(31) & b_(32) & b_(33) \end(pmatrix) = $$

$$ = \begin(pmatrix) a_(11) + b_(11) & a_(12)+b_(12) & a_(13)+b_(13) \\ a_(21)+b_(21) & a_ (22)+b_(22) & a_(23)+b_(23) \\ a_(31)+b_(31) & a_(32)+b_(32) & a_(33)+b_(33) \ end(pmatrix) = C$$

Please note that you can only add and subtract matrices of the same dimension. With the sum or difference, the result will be a matrix $ C $ of the same dimension as the terms (subtracted) of the matrices $ A $ and $ B $. If the matrices $ A $ and $ B $ differ from each other in size, then adding (subtracting) such matrices will be an error!

The formula adds 3 by 3 matrices, which means the result should be a 3 by 3 matrix.

Subtraction of matrices completely similar to the addition algorithm, only with a minus sign. Each element of the required matrix $C$ is obtained by subtracting the corresponding elements of the matrices $A$ and $B$:

$$ c_(ij) = a_(ij) - b_(ij) $$

Let's write down the detailed formula for subtracting two matrices:

$$ A - B = \begin(pmatrix) a_(11) & a_(12) & a_(13) \\ a_(21) & a_(22) & a_(23) \\ a_(31) & a_( 32) & a_(33) \end(pmatrix) - \begin(pmatrix) b_(11) & b_(12) & b_(13) \\ b_(21) & b_(22) & b_(23) \\ b_(31) & b_(32) & b_(33) \end(pmatrix) = $$

$$ = \begin(pmatrix) a_(11) - b_(11) & a_(12)-b_(12) & a_(13)-b_(13) \\ a_(21)-b_(21) & a_ (22)-b_(22) & a_(23)-b_(23) \\ a_(31)-b_(31) & a_(32)-b_(32) & a_(33)-b_(33) \ end(pmatrix) = C$$

It is also worth noting that you cannot add and subtract matrices with ordinary numbers, as well as with some other elements

It will be useful to know the properties of addition (subtraction) for further solutions to problems with matrices.

Properties

  1. If the matrices $ A,B,C $ are the same in size, then the associativity property applies to them: $$ A + (B + C) = (A + B) + C $$
  2. For each matrix there is a zero matrix, denoted $ O $, upon addition (subtraction) with which the original matrix does not change: $$ A \pm O = A $$
  3. For every non-zero matrix $ A $ there is an opposite matrix $ (-A) $ whose sum vanishes: $ $ A + (-A) = 0 $ $
  4. When adding (subtracting) matrices, the property of commutativity is allowed, that is, the matrices $ A $ and $ B $ can be swapped: $$ A + B = B + A $$ $$ A - B = B - A $$

Examples of solutions

Example 1

Given matrices $ A = \begin(pmatrix) 2&3 \\ -1& 4 \end(pmatrix) $ and $ B = \begin(pmatrix) 1&-3 \\ 2&5 \end(pmatrix) $.

Perform matrix addition and then subtraction.

Solution

First of all, we check the matrices for dimensionality. The matrix $ A $ has dimension $ 2 \times 2 $, the second matrix $ B $ has dimension $ 2 \times 2 $. This means that with these matrices it is possible to perform a joint operation of addition and subtraction.

Recall that for the sum it is necessary to perform pairwise addition of the corresponding elements of the matrices $ A \text( and ) B $.

$$ A + B = \begin(pmatrix) 2&3 \\ -1& 4 \end(pmatrix) + \begin(pmatrix) 1&-3 \\ 2&5 \end(pmatrix) = $$

$$ = \begin(pmatrix) 2 + 1 & 3 + (-3) \\ -1 + 2 & 4 + 5 \end(pmatrix) = \begin(pmatrix) 3 & 0 \\ 1 & 9 \end( pmatrix) $$

Similarly to the sum, we find the difference of the matrices by replacing the “plus” sign with a “minus”:

$$ A - B = \begin(pmatrix) 2&3 \\ -1& 4 \end(pmatrix) + \begin(pmatrix) 1&-3 \\ 2&5 \end(pmatrix) = $$

$$ = \begin(pmatrix) 2 - 1 & 3 - (-3) \\ -1 - 2 & 4 - 5 \end(pmatrix) = \begin(pmatrix) 1 & 6 \\ -3 & -1 \ end(pmatrix)$$

If you cannot solve your problem, then send it to us. We will provide detailed solution. You will be able to view the progress of the calculation and gain information. This will help you get your grade from your teacher in a timely manner!

Answer

$$ A + B = \begin(pmatrix) 3 & 0 \\ 1 & 9 \end(pmatrix); A - B = \begin(pmatrix) 1 & 6 \\ -3 & -1 \end(pmatrix) $$

In the article: “Addition and subtraction of matrices” definitions, rules, comments, properties of operations and practical examples of solutions were given.

It should be noted that only matrices of the same size can be used for this operation. When adding two matrices, all their elements are summed in pairs, and when subtracting, we, accordingly, deal with their pairwise difference. Having received a detailed and step-by-step solution, you will be able to better understand the process of finding the sum and difference of matrices.

So, you have two matrices in front of you, and you need to find out their sum, or their difference. You can do both easily and quickly if you use our online calculator. It will be very useful to you if you want to understand the algorithm of these operations. Theory is not always able to give a clear answer to all questions; practical calculations cope with this task much better. Using an online calculator, you will receive a detailed diagram of how matrices are subtracted or added. In addition, you can first try to calculate everything yourself, and then double-check yourself here.

This online calculator has extremely simple instructions. You can indicate the dimensions of each of the matrices by clicking on the “+” or “-” icons to the left of the matrices and below them. Next, you will need to enter all the elements. And then, by clicking the “Calculate” button, you can quickly get the desired value along with a detailed calculation algorithm.

1st year, higher mathematics, studying matrices and basic actions on them. Here we systematize the basic operations that can be performed with matrices. Where to start getting acquainted with matrices? Of course, from the simplest things - definitions, basic concepts and simple operations. We assure you that the matrices will be understood by everyone who devotes at least a little time to them!

Matrix Definition

Matrix is a rectangular table of elements. Well, in simple terms – a table of numbers.

Typically, matrices are denoted in capital Latin letters. For example, matrix A , matrix B and so on. Matrices can be of different sizes: rectangular, square, and there are also row and column matrices called vectors. The size of the matrix is ​​determined by the number of rows and columns. For example, let's write a rectangular matrix of size m on n , Where m – number of lines, and n – number of columns.

Items for which i=j (a11, a22, .. ) form the main diagonal of the matrix and are called diagonal.

What can you do with matrices? Add/Subtract, multiply by a number, multiply among themselves, transpose. Now about all these basic operations on matrices in order.

Matrix addition and subtraction operations

Let us immediately warn you that you can only add matrices of the same size. The result will be a matrix of the same size. Adding (or subtracting) matrices is simple - you just need to add their corresponding elements . Let's give an example. Let's perform the addition of two matrices A and B of size two by two.

Subtraction is performed by analogy, only with the opposite sign.

Any matrix can be multiplied by an arbitrary number. To do this you need to multiply each of its elements by this number. For example, let's multiply matrix A from the first example by the number 5:

Matrix multiplication operation

Not all matrices can be multiplied together. For example, we have two matrices - A and B. They can be multiplied by each other only if the number of columns of matrix A is equal to the number of rows of matrix B. In this case each element of the resulting matrix, located in the i-th row and j-th column, will be equal to the sum of the products of the corresponding elements in the i-th row of the first factor and the j-th column of the second. To understand this algorithm, let's write down how two square matrices are multiplied:

And an example with real numbers. Let's multiply the matrices:

Matrix transpose operation

Matrix transposition is an operation where the corresponding rows and columns are swapped. For example, let's transpose the matrix A from the first example:

Matrix determinant

Determinant, or determinant, is one of the basic concepts of linear algebra. Once upon a time, people came up with linear equations, and after them they had to come up with a determinant. In the end, it’s up to you to deal with all this, so, the last push!

The determinant is a numerical characteristic of a square matrix, which is needed to solve many problems.
To calculate the determinant of the simplest square matrix, you need to calculate the difference between the products of the elements of the main and secondary diagonals.

The determinant of a matrix of first order, that is, consisting of one element, is equal to this element.

What if the matrix is ​​three by three? This is more difficult, but you can manage it.

For such a matrix, the value of the determinant is equal to the sum of the products of the elements of the main diagonal and the products of the elements lying on the triangles with a face parallel to the main diagonal, from which the product of the elements of the secondary diagonal and the product of the elements lying on the triangles with the face of the parallel secondary diagonal are subtracted.

Fortunately, in practice it is rarely necessary to calculate determinants of matrices of large sizes.

Here we looked at basic operations on matrices. Of course, in real life you may never encounter even a hint of a matrix system of equations, or, on the contrary, you may encounter much more complex cases when you really have to rack your brains. It is for such cases that professional student services exist. Ask for help, get a high-quality and detailed solution, enjoy academic success and free time.


This manual will help you learn how to perform operations with matrices: addition (subtraction) of matrices, transposition of a matrix, multiplication of matrices, finding the inverse matrix. All material is presented in a simple and accessible form, relevant examples are given, so even an unprepared person can learn how to perform actions with matrices. For self-monitoring and self-testing, you can download a matrix calculator for free >>>.

I will try to minimize theoretical calculations, in some places explanations “on the fingers” and the use of non-scientific terms are possible. Lovers of solid theory, please do not engage in criticism, our task is learn to perform operations with matrices.

For SUPER FAST preparation on the topic (who is “on fire”) there is an intensive pdf course Matrix, determinant and test!

A matrix is ​​a rectangular table of some elements. As elements we will consider numbers, that is, numerical matrices. ELEMENT is a term. It is advisable to remember the term, it will appear often, it is no coincidence that I used bold font to highlight it.

Designation: matrices are usually denoted in capital Latin letters

Example: Consider a two-by-three matrix:

This matrix consists of six elements:

All numbers (elements) inside the matrix exist on their own, that is, there is no question of any subtraction:

It's just a table (set) of numbers!

We'll also agree do not rearrange numbers, unless otherwise stated in the explanations. Each number has its own location and cannot be shuffled!

The matrix in question has two rows:

and three columns:

STANDARD: when talking about matrix sizes, then at first indicate the number of rows, and only then the number of columns. We have just broken down the two-by-three matrix.

If the number of rows and columns of a matrix is ​​the same, then the matrix is ​​called square, For example: – a three-by-three matrix.

If a matrix has one column or one row, then such matrices are also called vectors.

In fact, we have known the concept of a matrix since school; consider, for example, a point with coordinates “x” and “y”: . Essentially, the coordinates of a point are written into a one-by-two matrix. By the way, here is an example of why the order of numbers matters: and are two completely different points on the plane.

Now let's move on to studying operations with matrices:

1) Act one. Removing a minus from the matrix (introducing a minus into the matrix).

Let's return to our matrix . As you probably noticed, there are too many negative numbers in this matrix. This is very inconvenient from the point of view of performing various actions with the matrix, it is inconvenient to write so many minuses, and it simply looks ugly in design.

Let's move the minus outside the matrix by changing the sign of EACH element of the matrix:

At zero, as you understand, the sign does not change; zero is also zero in Africa.

Reverse example: . It looks ugly.

Let's introduce a minus into the matrix by changing the sign of EACH element of the matrix:

Well, it turned out much nicer. And, most importantly, it will be EASIER to perform any actions with the matrix. Because there is such a mathematical folk sign: the more minuses, the more confusion and errors.

2) Act two. Multiplying a matrix by a number.

Example:

It's simple, in order to multiply a matrix by a number, you need every matrix element multiplied by a given number. In this case - a three.

Another useful example:

– multiplying a matrix by a fraction

First let's look at what to do NO NEED:

There is NO NEED to enter a fraction into the matrix; firstly, it only complicates further actions with the matrix, and secondly, it makes it difficult for the teacher to check the solution (especially if – final answer of the task).

And, moreover, NO NEED divide each element of the matrix by minus seven:

From the article Mathematics for dummies or where to start, we remember that in higher mathematics they try to avoid decimal fractions with commas in every possible way.

The only thing is preferably What to do in this example is to add a minus to the matrix:

But if only ALL matrix elements were divided by 7 without a trace, then it would be possible (and necessary!) to divide.

Example:

In this case, you can NEED TO multiply all matrix elements by , since all matrix numbers are divisible by 2 without a trace.

Note: in the theory of higher school mathematics there is no concept of “division”. Instead of saying “this divided by that,” you can always say “this multiplied by a fraction.” That is, division is a special case of multiplication.

3) Act three. Matrix Transpose.

In order to transpose a matrix, you need to write its rows into the columns of the transposed matrix.

Example:

Transpose matrix

There is only one line here and, according to the rule, it needs to be written in a column:

– transposed matrix.

A transposed matrix is ​​usually indicated by a superscript or a prime at the top right.

Step by step example:

Transpose matrix

First we rewrite the first row into the first column:

Then we rewrite the second line into the second column:

And finally, we rewrite the third row into the third column:

Ready. Roughly speaking, transposing means turning the matrix on its side.

4) Act four. Sum (difference) of matrices.

The sum of matrices is a simple operation.
NOT ALL MATRICES CAN BE FOLDED. To perform addition (subtraction) of matrices, it is necessary that they be the SAME SIZE.

For example, if a two-by-two matrix is ​​given, then it can only be added with a two-by-two matrix and no other!

Example:

Add matrices And

In order to add matrices, you need to add their corresponding elements:

For the difference of matrices the rule is similar, it is necessary to find the difference of the corresponding elements.

Example:

Find matrix difference ,

How can you solve this example more easily, so as not to get confused? It is advisable to get rid of unnecessary minuses; to do this, add a minus to the matrix:

Note: in the theory of higher school mathematics there is no concept of “subtraction”. Instead of saying “subtract this from this,” you can always say “add a negative number to this.” That is, subtraction is a special case of addition.

5) Act five. Matrix multiplication.

What matrices can be multiplied?

In order for a matrix to be multiplied by a matrix, it is necessary so that the number of matrix columns is equal to the number of matrix rows.

Example:
Is it possible to multiply a matrix by a matrix?

This means that matrix data can be multiplied.

But if the matrices are rearranged, then, in this case, multiplication is no longer possible!

Therefore, multiplication is not possible:

It is not so rare to encounter tasks with a trick, when the student is asked to multiply matrices, the multiplication of which is obviously impossible.

It should be noted that in some cases it is possible to multiply matrices in both ways.
For example, for matrices, and both multiplication and multiplication are possible

Purpose of the service. Matrix calculator is intended for solving matrix expressions, for example, such as 3A-CB 2 or A -1 +B T .

Instructions. For an online solution, you need to specify a matrix expression. At the second stage, it will be necessary to clarify the dimension of the matrices.

Actions on matrices

Valid operations: multiplication (*), addition (+), subtraction (-), inverse matrix A^(-1), exponentiation (A^2, B^3), matrix transposition (A^T).

Valid operations: multiplication (*), addition (+), subtraction (-), inverse matrix A^(-1), exponentiation (A^2, B^3), matrix transposition (A^T).
To perform a list of operations, use a semicolon (;) separator. For example, to perform three operations:
a) 3A+4B
b) AB-VA
c) (A-B) -1
you will need to write it like this: 3*A+4*B;A*B-B*A;(A-B)^(-1)

A matrix is ​​a rectangular numerical table with m rows and n columns, so the matrix can be schematically represented as a rectangle.
Zero matrix (null matrix) is a matrix whose elements are all equal to zero and are denoted by 0.
Identity matrix is called a square matrix of the form


Two matrices A and B are equal, if they are the same size and their corresponding elements are equal.
Singular matrix is a matrix whose determinant is equal to zero (Δ = 0).

Let's define basic operations on matrices.

Matrix addition

Definition . The sum of two matrices of the same size is a matrix of the same dimensions, the elements of which are found according to the formula . Denoted by C = A+B.

Example 6. .
The operation of matrix addition extends to the case of any number of terms. Obviously A+0=A .
Let us emphasize once again that only matrices of the same size can be added; For matrices of different sizes, the addition operation is not defined.

Subtraction of matrices

Definition . The difference B-A of matrices B and A of the same size is a matrix C such that A+ C = B.

Matrix multiplication

Definition . The product of a matrix by a number α is a matrix obtained from A by multiplying all its elements by α, .
Definition . Let two matrices be given and , and the number of columns of A is equal to the number of rows of B. The product of A by B is a matrix whose elements are found according to the formula .
Denoted by C = A·B.
Schematically, the operation of matrix multiplication can be depicted as follows:

and the rule for calculating an element in a product:

Let us emphasize once again that the product A·B makes sense if and only if the number of columns of the first factor is equal to the number of rows of the second, and the product produces a matrix whose number of rows is equal to the number of rows of the first factor, and the number of columns is equal to the number of columns of the second. You can check the result of multiplication using a special online calculator.

Example 7. Given matrices And . Find matrices C = A·B and D = B·A.
Solution. First of all, note that the product A·B exists because the number of columns of A is equal to the number of rows of B.


Note that in the general case A·B≠B·A, i.e. the product of matrices is anticommutative.
Let's find B·A (multiplication is possible).

Example 8. Given a matrix . Find 3A 2 – 2A.
Solution.

.
; .
.
Let us note the following interesting fact.
As you know, the product of two non-zero numbers is not equal to zero. For matrices, a similar circumstance may not occur, that is, the product of non-zero matrices may turn out to be equal to the null matrix.



Did you like the article? Share with your friends!