Two shopkeepers, Juma and Wan bought some items from a wholesaler. Juma bought 18 loaves of bread, 40 packets of milk and 5 bars of soap while Wan bought 15 loaves of bread, 30 packets of milk and 6 bars of soap. The price of a loaf of bread, a packet of milk and a bar of soap were sh 45, sh 50 and sh 150 respectively.

a.
(I) the number of items bought by Juma and Wan using a 2 * 3 matrix.
18l 40m 5b
15l 30m 6b

(ii) the price of the items bought a 3 * 1 matrix
45
50
150

(b) Use the matrices in (a) above to determine the total expenditure incurred by each person and hence the difference in their expenditure.

Your matrices are correct.

As for determining the total expenditure, multiply both the matrices together.
If you multiply a 2*3 with a 3*1 matrix (in that order), the product will be a 2*1 matrix. It will have two entries, each giving you the total expenditure of one school.

To find the number of items bought by Juma and Wan, we can create a matrix using the given information:

Matrix A represents Juma's purchases:
```
18 40 5
```

Matrix B represents Wan's purchases:
```
15 30 6
```

To find the price of the items bought, we can create a matrix using the given prices:

Matrix C represents the prices:
```
45
50
150
```

To find the total expenditure incurred by each person, we need to perform matrix multiplication.

To multiply Matrix A and Matrix C, we perform the following matrix multiplication operation:

```
A * C = [18 40 5] * [45 0 0] + [0 50 0] + [0 0 150]
```

Calculating each element of the resulting matrix:
```
18 * 45 + 40 * 50 + 5 * 150 = 1910
```

Similarly, to multiply Matrix B and Matrix C, we perform the following matrix multiplication operation:

```
B * C = [15 30 6] * [45 0 0] + [0 50 0] + [0 0 150]
```

Calculating each element of the resulting matrix:
```
15 * 45 + 30 * 50 + 6 * 150 = 1995
```

Therefore, the total expenditure incurred by Juma is sh 1910 and the total expenditure incurred by Wan is sh 1995.

To find the difference in their expenditure, we subtract Juma's expenditure from Wan's expenditure:

```
Difference = Wan's expenditure - Juma's expenditure
Difference = 1995 - 1910
Difference = 85 sh
```

Hence, the difference in their expenditure is sh 85.