Basic Math Review for CS4830

Similar documents
Basic Math Review for CS1340

Knowledge Discovery and Data Mining 1 (VO) ( )

MATH.2720 Introduction to Programming with MATLAB Vector and Matrix Algebra

Math for ML: review. CS 1675 Introduction to ML. Administration. Lecture 2. Milos Hauskrecht 5329 Sennott Square, x4-8845

Review of Linear Algebra

Complex Numbers: Definition: A complex number is a number of the form: z = a + bi where a, b are real numbers and i is a symbol with the property: i

6x 3 12x 2 7x 2 +16x 7x 2 +14x 2x 4

Elementary maths for GMT

Systems of Algebraic Equations and Systems of Differential Equations

Chapter 2. Ma 322 Fall Ma 322. Sept 23-27

Linear Algebra V = T = ( 4 3 ).

Math for ML: review. ML and knowledge of other fields

Matrix Basic Concepts

OR MSc Maths Revision Course

Calculus II - Basic Matrix Operations

Econ Slides from Lecture 7

Chapter 2. Linear Algebra. rather simple and learning them will eventually allow us to explain the strange results of

Introduction Eigen Values and Eigen Vectors An Application Matrix Calculus Optimal Portfolio. Portfolios. Christopher Ting.

There are six more problems on the next two pages

JUST THE MATHS UNIT NUMBER 1.6. ALGEBRA 6 (Formulae and algebraic equations) A.J.Hobson

Chapter 2. Matrix Arithmetic. Chapter 2

Math 309 Notes and Homework for Days 4-6

Lecture 3: Matrix and Matrix Operations

A primer on matrices

Section-A. Short Questions

Math Camp II. Basic Linear Algebra. Yiqing Xu. Aug 26, 2014 MIT

Matrices BUSINESS MATHEMATICS

Introduction to Matrix Algebra

Numerical Linear Algebra Homework Assignment - Week 2

Chapter 1 Vector Spaces

Reference Material /Formulas for Pre-Calculus CP/ H Summer Packet

Introduction to Quantitative Techniques for MSc Programmes SCHOOL OF ECONOMICS, MATHEMATICS AND STATISTICS MALET STREET LONDON WC1E 7HX

3 (Maths) Linear Algebra

CS 246 Review of Linear Algebra 01/17/19

Willmar Public Schools Curriculum Map

Calculus (Math 1A) Lecture 4

Linear Equations in Linear Algebra

Quadratic forms. Here. Thus symmetric matrices are diagonalizable, and the diagonalization can be performed by means of an orthogonal matrix.

Math 315: Linear Algebra Solutions to Assignment 7

Image Registration Lecture 2: Vectors and Matrices

Dividing Polynomials: Remainder and Factor Theorems

The Cayley-Hamilton Theorem and Minimal Polynomials

Calculus (Math 1A) Lecture 4

Glossary of Linear Algebra Terms. Prepared by Vince Zaccone For Campus Learning Assistance Services at UCSB

Getting Started with Communications Engineering. Rows first, columns second. Remember that. R then C. 1

a11 a A = : a 21 a 22

Math-2A Lesson 2-1. Number Systems

Exercise Set Suppose that A, B, C, D, and E are matrices with the following sizes: A B C D E

Matrices. Chapter Definitions and Notations

Algebra II Vocabulary Alphabetical Listing. Absolute Maximum: The highest point over the entire domain of a function or relation.

A matrix is a rectangular array of. objects arranged in rows and columns. The objects are called the entries. is called the size of the matrix, and

. a m1 a mn. a 1 a 2 a = a n

Matrix Algebra 2.1 MATRIX OPERATIONS Pearson Education, Inc.

Phys 201. Matrices and Determinants

College Algebra. Basics to Theory of Equations. Chapter Goals and Assessment. John J. Schiller and Marie A. Wurster. Slide 1

Math Camp Lecture 4: Linear Algebra. Xiao Yu Wang. Aug 2010 MIT. Xiao Yu Wang (MIT) Math Camp /10 1 / 88

A matrix is a rectangular array of. objects arranged in rows and columns. The objects are called the entries. is called the size of the matrix, and

Jim Lambers MAT 610 Summer Session Lecture 2 Notes

Ron Paul Curriculum 9th Grade Mathematics Problem Set #2

Chapter 6: Rational Expr., Eq., and Functions Lecture notes Math 1010

18.S34 linear algebra problems (2007)

Order of Operations. Real numbers

Linear Algebra. The analysis of many models in the social sciences reduces to the study of systems of equations.

Math-2 Section 1-1. Number Systems

Review from Bootcamp: Linear Algebra

MAC Module 1 Systems of Linear Equations and Matrices I

(Mathematical Operations with Arrays) Applied Linear Algebra in Geoscience Using MATLAB

REQUIRED MATHEMATICAL SKILLS FOR ENTERING CADETS

Lecture 3 Linear Algebra Background

MATHEMATICS. Higher 2 (Syllabus 9740)

Review of linear algebra

Lecture 7. Econ August 18

Check boxes of Edited Copy of Sp Topics (was 217-pilot)

Matrices Gaussian elimination Determinants. Graphics 2009/2010, period 1. Lecture 4: matrices

Lecture 6: Geometry of OLS Estimation of Linear Regession

Review of Basic Concepts in Linear Algebra

[ Here 21 is the dot product of (3, 1, 2, 5) with (2, 3, 1, 2), and 31 is the dot product of

Chapter 5. Linear Algebra. A linear (algebraic) equation in. unknowns, x 1, x 2,..., x n, is. an equation of the form

The symmetric group R + :1! 2! 3! 1. R :1! 3! 2! 1.

Intro to Maths for CS: Powers and Surds

1 Proof techniques. CS 224W Linear Algebra, Probability, and Proof Techniques

Basics of Calculus and Algebra

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Linear Algebra /34

NATIONAL BOARD FOR HIGHER MATHEMATICS. Research Scholarships Screening Test. Saturday, January 20, Time Allowed: 150 Minutes Maximum Marks: 40

0.1 Rational Canonical Forms

1 Matrices and Systems of Linear Equations. a 1n a 2n

Region 16 Board of Education. Precalculus Curriculum

MATH 2030: MATRICES ,, a m1 a m2 a mn If the columns of A are the vectors a 1, a 2,...,a n ; A is represented as A 1. .

NAME DATE PERIOD. A negative exponent is the result of repeated division. Extending the pattern below shows that 4 1 = 1 4 or 1. Example: 6 4 = 1 6 4

1. Vectors.

Matrix Algebra Determinant, Inverse matrix. Matrices. A. Fabretti. Mathematics 2 A.Y. 2015/2016. A. Fabretti Matrices

10-701/ Recitation : Linear Algebra Review (based on notes written by Jing Xiang)

WEST AFRICAN SENIOR SCHOOL CERTIFICATE EXAMINATION FURTHER MATHEMATICS/MATHEMATICS (ELECTIVE)

A primer on matrices

Complex Numbers. Essential Question What are the subsets of the set of complex numbers? Integers. Whole Numbers. Natural Numbers

Section 3.2. Multiplication of Matrices and Multiplication of Vectors and Matrices

The minimal polynomial

ADDITIONAL MATHEMATICS

Mathematics for Computer Science

Check boxes of Edited Copy of Sp Topics (was 261-pilot)

Transcription:

Basic Math Review for CS4830 Dr. Mihail August 18, 2016 (Dr. Mihail) Math Review for CS4830 August 18, 2016 1 / 35

Sets Definition of a set A set is a collection of distinct objects, considered as an object in its own right. For example, the numbers 2, 4, and 6 are distinct objects when considered separately, but when they are considered collectively they form a single set of size three, written {2, 4, 6}. Sets are one of the most fundamental concepts in mathematics. Have to know symbols : set membership. Example: x R is read x belongs to the set R. : union. Example: X = A B is read: X is the result of A union B, and contains all elements of A and B. : intersection. Example X = A B is read X is the result of A intersect B, and contains elements that are in BOTH A and in B (Dr. Mihail) Math Review for CS4830 August 18, 2016 2 / 35

Number sets Naturals Natural numbers: N (Dr. Mihail) Math Review for CS4830 August 18, 2016 3 / 35

Number sets Naturals Natural numbers: N Examples: 0, 1, 2, 3, 4,... (Dr. Mihail) Math Review for CS4830 August 18, 2016 3 / 35

Number sets Naturals Natural numbers: N Integers Examples: 0, 1, 2, 3, 4,... Integers: Z (Dr. Mihail) Math Review for CS4830 August 18, 2016 3 / 35

Number sets Naturals Natural numbers: N Integers Examples: 0, 1, 2, 3, 4,... Integers: Z Examples:... 4, 3, 2, 1, 0, 1, 2, 3, 4,... (Dr. Mihail) Math Review for CS4830 August 18, 2016 3 / 35

Number sets Naturals Natural numbers: N Integers Examples: 0, 1, 2, 3, 4,... Integers: Z Examples:... 4, 3, 2, 1, 0, 1, 2, 3, 4,... (Dr. Mihail) Math Review for CS4830 August 18, 2016 3 / 35

Number sets Naturals Natural numbers: N Integers Examples: 0, 1, 2, 3, 4,... Integers: Z Examples:... 4, 3, 2, 1, 0, 1, 2, 3, 4,... Rationals Rational numbers: Q (Dr. Mihail) Math Review for CS4830 August 18, 2016 3 / 35

Number sets Naturals Natural numbers: N Integers Examples: 0, 1, 2, 3, 4,... Integers: Z Examples:... 4, 3, 2, 1, 0, 1, 2, 3, 4,... Rationals Rational numbers: Q Examples: 1 2, 2 3, 10 7, 1 3 (Dr. Mihail) Math Review for CS4830 August 18, 2016 3 / 35

Number sets Naturals Natural numbers: N Integers Examples: 0, 1, 2, 3, 4,... Integers: Z Examples:... 4, 3, 2, 1, 0, 1, 2, 3, 4,... Rationals Rational numbers: Q Examples: 1 2, 2 3, 10 7, 1 3 a More generally, rational numbers are ratios of two whole numbers: b, where a, b Z subject to b 0 (Dr. Mihail) Math Review for CS4830 August 18, 2016 3 / 35

Number sets contd. Irrationals Numbers that cannot be expressed as a ratio of two integers No set symbol, often noted as: R Q Examples: π, e, 2 (Dr. Mihail) Math Review for CS4830 August 18, 2016 4 / 35

Number sets contd. Irrationals Numbers that cannot be expressed as a ratio of two integers No set symbol, often noted as: R Q Examples: π, e, 2 Reals Real numbers: R (Dr. Mihail) Math Review for CS4830 August 18, 2016 4 / 35

Number sets contd. Imaginaries Imaginary numbers: I They are numbers that, when squared, result in a negative number Example: 9 = 3i, because (3i) 2 = 9, here i 2 = 1 (Dr. Mihail) Math Review for CS4830 August 18, 2016 5 / 35

Number sets contd. Imaginaries Imaginary numbers: I They are numbers that, when squared, result in a negative number Example: 9 = 3i, because (3i) 2 = 9, here i 2 = 1 Algebraic numbers Algebraic numbers: A Numbers that are roots (solutions) to at least one non-zero polynomial with rational coefficients Example: x in 2x 3 5x + 39 (Dr. Mihail) Math Review for CS4830 August 18, 2016 5 / 35

Number sets contd. Imaginaries Imaginary numbers: I They are numbers that, when squared, result in a negative number Example: 9 = 3i, because (3i) 2 = 9, here i 2 = 1 Algebraic numbers Algebraic numbers: A Numbers that are roots (solutions) to at least one non-zero polynomial with rational coefficients Example: x in 2x 3 5x + 39 What about i Is i also an algebraic number? (Dr. Mihail) Math Review for CS4830 August 18, 2016 5 / 35

Number sets contd. Complex Complex numbers: C They are a combination of a real and an imaginary number Examples 10 2i, 2 + 3i More generally, they have the form x + iy, where x, y R (Dr. Mihail) Math Review for CS4830 August 18, 2016 6 / 35

Number sets contd. Complex Complex numbers: C They are a combination of a real and an imaginary number Examples 10 2i, 2 + 3i More generally, they have the form x + iy, where x, y R (Dr. Mihail) Math Review for CS4830 August 18, 2016 6 / 35

Operations on numbers Venn diagram of number sets (Dr. Mihail) Math Review for CS4830 August 18, 2016 7 / 35

Operations on numbers Common operations Addition: 2 + 3 = 5 Subtraction 2 3 = 1 Multiplication 2 3 = 6 Division 2 3 = 0.(6) Exponentiation 2 3 = 8 (Dr. Mihail) Math Review for CS4830 August 18, 2016 8 / 35

Variables Variable may refer to: In research: a logical set of attributes In mathematics: a symbol that represents a quantity in a mathematical expression In computer science: a symbolic name associated with a value and whose associated value may be changed We shall use all 3 flavors in this course. (Dr. Mihail) Math Review for CS4830 August 18, 2016 9 / 35

Functions What is a function? (Dr. Mihail) Math Review for CS4830 August 18, 2016 10 / 35

Functions Intuition (Dr. Mihail) Math Review for CS4830 August 18, 2016 11 / 35

Functions Intuition useful for computer scientists (Dr. Mihail) Math Review for CS4830 August 18, 2016 12 / 35

Functions Informal definition Think of a function as a process that takes input x and produces output f(x). For example, the function f (x) = x 2, takes an input x (a number) and processes it by squaring it. Plotting a function with a single number as input (Dr. Mihail) Math Review for CS4830 August 18, 2016 13 / 35

Terminology related to functions Terms to absolutely have to know Function input: domain (Dr. Mihail) Math Review for CS4830 August 18, 2016 14 / 35

Terminology related to functions Terms to absolutely have to know Function input: domain Function output: range or more accurately image (Dr. Mihail) Math Review for CS4830 August 18, 2016 14 / 35

Terminology related to functions Terms to absolutely have to know Function input: domain Function output: range or more accurately image When plotting a function with scalar inputs, the X -axis is called the abscissa, the Y -axis is called the ordinate (Dr. Mihail) Math Review for CS4830 August 18, 2016 14 / 35

Terminology related to functions Terms to absolutely have to know Function input: domain Function output: range or more accurately image When plotting a function with scalar inputs, the X -axis is called the abscissa, the Y -axis is called the ordinate The input X, is also referred to as the independent variable or predictor variable, regressor, controlled variable, manipulated variable, explanatory variable, etc. (Dr. Mihail) Math Review for CS4830 August 18, 2016 14 / 35

Terminology related to functions Terms to absolutely have to know Function input: domain Function output: range or more accurately image When plotting a function with scalar inputs, the X -axis is called the abscissa, the Y -axis is called the ordinate The input X, is also referred to as the independent variable or predictor variable, regressor, controlled variable, manipulated variable, explanatory variable, etc. The output Y, is also referred to as the dependent variable or response variable, regressand, measured variable, outcome variable, output variable, etc. (Dr. Mihail) Math Review for CS4830 August 18, 2016 14 / 35

Operations on functions Composition The idea is to process the input through one function, then use the result of that function as the input to the second. This results in a different function. Notation: given two functions f and g, the composition of g and f is written as (g f ) = g(f (x)). Example: if f (x) = 2x + 3, and g(x) = x 2, then (g f ) = g(f (x)) = g(2x + 3) = (2x + 3) 2 = 4x 2 + 12x + 9. (f g) (g f ). (Dr. Mihail) Math Review for CS4830 August 18, 2016 15 / 35

Operations on functions Differentiation/Integration Rates of change and areas under the curve. Derivative of a function f is often noted as f or d dx [f (x)] (Dr. Mihail) Math Review for CS4830 August 18, 2016 16 / 35

Operations on functions Differentiation/Integration Rates of change and areas under the curve. Derivative of a function f is often noted as f or d dx [f (x)] It is important to know if a function is differentiable and where (Dr. Mihail) Math Review for CS4830 August 18, 2016 16 / 35

Operations on functions Differentiation/Integration Rates of change and areas under the curve. Derivative of a function f is often noted as f or d dx [f (x)] It is important to know if a function is differentiable and where Indefinite integral of a function f is written as f (x)dx Definite integral of a function f over an interval [a, b] is written as b a f (x)dx (Dr. Mihail) Math Review for CS4830 August 18, 2016 16 / 35

Operations on functions Differentiation/Integration Rates of change and areas under the curve. Derivative of a function f is often noted as f or d dx [f (x)] It is important to know if a function is differentiable and where Indefinite integral of a function f is written as f (x)dx Definite integral of a function f over an interval [a, b] is written as b a f (x)dx (Dr. Mihail) Math Review for CS4830 August 18, 2016 16 / 35

Analytic/Numerical In Calculus courses you were probably taught analytic solutions to differentiation and integration problems. In the real-world, you will most likely deal with numerical differentiation and integration. More on that later in the course. (Dr. Mihail) Math Review for CS4830 August 18, 2016 17 / 35

Vector and Matrix Algebra Scalars A scalar is a simple quantity, or a number. For example, in x = 1, x is a scalar. (Dr. Mihail) Math Review for CS4830 August 18, 2016 18 / 35

Vector and Matrix Algebra Scalars A scalar is a simple quantity, or a number. For example, in x = 1, x is a scalar. Vectors Going a bit further, a vector is an ordered set of scalars. For example, [2, 3] is a vector. (Dr. Mihail) Math Review for CS4830 August 18, 2016 18 / 35

Vector and Matrix Algebra Scalars A scalar is a simple quantity, or a number. For example, in x = 1, x is a scalar. Vectors Going a bit further, a vector is an ordered set of scalars. For example, [2, 3] is a vector. Vector elements The position of the scalar in the ordered set is referred to as the index. In the example above, the index of the element 2 is 1, since it is the first element in the set. The index of 3 is 2, since it is the second element. (Dr. Mihail) Math Review for CS4830 August 18, 2016 18 / 35

More about vectors Vector dimensionality The number of elements a vector has is referred to as its dimensionality. For example, the vector X = [x 1, x 2, x 3 ] has dimensionality 3, and if x 1, x 2, x 3 R, then it is denoted as X R 3. There can be any number dimensional vectors. For example 6-dimensional vectors R 6. (Dr. Mihail) Math Review for CS4830 August 18, 2016 19 / 35

More about vectors Vector dimensionality The number of elements a vector has is referred to as its dimensionality. For example, the vector X = [x 1, x 2, x 3 ] has dimensionality 3, and if x 1, x 2, x 3 R, then it is denoted as X R 3. There can be any number dimensional vectors. For example 6-dimensional vectors R 6. Vector magnitude A vector s magnitude is the distance (or L2-norm) from the origin of the space it lives in and a point. The magnitude is computed using the Pythagorean theorem (more accurately, a generalization of that known as Euclidian distance) using the following formula and notation: n X = ( xi 2) (1) i=1 (Dr. Mihail) Math Review for CS4830 August 18, 2016 19 / 35

But I thought... That... Vectors area mathematical object with a magnitude and direction, not what you just told us. (Dr. Mihail) Math Review for CS4830 August 18, 2016 20 / 35

But I thought... That... Vectors area mathematical object with a magnitude and direction, not what you just told us. This definition is nothing but a special case of the definition in the previous slide. (Dr. Mihail) Math Review for CS4830 August 18, 2016 20 / 35

But I thought... That... Vectors area mathematical object with a magnitude and direction, not what you just told us. This definition is nothing but a special case of the definition in the previous slide. (Dr. Mihail) Math Review for CS4830 August 18, 2016 20 / 35

But I thought... That... Vectors area mathematical object with a magnitude and direction, not what you just told us. This definition is nothing but a special case of the definition in the previous slide. When the tail and the head are points on 2D plane, how can we compute magnitude? (Dr. Mihail) Math Review for CS4830 August 18, 2016 20 / 35

3D visualization (Dr. Mihail) Math Review for CS4830 August 18, 2016 21 / 35

3D visualization In-class exercise If a = [1, 2, 3], what is a? (Dr. Mihail) Math Review for CS4830 August 18, 2016 21 / 35

Matrices Definition A matrix is a rectangular table of numbers. (Dr. Mihail) Math Review for CS4830 August 18, 2016 22 / 35

Matrices Definition A matrix is a rectangular table of numbers. Example (Dr. Mihail) Math Review for CS4830 August 18, 2016 22 / 35

Matrices Structure in the 2D case (Dr. Mihail) Math Review for CS4830 August 18, 2016 23 / 35

Matrices Rows and Columns One can also think of a matrix as a collection of rows or a collection of columns. Or as a collection of row vectors or column vectors Row/Column vectors 1 X = 2 3 Y = [ 1 2 3 ] X has dimensionality 3x1, and is called a column vector Y has dimensionality 1x3, and is called a row vector (Dr. Mihail) Math Review for CS4830 August 18, 2016 24 / 35

Matrices Collection of column vectors 1 4 Given X 1 = 2 and X 2 = 5, we can form a matrix Z using X 1 and X 2 : 3 6 Collection of row vectors Z = [ ] 1 4 X 1 X 2 = 2 5 3 6 Given X 1 = [ 1 2 3 ] and X 2 = [ 4 5 6 ], we can form a matrix Z using X 1 and X 2 : [ ] [ ] X1 1 2 3 Z = = 4 5 6 X 2 (Dr. Mihail) Math Review for CS4830 August 18, 2016 25 / 35

Indexing Say, Z = [ ] 1 2 3. The matrix is 2 rows by 3 colums (2x3). 4 5 6 (Dr. Mihail) Math Review for CS4830 August 18, 2016 26 / 35

Indexing How can we address an element from a matrix? [ ] 1 2 3 Say, Z =. The matrix is 2 rows by 3 colums (2x3). 4 5 6 (Dr. Mihail) Math Review for CS4830 August 18, 2016 27 / 35

Indexing How can we address an element from a matrix? [ ] 1 2 3 Say, Z =. The matrix is 2 rows by 3 colums (2x3). 4 5 6 Simple Each element has an assigned column and row number. Think of Z as follows: [ ] Z1,1 Z Z = 1,2 Z 1,3 Z 2,1 Z 2,2 Z 2,3 each Z i,j where i {possible rows} and j {possible columns}, where possible rows for Z is the set {1, 2} and the possible columns for Z is the set {1, 2, 3}. (Dr. Mihail) Math Review for CS4830 August 18, 2016 27 / 35

Indexing How can we address an element from a matrix? [ ] 1 2 3 Say, Z =. The matrix is 2 rows by 3 colums (2x3). 4 5 6 Simple Each element has an assigned column and row number. Think of Z as follows: [ ] Z1,1 Z Z = 1,2 Z 1,3 Z 2,1 Z 2,2 Z 2,3 each Z i,j where i {possible rows} and j {possible columns}, where possible rows for Z is the set {1, 2} and the possible columns for Z is the set {1, 2, 3}. Where is 5? Second row, second column: Z 2,2 (Dr. Mihail) Math Review for CS4830 August 18, 2016 27 / 35

Operations on vectors and matrices Addition and subtraction If two matrices have the same dimensions r by c, including vectors and scalars as special cases, they can be added or subtracted by adding or subtracting the elements in the same positions in each matrix. (Dr. Mihail) Math Review for CS4830 August 18, 2016 28 / 35

Operations on vectors and matrices Addition and subtraction If two matrices have the same dimensions r by c, including vectors and scalars as special cases, they can be added or subtracted by adding or subtracting the elements in the same positions in each matrix. If A is r by c, and B is r by c, then for C = A + B, C ij = A ij + B ij, similarly if C = A B, C ij = A ij B ij. (Dr. Mihail) Math Review for CS4830 August 18, 2016 28 / 35

Operations on vectors and matrices Multiplication Matrix multiplication summarizes a set of multiplications and additions. Multiplication of matrix by scalar: simply multiply each element of the matrix by the scalar. [ ] 1 2 3 Example: a = 2 and X =, then Ax or xa is a matrix formed as 4 5 6 [ ] [ ] 2 1 2 2 2 3 2 4 6 follows: = 2 4 2 5 2 6 8 10 12 (Dr. Mihail) Math Review for CS4830 August 18, 2016 29 / 35

Operations on vectors and matrices Multiplication Multiplication of two matrices: The two matrices must be conformable, that is if A is r 1 by c 1 and B is r 2 by c 2, then C = A B is defined when c 1 = r 2 and C is of size r 1 by c 2. C ij is found by multiplying each element of row i of A with each element of column j of B and adding up the multiplied pairs of real numbers. (Dr. Mihail) Math Review for CS4830 August 18, 2016 30 / 35

Operations on vectors and matrices Transposition The transpose of A, written as A T is created by one the following ways: write the rows of A as the columns of A T (Dr. Mihail) Math Review for CS4830 August 18, 2016 31 / 35

Operations on vectors and matrices Transposition The transpose of A, written as A T is created by one the following ways: write the rows of A as the columns of A T write the columns of A as the rows of A T (Dr. Mihail) Math Review for CS4830 August 18, 2016 31 / 35

Operations on vectors and matrices Transposition The transpose of A, written as A T is created by one the following ways: write the rows of A as the columns of A T write the columns of A as the rows of A T Properties: c T = c, if c is a scalar (Dr. Mihail) Math Review for CS4830 August 18, 2016 31 / 35

Operations on vectors and matrices Transposition The transpose of A, written as A T is created by one the following ways: write the rows of A as the columns of A T write the columns of A as the rows of A T Properties: c T = c, if c is a scalar (A T ) T = A (Dr. Mihail) Math Review for CS4830 August 18, 2016 31 / 35

Operations on vectors and matrices Transposition The transpose of A, written as A T is created by one the following ways: write the rows of A as the columns of A T write the columns of A as the rows of A T Properties: c T = c, if c is a scalar (A T ) T = A (A + B) T = A T + B T (Dr. Mihail) Math Review for CS4830 August 18, 2016 31 / 35

Operations on vectors and matrices Transposition The transpose of A, written as A T is created by one the following ways: write the rows of A as the columns of A T write the columns of A as the rows of A T Properties: c T = c, if c is a scalar (A T ) T = A (A + B) T = A T + B T (AB) T = B T A T (Dr. Mihail) Math Review for CS4830 August 18, 2016 31 / 35

Operations on vectors and matrices Transposition The transpose of A, written as A T is created by one the following ways: write the rows of A as the columns of A T write the columns of A as the rows of A T Properties: c T = c, if c is a scalar (A T ) T = A (A + B) T = A T + B T (AB) T = B T A T (ca) T = ca T On vectors Transpose of a row vector results in a column vector. Transpose of a column vector results in a row vector. (Dr. Mihail) Math Review for CS4830 August 18, 2016 31 / 35

Inner and outer products of vectors Given two vectors with the same number of elements, e.g.: a and b both r by 1, we can define the inner and outer products as follows: Inner product a T b = r a i b i (2) The inner product of a vector v with itself v T v is equal to the sums of squares of its elements, so has the property v T v 0. Outer product The outer product results in a matrix, of size r by r. If O = ab T is the outer product matrix, then O ij = a i b j. i=1 (Dr. Mihail) Math Review for CS4830 August 18, 2016 32 / 35

Operations on vectors and matrices Multiplication Elements in the resulting matrix M = A B, M ij = dot(a[i, ], B[, j]), where indicates all possible rows/colummns, and dot is the inner product (results in a scalar). A[i, ] is a row vector, B[, j] is a column vector. (Dr. Mihail) Math Review for CS4830 August 18, 2016 33 / 35

Special matrices Square matrices: have the same number of rows and columns (Dr. Mihail) Math Review for CS4830 August 18, 2016 34 / 35

Special matrices Square matrices: have the same number of rows and columns Diagnoal matrices: square matrices that have all except the elements on the main diagonal equal to 0 (Dr. Mihail) Math Review for CS4830 August 18, 2016 34 / 35

Special matrices Square matrices: have the same number of rows and columns Diagnoal matrices: square matrices that have all except the elements on the main diagonal equal to 0 Symmetric matrices: square matrices that have the same numbers above and below the main diagonal, i.e., a matrix A is symmetric if and only if A ij = Aji. (Dr. Mihail) Math Review for CS4830 August 18, 2016 34 / 35

Special matrices Square matrices: have the same number of rows and columns Diagnoal matrices: square matrices that have all except the elements on the main diagonal equal to 0 Symmetric matrices: square matrices that have the same numbers above and below the main diagonal, i.e., a matrix A is symmetric if and only if A ij = Aji. Identity matrix: diagonal matrix with all 1s on the main diagonal (Dr. Mihail) Math Review for CS4830 August 18, 2016 34 / 35

Trace and determinants of square matrices Trace The trace of a square matrix is the sum of elements in its main diagonal. For a matrix A of size rxr, its trace, denoted as Tr(A) is: Tr(A) = r i=1 A ii Important property: tr(a) = i λ i, where λ i are the eigenvalues of matrix A. Determinant The determinant of a square matrix is a difficult calculation, but serves important purposes in optimization problems. Often, the sign is more important than its exact value. An important property is: det(a) = i λ i (Dr. Mihail) Math Review for CS4830 August 18, 2016 35 / 35