How To Multiply Matrices Quickly and Correctly in Six Easy Steps

math
By Jesse

math-3

Step 0  Make Sure the product makes sense!

Say we’re given two matrices A and B, where

Screen Shot 2018-09-26 at 6.29.09 PM

and we’ve been asked to find the product AB. To see if AB makes sense, write down the sizes of the matrices in the positions you want to multiply them. In this case, we write

Screen Shot 2018-09-26 at 6.31.15 PM

To check that the product makes sense, simply check if the two numbers on the inside agree. If they do, the product can be taken, if they don’t agree, the product doesn’t make sense. For instance, even though the product AB makes sense, the product BA does not. Indeed, the inside numbers of

Screen Shot 2018-09-26 at 6.32.25 PMdon’t match up.

Step 1  If the product makes sense, find the dimensions of your answer

Again, we can make use of the technique of writing down the dimensions in order. Let’s take the same A and B from above. We write down

Screen Shot 2018-09-26 at 6.34.41 PM

The outside numbers, in order, give the dimensions of the product. Reading the outside numbers left to right, we get 1 × 3, which is the dimension of

Screen Shot 2018-09-26 at 7.27.01 PM

or the product AB. We’ll compute this ourselves in a minute! To recap,

• Write down the dimensions of the two matrices A and B. 

Screen Shot 2018-09-26 at 7.27.54 PM

• Check if the inside numbers agree.

Screen Shot 2018-09-26 at 7.28.27 PM

• If they agree, read the dimensions of the answer off the outside numbers

Screen Shot 2018-09-26 at 7.29.30 PM

Special Case – Multiplying a row vector by a matrix

Step 2 – Write out the rows of the matrix on the right

In our example, we would write

Screen Shot 2018-09-26 at 7.30.49 PM

Make sure you write them in the order they appeared!

Step 3 – Multiplication

Multiply the first row of B by the first entry of A, the second row by the second entry, and so on.

Screen Shot 2018-09-26 at 7.32.26 PMwhich equals

Screen Shot 2018-09-26 at 7.34.39 PM

Step 4 – Addition

Add up the rows you got in step 3 to get your answer

Screen Shot 2018-09-26 at 7.40.32 PM

General Case -- Two Matrices

Now let's say we want to multiply a new matrix A' by the same matrix B, where

Screen Shot 2018-09-26 at 7.43.01 PM

Doing steps 0 and 1, we see

Screen Shot 2018-09-26 at 7.43.47 PMthe product makes sense and the output should be 3 X 3.  We'll find the output row by row.

Step 5 – Break both matrices into rows

In our example, we would write

Screen Shot 2018-09-26 at 7.48.59 PM
Step 6 – Repeat Steps 1-4 for each row of A'

To find the first row of our 3x3 answer, compute the product Screen Shot 2018-09-26 at 7.53.09 PM, the first row of A' times B.

Screen Shot 2018-09-26 at 7.54.46 PM

which is the problem we just solved. So, the first row of our answer is

Screen Shot 2018-09-26 at 7.56.45 PMTo find the second row of our 3x3 answer, compute Screen Shot 2018-09-26 at 7.57.57 PM, which I'll leave the reader to verify is 

Screen Shot 2018-09-26 at 7.59.12 PM

Finally, the third row of our 3x3 answer is Screen Shot 2018-09-26 at 8.00.42 PM, so we multiply

Screen Shot 2018-09-26 at 8.01.20 PMand then add

Screen Shot 2018-09-26 at 8.01.56 PM

We've found the three rows of our solution matrix and we conclude

Screen Shot 2018-09-26 at 8.04.23 PM

The common way of stating this perspective is that in the multiplication of AB, A acts on B by row operations. We view B as a collection of row vectors and the rows of A have us take linear combinations of the row vectors in B to form the rows of the solution. There is an equivalent perspective of column operations. Each has their place. Stay tuned for a follow-up post about how each of these perspectives comes into play when solving the matrix equation Ax = b.

Are you interested in connecting with a mathematics tutor like Jesse?

Contact us!

Comments

topicTopics
academics study skills medical school admissions MCAT SAT college admissions expository writing strategy English MD/PhD admissions writing LSAT physics GMAT GRE chemistry graduate admissions academic advice biology math law school admissions ACT interview prep language learning test anxiety personal statements premed career advice MBA admissions AP exams homework help test prep creative writing MD computer science mathematics study schedules Common Application summer activities history secondary applications philosophy research organic chemistry economics supplements 1L admissions coaching dental admissions grammar statistics & probability PSAT psychology law legal studies ESL reading comprehension CARS PhD admissions SSAT covid-19 logic games calculus engineering USMLE medical school mentorship Latin Spanish parents AMCAS admissions advice biochemistry case coaching verbal reasoning DAT English literature STEM excel genetics political science skills French Linguistics MBA coursework Tutoring Approaches academic integrity astrophysics chinese classics dental school gap year letters of recommendation mechanical engineering technical interviews units Anki DO Social Advocacy algebra art history artificial intelligence business careers cell biology data science diversity statement first generation student freewriting geometry graphing kinematics linear algebra mental health pre-dental presentations quantitative reasoning software engineering study abroad tech industry time management work and activities 2L AAMC DMD IB exams ISEE MD/PhD programs MMI Sentence Correction adjusting to college algorithms amino acids analysis essay argumentative writing athletics business skills cold emails executive function fellowships finance functions genomics information sessions international students internships logic networking office hours poetry proofs resume revising scholarships science social sciences trigonometry writer's block 3L Academic Interest ChatGPT EMT FlexMed Fourier Series Greek Health Professional Shortage Area Italian JD/MBA admissions Japanese Lagrange multipliers London MD vs PhD Montessori National Health Service Corps Pythagorean Theorem Python Shakespeare Step 2 TMDSAS Taylor Series Truss Analysis Zoom acids and bases active learning architecture art art and design schools art portfolios bacteriology bibliographies biomedicine brain teaser burnout campus visits cantonese capacitors capital markets central limit theorem centrifugal force chem/phys chemical engineering chess chromatography class participation climate change clinical experience community service constitutional law consulting cover letters curriculum dementia demonstrated interest dimensional analysis distance learning econometrics electric engineering electricity and magnetism embryology entropy escape velocity evolution extracurriculars fundraising harmonics health policy history of medicine history of science hybrid vehicles hydrophobic effect ideal gas law immunology induction infinite institutional actions integrated reasoning intermolecular forces intern investing investment banking lab reports letter of continued interest linear maps