Algebra Continued

In our last session, we looked at how to simplify expressions, solve equations, and looked at polynomials. Today we are going to look at solving systems of equations and inequalities.

In mathematics, a system of linear equations is a collection of two or more linear equations involving the same set of variables. Systems of linear equations are actually the basis of linear algebra and tie into an array of practices such as engineering, chemistry, bio, and of course data science.

For now, we will look at two methods on solving systems of simple linear equations. We will revist them much later on when we look at matrix operations. In order to solve the problems we will be doing, we will need to use some techniques from the previous session.

Lets start with an example:

##Method 1: Substitution

The substitution technique asks the user to re-write one equation in terms of the other allowing us to solve for one variable. Once we have a value for that variable, we can plug into any of the equations in our system to find the other variable.

\[ x-7y=-11\\ 5x+2y=-18 \] We have a choice to re-write x in terms of y or y in terms of x. For this example, lets re-write y in terms of x by using the top equation.

\[ x-7y=-11\\ x+11=7y\\ \frac{x+11}{7}=y \]

We can now replace our newly derived expression for y, into the bottom equation and solve for x. After we replace our derived expression into the bottom equation, we will need to simplify by combining like terms also simplify fractions where possible and distribute as needed and get x alone.

\[ 5x+2y=-18\\ 5x+2(\frac{x+11}{7})=-18\\ 5x+\frac{2x+22}{7}=-18\\ 5x+\frac{2}{7}x+\frac{22}{7}=-18\\ \frac{37}{7}x=-\frac{148}{7}\\ 37x=-148\\ x=-4 \]

We have found that our value for x is -4. We can plug -4 for x in any of the two equations from our original system to find the value for y. Lets use the bottom equation to find y. We still need to simplify and isolate y.

\[ 5x+2y=-18\\ 5(-4)+2y=-18\\ -20+2y=-18\\ 2y=2\\ y=1 \]

Our solutions set for this system of equations is x=-4 and y=1.

##Method of Elimination

The next method we will look at is called elimination. This technique actually asks you to add or substract multiples of one equation to the other to eliminate variables as needed. This methos tends to be much faster especially as the number of equations and unknowns increases.

\[ 6x-5y=8\\ -12x+2y=0 \]

Multiply the first equation by two. The second equation remains fixed.

\[ 2(6x-5y)=(8)2\\ -12x+2y=0 \]

\[ 12x-10y=16\\ -12x+2y=0 \]

Add the first equation to the second equation. The 12x and -12x cancel each other out, leaving us with just

\[ -8y=16\\ y=-2 \]

We can replace our value for y into any of the equations in our system and find the value for x. Lets replace it in the first equation.

\[ 12x-10(-2)=16\\ 12x+20=16\\ 12x=-4\\ x=-\frac{4}{12}\\ x=-\frac{1}{3} \]

Our solutions to this system of equations are x=-1/3 and y=-2

Method of substitution will always be easier when dealing with at most a system of two equations and two unknowns. Anything more than that and it will no longer be a practical solution. method of elimination requires practice since it may not always be obvious what multiple of what equation to add to the other.

On your own: https://github.com/vindication09/Data-Science-Mathematics/blob/master/Alg_SystemsTwoVrbl_Problems.pdf

Inequalities

As given in wikipedia, In mathematics, an inequality is a relation that holds between two values when they are different. The notation a ≠ b means that value a is not equal to value b. This notation does not say that one is greater than the other, or even that they can be compared in size.

Inequalities are important comparitive operators that are used often, for example, they are a common criteria for filtering in SQL using a WHERE statement. We solve inequalities the same way we solve equations, however a caveat is that when you divide or multiply both sides by a negative, then the direction of the inequality changes. Other than that, it is almost identical to solving regular equations.

\[ x+2>12\\ x>10 \]

The solution that x>10 is saying that any value of x greater than 10 is a valid solution that makes this inequality true.

Inequalities can also ask you to find a range of possible values that are less than some value and greater than some other value like so. When it comes to something like this, you would still solve it using the same techniques we went over but apply them to the right and left side of the equation.

\[ -2<\frac{6-2x}{3}<4\\ -6<6-2x<12\\ -12<-2x<6\\ 6>x>-3 \]

Did you see how the direction of the inequality changed when I divided all three parts by a negative? Our solution says that any value of x that is greater than -3 and less than 6 satisfies this inequality.

We can apply the methods of solving systems of equations to solving systems of inequalities, but we will do that in the next session after we do graphing and functions.

Try these on your own: https://github.com/vindication09/Data-Science-Mathematics/blob/master/Alg_SolveLinearIneq_Problems.pdf