A linear system is a set of one or more **linear equations** with the form $a_i X_1 + a_2 X_2 + \dots + a_n X_n = b$ The key characteristic is that the system consists of **linear combinations** of variables. ## solutions to linear systems Linear systems can either have one solution, no solution, or an infinite number of solutions. A straightforward way to solve linear systems (in two variables) is by graphing each equation. The solution is found where the lines intersect. If the lines are in parallel, no solution exists. If the lines overlap, an infinite number of solutions exist. Substitution is an alternative approach. Solve the first equation for $y$ in terms of $x$ (e.g., **slope-intercept form**) and then plug that into the second equation to solve for $x$. Reverse the process to solve for $y$. Finally, in elimination by addition you can transform one or more of the equations to make the coefficient of either $x$ or $y$ the same, then add the two equations together to eliminate the matched term. A system of linear equations is transformed into an equivalent system if - two equations are interchanged - an equation is multiplied by a nonzero constant - a constant multiple of one equation is added to another equation. If the solution is nonsensical (e.g., 6 = 0), then no solution exists. If the solution is an identity (e.g., 0 = 0), then an infinite number of solutions exist. In this case, we let $x = k$, where $k$ is called a **parameter** and solve for $y$, such as $y = 2k - 8$. Any solution that satisfies this condition is a **particular solution** to the system (e.g., let $k=5$ and $y = 2*5 - 8 = 2$ thus $(5, 2)$ is one solution.) ## Application To motivate linear systems, let's consider an example. A wildlife rehabilitation center wants to combine raw fish and supplemental feed to meet daily dietary requirements for protein and fats for their animals, as described in this table: | | Fish | Feed | Total Needed | | ------- | ---- | ---- | ------------ | | Protein | 60 | 30 | 3000 | | Fat | 12 | 2 | 400 | The system of linear equations would be $\begin{align} 60x + 30y = 3000 \\ 12x + 2y = 400 \end{align}$ We multiply the second equation by $-5$ to use elimination by addition. $\begin{align} 60x + 30y &= 3000 \\ -60x - 10y &= -2000 \\ \hline 20y &= 1000 \\ y &= 50 \end{align}$ Plugging back in to the second equation (either will work) yields $\begin{align} 12x + 2(50) &= 400 \\ 12x &= 300 \\ x &= 25 \end{align}$ Thus, $25$ units of fish and $50$ units of feed will meet the animal's dietary requirements. Note that we could have simplified both equations by extracting the factors $30$ and $2$ before solving. ## not linear systems Equations that are not linear combinations of variables are not linear systems. Examples include: #check $x_1 x_2 + 3x_3 = 5$ $4 \sqrt{x_1} + x_2 = 5$ $x^2 = 3$ Think about linearity as the relationship between the response $y$ and the parameters $\beta_1, \dots, \beta_n$ rather than between $y$ and the predictors $xs. #refactor