Showing posts with label Algebra. Show all posts
Showing posts with label Algebra. Show all posts

Friday, October 18, 2013

Post 12: Matrix Operation

Matrix Equality: Two matrices and are said to be equal if and only if they have the same dimension and have identical elements in the corresponding locations in the array.

Addition and Subtraction of Matrices:
Two matrices can be added if and only if they have the same dimension. The addition rule can be stated as:
                                                 
                              

The subtraction operation A - B can be similarly defined if and only if a and B have the same dimension. The operation entails the result:

                              

Scalar Multiplication:
To multiply a matrix by a number - or in matrix algebra terminology, by a scalar - is to multiply every element of that matrix by the given scalar.

Multiplication of Matrices:
Suppose that, given two matrices A and B, we want to find the product of AB. The conformability condition for manipulation is that the column dimension of A (the "lead" matrix the expression AB) must be equal to the row dimension of B (the "lag" matrix).

In general, if A is of dimension m x n and B is of dimension p x q, the matrix product AB will be defined i and only if n = p. If defined, moreover, the product matrix AB will have the dimension m x q - the same number of rows as the lead matrix A and the same number of columns as the lag matrix B.

An example of matrix multiplication is given below:

                                               

For the metrics given, AB will be 1 x 3. So let's consider,

                              

The placeholder values of , mentioned above, can be calculated as:

                              
                              
                              

           
           


Given two vectors u and v with n elements each, say, and , arranged either as two rows or as two columns, or as one row and one column, their inner product, written as u . v, is defined as:
        
                              

Note: A square matrix with 1s in its principal diagonal and 0s everywhere else - examplifies the important type of matrix known as identity matrix.

Division:
It is not possible to divide one matrix by another.

  Notation:

The summation shorthand makes use of the Greek letter (sigma). To express the sum of , for instance, we may write:

                                
 
Extending this to the multiplication of an m x n matrix and an n x p matrix , we may now write the elements of the m x p product matrix AB = C = as,

                                  

or more generally,

                                  

Thursday, October 17, 2013

Post 11: Matrices and Vectors

Matrix algebra can enable us to do many things.

1) It provides a compact way of writing an equation system, even an extremely large one.
2) It leads to a way of testing the existence of solution by evaluation of a determinant
3) It gives a method of finding that solution (if it exists)

However, one slight catch is that matrix algebra is applicable only to linear-equation system. In many cases, even if some sacrifice of realism is entailed by the assumption of linearity, an assumed linear relationship can produce sufficiently close approximation to an actual nonlinear relationship to warrant its use.

In other cases, while preserving the non-linearity in the model, we can effect a transformation of variables so as to obtain a linear relation to work with. For example, the nonlinear function,

                                        

can be readily transformed, by taking the logarithm on both sides as:

                                      log y = log a + b logx

Matrices and Vectors
In general, a system of m linear equations in n variables can be arranged into such a format:

                               
                                                                (11.1)
                                ...............................................................
                               

There are essentially three types of ingredients in the equation system 11.1. The first is set of coefficients ; the second is the set of variables ; and the last is the set of constant terms . If we label them, respectively, as A, x, and d, then we have:


                                         

As a shorthand device, the array in matrix A can be written more simply as:

              

Some matrices may contain only one column, such as x and d above. Such matrices are given the special name column vectors. If we arrange the vector x in horizontal way, though, there would result a 1 x n matrix, which is called row vector. A row vector is often distinguished from a column vector by the use of a prime symbol, X'.

A vector, whether row or column, is merely an ordered n-tuple, and as such it may sometimes be interpreted as a point in an n-dimensional space. With the matrices defined above, we can express the equation system in 11.1 as,

                                                     Ax = d

However, the equation Ax = d prompts at least two questions. How do we multiply two matrices A and x? What is meant by the equality of Ax and d? Since matrices involve whole block of numbers, the familiar algebraic operations defined for single numbers are not directly applicable, and there is a need for a new set of operational rules, which would be discussed in Post 12 onwards.

Tuesday, October 15, 2013

Post 8: Solving Quadratic and Other Higher Degree Polynomials

Before solving a quadratic or other higher degree polynomials, a clear distinction should be made between the two terms, equation and function. Let us consider the difference between a quadratic equation and a quadratic function. A quadratic function, say, f(P), has the general format as:

                                       

There is an infinite number of solution for the above equation, as an infinite number of ordered pairs (P, f(P)) can be written for the above equation.

But if we equate the above f(P) = 0, the situation fundamentally changes. Since the variable f(P) is now assigned a 0 value, the result is a quadratic equation in the single variable P.

                           

Now that f(P) is restricted to 0 value, only a select number of P values satisfy and qualify as its solution values, namely, those solution values at which the parabola is figure above intersects the horizontal axis - on which f(P) is 0. The solution P values are often referred to as the roots of the quadratic equation f(P) = 0.

In general, given a quadratic equation of the form:

                            
there are two roots, which can be obtained using the formula,

                          
                                    
For , we would get , which gives us identical repeated roots. For , we get the find the square root of the -ve numbers, which is not possible in real number system. So for those cases, no real-valued root exists.

Higher Degree Polynomials
For higher degree polynomials, one useful method that might work is that of factoring the function. Given a 3rd-degree polynomial equation, factoring results in three terms of the form (x-root) yields 3 roots. Generally, an nth-degree polynomial equation should a total of n roots. Second, and more important in root search is the relationship between the roots and the constant term: since the constant term must be the product of the three roots, each root must be a divisor of the constant term. This relationship can be formalized in the following theorem:

Theorem I Given the polynomial eqaution
                      
                         

where all coefficients are integers, and the coefficient of is unity, if there exists integer roots, then each of them must be a divisor of .

Theorem II Sometimes because the coefficients of the highest degree term is not unity, we cannot apply Theorem I and rather we resort on to a more general theorem:

                        

if there exists a rational root r/s, where r and s are integers without a common divisor except unity, then r is a divisor of , and s is a divisor of .

Note: An example is given below to show how this can be applied to a concrete polynomial function to derive its roots.

Theorem III Given a polynomial 
        
                       

if the coefficients add up to 0, then x=1 is a root of the equation.


Example - Applying Theorem II to solve the quartic equation:

                        .

With , the only possible values for the numerator r in r/s are the set of divisors {1, -1, 2, -2, 3, -3, 4, -4, 6, -6, 12, -12}. And, with , the only possible values for s are the set of divisors {1, -1, 2, -2}. Taking each element in the r set in turn, and dividing it by each element in the s set, respectively, we find r/s can only assume the values

                    1, -1, 1/2, -1/2, 2, -2, 3, -3, 3/2, -3/2, 4, -4, 6, -6, 12, -12

Among these candidates for the roots, many fail to satisfy the given equation. Also, since we are solving a quartic equation, we can expect at most 4 of the listed r/s values to qualify as the roots. The four successful candidates turn out to be 1/2, 2. -2, and -3. According to factoring principle, we can thus write the quartic equation as

                   (x - 1/2) (x-2) (x+2) (x+3) = 0
            =>   (2x - 1) (x-2) (x+2) (x+3) = 0