jueves, 5 de diciembre de 2013

Cramer's Rule

Given a system of linear equations, Cramer's Rule is a handy way to solve for just one of the variables without having to solve the whole system of equations. They don't usually teach Cramer's Rule this way, but this is supposed to be the point of the Rule: instead of solving the entire system of equations, you can use Cramer's to solve for just one single variable.
Let's use the following system of equations:
    2x +   y + z = 3
      
    x –   yz = 0

      
    x + 2y + z = 0
We have the left-hand side of the system with the variables (the "coefficient matrix") and the right-hand side with the answer values. Let D be the determinant of the coefficient matrix of the above system, and let Dx be the determinant formed by replacing the x-column values with the answer-column values:
system of
equations
coefficient
matrix's
determinant
answer
column
Dx: coefficient determinant
with answer-column
values in
x-column
2x + 1y + 1z = 3
 
1x1y1z = 0
1x + 2y + 1z = 0
D = || 2 1 1 || 1 –1 –1 || 1 2 1 ||
[[ 3 ][ 0 ][ 0 ]]
D_x = || 3 1 1 || 0 –1 –1 || 0 2 1 ||
Similarly, Dy and Dz would then be:   Copyright © Elizabeth Stapel 2004-2011 All Rights Reserved
    D_y = || 2 3 1 || 1 0 -1 || 1 0 1 ||
    D_z = || 2 1 3 || 1 -1 0 || 1 2 0 ||
Evaluating each determinant, we get:
    D = 3
    D_x = 3
    D_y = -6
    D_z = 9
Cramer's Rule says that x = Dx ÷ D, y = Dy ÷ D, and z = Dz ÷ D. That is:
    x = 3/3 = 1,  y = –6/3 = –2,  and  z = 9/3 = 3
That's all there is to Cramer's Rule. To find whichever variable you want (call it "ß" or "beta"), just evaluate the determinant quotient Dß ÷ D. (Please don't ask me to explain why this works. Just trust me that determinants can work many kinds of magic.)
  • Given the following system of equations, find the value of z.
    • 2x +   y +   z = 1
        
      x –   y + 4z = 0

        
      x + 2y – 2z = 3
    To solve only for z, I first find the coefficient determinant.
      D = -3
    Then I form Dz by replacing the third column of values with the answer column:
      D_z = -6
        
    Then I form the quotient and simplify:

    D_z / D = -6 / -3 = 2
      z = 2
The point of Cramer's Rule is that you don't have to solve the whole system to get the one value you need. This saved me a fair amount of time on some physics tests. I forget what we were working on (something with wires and currents, I think), but Cramer's Rule was so much faster than any other solution method (and God knows I needed the extra time). Don't let all the subscripts and stuff confuse you; the Rule is really pretty simple. You just pick the variable you want to solve for, replace that variable's column of values in the coefficient determinant with the answer-column's values, evaluate that determinant, and divide by the coefficient determinant. That's all there is to it.
Almost.
What if the coefficient determinant is zero? You can't divide by zero, so what does this mean? I can't go into the technicalities here, but "D = 0" means that the system of equations has no unique solution. The system may be inconsistent (no solution at all) or dependent (an infinite solution, which may be expressed as a parametric solution such as "(a, a + 3, a – 4)"). In terms of Cramer's Rule, "D = 0" means that you'll have to use some other method (such as matrix row operations) to solve the system. If D = 0, you can't use Cramer's Rule.

lunes, 2 de diciembre de 2013

Determinants

Determinants: 2×2 Determinants

Determinants are like matrices, but done up in absolute-value bars instead of square brackets. There is a lot that you can do with (and learn from) determinants, but you'll need to wait for an advanced course to learn about them. In this lesson, I'll just show you how to compute 2×2 and 3×3 determinants. (It is possible to compute larger determinants, but the process is much more complicated.)
If you have a square matrix, its determinant is written by taking the same grid of numbers and putting them inside absolute-value bars instead of square brackets:
    If this is "the matrix A" (or "A")...
    ...then this is "the determinant
    of
    A" (or "det A").
     
    [[ 1 0 3 ][ 6 -2 1 ][ 0 3 0 ]]
      
     
    || 1 0 3 || 6 -2 1 || 0 3 0 ||
      
Just as absolute values can be evaluated and simplified to get a single number, so can determinants. The process for evaluating determinants is pretty messy, so let's start simple, with the 2×2 case.

For a 2×2 matrix, its determinant is found by subtracting the products of its diagonals, which is a fancy way of saying in words what the following says in pictures:
the matrix A
the determinant of A ("det A")
[[ a b ][ c d ]]
animation: det(A) = ab - cb
the matrix A
the determinant of A ("det A")
[[ 1 2 ][ 3 4 ]]
animation: det(A) = (1)(4) - (3)(2) = 4 - 6 = -2
In other words, to take the determinant of a 2×2 matrix, you multiply the top-left-to-bottom-right diagonal, and from this you subtract the product of bottom-left-to-top-right diagonal.
"But wait!" I hear you cry; "Aren't absolute values always supposed to be positive? You show that second matrix above as having a negative determinant. What's up with that?" You make a good point. Determinants are similar to absolute values, and use the same notation, but they are not identical, and one of the differences is that determinants can indeed be negative.
  • Evaluate the following determinant:
    • || 1 -4 || 0 3 ||
    I multiply the diagonals, and subtract:   Copyright © Elizabeth Stapel 2004-2011 All Rights Reserved
      (1)(3) - (0)(-4) = 3 - 0 = 3
  • Find the determinant of the following matrix:
    • [[ 2 1 ][ -1 3 ]]
I convert from a matrix to a determinant, multiply along the diagonals, subtract, and simplify:


Determinants: 3×3 Determinants (page 2 of 2)
Sections: 2×2 determinants, 3×3 determinants

The computations for 3×3 determinants are messier than for 2×2's. Various methods can be used, but the simplest is probably the following:   Copyright © Elizabeth Stapel 2004-2011 All Rights Reserved

    Take a matrix
    A:

    [[ 1 2 3 ][ 0 -4 1 ][ 0 3 -1]]
     

    Write down its determinant:


    || 1 2 3 || 0 -4 1 || 0 3 -1 ||
     

    Extend the determinant's grid by rewriting the first two columns of numbers:


    ( 1 2 3 1 2 )( 0 -4 1 0 -4 )( 0 3 -1 0 3 )
      

    Then multiply along the down-diagonals:


    multiplying down
     

    ...and along the up-diagonals

    multiplying up
     

    Add the down-diagonals and subtract the up-diagonals:

    det(A) = (4) + (0) + (0) - (0) - (3) - (0)
     

    And simplify:


    det(A) = (4) + (0) + (0) - (0) - (3) - (0) = 4 - 3 = 1
      Then det(A) = 1.
  • Find the deteriminant of the following matrix:
    • [[ 5 –2 1 ][ 0 3 –1 ][ 2 0 7 ]]
        
    First I convert from the matrix to its determinant, with the extra columns:

    ( 5 –2 1 5 –2 )( 0 3 –1 0 3 )( 2 0 7 2 0 )
      

    Then I multiply down and up the diagonals:

    multiplications along the diagonals
     
    Then I add the down-diagonals, subtract the up-diagonals, and simplify for the final answer:
      || 5 –2 1 || 0 3 –1 || 2 0 7 || = (105) + (4) + (0) – (6) – (0) – (0) = 109 – 6 = 103
There are other methods for simplifying determinants by hand, and these other methods are required when evaluating larger determinants by hand, but those methods can probably wait until later. For the time being, note that your graphing calculator should be able to evaluate the determinant of any (square) matrix you enter. For instance:
    [C] = [[ 5 –2 1 ][ 0 3 –1 ][ 2 0 7 ]] then det([C]) = 103
But make sure, even if you have a graphing calculator, that you can evaluate 2×2 and 3×3 determinants, because you are likely to have word problems where the determinants contain variables that your calculator can't handle.(6) - (-1) = 6 + 1 = 7

Solving Systems of Linear Equations Using Matrices

If you need to, review matrices, matrix row operations and solving systems of linear equations before reading this page.
The matrix method of solving systems of linear equations is just the elimination method in disguise. By using matrices, the notation becomes a little easier.
Suppose you have a system of linear equations such as:

The first step is to convert this into a matrix. Make sure all equations are in standard form (Ax + By = C), and use the coefficients of each equation to form each row of the matrix. It may help you to separate the right column with a dotted line.

Next, we use the matrix row operations to change the 2 × 2 matrix on the left side to the identity matrix. First, we want to get a zero in Row 1, Column 2. So, add 4 times Row 2 to Row 1.

Next we want a 1 in the top left corner.

Now we want a zero in the bottom left corner.

Finally, we want a 1 in Row 2, Column 2.

Now that we have the 2 × 2 identity matrix on the left, we can read off the solutions from the right column:
x = 3
y = –1
The same method can be used for n linear equations in n unknowns; in this case you would create an n × (n + 1) matrix, and use the matrix row operations to get the identity n × n matrix on the left side.
Important Note: If the equations represented by your original matrix represent parallel lines, you will not be able to get the identity matrix using the row operations. In this case, the solution either does not exist or there are infinitely many solutions to the system.

martes, 29 de octubre de 2013

Solving and Graphing Linear Inequalities in Two Variables

Learning Objective
·         Represent linear inequalities as regions on the coordinate plane.
·         Determine if a given point is a solution of a linear inequality.

Introduction

We use inequalities when there is a range of possible answers for a situation. “I have to be there in less than 5 minutes,” “This team needs to score at least a goal to have a chance of winning,” and “To get into the city and back home again, I need at least $6.50 for train fare” are all examples of situations where a limit is specified, but a range of possibilities exist beyond that limit. That’s what we are interested in when we study inequalities—possibilities.

We can explore the possibilities of an inequality using a number line. This is sufficient in simple situations, such as inequalities with just one variable. But in more complicated circumstances, like those with two variables, it’s more useful to add another dimension, and use a coordinate plane. In these cases, we use linear inequalities—inequalities that can be written in the form of a linear equation.

One Variable Inequalities

Inequalities with one variable can be plotted on a number line, as in the case of the inequality x ≥ -2:



Here is another representation of the same inequality x ≥ -2, this time plotted on a coordinate plane:



On this graph, we first plotted the line x = -2, and then shaded in the entire region to the right of the line. The shaded area is called the bounded region, and any point within this region satisfies the inequality x ≥ -2. Notice also that the line representing the region’s boundary is a solid line; this means that values along the line x = -2 are included in the solution set for this inequality.

By way of contrast, look at the graph below, which shows y < 3:



In this inequality, the boundary line is plotted as a dashed line. This means that the values on the line y = 3 are not included in the solution set of the inequality.

Notice that the two examples above used the variables x and y. It is standard practice to use these variables when you are graphing an inequality on a (x, y) coordinate grid.

Two Variable Inequalities

There’s nothing too compelling about the plots of x ≥ -2 and y < 3, shown above. We could have represented both of these relationships on a number line, and depending on the problem we were trying to solve, it may have been easier to do so.

Things get a little more interesting, though, when we plot linear inequalities with two variables. Let’s start with a basic two-variable inequality: x > y.



The boundary line is represented by a dotted line along x = y. All of the points under the line are shaded; this is the range of points where the inequality x > y is true. Take a look at the three points that have been identified on the graph. Do you see that the points in the boundary region have x values greater than the y values, while the point outside this region do not?

When plotted on a coordinate plane, what does the graph of yx look like?

A)

B)

C)

D)



Plotting other inequalities in standard y = mx + b form is fairly straightforward as well. Once we graph the boundary line, we can find out which region to shade by testing some ordered pairs within each region or, in many cases, just by looking at the inequality.

The graph of the inequality y > 4x − 5.5 is shown below. The boundary line is the line y = 4x − 5.5, and it is dashed because our y term is “greater than,” not “greater than or equal to.”



To identify the bounded region, the region where the inequality is true, we can test a couple of coordinate pairs, one on each side of the boundary line.

If we substitute (-1, 3) into y > 4x − 5.5, we find 3 > 4(-1) − 5.5, or 3 > -9.5. This is a true statement. It looks like we need to shade the area to the left side of the line.

On the other hand, if we plug (2, -2) into y > 4x − 5.5, we find -2 > 4(2) − 5.5, or -2 > 2.5. This is not a true statement, so the point (2, -2) must not be within the solution set. Yes, the bounded region is to the left of the boundary line.

Inequalities in Context

Making sense of the importance of the shaded region in an inequality can be a bit difficult without assigning any context to it. The following problem shows one instance where the shaded region helps us understand a range of possibilities.

Celia and Juniper want to donate some money to a local food pantry. To raise funds, they are selling necklaces and earrings that they have made themselves. Necklaces cost $8 and earrings cost $5. What is the range of possible sales they could make in order to donate at least $100?

The first step here is to create the inequality. Once we have it, we can solve it and then create a graph of it to better understand the importance of the bounded region. Let’s begin by assigning the variable x to the number of necklaces sold and y to the number of earrings sold. (Remember—since this will be mapped on a coordinate plane, we should use the variables x and y.)

amount of money earned from selling necklaces
+
amount of money earned from selling earrings
$100
8x
+
5y
100

We can rearrange this inequality so that it solves for y. That’s the slope-intercept form, and it will make the boundary line easier to graph.

Example
Problem
8x
+
5y
100

8x − 8x
+
5y
100 − 8x



5y
100 − 8x






y
20 −
Answer


y
+ 20

So the slope intercept form of the inequality is . Now let’s graph it:



The shaded region represents all the possible combinations of necklaces and earrings that Celia and Juniper could sell in order to make at least $100 for the food pantry. It’s quite a wide range!

We can look at the two ordered pairs for confirmation that we have shaded the correct region. If we substitute (10, 15) into the inequality, we find 8(10) + 5(15) ≥ 100, which is a true statement. However, using (5, 5) creates a false statement: 8(5) + 5(5) is only 65, and is thus less than 100.

Note that while all points will satisfy the inequality, not all points will make sense in this context. Take (21.25, 10.5), for example. While it does fall within the shaded region, it’s hard to expect them to sell 21.25 necklaces and 10.5 earrings! The women can look for whole number combinations in the bounded region to plan how much jewelry to produce.

Summary

Inequalities can be mapped on a number line or a coordinate plane. When graphed on a coordinate plane, the full range of possible solutions is represented as a shaded area on the plane. The boundary line for the inequality is drawn as a solid line if the points on the line itself do satisfy the inequality, as in the cases of ≤ and ≥. It is drawn as a dashed line if the points on the line do not satisfy the inequality, as in the cases of < and >. Using a coordinate plane is especially helpful for understanding the range of possible solutions for inequalities with two variables.