# Matrix multiplication

0/1
##### Intros
###### Lessons
1. Multiplying a matrix by a matrix overview:
Dot product
0/11
##### Examples
###### Lessons
1. Dot product
Find the dot product of the following ordered $n$-tuples:
1. $\vec{a}=(2,4,6)$ and $\vec{b}=(1,3,5)$
2. $\vec{a}=(1,7,5,3)$ and $\vec{b}=(-2,3,6,1)$
3. $\vec{a}=(1,2)$ and $\vec{b}=(3,5)$
4. $\vec{a}=(7,-2,-1,4)$ and $\vec{b}=(1,1,2,2)$
2. Multiplying matrices
Multiply the following matrices:

3. Multiplying matrices with different dimensions
Multiply the following matrices:
###### Topic Notes
In this lesson, we will learn how to multiply a matrix with another matrix. But we will learn about n-tuples first. An n-tuple is an ordered list of n numbers. Multiplying an n-tuple by another n-tuple is called the dot product. The dot product is the summation of all product of each corresponding entries. To multiply a matrix with another matrix, we have to think of each row and column as a n-tuple. Each entry will be the dot product of the corresponding row of the first matrix and corresponding column of the second matrix. For example, if your entry is at the 3rd row and 4th column, then you have to take the dot product of the 3rd row of the first matrix and 4th column of the second matrix. Note that not all matrices can be multiplied.

## Introduction to Matrix Multiplication

Welcome to our exploration of matrix multiplication, a fundamental concept in linear algebra that's crucial for various applications in mathematics, science, and engineering. This operation, which combines the dot product with the structure of matrices, allows us to perform complex calculations efficiently. Our introduction video will guide you through the basics, making this sometimes challenging topic more accessible. As your personal math tutor, I'm excited to help you understand how matrix multiplication works and why it's so important. You'll see how it's used in everything from computer graphics to data analysis. By mastering this concept, you'll unlock a powerful tool for solving systems of equations and transforming data. Remember, while it might seem daunting at first, with practice, you'll find matrix multiplication to be an invaluable skill in your mathematical toolkit. Let's dive in and discover the fascinating world of matrix multiplication together!

## Understanding N-tuples and Dot Products

Let's dive into the fascinating world of n-tuples and dot products, two fundamental concepts in linear algebra that play a crucial role in matrix multiplication process. Imagine you're organizing a list of your favorite things that's essentially what an n-tuple is, but in mathematics!

An n-tuple is an ordered list of n elements, where n can be any positive integer. For example, a 3-tuple (also called a triple) might look like (2, 5, 8), while a 5-tuple could be (1, 3, 5, 7, 9). These n-tuples are the building blocks of vectors, which are essential in many mathematical and scientific applications.

Now, let's connect n-tuples to vectors. A vector is a mathematical object that has both magnitude and direction of vectors. In linear algebra, we often represent vectors as n-tuples. For instance, a vector in two-dimensional space might be written as (3, 4), where 3 represents the x-coordinate and 4 represents the y-coordinate.

This is where dot products come into play. The dot product, also known as the scalar product, is a way to multiply two vectors together to get a single number as a result. It's a fundamental operation in linear algebra and has numerous applications in physics, computer graphics, and machine learning.

To calculate the dot product of two vectors, we multiply corresponding components and then sum the results. Let's walk through this process step-by-step:

1. Take two vectors of the same dimension, let's say A = (a1, a2, a3) and B = (b1, b2, b3).
2. Multiply the corresponding components: (a1 * b1), (a2 * b2), (a3 * b3).
3. Sum up these products: A · B = (a1 * b1) + (a2 * b2) + (a3 * b3).

Let's try an example to make this clearer. Suppose we have two vectors: A = (2, 3, 4) and B = (1, 5, 2). To find their dot product:

1. Multiply corresponding components: (2 * 1), (3 * 5), (4 * 2)
2. This gives us: 2, 15, 8
3. Sum these results: 2 + 15 + 8 = 25

So, the dot product of A and B is 25.

The dot product has some interesting properties. If two vectors are perpendicular (orthogonal), their dot product is zero. Additionally, the dot product of a vector with itself gives the square of its magnitude.

Now, you might be wondering how this relates to matrix multiplication process. Well, when we multiply matrices, we're essentially performing a series of dot products! Each element in the resulting matrix is the dot product of a row from the first matrix and a column from the second matrix.

For instance, if we have two matrices:

A = [1 2] B = [5 6]
[3 4] [7 8]

To find the element in the first row and first column of the result, we'd calculate the dot product of the first row of A (1, 2) and the first column of B (5, 7):

(1 * 5) + (2 * 7) = 5 + 14 = 19

We'd repeat this process for each element in the resulting matrix.

Understanding n-tuples and dot products is crucial for grasping more advanced concepts in linear algebra and its applications. These concepts form the foundation for understanding vector spaces, linear transformations, and many other important mathematical ideas.

As you continue your journey in mathematics, you'll find these concepts popping up in various fields, from physics to computer science. The ability to work with n-tuples and calculate dot products will

## Matrix Multiplication Rules and Process

Welcome to the fascinating world of matrix multiplication! This fundamental operation in linear algebra might seem daunting at first, but don't worry we'll break it down step by step. By the end of this guide, you'll be confidently multiplying matrices like a pro!

Let's start with the golden rule of matrix multiplication: the number of columns in the first matrix must equal the number of rows in the second matrix. This rule is crucial because it determines whether two matrices can be multiplied together. For example, you can multiply a 2x3 matrix by a 3x2 matrix, but not by a 2x3 matrix.

Now, let's dive into the matrix multiplication formula. When multiplying two matrices, the resulting matrix will have the same number of rows as the first matrix and the same number of columns as the second matrix. Each element in the result is calculated by multiplying corresponding elements from a row of the first matrix with a column of the second matrix and then summing these products.

Here's a step-by-step guide to matrix multiplication:

1. Verify that the matrices can be multiplied (columns of first = rows of second).
2. Determine the dimensions of the resulting matrix.
3. For each element in the result, multiply corresponding row elements with column elements.
4. Sum these products to get the final value for that position.
5. Repeat for all elements in the result matrix.

Let's look at a 2x2 matrix multiplication example:

Matrix A = [1 2] [3 4]

Matrix B = [5 6] [7 8]

To multiply these, we'll follow our steps:

1. (2x2) * (2x2) is valid, as the inner dimensions match (2 = 2).
2. The result will be a 2x2 matrix.
3. For the first element (row 1, column 1): (1 * 5) + (2 * 7) = 5 + 14 = 19
4. We continue this process for all elements.

The final result is: [19 22] [43 50]

Now, let's tackle a 3x3 matrix multiplication example:

Matrix C = [1 2 3] [4 5 6] [7 8 9]

Matrix D = [9 8 7] [6 5 4] [3 2 1]

Following the same process:

1. (3x3) * (3x3) is valid.
2. The result will be a 3x3 matrix.
3. For the first element: (1 * 9) + (2 * 6) + (3 * 3) = 9 + 12 + 9 = 30
4. We continue this for all nine elements in the result.

The final 3x3 result is: [30 24 18] [84 69 54] [138 114 90]

Remember, matrix multiplication commutative property is not commutative, meaning A * B is not always equal to B * A. This is different from regular number multiplication where order doesn't matter.

As you practice, you'll find that understanding matrix multiplication dimensions is key. Always check if the matrices can be multiplied before starting the calculation. With time and practice, you'll become more comfortable with these operations.

Matrix multiplication dimensions has numerous applications in various fields, including computer graphics, data analysis, and physics simulations. By mastering this skill, you're

## Comparing Matrix Multiplication to Other Operations

When it comes to matrix operations, multiplication stands out as a unique and powerful tool in linear algebra. Let's explore how matrix multiplication examples compare to other operations like matrix addition and subtraction, and why it's so special.

First, let's consider matrix addition and subtraction. These operations are relatively straightforward: you simply add or subtract corresponding elements in two matrices of the same size. For example:

[1 2] + [3 4] = [4 6]
[3 4] [1 2] [4 6]

Matrix multiplication examples, however, is a whole different ball game. It's not just about matching up elements; it involves a more complex process of combining rows and columns. This is what makes matrix multiplication so powerful and unique.

One key difference is that matrix multiplication isn't commutative. While A + B = B + A for addition, AB BA for multiplication (unless A and B are special cases). This property alone sets matrix multiplication apart from simpler operations.

Another crucial aspect is the dimension rules for matrix multiplication. Unlike addition and subtraction, which require matrices of the same size, multiplication has its own set of rules. To multiply two matrices, the number of columns in the first matrix must equal the number of rows in the second matrix. This is where the concept of "multiplying matrices of different sizes" comes into play.

For instance, you can multiply a 2x3 matrix by a 3x2 matrix, resulting in a 2x2 matrix. But you can't multiply a 2x3 matrix by a 2x2 matrix. Understanding when you can multiply matrices is essential in linear algebra and its applications.

Let's look at an example to illustrate this:

[1 2 3] x [1 2] = [14 20]
[4 5 6] [3 4] [32 47]
[5 6]

Here, we're multiplying a 2x3 matrix by a 3x2 matrix, resulting in a 2x2 matrix. The process involves dot products of rows and columns, which is why "matrix multiplication vs dot product" is often discussed they're closely related!

It's important to note that matrix multiplication isn't just about following rules; it's a powerful tool for transforming data with matrices and solving complex problems. In fields like computer graphics, data analysis, and machine learning, matrix multiplication is used to perform rotations, scaling, and other transformations efficiently.

When learning about matrix multiplication, don't get discouraged if it seems complex at first. Remember, every mathematician and scientist had to start somewhere! With practice and patience, you'll begin to see the beauty and utility of this operation.

To summarize the key points:

• Matrix addition and subtraction are element-wise operations on same-sized matrices.
• Matrix multiplication involves a more complex combination of rows and columns.
• Matrix multiplication isn't commutative (AB BA in general).
• To multiply matrices, the number of columns in the first matrix must equal the number of rows in the second.
• The resulting matrix size depends on the outer dimensions of the multiplied matrices.

As you continue your journey in linear algebra, remember that matrix multiplication is a fundamental concept with wide-ranging applications. Don't hesitate to practice with different examples and visualize the process. With time, you'll develop an intuition for when and how to use this powerful operation.

Keep exploring, stay curious, and embrace the challenges you're on your way to mastering one of the most important concepts in mathematics and its applications!

## Applications and Importance of Matrix Multiplication

Matrix multiplication is an incredibly powerful mathematical tool that has revolutionized numerous fields, from computer graphics to data analysis and physics. It's not just a concept confined to textbooks; it's a fundamental operation that drives many of the technologies we use every day. Let's dive into the exciting world of matrix multiplication and explore its practical applications!

In computer graphics, matrix multiplication is the secret sauce behind stunning 3D animations and video games. Imagine transforming a simple 2D shape into a complex 3D object that you can rotate, scale, and move around on your screen. That's matrix multiplication in action! Every time you marvel at the realistic movements of characters in animated movies or enjoy immersive virtual reality experiences, you're witnessing the power of matrix operations.

But the applications don't stop there. In the realm of data analysis, matrix multiplication is a game-changer. It's the backbone of machine learning algorithms that process vast amounts of information to make predictions and uncover patterns. When you receive personalized recommendations on streaming platforms or see targeted ads online, that's matrix multiplication working behind the scenes to analyze your preferences and behavior.

The importance of matrix multiplication in physics cannot be overstated. It's the language that describes complex systems and their interactions. From quantum mechanics to relativity theory, matrices help physicists model and understand the fundamental laws of the universe. When scientists simulate particle collisions or study the behavior of electromagnetic fields, they rely heavily on matrix operations to perform their calculations.

Real-world examples of matrix multiplication are all around us. In robotics, matrices are used to control the movement of robotic arms with precision. In economics, they help analyze complex market trends and make financial forecasts. Even in social network analysis, matrices play a crucial role in understanding connections and influences within large groups of people.

The beauty of matrix multiplication lies in its ability to simplify complex problems. Instead of dealing with numerous individual equations, we can represent entire systems as matrices and perform operations on them efficiently. This not only saves time but also allows us to tackle problems that would be practically impossible to solve otherwise.

Understanding matrix multiplication is crucial because it forms the foundation for more advanced mathematical concepts. It's like learning a new language that opens up a world of possibilities in various fields. Whether you're aspiring to be a computer scientist, data analyst, physicist, or engineer, a solid grasp of matrix operations will give you a significant advantage.

The applications of matrix multiplication continue to expand as technology advances. In the field of artificial intelligence, matrices are at the heart of neural networks that power cutting-edge AI systems. These networks use matrix operations to process and learn from vast amounts of data, enabling machines to perform tasks that once seemed impossible, like natural language processing and image recognition.

In the world of computer vision, matrix multiplication helps in image processing tasks such as filtering, edge detection, and facial recognition. Every time you use a face filter on social media or your phone automatically focuses on faces in a photo, you're benefiting from matrix operations working in real-time.

The importance of matrix multiplication extends to the realm of cryptography as well. Many encryption algorithms rely on matrix operations to secure digital communications. When you make an online purchase or send a confidential email, matrix multiplication plays a role in keeping your information safe from prying eyes.

As we look to the future, the applications of matrix multiplication are only set to grow. Emerging fields like quantum computing heavily rely on matrix operations to perform complex calculations that could revolutionize industries from drug discovery to financial modeling. The potential for breakthroughs in these areas is truly exciting!

In conclusion, matrix multiplication is not just a mathematical concept; it's a powerful tool that shapes our modern world in countless ways. From the entertainment we enjoy to the scientific discoveries that push the boundaries of human knowledge, matrices are working tirelessly behind the scenes. By understanding and harnessing the power of matrix multiplication, we open doors to innovation and problem-solving across a wide range of disciplines. So the next time you encounter matrices, remember that you're looking at one of the most versatile and important mathematical tools at our disposal. Embrace the world of matrix multiplication, and you'll be amazed at the possibilities it unlocks!

## Common Mistakes and Tips for Matrix Multiplication

Matrix multiplication is a fundamental concept in linear algebra, but it can be challenging for many students. Let's explore some common mistakes and provide helpful tips to improve your matrix multiplication skills. Remember, making mistakes is a natural part of the learning process, so don't get discouraged!

### Common Mistakes in Matrix Multiplication

1. Forgetting the compatibility rule: One of the most frequent errors is attempting to multiply matrices that aren't compatible. Always remember that the number of columns in the first matrix must equal the number of rows in the second matrix.

2. Mixing up row-by-column multiplication: Students often confuse which elements to multiply together. Remember, you multiply each row of the first matrix by each column of the second matrix.

3. Incorrect order of operations: When multiplying matrices, the order matters. A × B is not necessarily equal to B × A. Always pay attention to the given order.

4. Misaligning elements: Ensure that you're aligning the correct elements when multiplying. It's easy to lose track, especially with larger matrices.

5. Addition errors: After multiplying the correct elements, students sometimes make mistakes when adding up the products. Double-check your arithmetic!

### Tips and Strategies for Successful Matrix Multiplication

1. Check compatibility first: Before starting any calculations, verify that the matrices can be multiplied. The number of columns in the first matrix should equal the number of rows in the second.

2. Use the "dot product" method: Think of each entry in the result as a dot product of a row from the first matrix and a column from the second. This mental model can help you stay organized.

3. Practice with smaller matrices: Start with 2x2 or 3x3 matrices to build your confidence and understanding before tackling larger ones.

4. Use a systematic approach: Develop a consistent method for working through the multiplication process. This could involve using your finger to track rows and columns or creating a visual guide on scratch paper.

5. Double-check your work: After completing the multiplication, take a moment to review your steps and final answer. Look for any obvious errors or inconsistencies.

### Memory Aids and Shortcuts

1. "ROW times COLumn": This phrase can help you remember the correct orientation for multiplication. You're always multiplying a row from the first matrix by a column from the second.

2. The "FOIL" method: For 2x2 matrices, you can use the FOIL (First, Outer, Inner, Last) method as a memory aid for the four multiplications needed for each entry in the result.

3. Visualize a grid: Imagine the resulting matrix as a grid, with each cell representing the dot product of a specific row and column. This mental image can help you keep track of your progress.

4. Use mnemonic devices: Create memorable phrases or acronyms to help you remember the steps. For example, "Carefully Read Columns, Multiply Accurately" (CRCMA) can remind you of the process.

### Encouragement and Final Thoughts

Remember, mastering matrix multiplication takes time and practice. Don't be discouraged if you make mistakes they're an essential part of the learning process. Each error is an opportunity to reinforce your understanding and improve your skills. Keep practicing, stay patient with yourself, and celebrate your progress along the way.

As you continue to work with matrices, you'll develop a more intuitive understanding of the process. Soon, you'll find yourself performing matrix multiplications with greater ease and confidence. Keep up the great work, and don't hesitate to seek help from teachers, tutors, or classmates if you need additional support. With persistence and the right strategies, you'll become proficient in matrix multiplication in no time!

## Conclusion and Further Study

In this article, we've explored the fundamental concepts of matrix multiplication, emphasizing its importance in linear algebra and various applications. The introduction video provided a crucial visual understanding of the process, making it easier to grasp the mechanics behind matrix multiplication. Key points covered include the rules for matrix compatibility, the step-by-step procedure for multiplying matrices, and real-world applications. To further your understanding, consider practicing with online matrix calculators and exploring more complex examples. Delve deeper into linear algebra by studying topics like eigenvalues, vector spaces, and linear transformations. Apply your newfound knowledge to fields such as computer graphics, data analysis, or machine learning. Remember, mastering matrix multiplication is a stepping stone to more advanced concepts in linear algebra. Challenge yourself with increasingly difficult problems and don't hesitate to explore related mathematical topics. Your journey in understanding matrices has just begun keep practicing and expanding your knowledge!

Understanding the step-by-step matrix multiplication process is crucial for solving complex problems. Additionally, exploring linear algebra applications can provide practical insights into how these concepts are used in real-world scenarios. By studying vector spaces in linear algebra, you can gain a deeper understanding of the structure and behavior of different mathematical systems. Moreover, learning about linear transformations will enhance your ability to manipulate and analyze various mathematical models. Keep challenging yourself with new problems and continue to explore the vast field of linear algebra to build a strong foundation for future studies.

### Multiplying a Matrix by a Matrix Overview: Dot Product

In this guide, we will walk through the process of multiplying a matrix by another matrix using the dot product method. This involves understanding n-tuples, vectors, and the dot product itself. Let's break down the steps to ensure a clear and comprehensive understanding.

#### Step 1: Understanding n-Tuples

Before diving into the dot product, it's essential to understand what n-tuples are. An n-tuple is an ordered list of n numbers. For example, a list of four numbers (1, 2, 3, 4) is called an ordered quadruple, while a list of three numbers (5, 6, 7) is called an ordered triple. These n-tuples can be represented with a variable and an arrow on top, often referred to as vectors in physics.

#### Step 2: Introduction to the Dot Product

The dot product is a way to multiply two ordered n-tuples. To perform the dot product, you multiply each corresponding number in the two n-tuples and then add all the products together. For example, if you have two ordered triples, A = (1, 2, 3) and B = (2, 2, 2), the dot product is calculated as follows:

• Multiply the first numbers: 1 * 2 = 2
• Multiply the second numbers: 2 * 2 = 4
• Multiply the third numbers: 3 * 2 = 6
• Add the products: 2 + 4 + 6 = 12

Thus, the dot product of A and B is 12. It's important to note that the two n-tuples must have the same number of elements to perform the dot product.

#### Step 3: Multiplying Matrices Using the Dot Product

When multiplying two matrices, each row of the first matrix and each column of the second matrix are treated as n-tuples. The dot product of these n-tuples gives the entries of the resulting matrix. Let's consider two matrices:

    Matrix A:
1 2 3
4 5 6
7 8 9

Matrix B:
1 2 1
2 4 6
7 2 5


To multiply these matrices, follow these steps:

• Identify the rows of the first matrix (A) and the columns of the second matrix (B).
• For each entry in the resulting matrix, take the dot product of the corresponding row from A and column from B.

#### Step 4: Calculating the Entries of the Resulting Matrix

Let's calculate the entries of the resulting matrix step by step:

• First entry (row 1, column 1): Dot product of (1, 2, 3) and (1, 2, 7)
• 1 * 1 + 2 * 2 + 3 * 7 = 1 + 4 + 21 = 26
• Second entry (row 1, column 2): Dot product of (1, 2, 3) and (2, 4, 2)
• 1 * 2 + 2 * 4 + 3 * 2 = 2 + 8 + 6 = 16
• Third entry (row 1, column 3): Dot product of (1, 2, 3) and (1, 6, 5)
• 1 * 1 + 2 * 6 + 3 * 5 = 1 + 12 + 15 = 28
• Continue this process for all entries in the resulting matrix.

#### Step 5: Final Result

After calculating all the entries, the resulting matrix is:

    26 16 28
56 40 64
86 64 100


This matrix is the product of multiplying Matrix A by Matrix B using the dot product method.

#### Conclusion

Multiplying matrices using the dot product involves understanding n-tuples, vectors, and the dot product itself. By treating each row of the first matrix and each column of the second matrix as n-tuples, you can calculate the entries of the resulting matrix through the dot product. Practice this method to become proficient in matrix multiplication.

### FAQs

#### 1. Can you multiply a 2x2 and 2x3 matrix?

No, you cannot multiply a 2x2 matrix with a 2x3 matrix. For matrix multiplication to be possible, the number of columns in the first matrix must equal the number of rows in the second matrix. In this case, a 2x2 matrix has 2 columns, but a 2x3 matrix has 2 rows, so they are not compatible for multiplication.

#### 2. What is the row rule for matrix multiplication?

The row rule for matrix multiplication states that each element in the resulting matrix is calculated by taking the dot product of a row from the first matrix with a column from the second matrix. This means you multiply corresponding elements from the row and column, then sum these products to get the new element.

#### 3. How do you multiply a 3x3 matrix?

To multiply two 3x3 matrices:

1. Multiply each element of a row in the first matrix by the corresponding element in a column of the second matrix.
2. Sum these products to get one element of the result matrix.
3. Repeat this process for all rows and columns to fill the entire result matrix.

The resulting matrix will also be 3x3.

#### 4. What is the difference between dot product and matrix multiplication?

The dot product is an operation between two vectors that results in a scalar (single number). Matrix multiplication, on the other hand, is an operation between two matrices that results in a new matrix. However, matrix multiplication uses the dot product in its calculation process. Each element in the resulting matrix is the dot product of a row from the first matrix and a column from the second matrix.

#### 5. Is matrix multiplication commutative?

No, matrix multiplication is not commutative in general. This means that for two matrices A and B, A × B is not necessarily equal to B × A. The order of multiplication matters in matrix operations, unlike in regular number multiplication where the order doesn't affect the result.

### Prerequisite Topics for Matrix Multiplication

Understanding matrix multiplication is crucial in various fields of mathematics and its applications. However, to fully grasp this concept, it's essential to have a solid foundation in several prerequisite topics. One of the fundamental skills required is proficiency in operations on vectors in magnitude and direction form. This knowledge helps in comprehending how matrices represent and transform vectors, which is at the core of matrix multiplication.

Another important prerequisite is understanding polynomial components. Matrices often contain polynomial expressions, and being comfortable with these components aids in manipulating and interpreting matrix elements. Additionally, familiarity with the properties of matrix addition is crucial, as matrix multiplication builds upon these principles.

The properties of scalar multiplication play a significant role in matrix multiplication. Understanding how scalars interact with matrices is essential for grasping the more complex operations involved in multiplying two matrices. This knowledge also helps in determining the correct matrix multiplication dimensions, which is critical for performing valid matrix operations.

One of the most exciting applications of matrix multiplication is in transforming shapes with matrices. This concept bridges the gap between abstract matrix operations and real-world geometric transformations, making it an essential prerequisite for understanding the practical applications of matrix multiplication.

Proficiency in solving systems of equations is another crucial skill. Matrix multiplication is often used to solve complex systems of linear equations efficiently, making this prerequisite invaluable. Furthermore, understanding linear equation applications and being able to graph them provides a visual representation of matrix transformations.

By mastering these prerequisite topics, students can approach matrix multiplication with a comprehensive understanding of its underlying principles. This foundation not only makes learning matrix multiplication easier but also enhances the ability to apply this powerful mathematical tool in various real-world scenarios, from computer graphics to economic modeling. Remember, each prerequisite topic contributes uniquely to the overall understanding of matrix multiplication, forming a robust framework for advanced mathematical concepts.

In this section we will learn how to multiply two matrices like A $\cdot$ B together.

A $n$-tuple is an ordered list of $n$ numbers. For example,
(1,2,3,4) is an ordered quadruple with 4 numbers, and (1,2,3) is an ordered triple with 3 numbers. We usually specify each ordered $n$-tuple as a variable with an arrow on top. For example,

$\vec{x}=(1,2,3,4)$

If we have 2 ordered $n$-tuples, then we can find the dot product. The dot product is summation of all the product of each corresponding entries. For example, let

$\vec{a}=(1,2,3)$ and $\vec{b}=(2,2,2)$.

If we do the dot product of $\vec{a}$ and $\vec{b}$ and ,then we will get the following:

$\vec{a}\cdot\vec{b}=(1,2,3)\cdot(2,2,2)$
$=1\cdot2+2\cdot2+3\cdot2$
$=2+4+6$
$=12$

When we want to multiply a matrix by a matrix, we want to think of each row and column as a $n$-tuple. To be exact, we want to focus on the rows of the first matrix and focus on columns of the second matrix. For example,

For example, $\vec{r_1}$is the first row of the matrix with an ordered triple (1,2,3). Now to multiply these two matrices, we need to use the dot product of $\vec{r_1}$ to each column, dot product of $\vec{r_2}$ to each column, and $\vec{r_3}$ to each column. In other words