You can already multiply matrices. This article is about where that multiplication is needed most often: in production that runs in several stages, where raw materials first become an intermediate product and that becomes the final product.
Imagine a chocolate factory that has received an order. The buyer has to decide how much cocoa and sugar to buy. Buy too little, and the line stops in the middle of the order. Buy too much, and the money sits in the warehouse.
The difficulty is that nobody weighed the cocoa for a bar directly. Production runs in two stages:
cocoa, sugar→→masses→→goods
For each stage there is only its own table. So the need for the order is assembled from two tables, and the whole work is to multiply them in the right order.
Every production in several stages works like this. In the exam these tasks, together with the tasks on machine costs, belong to the chapter on matrix algebra. After the article you will find how much raw material an order takes and work out the costs on the machines.
There are two masses, a dark one and a milk one, and two products, bars and boxes of chocolates.
The technologist drew up the table for the first stage: how much cocoa and sugar goes into one unit of each mass.
The foreman drew up the table for the second stage: how much mass each product takes.
An order comes in: 20 bars and 10 boxes of chocolates.
How much cocoa has to be bought?
Neither of the two tables says. The answer is built stage by stage, first the masses for the order, then the cocoa for those masses, and below the two tables give 180 units of cocoa.
This is where it is easy to go wrong: you multiply the two consumption tables in the order their letters appear in the task and get a wrong answer. The order of the factors follows the path of the material: from raw material to intermediate product, from it to the final product. Only in that order does the product tell how much raw material an order needs.
Check yourself. An exam-level task. Raw materials R1,R2 go into parts Z1,Z2, the parts into products E1,E2:
the matrix A has the rows Z1,Z2 and the columns E1,E2;
the matrix B has the rows R1,R2 and the columns Z1,Z2.
AB=(1321)=(2014)
Order: 10 units of E1 and 5 units of E2. How much raw material R1 is needed?
What the task gives: two requirement tables and an order
Both stages of the factory, raw material to mass and mass to bar, are written as two tables, and the order as a separate column. Before calculating, recall the one rule needed here.
What you need here. Two consumption tables are multiplied into one by the rule “row times column”: an element of the product is a row of the left matrix times a column of the right one, that is, the numbers of the row and the column are multiplied in pairs and added. The rule is derived in the article “Matrix multiplication: why row times column” on two tables of a bakery. The exam sets it in its own way: the tables are described in words, the letters stand in any order, the question is about a single raw material or its cost.
In such tasks the goods pass through three stages:
raw materials, German Rohstoffe, letter R: cocoa and sugar;
intermediate products, German Zwischenprodukte, letter Z: dark mass and milk mass; tasks also call them semi-finished goods, parts or assemblies;
final products, German Endprodukte, letter E: bar and box of chocolates.
Each requirement table links two neighbouring stages. The technologist wrote down how much raw material one unit of mass takes. The rows are labelled with raw materials, the columns with the masses, dark and milk:
M==(3112)←cocoa←sugar
An element is read by its labels:
in the row 'cocoa' and the column 'dark' stands 3: one unit of dark mass takes 3 units of cocoa;
a column holds the recipe of one mass: the dark one takes 3 units of cocoa and 1 of sugar, the milk mass 1 of cocoa and 2 of sugar.
The foreman wrote down how much mass one product takes. The rows are labelled with masses, the columns with the products, bar and box of chocolates:
P==(2013)←dark←milk
a bar takes 2 units of dark mass and no milk mass;
a box of chocolates takes 1 unit of dark and 3 units of milk mass.
The order is written as a vector over the products, in the order of the columns of P: p=(2010), 20 bars and 10 boxes.
It helps to name a table by its labels. M is 'raw materials × masses', R×Z for short. P is 'masses × products', Z×E. These labels decide in which order the tables are multiplied.
The order of the factors: the intermediate product in the middle
Count the cocoa for one bar from the recipes. The bar takes 2 units of dark mass, each with 3 units of cocoa. Of the milk mass, with 1 unit of cocoa, it takes 0:
3⋅⋅2++1⋅⋅0==6 units of cocoa per bar
The first factors, 3 and 1, stand in the row 'cocoa' of M. The second ones, 2 and 0, stand in the column 'bar' of P. That is row times column, an element of the product M⋅P. Every raw material for every product is counted the same way, one cell per step:
3 · 2 + 1 · 0 = 6
Step 1 of 4Cocoa per bar: row 1 times column 1
3⋅2+1⋅0=6.
3⋅1+1⋅3=6. The box takes less dark mass but a lot of milk mass.
1⋅2+2⋅0=2.
1⋅1+2⋅3=7. Result: M⋅P=(6267), rows raw materials, columns products.
The table that says how much raw material one final product takes is called the total requirements matrix (German Gesamtbedarfsmatrix) and written G. The masses no longer show in it: they went into the middle of the product.
G==(R××Z)⋅⋅(Z××E),size R××E
On the left stands the table whose rows are raw materials. On the right stands the table whose columns are products. The columns of the left one and the rows of the right one carry the same intermediate product, in the same order.
The letters do not fix the order. In a task the table 'raw material per mass' may be called B, and 'mass per product' A, and come first in the text. Then G=B⋅A. Before calculating, label both matrices and put on the left the one whose rows are raw materials.
What happens if you mix them up. With square tables the product in reverse order can be calculated too: P⋅M=(7346). But in its first cell 2⋅3+1⋅1=7, 'dark per bar' is multiplied by 'cocoa per dark mass' and 'dark per box' by 'sugar per dark mass'. The 7 looks like an answer and counts nothing. With non-square tables the sizes often give the wrong order away: the product simply does not exist.
Your turn1 of 5
In a furniture factory the matrix T shows boards and glue (rows) per tabletop and per leg (columns), and the matrix S shows tabletops and legs (rows) per table and per chair (columns). The vector p is the order: tables and chairs. Which expression gives the boards and glue for the whole order?
Raw materials for the order: a row of G times the order vector
The matrix G says how much raw material one product takes. Cocoa for the whole order: 6 units for each of the 20 bars and 6 for each of the 10 boxes:
6⋅⋅20++6⋅⋅10==120++60==180
That is the row 'cocoa' of G times the order vector. Sugar: 2⋅20+7⋅10=110. Together this is the vector of raw material requirements (German Rohstoffbedarf):
r=G⋅p==(6267)(2010)==(180110)
The answer to the question at the start: 180 units of cocoa.
Check by stages. The calculation takes two steps:
first the masses for the order, P⋅p: dark 2⋅20+1⋅10=50, milk 0⋅20+3⋅10=30;
then the raw material for these masses, M times (5030): cocoa 3⋅50+1⋅30=180, sugar 1⋅50+2⋅30=110.
It matches because G⋅p=M⋅(P⋅p): through G or stage by stage, the raw material needed is the same.
Only the row asked for. If the question is about one raw material, say cocoa, only the row 'cocoa' of G is needed. It comes from the row 'cocoa' of M and the whole of P: two sums instead of four. Then this row is multiplied by the order.
Total requirements (“Gesamtbedarf”) and raw materials for an order
The chocolate factory went the whole way: two tables into one, then a row times the order. The exam task asks for the same, only its stages are raw materials and intermediate products, and the order of the factors is read off the labels:
Exam-style task
Eine Bäckerei stellt aus Mehl und Butter zunächst die Teige Mürbeteig und Hefeteig her und backt daraus Torte und Zopf. Die Matrix A gibt die Einheiten je Zwischenprodukt (Zeilen: Mürbeteig und Hefeteig) für eine Einheit Endprodukt (Spalten: Torte und Zopf) an, B die Einheiten Rohstoff (Zeilen: Mehl und Butter) je Einheit Zwischenprodukt (Spalten: Mürbeteig und Hefeteig):
A==(3453),B==(2304)
Bestellt werden (in Einheiten): Torte 12, Zopf 20. Wie viele Einheiten Butter werden insgesamt benötigt?
a)42
b)840
c)108
d)742
e)444
You recognise the task by two stages, raw materials and intermediate products, by an order for final products and by the question how much raw material is needed in total. The labels 'rows: flour and butter' decide the order: here the raw material rows belong to B, although the text names A first.
The scheme is the same as in the chocolate factory, only the task has a bakery. B is raw material per dough, like M; A is dough per product, like P. The dough stands in the middle, so G=B⋅A. The question is about one raw material, butter, so one row of G is enough.
B: raw material × dough, A: dough × productdough in the middle: G = B · Ause for the whole order: 840, option (b)
Step 1 of 5Label the rows and columns
A: rows doughs, columns products, so Z×E. B: rows flour and butter, columns doughs, so R×Z. The order p=(1220) counts products, cake and braid.
The dough has to stand in the middle: (R×Z)⋅(Z×E), so G=B⋅A, not A⋅B as the letters suggest.
Row 'butter' of B, (34), times column 'cake' of A, (34): 3⋅3+4⋅4=25 units of butter per cake.
The same row times column 'braid', (53): 3⋅5+4⋅3=27. The row 'butter' of G is (2527).
25⋅12+27⋅20=300+540=840 units of butter, option (b). Check by stages: dough for the order A⋅p=(3⋅12+5⋅204⋅12+3⋅20)=(136108), butter for this dough 3⋅136+4⋅108=840.
A bicycle workshop makes frames and wheels from steel and paint, and city bikes and children's bikes from these. The matrix A has the rows steel and paint and the columns frame and wheel. The matrix B has the rows frame and wheel and the columns city bike and children's bike:
AB=(4110)=(1213)
The finished bike is painted once more, past the parts. That is the matrix C, rows steel and paint, columns city and children's bike: C=(0201). Order: 10 city bikes and 4 children's bikes. How much paint is needed?
A: raw material × parts, B: parts × products, C: raw material × productsparts in the middle, C runs past the partsrow 'paint' of A times the columns of Bwith C added: the row paint in G; 38 units of paint for the whole order
Step 1 of 4Label the rows and columns
A is R×Z, B is Z×E, C is R×E: raw material per product straight away.
Through the parts runs A⋅B, parts in the middle. Past the parts runs C. Both tables have the size R×E and are added: G=A⋅B+C.
Row 'paint' of A⋅B: (1⋅1+0⋅21⋅1+0⋅3)=(11). Plus the row 'paint' of C, (21): in G the row is (32).
3⋅10+2⋅4=38 units of paint. Without C it would be 1⋅10+1⋅4=14.
The chocolate factory gets a second order: 30 bars and 20 boxes. How much sugar has to be bought? The order of the factors is already known, G=M⋅P. Row 'sugar' of G: (1⋅2+2⋅01⋅1+2⋅3)=(27). Times the new order: 2⋅30+7⋅20=60+140=200 units of sugar. Taking the row 'sugar' of M, (12), gives 70: the masses are skipped, and the products are not made straight from raw materials.
Other forms of the same question
Raw material cost. Raw material prices are written as a row kT. In the exam, amounts are written in GE (“Geldeinheiten”, money units): just money. Let cocoa cost 4 GE and sugar 1 GE. The raw material for the first order is already known, r=(180110), and the cost is kTr=4⋅180+1⋅110=830 GE.
Raw material cost per product is the row kTG=(4⋅6+1⋅24⋅6+1⋅7)=(2631) GE. For the order: 26⋅20+31⋅10=830 GE, the same number.
Three stages. If there are two stages of parts between raw material and product, G=A12⋅A23⋅A34, where A12 is stage 1 per stage 2. The intermediate stages again stand in the middle. For one raw material, carry its row from stage to stage: the row times the second matrix, the resulting row times the third.
The question is G itself or one element of it. Then there is no multiplying by the order.
Your turn2 of 5
The matrix A has the rows parts Z1,Z2 and the columns products E1,E2, the matrix B the rows raw materials R1,R2,R3 and the columns Z1,Z2: A=(2113), B=132202. Order: 15 units of E1 and 10 units of E2. How much raw material R3 is needed?
Your turn3 of 5
Raw materials R1,R2 go into parts Z1,Z2: A=(2111) (rows raw materials, columns parts). The parts go into products E1,E2: B=(1320) (rows parts, columns products). R1 costs 5 GE per unit, R2 2 GE. Order: 10 units of E1 and 20 units of E2. What does the raw material for the order cost?
Traps. Behind each wrong option of the bakery task at the start of this section is a mistake of its own:
Order by letters, option (e), 444: A⋅B was calculated and its second row, (1712), multiplied by the order: 17⋅12+12⋅20=444. The rows of A⋅B are doughs, not raw materials. Check: the labels of the columns of the left matrix and of the rows of the right one must match.
Stopping at the intermediate products, option (c), 108: that is A⋅p, yeast dough for the order. Check: the answer has to be the raw material asked about.
Other mistakes from tasks of this kind:
Mistake in cost tasks: adding the intermediate products to the raw material. The parts for the order are added to the raw material as well, but they must not be: they are made of that same raw material and are already counted in G.
Forgetting the direct use. If a matrix C is given, raw material past the parts, the answer without it is too small: in the second example 14 instead of 38.
Remember: the intermediate product stands in the middle, (R×Z)⋅(Z×E); for one raw material one row of G is needed.
Unit cost from machine minutes and hourly rates (“Stundensätze”)
In the first task of the article everything turned on the order of two tables. The second works out the money for machine time, and there is no order of factors to think about. The mistake happens somewhere else, in dividing by 60.
This is how the task looks in the exam:
Exam-style task
Eine Näherei verarbeitet Hemden, Blusen und Röcke. Die Tabelle nennt die Maschinenminuten je Stück (Zeilen: Hemden, Blusen und Röcke, Spalten: Zuschneidemaschine und Nähmaschine). Kosten je Maschinenstunde: 24 GE (Zuschneidemaschine), 72 GE (Nähmaschine). Das Material kostet zusätzlich 4 GE je Stück; die Rüstzeiten sind in der Tabelle enthalten.
T==353520201515
Der Kunde bestellt 49 Hemden, 45 Blusen und 115 Röcke. Wie hoch sind die Maschinenkosten allein für Hemden?
a)510
b)111720
c)2812
d)1862
e)896
You recognise the task by a table of minutes per piece on the machines, the price of a machine hour and the question about machine costs. There is one table here, not two stages: the products pass through machines, and every machine minute costs money.
Why you divide by 60 shows in the chocolate factory. A bar spends 6 minutes in the tempering machine, whose hour costs 30 €, and 4 minutes in the packing machine, whose hour costs 45 €. A minute of the first costs 30/60=0.5 €, a minute of the second 45/60=0.75 €. The bar costs 6⋅0.5+4⋅0.75=6 €. There is no need to divide each rate: first the row of minutes times the rates, then once by 60.
cost per piece=60t1⋅s1+t2⋅s2+…606⋅30+4⋅45==60360==6
Here t is the minutes per piece and s the machine rates per hour. You take the row of the product because it holds all the machines one piece passes through. That is a row times the column of rates, like the price list times the purchase in the article 'Matrix and vector: working out the cost of a purchase from several suppliers'.
rows: products, columns: machines, minutes in the cellsshirts: 35 minutes cutting, 20 minutes sewingminutes in hours: 38 GE per shirtfor 49 shirts: option (d)
Step 1 of 5Label the rows and columns
Rows of T: shirts, blouses, skirts. Columns: cutting machine and sewing machine. In the cells, minutes per piece. Rates: 24 GE per hour of cutting, 72 GE per hour of sewing. Order: 49 shirts, no blouses or skirts are ordered.
Only shirts are asked about, so the row 'shirts' is needed: (3520) minutes.
Minutes times rates: 35⋅24+20⋅72=840+1440=2280. That is not GE yet: minutes were multiplied by the price of an hour.
An hour has 60 minutes: 2280/60=38 GE per shirt.
49 shirts: 38⋅49=1862 GE, option (d). The material at 4 GE per piece is not part of the machine costs, and neither are blouses and skirts.
A print shop prints flyers and posters. A flyer spends 2 minutes on the printing press and 3 minutes on the cutter, a poster 6 minutes and 1 minute. An hour of the press costs 60 €, an hour of the cutter 30 €. Order: 100 flyers and 50 posters.
What are the machine costs for the whole order?
Rows of the minutes table: flyer (23), poster (61). Columns: press and cutter. Rates: 60 and 30 € per hour.
Flyer: 2⋅60+3⋅30=210. Poster: 6⋅60+1⋅30=390.
210/60=3.5 € per flyer, 390/60=6.5 € per poster.
3.5⋅100+6.5⋅50=350+325=675 €. Check by machine: the press runs 2⋅100+6⋅50=500 minutes, the cutter 3⋅100+1⋅50=350 minutes, (500⋅60+350⋅30)/60=675 €.
A bar spends 6 minutes in the tempering machine and 4 minutes in the packing machine, a box of chocolates 3 and 10 minutes. Order: 20 bars and 10 boxes. How many hours does the packing machine run? Here the column of the machine is needed: it holds every product that passes through it. Column 'packing' times the quantities: 4⋅20+10⋅10=180 minutes. That is 180/60=3 hours. The rates are not needed here: the question is about time, not money.
Other forms of the same question
A machine's hours for an order: the machine's column times the quantities, divided by 60, as above; no rates are needed.
Recipe times quantities: instead of minutes there is raw material per piece, instead of rates quantities by day or week. Then the raw material's row times the column of quantities gives the use without dividing by 60: in the chocolate factory the row 'sugar' of G, (27), times one week's output (305) gives 60+35=95.
Your turn4 of 5
A table spends 40 minutes on the saw and 20 minutes on the sander, a chair 15 and 30 minutes. An hour of the saw costs 45 GE, an hour of sanding 30 GE, the material 12 GE per piece. What are the machine costs for 10 tables?
Your turn5 of 5
In a repair shop, replacing a phone screen takes 30 minutes at the soldering station and 15 minutes at the test station, replacing a battery 10 and 15 minutes. An hour of soldering costs 48 GE, an hour of testing 24 GE. What do the stations cost for 4 screen replacements and 6 battery replacements?
Trap. Without dividing by 60, option (b) of the sewing shop task, 111720: 2280⋅49, minutes multiplied by the price of an hour and left at that. The answer is 60 times too large. Check: the rate is per hour, the table holds minutes.
Other mistakes from tasks of this kind:
Only the first machine: only cutting was taken, 35⋅24/60⋅49=686 GE. A piece passes through all the machines of its row.
The wrong quantity: the cost per piece was multiplied by the number of another product. Check: the quantity belongs to the product whose row you took.
The wrong recipe: in 'recipe times quantities' tasks the row of another raw material was taken, or the recipe was read flipped, a row instead of a column.
Remember: the rate is per hour and the table holds minutes, so the sum 'minutes times rates' is divided by 60.
At a glance: two methods and the formula sheet
The topic in a minute
Order: the intermediate product in the middle, G=(R×Z)⋅(Z×E); on the left the table with the raw material rows, whatever it is called. Trap: order by letters.
Raw material for the order:r=G⋅p; for one raw material only its row of G; cost kTr; with direct use G=A⋅B+C. Trap: stopping at the intermediate products.
Minutes and rates: the row of the product times the rates, divided by 60, gives GE per piece; the hours of a machine are its column times the quantities, divided by 60. Trap: forgetting to divide by 60.
Raw materials go into intermediate products, these into final products, an order is given. The matrices of the stages are multiplied so that the intermediate product stands in the middle; G times the order p gives the raw material r.
G==(R××Z)⋅⋅(Z××E),r==G⋅⋅p
Trap:multiplying in the order of the letters; the labels of the rows and columns fix the order.
Minutes per piece on the machines t and machine rates s in GE per hour. The row of the product times the rates, divided by 60: the rate is per hour, the time is in minutes.
60t1s1+t2s2+…
Trap:not dividing by 60, or taking one machine instead of the whole row.
The exam's formula sheet has nothing on multi-stage production: the order of the factors and dividing by 60 have to be known by heart.