Exercise 4.5 · Q16: Onion, wheat and rice prices by the matrix method
16. The cost of 4 kg onion, 3 kg wheat and 2 kg rice is ₹ 60. The cost of 2 kg onion, 4 kg wheat and 6 kg rice is ₹ 90. The cost of 6 kg onion 2 kg wheat and 3 kg rice is ₹ 70. Find cost of each item per kg by matrix method.
Let the cost per kg of onion, wheat and rice be , and (in rupees). Then
This is , where
Expanding along :
. So exists and the system has a unique solution, .
Cofactors:
. The cost per kg is ₹ 5 for onion, ₹ 8 for wheat and ₹ 8 for rice.
Want the reason behind every step, the basics and the checks?
Each bill says: (kilograms of onion) × (price of onion) + (kilograms of wheat) × (price of wheat) + (kilograms of rice) × (price of rice) = total. That is exactly "a row times a column", so the three bills together are one matrix equation : holds the quantities, the unknown prices, the totals. Since , the prices are , and they are the only prices consistent with all three bills.
- Given
- Three purchases, with the quantities (in kg) of onion, wheat and rice, and the total cost (in ₹) of each.
- To find
- The cost per kg of onion, of wheat and of rice.
- Plan
- (1) Name the unknowns and turn each bill into an equation. (2) Write and explain why the product is in that order. (3) . (4) All nine cofactors. (5) , , and the check . (6) . (7) Check against every bill and interpret.
Basics you need
Buying 4 kg at ₹ per kg costs ₹ . A bill for several items is the sum of such products. Units: kg × (₹ per kg) = ₹. Basics: algebra the chapter leans on
A row times a column is : pair up, multiply, add. So a whole bill is one row times the column of prices. Basics: matrix facts the chapter uses
, and is the transpose of . Basics: the + − + sign pattern
If , , and has the single solution . Basics: why the inverse divides by |A|
Solution
Name the unknowns and turn each bill into an equation
Let the cost per kg be ₹ for onion, ₹ for wheat and ₹ for rice. Put the data in a table, one row per bill (quantities in kg, totals in ₹):
Bill Onion Wheat Rice Total 1 4 3 2 60 2 2 4 6 90 3 6 2 3 70 Each bill: quantity times price for each item, added, equals the total:
The unknowns must be the things asked for, the prices per kg, and each must keep the same meaning in every equation: is always the onion price. The third bill in the book reads "6 kg onion 2 kg wheat" without a comma; the numbers are 6 kg onion and 2 kg wheat.Forming linear equations from words, as in Example 18 (Section 4.6.1). Basics: algebra the chapter leans onWrite the system as
The table's quantity columns become (rows: bills; columns: onion, wheat, rice), the prices become , the totals become :
is and is , so is defined and , like :
Why and not ? Row of lists what was bought on bill , and the column lists the price of each item in the same order (onion, wheat, rice). Row times column pairs each quantity with its own price and adds, which is precisely the bill. (a times a ) is not even defined.Section 4.6.1 (matrix form); Section 3.4.5 (row times column). Lesson: solving systems AX = BCompute by expanding along row 1
(The minors , , are worked out in Step 4.) , so is nonsingular: there is exactly one set of prices that fits all three bills.
The first minor is 0 because is twice , so that term drops out. In real terms, guarantees that the three bills pin down one set of prices (Case I of Section 4.6.1). (Later courses show that happens exactly when one bill's quantities are a combination of the other two; this reprint does not prove that, and we do not need it here.)Section 4.2.3 (expansion along R1); Section 4.6.1, Case I. Lesson: expanding a 3 × 3 determinantFind all nine minors and cofactors
Row 1 (entries ):
Row 2 (entries ):
Row 3 (entries ):
Each minor is the determinant left after deleting the row and column of that entry; the sign is then applied. Two cofactors are 0 ( and ), which is allowed and makes later sums shorter.Definitions 1 and 2, Section 4.4. Lesson: minors and cofactorsBuild and , and check
Matrix of cofactors:
Transpose, then divide by :
Check , row of times column of :
so .
The adjoint is the transpose of the cofactor matrix (Definition 3). The product check is Theorem 1: on the diagonal, 0 elsewhere. It confirms all nine cofactors before we use them on the money.Definition 3, Section 4.5.1; Theorems 1 and 4, Section 4.5. Lesson: the adjointCompute
is , is , so the product is . First :
So , , .
Multiplying on the left by gives , so these are the only prices that fit. Units: has units of "1 per kg" and is in ₹, so is in ₹ per kg, as a price should be.Section 4.6.1, Case I. Lesson: inverse of a matrixCheck against every bill, and say what it means
All three totals (₹ 60, ₹ 90, ₹ 70) are reproduced. So onion costs ₹ 5 per kg, wheat ₹ 8 per kg and rice ₹ 8 per kg.
The check is done on the bills themselves, in rupees, which tests the whole chain from the words to the answer. All three prices are positive, as prices must be; a negative value would have signalled an error in setting up the equations (or data that no real prices could fit).
With the prices per kg, and
The cost per kg is onion ₹ 5, wheat ₹ 8, rice ₹ 8.
(Textbook answer: cost of onions per kg = ₹ 5, cost of wheat per kg = ₹ 8, cost of rice per kg = ₹ 8.)
along column 1. Entries with cofactors : . The same as along row 1.
By elimination. Halve bill 2: . Bill 1 minus 4 times this: , so . Bill 3 minus 6 times it: , so . Putting into the last: , so , , and . The same prices.
- Mixing up the order of the items. If rice is listed second in one row and third in another, is wrong. Keep onion, wheat, rice in the same column positions in every row.
- Putting the bills in the columns of . That matrix is , and is a different system (its solution is not 5, 8, 8).
- Losing a sign in a cofactor. and ; the check catches such slips.
- Stopping at without units. The answer is a price: ₹ per kg.
- For a word problem, a table with one row per condition and one column per unknown is the coefficient matrix.
- Quantity × price summed over items is a row times a column; that fixes the order .
- means the unknowns are determined uniquely, by .
Every fact used, and where it comes from
| Fact | Used in | Source |
|---|---|---|
| Forming equations from a word problem | Step 1 | Example 18, Section 4.6.1 |
| A system written as | Step 2 | Section 4.6.1 (Lesson: solving systems) |
| Matrix product, row times column | Steps 2, 5, 6 | Section 3.4.5 (Chapter 3) |
| Expansion along a row or column | Step 3 | Section 4.2.3 (Lesson: expanding a 3 × 3 determinant) |
| Minor and cofactor | Step 4 | Definitions 1 and 2, Section 4.4 (Lesson: minors and cofactors) |
| = transpose of | Step 5 | Definition 3, Section 4.5.1 (Lesson: the adjoint) |
| ; | Step 5 | Theorems 1 and 4, Section 4.5 (Lesson: inverse of a matrix) |
| is the unique solution | Steps 3, 6 | Section 4.6.1, Case I |
Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →