Business Mathematics & Statistics (MTH 302)

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 12

Business Mathematics & Statistics (MTH 302)

MTH 302
LECTURE 11

MATRICES

1 OBJECTIVES
The objectives of the lecture are to learn about:
 Review Lecture 10
 Matrix functions in Excel
 Set up and manipulate ratios.
 Allocate an amount on a prorata basis using proportions.

2 MATRIX FUNCTIONS IN MS EXCEL

The Matrix Functions in Microsoft Excel are as follows:

MDETERM

Returns the matrix determinant of an array

MINVERSE

Returns the matrix inverse of an array

MMULT

Returns the matrix product of two arrays

3 MINVERSE

Returns the inverse matrix for the matrix stored in an array.

Syntax
MINVERSE(array)

Array is a numeric array with an equal number of rows and columns.

Remarks
 Array can be given as a cell range, such as A1:C3; as an array constant, such as
{1,2,3;4,5,6;7,8,9}; or as a name for either of these.
 If any cells in array are empty or contain text, MINVERSE returns the #VALUE!
error value.

Page 1 of 12
© Copyright Virtual University of Pakistan
Business Mathematics & Statistics (MTH 302)

 MINVERSE also returns the #VALUE! error value if array does not have an equal
number of rows and columns.
 Formulas that return arrays must be entered as array formulas.
 Inverse matrices, like determinants, are generally used for solving systems of
mathematical equations involving several variables. The product of a matrix and
its inverse is the identity matrix — the square array in which the diagonal values
equal 1, and all other values equal 0.
 As an example of how a two-row, two-column matrix is calculated, suppose that
the range A1:B2 contains the letters a, b, c, and d that represent any four numbers.
The following table shows the inverse of the matrix A1:B2.

Column A Column
B
Row 1 d/(a*d-b*c) b/(b*c-
a*d)
Row 2 c/(b*c-a*d) a/(a*d-
b*c)

 MINVERSE is calculated with an accuracy of approximately 16 digits, which may


lead to a small numeric error when the cancellation is not complete.
 Some square matrices cannot be inverted and will return the #NUM! error value
with MINVERSE. The determinant for a noninvertable matrix is 0.

4 MINVERSE-EXAMPLE
The slide below shows the inversion of matrix with row 1 [4 - 1] and row 2 [2
0].

The formula in the example must be entered as an array formula. Select the range
A4:B5 starting with the formula cell. Press F2, and then press
CTRL+SHIFT+ENTER. If the formula is not entered as an array formula, the single
result is 0.

Page 2 of 12
© Copyright Virtual University of Pakistan
Business Mathematics & Statistics (MTH 302)

The process was as follows:


1. Enter data of array to be inverted. Cells A4:B5.
2. Select cells A6:B7 for the formula.
3. Enter the formula “=MINVERSE(“
4. Select the range A4:B5
5. Enter “)”
6. Press CTRL+SHIFT+ENTER
7. Press Enter

Please note that the entry of the array Formula can be tricky. You must enter the
data and formula as summarised above. If your entry is correct the curly bracket
will indicate that the formula was entered as an array formula.

5 MDETERM

Returns the matrix determinant of an array.

Syntax

Page 3 of 12
© Copyright Virtual University of Pakistan
Business Mathematics & Statistics (MTH 302)

MDETERM(array)

Array is a numeric array with an equal number of rows and columns.

Remarks

 Array can be given as a cell range, for example, A1:C3; as an array constant,
such as {1,2,3;4,5,6;7,8,9}; or as a name to either of these.
 If any cells in array are empty or contain text, MDETERM returns the #VALUE!
error value.

 MDETERM also returns #VALUE! if array does not have an equal number of
rows and columns.

 The matrix determinant is a number derived from the values in array. For a three-
row, three-column array, A1:C3, the determinant is defined as:

MDETERM(A1:C3) equals
A1*(B2*C3-B3*C2) + A2*(B3*C1-B1*C3) + A3*(B1*C2-B2*C1)

 Matrix determinants are generally used for solving systems of mathematical


equations that involve several variables.
 MDETERM is calculated with an accuracy of approximately 16 digits, which may
lead to a small numeric error when the calculation is not complete. For example,
the determinant of a singular matrix may differ from zero by 1E-16.

6 MDETERM-EXAMPLE

The example shows an array of size 4 x 4 in cell range A14:d17. The formula was
entered in cell A18. The result of this calculation is 88.

Page 4 of 12
© Copyright Virtual University of Pakistan
Business Mathematics & Statistics (MTH 302)

There are other ways of using this function. You can enter the matrix as an array
constant.

=MDETERM({3,6,1;1,1,0;3,10,2}) Determinant of the matrix as an array constant


(

You can calculate the determinant of the array constant.

=MDETERM({3,6;1,1}) Determinant of the matrix in the array


constant (-3)

Unequal number of rows and columns results in an error.

=MDETERM({1,3,8,5;1,3,6,1}) Returns an error because the array does not have


an equal number of rows and columns (#VALUE!)

6 MMULT

Returns the matrix product of two arrays. The result is an array with the same
number of rows as array1 and the same number of columns as array2.

Syntax

MMULT(array1,array2)

Array1, array2 are the arrays you want to multiply.

Page 5 of 12
© Copyright Virtual University of Pakistan
Business Mathematics & Statistics (MTH 302)

Remarks

 The number of columns in array1 must be the same as the number of rows in
array2, and both arrays must contain only numbers.
 Array1 and array2 can be given as cell ranges, array constants, or references.
 If any cells are empty or contain text, or if the number of columns in array1 is
different from the number of rows in array2, MMULT returns the #VALUE! error
value.
 The matrix product array a of two arrays b and c is:

where i is the row number, and j is the column number.

 Formulas that return arrays must be entered as array formulas.

7 MMULT-EXAMPLE
Array1 was entered in cell range A25:B26. Array2 was entered in cell range
A28:B29. The

The formula was entered as an array formula. Cell A30 was selected for entry of the
array Formula for MMULT. After entering “=MMULT(” the range A25:B26 was
selected. Then “;” was entered. Next range A28:B29 was selected. Next “)” was
entered. F2 was pressed to start the entry of array formula. Then the keys
CTRL+SHIFT+ENTER were pressed simultaneously. The answer 2 was obtained in
cell A30. The formula was also entered in cell C29 to show the syntax.

Page 6 of 12
© Copyright Virtual University of Pakistan
Business Mathematics & Statistics (MTH 302)

8 RATIO
A Ratio is a comparison between things. If in a room there are 30 men and 15
women then the ratio of men to women is 2 to 1. This is written as 2:1 where
the “:” is the notation for a ratio.
The method of calculating ratios is as under:
1. Find the minimum value
2. Divide all the values by the smallest value.

In the above example, the smallest value was 15. Division gives 30/15 = 2 for men
and 15/15 = 1 for women. The ratio is therefore 2:1 for men and women.

9 RATIO-EXAMPLE
Three friends ali, Fawad and Tanveer are doing business together. To set up the
business Ali invested Rs. 7800, Fawad Rs. 5,200 and Tanveer Rs. 6,500
respectively. The question is what is the ratio of their investments.
As discussed above the smallest value is 5200. All values are divided by 5200. the
results are 1.5 for Ali, 1 for Fawad and 1.25 for Tanveer. The answer is:
1.5 : 1 : 1.25.

This example was solved in Excel. The formula is as under:

Page 7 of 12
© Copyright Virtual University of Pakistan
Business Mathematics & Statistics (MTH 302)

Cell D57: =B57/B58


Cell D58: =B58/B58
Cell D59: =B59/B58

The result for cell D59 was shown in cell D60, because the cell D59 was used to
display the formula.

9 ESTIMATING USING RATIO

Ratio of sales of Product X to sales of Product Y is 4:3. The sales of product X


is forecasted at Rs. 180,000. What should be the Sales of product Y to
maintain the ratio of sales between the two products.

CALCULATION

Ratio sales X : Y = 4 : 3

Insert the value for forecasted sale for X.

180,000 : Y = 4 : 3

It can be rewritten as:


180,000/Y = 4/3

Cross – multiply

180,000 x 3 = 4 x Y

Rewrite to bring the unknown to the left of the equality

4 x Y = 180,000 x 3

Solve

Y = (180,000 x 3)/4

Y = 135,000

Calculations using EXCEL


In cells B70 and B71 the ratios of Product X and Y were entered.
The value of forecast of product X was entered in cell D70.

Page 8 of 12
© Copyright Virtual University of Pakistan
Business Mathematics & Statistics (MTH 302)

Before writing down the formula in excel, it was derived as follows:


1 Ratio of X = (cell B70)
2 Ratio of y = (cell B71)
3 Sale of X = (cell D70)
4 Sale of Y = (cell D71)
Now Ratio X: Y = (cell B70)/ (cell B71)
Ratio of sales = (cell D70)/ (cell D71)
Cross-multiply.
(cell B70) x (cell D71) = (cell B71) x (cell D70)
Cell D71 is unknown. Hence:
(cell D71) = (cell B71) x (cell D70)/ (cell B70)
Or
(cell D71) = (cell B71)/ (cell B70) * (cell D70)
Thus the formula was:
=B71/B70*D70
Please note that actually we are using the ratio Y to X as it is easier to think of ratio
of unknown to the known.

9 ESTIMATING USING RATIO-EXAMPLE 2


In a 500 bed hospital there are 200 nurses and 150 other staff. If the hospital

Page 9 of 12
© Copyright Virtual University of Pakistan
Business Mathematics & Statistics (MTH 302)

extends by a new wing for 100 beds, then what additional staff is needed?
Let us 500 beds B1 and 100 beds B2. Staff nurses N1 is 200 and other staff O1 is
150. What is the value of N2 and O2 for B2.
Obviously the ratio of beds will be used. As pointed out above, think of the ratio of
unknown to known. In other words ratio B2:B1 or B2/B1. Ratio of nurses would be
N2/N1. Ratio of other staff would be O2/O1.
Now :
N2/N1 = B2/B1 Or N2 = (B2/B1)*N1 or N2 = (100/500)*200 = 40 Nurses
O2/O1 = B2/B1 Or N2 = (B2/B1)*O1 or O2 = (100/500)*150 = 30 other staff.

Calculation

Beds : Nurses : Other staff

500 : 200 : 150

100 : X? : Y?

Nurses

500 : 200 = 100 : X

500 X = 200 x 100

X = (200 x 100)/500 = 40

Other staff

Y = (150 x 100)/500 = 30
Calculation using EXCEL
The calculation using EXCEL was done in a similar fashion as the previous
example.
The calculation is self-explanatory.

Page 10 of 12
© Copyright Virtual University of Pakistan
Business Mathematics & Statistics (MTH 302)

9 ESTIMATING USING RATIO-EXAMPLE 3

A Fruit Punch recipe requires mango juice, apple juice and orange juice ratio
of 3:2:1. To make 2 litres of punch calculate quantity of ingredient needed.
Again we shall use the raio of unknown to the unknown. The unknowns are mango
and apple juice. Consider first ratio of required mango juice (3) to total quantity of
punch (6). This was calculated from 3+2+1. Now the quantity of required mango for
2 litre would simply be (3/6)*2. Similarly the required quantity of apple juice is
(2/6)*2.

Calculation

Mango juice : Apple juice : Orange juice

3 : 2 : 1

Total = 6

X? : Y? : Z?

Total = 2 litre

Mango juice X = (3/6)*2 = 1 litre

Apple juice Y = (2/6)*2 = 0.67 litre

Orange juice Z = (1/6)*2 = 0.33 litre

Calculation using EXCEL

Page 11 of 12
© Copyright Virtual University of Pakistan
Business Mathematics & Statistics (MTH 302)

Here also the similar ratios were used.


Mango = B20/B23*D23
Apple = B21/B23*D23
Orange = B22/B23*D23

Page 12 of 12
© Copyright Virtual University of Pakistan

You might also like