Monday, June 7, 2010

Finding the area of a triangle


We begin by asking you to recall that moment not so long ago when you were in an algebra or geometry class, and a problem might begin when we gave you the coordinates of three points in the coordinate plane, A=(2,1); B=(5,6) and C= (9,-1). Among the myriad things we might have asked you to do with this given information would be two that are easily answered by the methods of determinants; “Find the area of the triangle formed?” and “Prove that the three points are, or are not, collinear (lie on the same line).”
Finding the area of a triangle
Taking the points in pairs we could find the length of each segment, and then employing the well known formula of Heron (you do remember Heron’s Formula, don’t you?) to find the area. We would arrive at an area of 20.5 square units. But now that you know how to evaluate the determinant of a matrix, we can instead just enter the x values of each point as one column of the matrix, enter the y values as a second column, and add a third column of all ones (someday I will explain about cross products of vectors and this third column will seem more clear). We get the matrix shown at right. And if we evaluate the determinant of the matrix we get –41, as the screen capture shows. Two things may concern you; but if you are at all clever, you realize that the area 20.5 is ½ the determinant of –41 except for the sign.
At this point I remind you that the sign of the determinant depends on the order we enter the values, and if we switch the 1st and 2nd rows, we get a positive determinant. So if we can suspend the concerns and accept that the area of the triangle formed is ½ the absolute value of the determinant, we have hit upon a easy, efficient, way to find the area of a triangle using technology and our new friend the determinant. (Now is when you say “Wow, way cool!”)
But what about the other problem of proving that the three points lie in a straight line. Well, if they were in a straight line, the area of the triangle would be zero, and the determinant would be zero, and that would tell us. If the points are NOT in a straight line, the determinant will NOT be zero because any three points in a plane which are NOT collinear, form a triangle with a non-zero area. So the same determinant answers both questions.

Business Math


in this example there are three people (P1, P2, P3) who produce three commodities (z1, z2, z3)

Using Matrix Functions For Finance

Source:http://www.mathworks.com/access/helpdesk/help/toolbox/finance/f2-1001993.html

Many financial analysis operations involve sets of numbers; Matrices, matrix functions, and matrix algebra are the most efficient ways to analyze sets of numbers and their relationships. Spreadsheets focus on individual cells and the relationships between cells. A matrix-oriented tool like MATLAB software manipulates sets of numbers more quickly, easily, and naturally.

For example, here is a 2-by-3 matrix of two bonds (the rows) with different par values, coupon rates, and coupon payment frequencies per year (the columns) entered using MATLAB notation:

Bonds =

[1000 0.06 2
500 0.055 4]

Vector. A matrix with only one row or column. The description is always "row-by-column." For example, here is a 1-by-4 vector of cash flows in MATLAB notation:
Cash = [1500 4470 5280 -1299]


Referencing Matrix Elements
To reference specific matrix elements, use (row, column) notation. For example:

Bonds(1,2)
ans =
0.06

Cash(3)
ans =
5280.00

We can also enlarge matrices using small matrices or vectors . For example,

AddBond = [1000 0.065 2];
Bonds = [Bonds; AddBond]

addsanother row to the matrix and creates

Bonds =

1000 0.06 2
500 0.055 4
1000 0.065 2

Transposing Matrices
In MATLAB, the apostrophe or prime character (') transposes a matrix: columns become rows, rows become columns. For example,

Cash = [1500 4470 5280 -1299]'
produces
Cash =

1500
4470
5280
-1299