Revision & study organizationLearning methods

Matrix multiplication: check row–column products, dimensions and units

A matrix-product entry sums matching products from one row of the left matrix and one column of the right. It does not merely multiply two entries in the same position. Check inner dimensions and category order first. This original two-group pack exercise supplies every input, four cell calculations, an independent total check and a changed-count problem.

A close-up stack of papers and documents, illustrating an exercise that calculates printed pages by pack
Illustrative photo: Camilo Rueda López · Unsplash LicenseA paper-document illustration; the matrices, packs and page counts in the article are original fictional teaching data. Photo: Camilo Rueda López / Unsplash.

The learning goal

The 2×3 count matrix A and 3×2 page matrix B align the pack types X, Y and Z, so AB is 2×2. Morning needs 10 black-and-white pages and 7 color pages; Afternoon needs 7 of each. Totals are 17 black-and-white and 14 color pages. Increasing Afternoon’s Z count from 3 to 4 changes its output to 8 black-and-white and 9 color pages.

Name every row and column first

The groups, pack types and counts are original KitNelo teaching material, not real course records. The single question is how many black-and-white and color pages each group needs after receiving specified pack counts. The unit is a printed page, not sheets after duplex layout, and excludes binding or waste pages.

A has Morning and Afternoon rows and X, Y, Z pack-count columns. B must retain that same X, Y, Z row order; its columns contain black-and-white and color pages per pack. A has two rows and three columns, B three rows and two columns. Preserve labels so the middle categories match in meaning as well as count.

Input A: packs received by each group
GroupX/packsY/packsZ/packs
Morning210
Afternoon103
Input B: printed pages per pack
Pack typeBlack-and-white pages/packColor pages/pack
X41
Y25
Z12

Use one row and one column for each output

OpenStax’s matrix-operations chapter requires equal inner dimensions and gives the product the left matrix’s row count and the right matrix’s column count. Here (2×3)×(3×2) produces 2×2. Mark those four output positions before calculating.

For Morning’s black-and-white output, match row (2, 1, 0) with column (4, 2, 1): 2×4+1×2+0×1=10. Each term multiplies a pack count by pages per pack. Add the contributions for that one page category.

Expand the remaining cells fully. Zero explicitly means no packs of that type in this example; it is not missing data. Do not remove 0×5 and shift the later category into its position. The reason-for-each-step exercise helps check whether you can identify where every factor came from.

Complete row–column calculations
Output positionSum of matching productsResult
Morning/black-and-white2×4+1×2+0×110 pages
Morning/color2×1+1×5+0×27 pages
Afternoon/black-and-white1×4+0×2+3×17 pages
Afternoon/color1×1+0×5+3×27 pages

Check the totals through a different route

The cell answers should reconcile with a separate aggregation. Across both groups, X totals 2+1=3 packs, Y totals 1+0=1 and Z totals 0+3=3. Compute all printing by pack type next.

Black-and-white pages total 3×4+1×2+3×1=17; color pages total 3×1+1×5+3×2=14. These match the output-column sums 10+7 and 7+7. All printed pages total 17+14=31.

This check reconstructs contributions to a total; it does not require division by pack counts. The weighted-average contribution exercise distinguishes totals from averages. The deliverable here is total printing, so an extra final division would answer another question.

Two aggregation routes should agree
Page typeBy groupBy pack type
Black-and-white10+7=173×4+1×2+3×1=17
Color7+7=143×1+1×5+3×2=14

Why valid dimensions can still answer the wrong question

Matching dimensions permit the numerical operation; they do not align categories automatically. If B’s rows become Z, X, Y while A’s columns remain X, Y, Z, multiplying by position gives Morning 6 black-and-white and 5 color pages. The arithmetic executes but matches the wrong pack types. Repair the label alignment rather than editing the final values.

Order is also part of the question. BA is numerically defined here but produces 3×3, not two groups by two page types. B’s column labels are page categories while A’s row labels are groups. Both happen to have two positions, but they do not provide this task’s common middle category. Equal position counts alone do not preserve the original model.

An editor-designed missing-term error

Faulty calculation

Morning black-and-white pages: 2×4=8.

Repaired calculation

Morning black-and-white pages=2×4+1×2+0×1=10.

The first term counts X only and omits one Y pack. A row–column product accumulates every matching category’s contribution, not just the first position or a product of two row/column sums.

Predict one more Z pack, then recompute

Change only Afternoon’s Z count from 3 to 4. One Z pack contains 1 black-and-white and 2 color pages, so predict additions of 1 and 2 to Afternoon’s outputs while Morning remains unchanged.

Full recomputation gives Afternoon black-and-white 1×4+0×2+4×1=8 and color 1×1+0×5+4×2=9. The new rows are (10, 7) and (8, 9), totaling 18 black-and-white and 16 color pages, or 34 pages altogether. The increase from 31 is 3, exactly one Z pack’s pages.

Explain the category matches through which that changed input traveled. This small model assumes fixed pages per pack and omits binding, copy waste and other operating constraints. Add those conditions for real printing instead of treating the exercise as a complete production plan.

Check the algorithm and meaning, not only one total

  • Identify the common X, Y, Z order in A’s columns and B’s rows.
  • Explain why 2×3 and 3×2 produce 2×2.
  • Retain all three terms for each of the four outputs.
  • Reconcile original totals 17 and 14 by group and by category.
  • Increase only the relevant group’s outputs by 1 and 2 for one more Z pack.

Common questions

If AB exists, does BA always exist?

No. With A of size 2×3 and B of size 3×1, AB has matching inner dimensions 3 and 3 and gives 2×1. BA has inner dimensions 1 and 2, which do not match. Check the two orders separately.

Further reading & sources

Related articles