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 MCAT medical school admissions SAT expository writing college admissions English MD/PhD admissions strategy writing LSAT GMAT GRE physics chemistry math biology graduate admissions academic advice ACT interview prep law school admissions test anxiety language learning premed MBA admissions career advice personal statements homework help AP exams creative writing MD study schedules test prep computer science Common Application summer activities history mathematics philosophy organic chemistry secondary applications economics supplements research 1L PSAT admissions coaching grammar law psychology statistics & probability legal studies ESL CARS SSAT covid-19 dental admissions logic games reading comprehension engineering USMLE calculus PhD admissions Spanish mentorship parents Latin biochemistry case coaching verbal reasoning DAT English literature STEM excel medical school political science skills AMCAS French Linguistics MBA coursework Tutoring Approaches academic integrity chinese letters of recommendation Anki DO Social Advocacy admissions advice algebra art history artificial intelligence astrophysics business cell biology classics diversity statement gap year genetics geometry kinematics linear algebra mechanical engineering mental health presentations quantitative reasoning study abroad technical interviews time management work and activities 2L DMD IB exams ISEE MD/PhD programs Sentence Correction adjusting to college algorithms amino acids analysis essay athletics business skills careers cold emails data science dental school finance first generation student functions graphing information sessions international students internships logic networking poetry resume revising science social sciences software engineering tech industry trigonometry writer's block 3L AAMC Academic Interest EMT FlexMed Fourier Series Greek Health Professional Shortage Area Italian Lagrange multipliers London MD vs PhD MMI Montessori National Health Service Corps Pythagorean Theorem Python Shakespeare Step 2 TMDSAS Taylor Series Truss Analysis Zoom acids and bases active learning architecture argumentative writing art art and design schools art portfolios bacteriology bibliographies biomedicine brain teaser campus visits cantonese capacitors capital markets central limit theorem centrifugal force 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 escape velocity evolution executive function freewriting genomics 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 linear maps mandarin chinese matrices mba medical physics meiosis microeconomics mitosis mnemonics music music theory nervous system neurology neuroscience object-oriented programming office hours operating systems

Related Content