Name:  Gena Lagle

Title: Systems of Equations

Description:  This project begins by using two sets of  raw data to produce a graph of points.  From this  data we will discuss the point of intersection and many other aspects of our graph.  The rest of the  unit will focus on solving equations algebraically in addition to the  graphing method.

SYSTEMS OF EQUATIONS

By Gena Lagle

Introduction

The following table represents the winning times for the men's and women's 100-meter freestyle swimming for all Olympic years from 1912 to 1988.  We will  be  using the data  from  this  table to  answer several  questions.  Our ultimate goal is to project the year when both the men's and women's times will be the same.

Clear[data,data1,data2]
data={
{1912, 63.2, 72.2},
{1920,61.4,73.6},                
{1924,59.0,72.4},
{1928,58.6,71.0},
{1932,58.2,66.8},
{1936,57.6,65.9},
{1948,57.3,66.3},
{1952,57.4,66.8},
{1956,55.4,62.0},
{1960,55.2,61.2},
{1964,53.4,59.5},
{1968,52.2,60.0},
{1972,51.22,58.59},
{1976,49.99,55.65},
{1980,50.40,54.79},
{1984,49.8,55.92},
{1988,48.63,54.93}
     };
Clear[dis]
dis[list_]:=MatrixForm[Map[Flatten,Partition[list,2]]]
blanks=Table["   ",{n,Length[data]}] 
Clear[disblanks]
disblanks[list_]:=dis[
Table[Append[list[[n]],blanks[[n]]],{n,1,Length[list]}]]
title={{"Year","Men","Women"},{"Year","Men","Women"}}
bars={{"_____","_____","_____"},
{"_____","_____","_____"}}
ColumnForm[{disblanks[title],
disblanks[bars],
disblanks[data]}]

Data Analysis

Now that we have finally produced our table of data, we can plot this data on a graph.   Race times for the men will be represented in blue and the women's times will be in pink.  After we have plotted our data, we will need to find the line of best fit for both the men and women.  The point of intersection will represent the projected year when the times will be the same if this trend continues.

data1={{1912,63.2},{1960,55.2},
      {1920,61.4},{1964,53.4},
      {1924,59.0},{1968,52.2}, 
      {1928,58.6},{1972,51.22},
      {1932,58.2},{1976,49.99},
      {1936,57.6},{1980,50.40},
      {1948,57.3},{1984,49.8},  
      {1952,57.4},{1988,48.63},
      {1956,55.4}};

data2={{1912, 72.2},{1920,73.6},                
{1924,72.4},{1928,71.0},
{1932,66.8},{1936,65.9},
{1948,66.3},{1952,66.8},
{1956,62.0},{1960,61.2},
{1964,59.5},{1968,60.0},
{1972,58.59},{1976,55.65},
{1980,54.79},{1984,55.92},
{1988,54.93}
     };

pointplot1=
ListPlot[data1,
PlotStyle->{RGBColor[0,0,1],
PointSize[.02]},
DisplayFunction->Identity];

pointplot2=
ListPlot[data2,
PlotStyle->{RGBColor[1,0,1],
PointSize[.02]},
DisplayFunction->Identity];

Show[pointplot1,pointplot2,
AxesLabel->{"Olympic Year","Time (seconds)"},
DisplayFunction->$DisplayFunction];

leastsqline1=Fit[data1,{1910,x},x]

leastsqline2=Fit[data2,{1910,x},x]

leastsqplot1=
Plot[leastsqline1,{x,1900,2080},
PlotStyle->{Thickness[.008]},
DisplayFunction->Identity];

leastsqplot2=
Plot[leastsqline2,{x,1900,2080},
     PlotStyle->{Thickness[.008]},
DisplayFunction->Identity];

Show[pointplot1,pointplot2,leastsqplot1,leastsqplot2,
AxesLabel->{"Olympic Year","Time (seconds)"},
PlotRange->{30,90},
DisplayFunction->$DisplayFunction];

What can we tell from this graph?  Whose times are decreasing faster?  In what years will the times for both the men and women be zero?  Does this make sense? Also, notice that if we continue the lines they times will soon dip down into the negative numbers.  Now we know that isn't possible!  Looking at the lines of best fit assumes the relationship between both the men's and women's times is linear.  This necessarily isn't true.  We must keep in mind that these lines are only predictions of what might happen.  

Let's use this graph to answer the obvious question:  When will the times for the men and women be the same?  If we highlight the graph box, we can use the cursor to trace to the presumed point of intersection by simultaneously holding down the Apple key and moving the mouse.  Locate what you believe to be the point of intersection and write that point down.  Plug the y-coordinate into both least square lines and compare the answers.

Clear[x,y]
y=leastsqline1

Solve[y==38,x]

y=leastsqline2

Solve[y==38,x]

How close were your answers?  If we want to find the exact point of intersection, we can have Mathematica solve the equations simultaneously.  Here's how!

Clear[x,y]
Solve[{y==401.391-0.17725 x, y==577.924-0.263468 x},{x,y}]

These answers tell us that in approximately the year 2047 or 2048 the winning times for both the men and women in the 100-meter freestyle will be 38.4682 seconds.   Do you think that this will really happen?
Since the Olympics are only held every four years, what year will this most likely occur in, 2047 or 2048?  The Summer Olympics were held in Barcelona, Spain this past summer.  Just for fun, let's compare our graph to the actual winning times for both the men's and the women's 100-meter freestyle.

Clear[f,g,x,y]
f[x_]=401.391 - 0.17725 x

g[x_]=577.924 - 0.263468 x

If we plug 1992 in for x in f[x] we will get the men's projected time.  Doing the same for g[x] will give us the women's projected time.

f[1992]

g[1992]

How close were the actual times to the projected times?

In this introduction we have seen an application for solving a system of equations by graphing.  We have also worked this same problem by solving simultaneous equations.  Throughout this chapter we will explore both of these methods more thoroughly.  In addition, we will be exposed to other methods of solving equations.

Graphing Systems of Equations

From the previous example, we found the equations for the lines of best fit to be the following:  
													Men:    y=-0.17725 x + 401.391
													Women:  y=-0.263468 x + 577.924
													
When we graphed these lines, we were able to find the point of intersection.  This point represented the year when the men's and women's	times would be the same if the trend were to continue.	 The coordinates of this point were (2047.52, 38.4682).  Why did we list the year first and then the time?

When we are working with "real" data our numbers usually do not come out "nice".  Let's look at a different example	whose answers are whole numbers, so we can get a better understanding.

					The sum of two numbers is 22 and their difference is 8.  
					What are the numbers?
					
	
	First we need to define our variables.  Let's use "x" and "y".  Now we must write an equation for each situation described above.
							Condition 1:  The sum of two numbers is 22.
																			x + y = 22
																			
							Condition 2:  Their difference is 8.
																			x - y = 8
																			
A system is a set of conditions where each condition is separated by the word "and".  In algebra, most of the time this will be represented by two equations, one written on top of the other like this:

																			x + y = 22
																			x - y =  8
																			
We need to graph each of these equations separately.   First, we must set both equations equal to "y".

																			y = -x + 22
																			y =  x -  8

Let f[x] = -x + 22 and g[x] = x - 8 for graphing purposes.  We also need to decide on a range that will fit both equations.

Clear [f,g,x]
f[x_] = -x + 22
g[x_] =  x -  8
Plot [{f[x],g[x]},{x,0,25},
						PlotStyle->{RGBColor[1,0,0],RGBColor[0,0,1]}];

Highlight the graphics box and press the apple key.  This will allow us to use the cursor to trace along the graph and find the point of intersection.  Remember, the point that you pick must satisfy both equations.

The intersection appears to be the point (15,7).  Let's check it out by plugging it into both equations:

																		7 = -15 + 22   True
																		7 =   15 - 8   True
		Therefore, the point (15,7) is the correct answer.
		
In general, the solution set to a system	is the intersection of the solution sets  for each	of the given equations.  When the equations have no points of intersection, there is no solution to the system.  The symbol for the set with no elements is Ø.			
Example:		Find all solutions to the system   y = 2 x + 1
                                        y = 2 x - 3.

Clear [f,x,g]
f[x_] = 2 x + 1
g[x_] = 2 x - 3
Plot [{f[x], g[x]}, {x,-3,3}];

What are the points of intersection for these two lines?  Since these lines have the same slope, they are parallel and do not intersect.  Therefore, there is no solution to this system of equations.

As we have just seen, graphing linear systems can help us find exact solutions.  However, if the solutions do not have integer coordinates, reading the graph will only give us an estimate.  In the following lessons we will be using algebra to find exact solutions to linear systems.

Solving Systems by Substitution

Graphing is useful, but it does not always give us an exact answer.  This is why we need algebraic methods.  The first method we are going to explore is the substitution method.

Example 1:

From a car wash, a service club made $109 that was to be divided between the Boy Scouts and the Girl Scouts.  There were twice as many girls as boys, so a decision was made to give the girls twice as much money.  How much did each group receive?

Solution:  

We need to write an equation for each condition.
Condition 1:  The total for both groups was $109 ->  G + B = 109
Condition 2:  The girls will receive twice as much money as the boys -> G = 2B

Since the second equation is solved for G, we can substitute this into the first equation.  We now only have one equation with one variable, so we can have Mathematica solve for B.
												2B + B = 109

Clear[B]
Solve[2B + B - 109 ==0,B]

Since we know that the Boy Scouts will receive 109/3 of the total amount, we need to determine how much of the money will be given to the Girl Scouts.  We can figure this out by substituting 109/3 in for B in either of the equations and then solving for G.  Let's use the second equation, since G is already by itself.

Clear[B,G]
Solve[G==2(109/3),G]

Now we can change B and G into mixed numerals so that they make a little more sense.  The solution is (B,G) = (36 1/3,72 2/3).  In other words, the Boy Scouts will receive $36.33  and the Girl Scouts will receive $72.67.  Does 36 1/3 + 72 2/3 = 109? And does 72 2/3 = 2(36 1/3)?

Example 2:
Two lines have equations 3x + 2y = 10 and y = 4x + 1.  Where do they intersect?

Let's graph it first to see if we can see the intersection clearly.  Remember when we graph all equations must be solved for "y".

Clear[f,g,x]
f[x_]= (-3/2) x + 5
g[x_]= 4x + 1
Plot[{f[x],g[x]}, {x,-5,5},
						PlotStyle->{RGBColor[1,0,0],RGBColor[0,0,1]}];

Remember, in order to trace along the graph and find the point of intersection, we click on the graph and use the apple key.  It appears that the intersection is not an integer value, so we can only approximate our solution.  However, we can use the substitution method to find our exact answer.  Here are our two equations again:
																								3x + 2y = 10
																								      y = 4x + 1.
Solution:	
																						      
Since the second equation is already solved for "y", let's substitute it into the first equation.  We now have the following single equation:
																								3x + 2(4x + 1) = 10.
We can now have Mathematica solve it for us.

Clear[x,y,f,g]
Solve[3 x + 2(4 x+ 1)-10==0,x]

We have found the x-coordinate, now we need to plug it into either equation to find the y-coordinate.  Let's use the second one.

Clear[f,g,x,y]
Solve[y==4(8/11) + 1,y]

The lines intersect at the point (8/11, 43/11).  You can verify this by plugging "x" and "y" into both equations to see if they check out.

Solving Systems by Elimination

Addition Method

In the last section we talked about substitution.  This method works well when one equation is already in slope-intercept form, but as we know equations aren't always in that form.  We have another method for solving equations simultaneously when both equations are in standard form.  This method is called elimination.  

The numbers 3/4 and 75% are equal even though they do not look the same.  The same is true for 1/5 and 20%.  We can add the fractions together and the sum will be the same as when we add the percents.

																							3/4 = 75%
																							1/5 = 20%
										So						3/4 + 1/5 =	 75% + 20%
	Simplifying each side		  19/20    =    95%
	
This is one example of the following generalization of the Addition Property of Equality.

Generalized Addition Property of Equality
For all numbers or expressions a,b,c,and d:
If                    a = b
and                   c = d
then               a + c = b + d.

The Generalized Addition Property of Equality is quite useful when solving equations that are both in standard form.

Example:
                3x + 2y = 1    (1)   
                 x - 2y = 107  (2)
If x and y satisfy both equations, they will satisfy the equation that results from adding the left and right sides.  Since 2y and -2y add to get 0, the sum will only have one variable.

                 3x + 2y = 1
                  x - 2y = 107 
                 4x       = 108
When we solve 4x = 108, x = 27.  We can find y by substituting x back into one of the original equations.  Let's use the second one.

                 27 - 2y = 107
                    - 2y =  80
                       y = -40
                       
Since (27,-40) checks in both equations, it is the solution.  Using straight addition is an easy way to solve systems when coefficients of the same variable are opposites.

Let's take this same problem and use Mathematica to explore what is actually happening.  We can begin by graphing both equations.  Remember in order to graph these equations they must be in slope-intercept form.  We will let f[x] = the first equation and g[x] = the second equation.

Clear [f,g,x,y]
 Solve[3 x + 2y == 1,y]

Clear [x,y]
Solve[x - 2 y ==107,y]

Clear[f,g,x,y]
 f[x_] = (-3/2) x + 1/2
 g[x_] = (1/2) x - (107/2)
 Plot[{f[x],g[x]},{x,0,30},
       PlotStyle->{RGBColor[1,0,1],RGBColor[0,0,1]}]

We can use the trace function to find that our point of intersection is indeed (27,-40).  Remember when we added the equations together and solved for x?  We got a new equation: x=27.  This will be a vertical line at x=27 that goes through the same point of intersection.  In other words, making the y's disappear will give us an equation in terms of x, which is a vertical line.  The opposite is true if we make the x's disappear.  We will have a horizontal line.  Looking at our graph, this is like shifting the blue line to make it horizontal and shifting the pink line to make it verical without changing the point of intersection. 

We can also have Mathematica solve this system automatically.  Notice that the equations don't have to be in slope-intercept form anymore.

Clear[x,y]
Solve[{3 x + 2 y == 1, x - 2 y ==107},{x,y}]

Isn't that amazing!  Once we understand the concepts, we can have Mathematica compute the answer in seconds.  Then we can spend more time concentrating on applications.  The next section shows us how to solve systems whose equations don't automatically have one variable cancelling itself out when we add them.

Multiplication Method

In the last section the equations were already set up so that one variable would cancel out when the equations were added.  You probably know from experience that equations usually are not set up in this way.  However, there is a method that can deal with this problem: the multiplication method.  The idea is to multiply one or both of the equations by a number that will make one variable cancel out, so that we can use the addition method.

Example 1:
           5x + 8y =  21   (1)
            10x - 3y = -15  (2)
First, we need to decide which variable would be the easiest to make disappear.  Since 10 is a multiple of 5, we could multiply everything in the first equation by -2 in order to get -10 as the coefficient of x. 

	                										-2(5x + 8y =  21)
					                						   10x - 3y = -15    
Multiplying we get											  -10x -16y = -42
						                					   10x - 3y = -15   
Adding we get						                -19y = -57 					         
Solve for y                            y = 3

When we substitute, we find that x = -3/5.  So the answer is the point (-3/5, 3).

Sometimes we may need to multiply both equations by a constant in order to make a variable drop out, but the method is still the same.
Let's use some of Mathematica's capabilities to solve a similar problem.

Example 2:
             3a + 5b = 8
             2a + 3b = 4.6
First, let's graph these equations and approximate where the intersection will be. Remember to solve both equations for "b" before we graph.

Clear[a,b]
Solve[3 a + 5 b ==8,b]

Clear [a,b]
Solve[2 a + 3 b == 4.6,b]

Clear [a,b]
Plot[{(-3 a + 8)/5,(-2 a + 4.6)/3},{a,-3,3},
							PlotStyle->{RGBColor[1,0,0],RGBColor[0,0,1]}];

Since we can't tell exactly where the lines are intersecting, we can have Mathematica solve the system algebraically.

Clear[a,b]
Solve[{3 a + 5 b == 8, 2 a + 3 b == 4.6}, {a,b}]

The point of intersection is (-1,2.2).  Go back up to the graph and see if you can trace the intersection to that exact point.

Exploration:
Use what you have learned in this chapter and see if you can solve the following problem by writing a system of equations.  Solve it by graphing and by elimination.

A marching band has 52 members in addition to 24 flag girls.  They wish to form haxagons and squares like those diagrammed below.  Can it be done with no people left over?

        HEXAGON                         SQUARE
     (Flag in center.)              (Band member in center.)
        B    B                           F     F
     B     F    B                           B
        B    B                           F     F

References

1) UCSMP Algebra, Scott Foresman, 1992, p530-554