# Matrix

### Matrix Multiplication

{% hint style="info" %}
Hadamard Product/Multiplication is simply the elementwise multiplication of two Matrix. Usually, in programming, the notation of this operation is a star (\*). &#x20;
{% endhint %}

### Multiplying a Matrix by Another Matrix

Need to do the "dot product" of rows and columns.

![](/files/-MPCpBOrhDSQZG9QX6WO)

![](/files/-MPCpJkw3xnLIZbAwx7u)

![](/files/-MPCpO5J0TAjzbek8iDd)

## Dividing a Matrix by Another Matrix

We don't do that. Rather we make the inverse of the denominator matrix and then multiply it with the numerator matrix.

**However**, the elementwise division is obviously possible.

## Inverse of a Matrix

**2x2 Matrix.** The inverse of a 2x2 is easy compared to larger matrices (such as a 3x3, 4x4, etc). For those larger matrices there are other methods to work out the inverse.

![](/files/-MPCqqlD0pE2rr1Hbjt8)

Very much helpful if we want to get an unknown matrix such as X where,$$XA = B$$ by $$X = BA^{-1}$$&#x20;

## Determinant of a Matrix

The determinant of a matrix is a special number that can be calculated from a square matrix. The determinant helps us find the inverse of a matrix, tells us things about the matrix that are useful in systems of linear equations, calculus and more.

**Calculating the Determinant - For a 2×2 Matrix**

![](/files/-MPCrmTlKQzbHOC0DOda)

$$
|A| = ad - bc
$$

## Identity Matrix

It is the matrix equivalent of the number "1". It is "square" (has same number of rows as columns), It has 1s on the diagonal and 0s everywhere else.

$$
A \times A^{-1} = A^{-1} \times A = I
$$

{% embed url="<https://www.mathsisfun.com/algebra/matrix-multiplying.html>" %}

{% embed url="<https://www.mathsisfun.com/algebra/matrix-inverse.html>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ai.nuhil.net/vector-and-matrix/matrix.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
