3 Pages

matrices

Course: CS 2130, Fall 2009
School: East Los Angeles College
Rating:
 
 
 
 
 

Word Count: 2410

Document Preview

Mathematics CS126 for Computing Matrix Algebra Matrix algebra occurs in many practical applications in computing (e.g. graphics, error detecting and error correcting codes), in mathematics and physics. An m n matrix is a rectangular array with m rows and n columns where m and n are positive integers. The matrix is enclosed by square brackets (although in some text-books round brackets are used. We use boldface...

Register Now

Unformatted Document Excerpt

Coursehero >> California >> East Los Angeles College >> CS 2130

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Mathematics CS126 for Computing Matrix Algebra Matrix algebra occurs in many practical applications in computing (e.g. graphics, error detecting and error correcting codes), in mathematics and physics. An m n matrix is a rectangular array with m rows and n columns where m and n are positive integers. The matrix is enclosed by square brackets (although in some text-books round brackets are used. We use boldface capital letters to denote complete matrices1. For example: 11 4 A = 7 2 10 4 7 5 -6 The individual entries in a matrix are called the elements of the matrix. We denote the element in row i, column j of the matrix A by aij, that is we use the corresponding lower case letter with two subscripts denoting the row (i) and column (j) numbers. Thus a11 = 11, a21 = 7, a12 = 4, a23 = 5. If A is an n n matrix, we say that A is a square matrix of order n. A 1 n matrix is called a row vector of order n. An m 1 matrix is called a column vector of order m. When referring to the elements of a row vector the row number is (of course) always 1 and so is often omitted. Thus the element in column j of a row vector V is often denote as vj rather than v1j. Similarly the element in row i of a column vector U is usually denoted by ui rather than ui1 as the column number is always 1. and U = [1 2 3 4] 3 V = 4 5 is a row vector of order 4 and u1 = 1, u2 = 2, u3 = 3, u4 = 4. is a column vector of order 3 and v1 = 3, v2 = 4, v3 = 5. If the elements of a matrix are all integers we speak of a matrix over Z (the integers). If the elements of a matrix are all real numbers we speak of a matrix over R (the Reals). If the elements of a matrix all belong to the integers modulo n we speak of a matrix over Zn. Two matrices A and B are equal if and only if they are the same size that is each has the same number of rows and columns that is both are m n for some integers m and n and corresponding elements are equal that is aij = bij for 1 i m and 1 j n Matrix Addition and Subtraction We can add or subtract matrices A and B only if they are the same size. The element in row i column j of the sum of two matrices is the sum of the corresponding elements of the two matrices. Thus A and B are m n matrices, their sum C = A + B is also m n and cij = aij + bij 1 for 1 i m and 1 j n. In hand-written text matrices are usually denoted by underlining the capital letter with a curly line. A Barnes 2000 1 CS126/L13 Similarly if A and B are m n matrices, their difference D = A B is also m n and dij = aij bij For example 11 4 A = 7 2 10 4 and 7 5 -6 for 1 i m and 1 j n. 3 7 B= 2 4 1 2 2 8 -8 5 3 then 2 8 11 12 C= A+B= 9 2 2 11 2 -4 and 14 3 D = A - B = 5 6 9 6 Scalar Multiplication Multiplication of a matrix A by a scalar a (a single number) produces a matrix of the same size as the original whose elements are the corresponding elements of A each multiplied by a. Thus if A is an m n matrix then B = aA is also m n and bij = aaij Example 3 1 2 If A = 6 5 4 3 6 then 3A = 18 15 9 12 for 1 i m and 1 j n. . Matrix Multiplication Suppose A and B are m p and q n matrices respectively. Then we can form the matrix product AB if and only if p=q, that is if the number of columns of A is equal to the number of rows of B. We say A and B are conformant for the product AB. In this case C = AB is an m n matrix and the element in row i, column j of the product matrix C = AB is given by p cij = aik bkj = ai1b1 j + bi 2 b2 j + ai 3b3j ... + aipb pj k =1 Note that to obtain the element in row i column j of AB we multiply corresponding elements in the ith row of A and the jth column of B and then add up these p multiples. The number of rows in the product matrix AB is the number of rows in A and the number of columns is the number of columns in B. Thus, for example, given that 3 7 5 4 2 3 4 6 7 A= and B = 2 4 3 then C = AB = 1 2 5 4 9 9 1 2 2 Note that since A is 2 3 and B is 3 3, AB is 2 3 and, for example, the element in row 1 column 2 is formed from row 1 of A and column 2 of B: 2 (7) + 3 4 + 4 2 = 6 Similarly the element in row 2 column 3 is formed from row 2 of A and column 3 of B: (1) (5) + (2) 3 + 5 2 = 9. A Barnes 2000 2 CS126/L13 Note that in the above example BA does not exist, since B is 3 3 and A is 2 3. We say A and B are not conformant for the product BA. Note also that square matrices are conformant for multiplication if and only if they have the same size. Even if A and B are square matrices of the same size it is NOT usually the case that AB = BA. For example, if 1 2 5 6 A= and B = 7 8 3 4 19 22 then C = AB = 43 50 23 34 and D = BA = 31 46 We say that in general matrix multiplication is not commutative. In a few special cases we can find square matrices A and B such that AB = BA, in this case we say A and B commute. The Zero Matrices The zero matrix Om n is the m n matrix with all its elements equal to zero Thus the 2 2 and 3 2 zero matrices are 0 0 0 0 O2 2 = O32 = 0 0 0 0 0 0 If the size of the matrix is clear from the context the subscripts are omitted and the zero matrix is represented simply by O. Let A be any m n matrix, then the following properties of the zero matrix are fairly obvious: A + O m n = Om n + A = A AOnp = Om p OqmA = Oqn The Identity Matrices The identity matrix In is a square matrix of order n with ones on the main diagonal and zeros elsewhere. Thus the 2 2 and 3 3 identity matrices are 1 0 I2 = 0 1 1 0 0 I 3 = 0 1 0 0 0 1 If the size of the matrix is clear from the context the subscript is omitted and the identity matrix is represented simply by I. If A is any 2 3 matrix then AI3 = I 2 A = A. Thus multiplying a matrix the by identity matrix of the appropriate size leaves the matrix unchanged. For example 3 2 1 2 1 0 0 4 2 0 1 0 = 5 1 0 0 1 3 2 4 5 4 2 3 1 0 2 3 and = 0 1 1 2 5 1 2 4 5 More generally we find that if A is m n then AIn = Im A = A. In particular if A is square of order n we have AIn = I n A = A. Thus any square matrix commutes with the identity matrix of the same size. A Barnes 2000 3 CS126/L13 Powers of a Square Matrix Let A be a square matrix of order n. Then we can form the matrix product AA which is also n n; this product is denoted by A2. Similarly we can form the products: A3 = A2A, A4 = A3A, ......., Am = Am1 A for any integer m1 where we define A1 = A and A0 = In. We saw above matrix multiplication is not normally commutative and however it can be shown that any two powers of a square matrix A always commute, thus: A3 = A2A = AA2 and more generally Am = Am1 A = AAm1 37 54 and also C = A2 A = 81 118 for any integer m1. Thus any two powers of a matrix commute. For example, if 1 2 7 10 2 A= then A = 15 22 3 4 37 54 thus B = AA2 = 81 118 The Transpose of a Matrix The transpose of an m n matrix A is the n m matrix formed from A by interchanging the rows and columns of A. The transpose of A is denoted by AT (or sometimes by A'). Thus, for example, if Suppose that A is m p and that B is p n, then A and B are conformant for the product AB which is m n . Note that BT is n p and that AT is p m and therefore BT and AT are conformant for the product BTAT which is n m. In fact the following result holds: (AB)T = For example, if 1 2 A= and 3 4 3 5 1 B= 1 8 0 1 then A = 2 T BTAT 3 4 3 1 and B = 5 8 1 0 T T 1 2 3 5 1 5 21 1 thus AB = = 3 4 1 8 0 13 47 3 3 1 1 B A = 5 8 1 0 2 T T 5 13 and (AB) = 21 47 1 3 whereas 5 13 3 T = 21 47 = (AB) 4 1 3 Laws of Matrix Algebra In the laws that follow, a and b are scalars (single numbers) and A, B and C are matrices of an appropriate size such that the matrix sums and products indicated exist. Commutative Law for Addition A+B= B+A 4 A Barnes 2000 CS126/L13 NO commutative Law for Multiplication Associative Law for Addition Associative Laws for Scalar Multiplication Associative Law for Matrix Multiplication Distributive Laws (Matrix) (Scalar) Properties of Zero Matrix Properties of the Identity Matrix Scalar Multiplication Properties AB BA (A + B) + C = A + (B + C) a(AB) = (aA)B = A(aB) (ab)A = a(bA) (AB)C = A(BC) (A + B)C = A(B + C) = a(A + B) = (a + b)C = AC + BC AB + AC aA + aB aC + bC O + A= A+ O = A OA = O AO = O IA = A 1A = A AI = A 0A = O Symmetric and Anti-Symmetric Matrices If A is a square matrix with A = AT, we say that the matrix A is symmetric. If A is a square matrix with A = AT, we say that the matrix A is anti-symmetric (or skewsymmetric). The symmetric part of a square matrix A is the matrix (A + AT). The anti- (or skew-) symmetric part of a square matrix A is the matrix (A AT). Not surprisingly the symmetric part of a square matrix is symmetric! This follows since (A + A T)T = (AT + (A T)T) = (AT + A) = (A + A T) Similarly the anti-symmetric part of a square matrix is anti-symmetric! The proof is left as an exercise. For example, if 1 2 A= 3 4 then 1 1 2.5 (A + AT ) = 2 2.5 4 and 1 0 -0.5 (A A T ) = 0 2 0.5 Matrices in Ada There is no direct support for matrix algebra in Ada. However it is relatively easy to...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

East Los Angeles College - CS - 2130
7# #/#,#T#,#T#T#-T#-T#-b#.#-#- #- #- #-#-#-#.#x#-p#/0# #/P#/#*#/#-T#/#/h#:#/#/#/# #/#/#/#/ #/#/#CS213 Programming Language Concepts and ParadigmsCoursework 2002 The coursework assignment contributes 25% to the overall assessment of the module. It con
East Los Angeles College - CS - 2130
7#q# %#X#"#T#"#T#T#T#T#b# #c# #w# #U#$#x#%# #%<#%w#*#% #T#% #%T#/#% # %#%# #% #%#%)#% #% ##% #CS2130 Programming Language Concepts and ParadigmsCoursework 2003The coursework assignment contributes 25% to the overall assessment of the module.Modify th
East Los Angeles College - CS - 2130
7#3#H(#1#F#l#F#l#Gl# #Gl#Gl#Gz#Gz#Gz#Gz#G # #G# #G #G #G #G #G# #G#G#G#G#H #G#9#H#H#G#H#H#H#H#H #H$# # # ##CS2130 Programming Language Concepts and ParadigmsCoursework 2005 Problem 1. A Task PoolIn the Ada code overleaf a main task loops repeatedly
CSU Fullerton - SRT - 0901
SRT210Week ThreeWeek OverviewChange Management Revision Control Time ManagementChange management is an organized effort to implement changes to a systemChange ManagementTypically, change management involves the following elements: Th
East Los Angeles College - CS - 2130
CS2130 Programming Language ConceptsUnit 11 More on Function and Procedure Abstractions Defining New Operators Some languages, for example Ada and C+, allow new overloadings of existing operator symbols to be defined. For example in Ada:TYPE Vector
East Los Angeles College - CS - 2130
CS2130 Programming Language ConceptsUnit 14 - Pointer or Access Types Dynamic Storage Allocation The binding of fixed amounts of storage to named variables is inadequate for algorithms that need to store arbitrary amounts of data. For example progra
East Los Angeles College - CS - 2130
CS2130 Programming Language ConceptsUnit 2 Concurrent Programming So far in this degree programme you have mainly considered sequential programs in which statements are obeyed in a single thread of control, that is where only one instruction sequenc
East Los Angeles College - CS - 2130
CS2130 Programming Language ConceptsUnit 16 Encapsulation and Abstraction Client/Server Model Most modern programming languages provide a means of grouping related services together in some program entity. This entity is variously called a package,
East Los Angeles College - CS - 2130
CS2130 Programming Language ConceptsUnit 10 Function and Procedure AbstractionsExpressions & Commands Revisited Recall that an expression is anything that can be evaluated to produce a value whereas a command modifies program state (the internal s
East Los Angeles College - CS - 2130
CS2130 Programming Language ConceptsUnit 12 - Bindings and Scope Binding Each time execution of a program in a high-level programming language such as Ada or Java reaches a declaration that declaration is elaborated which has the effect of binding o
East Los Angeles College - CS - 2130
CS2130 Programming Language ConceptsUnit 15 General Access Types In the last unit access or pointer types were used to provide a means of manipulating objects created by an allocator (i.e. NEW). Such access types are referred to as pool-specific acc
East Los Angeles College - CS - 2130
CS2130 Programming Language ConceptsUnit 8 - Programming Language Concepts Names A name is a string of characters used to identify some entity in a program (such as a variable, type, subprogram etc.) Names are often referred to as identifiers. A num
CSU Fullerton - OPS - 535
1OPS535Advanced TCP/IP Network AdministrationRPC and NFSRaymond Chan Seneca College of Applied Technology2What is RPC?RPC is a programming paradigm (or protocol) Based on work at Xerox PARC in the early 1980s RPC use XDR encoding Used by
CSU Fullerton - OPS - 535
Professor: RaymondChan Email: raymond.chan@senecac.on.caUseemailforallcommunication.Pleaseuse propergrammarandspelling.OnlyemailsfromyourSenecaLearn accountswillbereplied.PleaseaddOPS535asaprefixtothesubject line. Webpage: Myhomepageisathttp:/cs.sene
Air Force Academy - ME - 324
Granta Design, February 2007 Granta Design, February 2007Getting started with CES EduPackThese exercises give an easy way to learn to use the CES EduPack software. The comprehensive Help file and CES InDepth within the software give more detail
Air Force Academy - ME - 492
Air Force Academy - ME - 492
East Los Angeles College - CS - 2130
7#4a#"#A#0#0#1#1#1#1#X#23#23#23#2C# #2S#2o#2o#3a#x#23#3# #3#47#*#4a#1#47#4#&#47#47#4a#47#47#47#47# #47##47#Answer 3 questions.Time allowed: 1.5 hoursDisclaimer:This sample paper gives an indication as to the style of the sort of questions that may ap
Air Force Academy - ME - 492
Air Force Academy - ME - 492
Air Force Academy - ME - 492
Air Force Academy - ME - 229
2009WeekJan. 5 Jan. 9Introduction to Engineering DesignMonday Lab.1B71 2:30-5:20PM Class start Jan 5 Introduction of Faculty and Group Members Introduction to the Design Projects. Prof. Burton Design Process & Designers- Prof. W.Szyszkowski (Co
East Los Angeles College - CS - 2130
CS2130 Programming Language ConceptsUnit 15 addendum Function Pointers in C and C+We can also define function pointers in C or C+. For example to define a pointer type to refer to functions of type double > double we would define#include <math.h>
CSU Fullerton - SRT - 0901
SRT210Week OneWeek OverviewCourse Introduction System Administrators' Role Security Policy Role Types of Security Policies Week One TasksYour ProfessorRaymond Chan Email: raymond.chan@senecac.on.ca Home page: cs.senecac.on.ca/~rchan/ Office
East Los Angeles College - CS - 2130
There is no lab sheet for the labs in the weeks ending Fri 24thFebruary and Friday 3rd March.This is to allow students to work on the PLC coursework assignmentwhich is due in 7th March.There will be a lab sheets for the labs in week 8-11 ( wee
Air Force Academy - ME - 492
East Los Angeles College - CS - 2130
CS2130 Programming Language Concepts and ParadigmsLab Class 4 An On-screen Time Display Program In this example a task is used to manage a clock which displays the time and date at a certain position on the screen; every second the task updates the
Air Force Academy - ME - 492
Air Force Academy - ME - 492
Air Force Academy - ME - 492
Air Force Academy - ME - 492
East Los Angeles College - CS - 2130
CS2130 Programming Language Concepts and ParadigmsUnit 11 More on Synchronisation in Concurrent Ada Programs The Ada Rendezvous Protected objects and protected types largely solve the problem of synchronising task access to shared data structures. P
Air Force Academy - ME - 492
East Los Angeles College - CS - 2130
CS2130 Programming Language Concepts and ParadigmsUnit 16 - More on Object-Oriented Programming in Ada Object-Oriented Features in Standard Ada Libraries The standard Ada libraries use the object-oriented features of Ada to provide a number of power
Air Force Academy - ME - 492
East Los Angeles College - CS - 2130
CS2130 Programming Language Concepts and ParadigmsUnit 13 Encapsulation and Abstraction Client/Server Model A package typically provides a service that is utilised by a client. The interface of a package should provide exactly the information needed
Air Force Academy - ME - 492
East Los Angeles College - CS - 2130
CS2130 Programming Language Concepts and ParadigmsUnit 8 General Access Types In CS1210 (DSA) access or pointer types were used to provide a means of manipulating objects created by an allocator (i.e. NEW). Such access types are referred to as pool-
Air Force Academy - ME - 492
East Los Angeles College - CS - 2130
CS2130 Programming Language Concepts and ParadigmsUnit 4 - Bindings and Scope Binding Each time execution of a program in a high-level programming language such as Ada reaches a declaration that declaration is elaborated which has the effect of bind
Air Force Academy - ME - 324
East Los Angeles College - CS - 2130
CS2130 Programming Language Concepts and ParadigmsUnit 12 Java Threads A thread in Java is an instance of the Thread class (or a class that extends Thread). The Thread class provides methods to create, control and synchronise a thread. When a thread
East Los Angeles College - CS - 2130
CS2130 Programming Language Concepts and ParadigmsUnit 5 Function and Procedure Abstractions Functions A function definition establishes name for a program entity which, when called, yields a value (of a specific type) which usually depends on one o
Air Force Academy - ME - 492
East Los Angeles College - CS - 2130
CS2130 Programming Language Concepts and ParadigmsUnit 10 Synchronization in Concurrent Ada Programs Protected Variables In Ada 95 a simple mechanism: namely protected variables, was introduced for controlling access to shared data. A protected vari
Air Force Academy - ME - 324
East Los Angeles College - CS - 2130
CS2130 Programming Language Concepts and ParadigmsLecture 2 - Programming Language Concepts Every programming language has syntax and semantics: The syntax of a programming language is concerned with the form of expressions, commands and declaration
East Los Angeles College - CS - 2130
CS2130 Programming Language Concepts and ParadigmsUnit 16 Object-Oriented Programming in Ada Tagged Types In the previous lecture we saw how a new type could be derived from an existing type and how such a type inherited the primitive operations of
East Los Angeles College - CS - 2130
CS2130 Programming Language Concepts and ParadigmsLecture 14 Generics In the previous lecture the package IntStack provided an abstract data object namely a stack of integers. It should be clear that the implementation of a stack of floating point n
East Los Angeles College - CS - 2130
CS2130 Programming Language Concepts and ParadigmsUnit 7 - More on Types Semi-Boolean Truth Values In some languages (for example C and C+, but not Java) there is no special Boolean type as such. Instead comparisons and other Boolean expressions pro
East Los Angeles College - CS - 2130
CS2130 Programming Language Concepts and ParadigmsUnit 3 - Values, Types and Variables The term value refers to anything that results when an expression is evaluated, or an entity that may be stored in a memory cell within the computer, or which for
East Los Angeles College - CS - 2130
CS2130 Programming Language Concepts and ParadigmsUnit 9 Concurrent Programming in Ada Tasks So far we have only considered sequential programs in which statements are obeyed in a single thread of control. However a program can also be built from tw
East Los Angeles College - CS - 2130
CS2130 Programming Language Concepts and ParadigmsUnit 6 Renaming in Ada It is possible to give a new name to certain Ada entities using a renaming declaration. The following entities can be renamed: variables constants array elements packages recor
East Los Angeles College - CS - 2130
CS2130 Programming Language Concepts and ParadigmsPractical Class 2 Solutions Solutions to the first lab class exercises may now be found on the module web-site and in the Unix directory ~barnesa/cs2130/lab1. Recall that you can access the module we
East Los Angeles College - CS - 2130
CS2130 Programming Language Concepts and ParadigmsPractical Class 1 The Module Web-site Check that you can access the module Web-site by following the CS2130 link from my home page with URLhttp:/www.aston.ac.uk/~barnesaor following the links Prog
East Los Angeles College - CS - 2130
CS2130 Programming Language Concepts and ParadigmsPractical Class 3 The Ada.Command_Line and POSIX.Files Packages The purpose of this lab is to introduce a few more of the Ada Libraries available with the Gnat Ada system. which enable an Ada program
Air Force Academy - ME - 475
f4_3f4_4
CSU Fullerton - OPS - 234
AS/400 Operations Navigator It is now possible for a user to execute AS/400 commands without having to learn Command Language syntax. Also, for those users who are aware of CL but feel more productive by pointing and clicking with a graphical interfa
East Los Angeles College - CS - 2130
7#<#R#:#}#P#3#P#3#Q3# #Q=##QI#QW#QW#QW#QW##Qc# #Qm# #Qw#Qw#Qw#Qw#Qw# #Q#Qp#Q #Qe#Q#Q#,#Q#Q#Q #Q#Q#Q#Q# #Q#R# # # ##CS2130 Programming Language Concepts and ParadigmsUnit 9 Concurrent Programming in AdaTasksSo far we have only considered sequentia
East Los Angeles College - CS - 2130
7#|#:#v6#%#3# #3#3#.#a#$#I#w# #p## # # # # #,#"##&# (#,#0#2#6# # ## #CS2130 Programming Language Concepts and ParadigmsUnit 4 - Bindings and ScopeBindingEach time execution of a program in a high-level programming language such as Ada reaches a dec
Air Force Academy - ME - 324
Iron and Iron-Fe3C Equilibrium Phase DiagramIron (Fe) * Occurs naturally in meteorites. Only a small quantity is of terrestrial origin. * Is the second most abundant metal (after aluminium) in the Earths crust. It constitutes about 95% of all the me