Matrices (general theory). Definition. A matrix is a rectangular array of numbers enclosed by brackets (plural: matrices). Examples. 1 2 1 1 0 2 A= 0 0 7 B= 0 1 3 4 5 0 Terminology and Notations. Each number in a matrix is called an element or entry. Elements in a matrix are arranged in rows and columns. If a matrix has m rows and n columns, it called m n matrix. The expression m n is called the size of the matrix, and numbers m and n are called the dimensions of the matrix. Examples. Matrix A has the size 3 3. Matrix B has the size 2 3. 1 C = 2 has the size... 3 A matrix with one column is called a column matrix, with only one row a row matrix. D = [ 123] has the size 1
Note. It is important to remember that the number of rows is always given first. A matrix n n is called a square matrix of order n. Example. Matrix A (written above) is a matrix of? order. 1 0 F = 0 1 is a matrix of? order. The position of an element in a matrix is denoted by double subscript notation, where I is the row and j is the a ij a ij column containing the element. Examples. c c c a a 11 12 13 11 12 A = C = c21 c22 c23 a21 a22 c31 c32 c33 Elements with the same first and second index form the principal diagonal of the matrix. c c c a a 11 12 13 11 12 A = C = c21 c22 c23 a21 a22 c31 c32 c33 2
Matrices: Basic Operations. Equality of Matrices. Two matrices are equal if they have the same size and their corresponding elements are equal. Addition and Subtraction. The sum (difference) of two matrices of the same size is the matrix with the elements that are the sum (difference) of corresponding elements of two matrices. Problem #1. 2 1 0 1 4 2 A= 1 0 5 B = 1 3 5 3 6 4 5 2 0 Find A + B, A B. Because addition and subtraction for matrices are defined as addition and subtraction of their elements which are real numbers, properties of these operations are similar to those for real numbers. Addition is commutative and associative. 3
Product of a number and a matrix. The product of a number k and a matrix M Is a matrix formed by multiplying each element of M by k. Problem #2. For given matrix A find B= 2A 2 1 0 A = 1 0 5 3 6 4 Matrix product. The product AB can be defined for two matrices A and B only if the number of columns in A is the same as the number of rows in B. The element (ij) in the row i and column j in matrix AB is the real number equal to the sum of products of the elements from the ith row of the matrix A by elements from the jth column of matrix B. 4
Problem #3. Given two matrices A and B find the product AB. 1 1 1 2 0 1 2 3 1 1 3 2 0 2 1 Problem #4. Matrix A has size 5 2, matrix B size n 3. What value of n is necessary to make multiplication AB possible. What is the size of AB? Warning!!! Matrix multiplication is not commutative. First and second factors play different roles. AB BA. Problem #5. Given two matrices 1 A = ( 123) and B = 2, find 3 AB and BA. 5
Applications. Typical applications of matrix multiplication are Labor costs problem, Example #8 p.227, Inventory value, Nutrition problem and many-many other. Problem #6. Portfolio value. The Kaplans have 150 shares of ACME Corp., 100 shares of High Tech., and 240 shares of ABC in an investment portfolio. The closing prices of these stocks one week were Monday Tuesday Wednesday Thursday Friday Acme High Tech ABS 56 132 19 55 133 19 55 131 20= 54 130 22 53 128 21 A Find daily value of this portfolio for this week. B 150 = 100 240 this matrix ( 3 1) numbers of shares of all companies. Product A B is 5 1 matrix which elements are daily portfolio values. 26160 26110 A B= 26150 26380 25790 Monday Tuesday Wednesday Thursday Friday 6
Problem #7. In a certain county, the proportion of voters in each age group registered as Republicans, Democrats, and Independents is given by the following matrix A. Age 18-30 31-50 over 50 Republicans Democrats Independents 0.40 0.30 0.70 0.30 0.60 0.25 0.30 0.10 0.05 The distribution, by age and gender, of this county is given by the following matrix B. Age Male Female 18-30 31-50 over 50 6000 8000 12,000 14,000 14,000 16,000 a) Calculate the product AB. b) Interpret the entries in AB. c) How many female Democrats are there in this county? 7