Let the cost of onion is Rs x per kg, cost of wheat is Rs y per kg and cost of rice is Rs z per kg.
According to the question, the system of equation becomes,
4x+3y+2z=60
2x+4y+6z=90
6x+2y+3z=70
Write the system of equations in the form of AX=B.
[ 4 3 2 2 4 6 6 2 3 ][ x y z ]=[ 60 90 70 ]
Now, the determinant of A is,
| A |=4( 12−12 )−3( 6−36 )+2( 4−24 ) =0+90−40 =50
Since | A |≠0, thus A is non-singular, therefore, its inverse exists.
Since AX=B, thus, X= A -1 B.
It is known that,
A −1 = adjA | A |
The co-factors of each elements of the matrix are,
A 11 = ( −1 ) 1+1 [ 12−12 ] =0
A 12 = ( −1 ) 1+2 [ 6−36 ] =−( −30 ) =30
A 13 = ( −1 ) 1+3 [ 4−24 ] =−20
A 21 = ( −1 ) 2+1 [ 9−4 ] =−5
A 22 = ( −1 ) 2+2 [ 12−12 ] =0
A 23 = ( −1 ) 2+3 [ 8−18 ] =−( −10 ) =10
A 31 = ( −1 ) 3+1 [ 18−8 ] =10
A 32 = ( −1 ) 3+2 [ 24−4 ] =−20
A 33 = ( −1 ) 3+3 [ 16−6 ] =10
So, the value of adjA is,
adjA=[ A 11 A 21 A 31 A 12 A 22 A 32 A 13 A 23 A 33 ] =[ 0 −5 10 30 0 −20 −20 10 10 ]
Since | A |=50, thus,
A −1 = 1 50 [ 0 −5 10 30 0 −20 −20 10 10 ]
Now,
X= A −1 B [ x y z ]= 1 50 [ 0 −5 10 30 0 −20 −20 10 10 ][ 60 90 70 ] [ x y z ]= 1 50 [ 250 400 400 ]
Thus,
[ x y z ]=[ 5 8 8 ]
Hence,
x=5, y=8 and z=8
Thus cost of onion is Rs 5 per kg, cost of wheat is Rs 8 per kg and cost of rice is Rs 8 per kg.