# fcla / src / section-TSS.xml

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 
Types of Solution Sets

We will now be more careful about analyzing the reduced row-echelon form derived from the augmented matrix of a system of linear equations. In particular, we will see how to systematically handle the situation when we have infinitely many solutions to a system, and we will prove that every system of linear equations has either zero, one or infinitely many solutions. With these tools, we will be able to solve any system by a well-described method.

Consistent Systems

The computer scientist Donald Knuth said, Science is what we understand well enough to explain to a computer. Art is everything else. In this section we'll remove solving systems of equations from the realm of art, and into the realm of science. We begin with a definition.

Consistent System

A system of linear equations is consistent if it has at least one solution. Otherwise, the system is called inconsistent.

We will want to first recognize when a system is inconsistent or consistent, and in the case of consistent systems we will be able to further refine the types of solutions possible. We will do this by analyzing the reduced row-echelon form of a matrix, using the value of $r$, and the sets of column indices, $D$ and $F$, first defined back in .

Use of the notation for the elements of $D$ and $F$ can be a bit confusing, since we have subscripted variables that are in turn equal to integers used to index the matrix. However, many questions about matrices and systems of equations can be answered once we know $r$, $D$ and $F$. The choice of the letters $D$ and $F$ refer to our upcoming definition of dependent and free variables (). An example will help us begin to get comfortable with this aspect of reduced row-echelon form.

Reduced row-echelon form notation

For the $5\times 9$ matrix \begin{bmatrix} \end{bmatrix} in reduced row-echelon form we have

Notice that the sets F=\set{f_1,\,f_2,\,f_3,\,f_4,\,f_5}=\set{2,\,5,\,6,\,8,\,9} have nothing in common and together account for all of the columns of $B$ (we say it is a partition of the set of column indices).

The number $r$ is the single most important piece of information we can get from the reduced row-echelon form of a matrix. It is defined as the number of nonzero rows, but since each nonzero row has a leading 1, it is also the number of leading 1's present. For each leading 1, we have a pivot column, so $r$ is also the number of pivot columns. Repeating ourselves, $r$ is the number of nonzero rows, the number of leading 1's and the number of pivot columns. Across different situations, each of these interpretations of the meaning of $r$ will be useful.

Before proving some theorems about the possibilities for solution sets to systems of equations, let's analyze one particular system with an infinite solution set very carefully as an example. We'll use this technique frequently, and shortly we'll refine it slightly.

Archetypes I and J are both fairly large for doing computations by hand (though not impossibly large). Their properties are very similar, so we will frequently analyze the situation in Archetype I, and leave you the joy of analyzing Archetype J yourself. So work through Archetype I with the text, by hand and/or with a computer, and then tackle Archetype J yourself (and check your results with those listed). Notice too that the archetypes describing systems of equations each lists the values of $r$, $D$ and $F$. Here we go

Describing infinite solution sets, Archetype I

is the system of $m=4$ equations in $n=7$ variables. This system has a $4\times 8$ augmented matrix that is row-equivalent to the following matrix (check this!), and which is in reduced row-echelon form (the existence of this matrix is guaranteed by and its uniqueness is guaranteed by ),

So we find that $r=3$ and Let $i$ denote one of the $r=3$ non-zero rows, and then we see that we can solve the corresponding equation represented by this row for the variable $x_{d_i}$ and write it as a linear function of the variables $x_{f_1},\,x_{f_2},\,x_{f_3},\,x_{f_4}$ (notice that $f_5=8$ does not reference a variable). We'll do this now, but you can already see how the subscripts upon subscripts takes some getting used to.

Each element of the set $F=\set{f_1,\,f_2,\,f_3,\,f_4,\,f_5}=\set{2,\,5,\,6,\,7,\,8}$ is the index of a variable, except for $f_5=8$. We refer to $x_{f_1}=x_2$, $x_{f_2}=x_5$, $x_{f_3}=x_6$ and $x_{f_4}=x_7$ as free (or independent) variables since they are allowed to assume any possible combination of values that we can imagine and we can continue on to build a solution to the system by solving individual equations for the values of the other (dependent) variables.

Each element of the set $D=\set{d_1,\,d_2,\,d_3}=\set{1,\,3,\,4}$ is the index of a variable. We refer to the variables $x_{d_1}=x_1$, $x_{d_2}=x_3$ and $x_{d_3}=x_4$ as dependent variables since they depend on the independent variables. More precisely, for each possible choice of values for the independent variables we get exactly one set of values for the dependent variables that combine to form a solution of the system.

To express the solutions as a set, we write \setparts{ \colvector{ 4-4x_2-2x_5-x_6+3x_7\\ x_2\\ 2-x_5+3x_6-5x_7\\ 1-2x_5+6x_6-6x_7\\ x_5\\ x_6\\ x_7 } }{ x_2,\,x_5,\,x_6,\,x_7\in\complex{\null} }

The condition that $x_2,\,x_5,\,x_6,\,x_7\in\complex{\null}$ is how we specify that the variables $x_2,\,x_5,\,x_6,\,x_7$ are free to assume any possible values.

This systematic approach to solving a system of equations will allow us to create a precise description of the solution set for any consistent system once we have found the reduced row-echelon form of the augmented matrix. It will work just as well when the set of free variables is empty and we get just a single solution. And we could program a computer to do it! Now have a whack at Archetype J (), mimicking the discussion in this example. We'll still be here when you get back.

Using the reduced row-echelon form of the augmented matrix of a system of equations to determine the nature of the solution set of the system is a very key idea. So let's look at one more example like the last one. But first a definition, and then the example. We mix our metaphors a bit when we call variables free versus dependent. Maybe we should call dependent variables enslaved?

Independent and Dependent Variables

Suppose $A$ is the augmented matrix of a consistent system of linear equations and $B$ is a row-equivalent matrix in reduced row-echelon form. Suppose $j$ is the index of a column of $B$ that contains the leading 1 for some row ( column $j$ is a pivot column). Then the variable $x_j$ is dependent. A variable that is not dependent is called independent or free.

If you studied this definition carefully, you might wonder what to do if the system has $n$ variables and column $n+1$ is a pivot column? We will see shortly, by , that this never happens for a consistent system.

Free and dependent variables

Consider the system of five equations in five variables, whose augmented matrix row-reduces to \begin{bmatrix} \end{bmatrix}

There are leading 1's in columns 1, 3 and 4, so $D=\set{1,\,3,\,4}$. From this we know that the variables $x_1$, $x_3$ and $x_4$ will be dependent variables, and each of the $r=3$ nonzero rows of the row-reduced matrix will yield an expression for one of these three variables. The set $F$ is all the remaining column indices, $F=\set{2,\,5,\,6}$. That $6\in F$ refers to the column originating from the vector of constants, but the remaining indices in $F$ will correspond to free variables, so $x_2$ and $x_5$ (the remaining variables) are our free variables. The resulting three equations that describe our solution set are then,

Make sure you understand where these three equations came from, and notice how the location of the leading 1's determined the variables on the left-hand side of each equation. We can compactly describe the solution set as, S= \setparts{ \colvector{6+x_2-3x_5\\x_2\\1+2x_5\\9-4x_5\\x_5} }{x_2,\,x_5\in\complex{\null}}

Notice how we express the freedom for $x_2$ and $x_5$: $x_2,\,x_5\in\complex{\null}$.

Free and Dependent Variables Sage has the matrix method .pivot() to quickly and easily identify the pivot columns of the reduced row-echelon form of a matrix. Notice that we do not have to row-reduce the matrix first, we just ask which columns of a matrix $A$ would be the pivot columns of the matrix $B$ that is row-equivalent to $A$ and in reduced row-echelon form. By , the indices of the pivot columns for an augmented matrix of a system of equations are the indices of the dependent variables. And the remainder are free variables. But be careful, Sage numbers columns starting from zero and mathematicians typically number variables starting from one.

Let's reprise . coeff = matrix(QQ, [[ 1, 4, 0, -1, 0, 7, -9], [ 2, 8,-1, 3, 9, -13, 7], [ 0, 0, 2, -3, -4, 12, -8], [-1, -4, 2, 4, 8, -31, 37]]) const = vector(QQ, [3, 9, 1, 4]) aug = coeff.augment(const) dependent = aug.pivots() dependent (0, 2, 3) So, incrementing each column index by 1 gives us the same set $D$ of indices for the dependent variables. To get the free variables, we can use the following code. Study it and then read the explanation following. free = [index for index in range(7) if not index in dependent] free [1, 4, 5, 6] This is a Python programming construction known as a list comprehension but in this setting I prefer to call it set builder notation. Let's dissect the command in pieces. The brackets ([,]) create a new list. The items in the list will be values of the variable index. range(7) is another list, integers starting at 0 and stopping just before 7. (While perhaps a bit odd, this works very well when we consistently start counting at zero.) So range(7) is the list [0,1,2,3,4,5,6]. Think of these as candidate values for index, which are generated by for index in range(7). Then we test each candidate, and keep it in the new list if it is not in the list dependent.

This is entirely analogous to the following mathematics: where $F$ is free, $f$ is index, and $D$ is dependent, and we make the 0/1 counting adjustments. This ability to construct sets in Sage with notation so closely mirroring the mathematics is a powerful feature worth mastering. We will use it repeatedly. It was a good exercise to use a list comprehension to form the list of columns that are not pivot columns. However, Sage has us covered. free_and_easy = coeff.nonpivots() free_and_easy (1, 4, 5, 6) Can you use this new matrix method to make a simpler version of the consistent() function we designed above?

Sets are an important part of algebra, and we've seen a few already. Being comfortable with sets is important for understanding and writing proofs. If you haven't already, pay a visit now to .

We can now use the values of $m$, $n$, $r$, and the independent and dependent variables to categorize the solution sets for linear systems through a sequence of theorems.

Through the following sequence of proofs, you will want to consult three proof techniques. See , , .

First we have an important theorem that explores the distinction between consistent and inconsistent linear systems.

Recognizing Consistency of a Linear System

Suppose $A$ is the augmented matrix of a system of linear equations with $n$ variables. Suppose also that $B$ is a row-equivalent matrix in reduced row-echelon form with $r$ nonzero rows. Then the system of equations is inconsistent if and only if the leading 1 of row $r$ is located in column $n+1$ of $B$.

The first half of the proof begins with the assumption that the leading 1 of row $r$ is located in column $n+1$ of $B$. Then row $r$ of $B$ begins with $n$ consecutive zeros, finishing with the leading 1. This is a representation of the equation $0=1$, which is false. Since this equation is false for any collection of values we might choose for the variables, there are no solutions for the system of equations, and it is inconsistent.

For the second half of the proof, we wish to show that if we assume the system is inconsistent, then the final leading 1 is located in the last column. But instead of proving this directly, we'll form the logically equivalent statement that is the contrapositive, and prove that instead (see ). Turning the implication around, and negating each portion, we arrive at the logically equivalent statement: If the leading 1 of row $r$ is not in column $n+1$, then the system of equations is consistent.

If the leading 1 for row $r$ is located somewhere in columns 1 through $n$, then every preceding row's leading 1 is also located in columns 1 through $n$. In other words, since the last leading 1 is not in the last column, no leading 1 for any row is in the last column, due to the echelon layout of the leading 1's (). We will now construct a solution to the system by setting each dependent variable to the entry of the final column for the row with the corresponding leading 1, and setting each free variable to zero. That sentence is pretty vague, so let's be more precise. Using our notation for the sets $D$ and $F$ from the reduced row-echelon form ():

These values for the variables make the equations represented by the first $r$ rows of $B$ all true (convince yourself of this). Rows numbered greater than $r$ (if any) are all zero rows, hence represent the equation $0=0$ and are also all true. We have now identified one solution to the system represented by $B$, and hence a solution to the system represented by $A$ (). So we can say the system is consistent ().

The beauty of this theorem being an equivalence is that we can unequivocally test to see if a system is consistent or inconsistent by looking at just a single entry of the reduced row-echelon form matrix. We could program a computer to do it!

Recognizing Consistency of a Linear System Another way of expressing is to say a system is consistent if and only if column $n+1$ is not a pivot column of $B$. Sage has the matrix method .pivot() to easily identify the pivot columns of a matrix. Let's use as an example. coeff = matrix(QQ, [[ 2, 1, 7, -7], [-3, 4, -5, -6], [ 1, 1, 4, -5]]) const = vector(QQ, [2, 3, 2]) aug = coeff.augment(const) aug.rref() [ 1 0 3 -2 0] [ 0 1 1 -3 0] [ 0 0 0 0 1] aug.pivots() (0, 1, 4) We can look at the reduced row-echelon form of the augmented matrix and see a leading one in the final column, so we know the system is inconsistent. However, we could just as easily not form the reduced row-echelon form and just look at the list of pivot columns computed by aug.pivots(). Since aug has 5 columns, the final column is numbered 4, which is present in the list of pivot columns, as we expect.

One feature of Sage is that we can easily extend its capabilities by defining new commands. Here will create a function that checks if an augmented matrix represents a consistent system of equations. The syntax is just a bit complicated. lambda is the word that indicates we are making a new function, the input is temporarily named A (think Augmented), and the name of the function is consistent. Everything following the colon will be evaluated and reported back as the output. consistent = lambda A: not(A.ncols()-1 in A.pivots()) Execute this block above. There will not be any output, but now the consistent function will be defined and available. Now give it a try (after making sure to have run the code above that defines aug). Note that the output of consistent() will be either True or False. consistent(aug) False The consistent() command works by simply checking to see if the last column of A is not in the list of pivots. We can now test many different augmented matrices, such as perhaps changing the vector of constants while keeping the coefficient matrix fixed. Again, make sure you execute the code above that defines coeff and const. consistent(coeff.augment(const)) False w = vector(QQ, [3,1,2]) consistent(coeff.augment(w)) True u = vector(QQ, [1,3,1]) consistent(coeff.augment(u)) False Why do some vectors of constants lead to a consistent system with this coefficient matrix, while others do not? This is a fundamental question, which we will come to understand in several different ways.

Notice that for a consistent system the row-reduced augmented matrix has $n+1\in F$, so the largest element of $F$ does not refer to a variable. Also, for an inconsistent system, $n+1\in D$, and it then does not make much sense to discuss whether or not variables are free or dependent since there is no solution. Take a look back at and see why we did not need to consider the possibility of referencing $x_{n+1}$ as a dependent variable.

With the characterization of , we can explore the relationships between $r$ and $n$ in light of the consistency of a system of equations. First, a situation where we can quickly conclude the inconsistency of a system.

Inconsistent Systems, $r$ and $n$

Suppose $A$ is the augmented matrix of a system of linear equations in $n$ variables. Suppose also that $B$ is a row-equivalent matrix in reduced row-echelon form with $r$ rows that are not completely zeros. If $r=n+1$, then the system of equations is inconsistent.

If $r=n+1$, then $D=\set{1,\,2,\,3,\,\ldots,\,n,\,n+1}$ and every column of $B$ contains a leading 1 and is a pivot column. In particular, the entry of column $n+1$ for row $r=n+1$ is a leading 1. then says that the system is inconsistent.

Do not confuse with its converse! Go check out right now.

Next, if a system is consistent, we can distinguish between a unique solution and infinitely many solutions, and furthermore, we recognize that these are the only two possibilities.

Consistent Systems, $r$ and $n$

Suppose $A$ is the augmented matrix of a consistent system of linear equations with $n$ variables. Suppose also that $B$ is a row-equivalent matrix in reduced row-echelon form with $r$ rows that are not zero rows. Then $r\leq n$. If $r=n$, then the system has a unique solution, then the system has infinitely many solutions.

This theorem contains three implications that we must establish. Notice first that $B$ has $n+1$ columns, so there can be at most $n+1$ pivot columns, $r\leq n+1$. If $r=n+1$, then tells us that the system is inconsistent, contrary to our hypothesis. We are left with $r\leq n$.

When $r=n$, we find $n-r=0$ free variables ( $F=\set{n+1}$) and any solution must equal the unique solution given by the first $n$ entries of column $n+1$ of $B$.

we have $n-r>0$ free variables, corresponding to columns of $B$ without a leading 1, excepting the final column, which also does not contain a leading 1 by . By varying the values of the free variables suitably, we can demonstrate infinitely many solutions.

Free Variables

The next theorem simply states a conclusion from the final paragraph of the previous proof, allowing us to state explicitly the number of free variables for a consistent system.

Free Variables for Consistent Systems

Suppose $A$ is the augmented matrix of a consistent system of linear equations with $n$ variables. Suppose also that $B$ is a row-equivalent matrix in reduced row-echelon form with $r$ rows that are not completely zeros. Then the solution set can be described with $n-r$ free variables.

See the proof of .

Counting free variables

For each archetype that is a system of equations, the values of $n$ and $r$ are listed. Many also contain a few sample solutions. We can use this information profitably, as illustrated by four examples.

1. has $n=3$ and $r=2$. It can be seen to be consistent by the sample solutions given. Its solution set then has $n-r=1$ free variables, and therefore will be infinite.
2. has $n=3$ and $r=3$. It can be seen to be consistent by the single sample solution given. Its solution set can then be described with $n-r=0$ free variables, and therefore will have just the single solution.
3. has $n=2$ and $r=3$. In this case, $r=n+1$, so says the system is inconsistent. We should not try to apply to count free variables, since the theorem only applies to consistent systems. (What would happen if you did?)
4. has $n=4$ and $r=3$. However, by looking at the reduced row-echelon form of the augmented matrix, we find a leading 1 in row 3, column 5. By we recognize the system as inconsistent. (Why doesn't this example contradict ?)

We have accomplished a lot so far, but our main goal has been the following theorem, which is now very simple to prove. The proof is so simple that we ought to call it a corollary, but the result is important enough that it deserves to be called a theorem. (See .) Notice that this theorem was presaged first by and further foreshadowed by other examples.

Possible Solution Sets for Linear Systems

A system of linear equations has no solutions, a unique solution or infinitely many solutions.

By its definition, a system is either inconsistent or consistent (). The first case describes systems with no solutions. For consistent systems, we have the remaining two possibilities as guaranteed by, and described in, .

Here is a diagram that consolidates several of our theorems from this section, and which is of practical use when you analyze systems of equations. Decision Tree for Solving Linear Systems \matrix (m) [matrix of math nodes, row sep=4em, column sep=0em, text height=1.5ex, text depth=0.25ex] \path[->] (m-1-3) edge[thick] node[left,xshift=-1em, yshift=0.5em] (m-1-3) edge[thick] node[right,xshift=1em, yshift=0.5em] % (m-2-2) edge[thick] (m-3-2) (m-3-2) edge[thick] node[right, xshift=1em] {$r = n$} (m-4-3);

We have one more theorem to round out our set of tools for determining solution sets to systems of linear equations.

Consistent, More Variables than Equations, Infinite solutions

Suppose a consistent system of linear equations has $m$ equations in $n$ variables. If $n>m$, then the system has infinitely many solutions.

Suppose that the augmented matrix of the system of equations is row-equivalent to $B$, a matrix in reduced row-echelon form with $r$ nonzero rows. Because $B$ has $m$ rows in total, the number that are nonzero rows is less. In other words, $r\leq m$. Follow this with the hypothesis that $n>m$ and we find that the system has a solution set described by at least one free variable because n-r\geq n-m>0.

A consistent system with free variables will have an infinite number of solutions, as given by .

Notice that to use this theorem we need only know that the system is consistent, together with the values of $m$ and $n$. We do not necessarily have to compute a row-equivalent reduced row-echelon form matrix, even though we discussed such a matrix in the proof. This is the substance of the following example.

One solution gives many, Archetype D

Archetype D is the system of $m=3$ equations in $n=4$ variables, and the solution $x_1 = 0$, $x_2 = 1$, $x_3 = 2$, $x_4 = 1$ can be checked easily by substitution. Having been handed this solution, we know the system is consistent. This, together with $n>m$, allows us to apply and conclude that the system has infinitely many solutions.

These theorems give us the procedures and implications that allow us to completely solve any system of linear equations. The main computational tool is using row operations to convert an augmented matrix into reduced row-echelon form. Here's a broad outline of how we would instruct a computer to solve a system of linear equations.

1. Represent a system of linear equations by an augmented matrix (an array is the appropriate data structure in most computer languages).
2. Convert the matrix to a row-equivalent matrix in reduced row-echelon form using the procedure from the proof of .
3. Determine $r$ and locate the leading 1 of row $r$. If it is in column $n+1$, output the statement that the system is inconsistent and halt.
4. With the leading 1 of row $r$ not in column $n+1$, there are two possibilities:
1. $r=n$ and the solution is unique. It can be read off directly from the entries in rows 1 through $n$ of column $n+1$.
2. and there are infinitely many solutions. If only a single solution is needed, set all the free variables to zero and read off the dependent variable values from column $n+1$, as in the second half of the proof of . If the entire solution set is required, figure out some nice compact way to describe it, since your finite computer is not big enough to hold all the solutions (we'll have such a way soon).

The above makes it all sound a bit simpler than it really is. In practice, row operations employ division (usually to get a leading entry of a row to convert to a leading 1) and that will introduce round-off errors. Entries that should be zero sometimes end up being very, very small nonzero entries, or small entries lead to overflow errors when used as divisors. A variety of strategies can be employed to minimize these sorts of errors, and this is one of the main topics in the important subject known as numerical linear algebra.

In this section we've gained a foolproof procedure for solving any system of linear equations, no matter how many equations or variables. We also have a handful of theorems that allow us to determine partial information about a solution set without actually constructing the whole set itself. Donald Knuth would be proud.

Solving Systems, Part 1 Sage has built-in commands that will solve a linear system of equations, given a coefficient matrix and a vector of constants. We need to learn some more theory before we can entirely understand this command, but we can begin to explore its use. For now, consider these methods experimental and do not let it replace row-reducing augmented matrices.

The matrix method A.solve_right(b) will provide information about solutions to the linear system of equations with coefficient matrix A and vector of constants b. The reason for the right (and the corresponding command named with left) will have to wait for . For now, it is generally correct in this course to use the right variant of any Sage linear algebra command that has both left and right variants.

Lets apply the .solve_right() command to a system with no solutions, in particular . We have already seen in that this system is inconsistent. coeff = matrix(QQ, [[ 2, 1, 7, -7], [-3, 4, -5, -6], [ 1, 1, 4, -5]]) const = vector(QQ, [2, 3, 2]) coeff.solve_right(const) Traceback (most recent call last): ... ValueError: matrix equation has no solutions This is our first discussion of Sage error messages, though undoubtedly you have seen several already! First, here we only show the first and last lines of the message since typically it contains a lot of information specific to whichever computer you may be using. but we always begin with the last line as the most important indication of what has happened. Here the problem is quite evident: we get an error message telling us that the matrix equation has no solutions. We can debate whether or not this is really an error, but that is the design decision taken in Sage we just need to be aware of it, the .solve_right() is really only valuable when there is a solution.

Generally, when deciphering Sage error message, you want to start at the bottom of the traceback and read up through the various routines that have been called. Execute the block above and you may see references to matrix methods such as ._solve_right_general() and then .solve_right(). With time and practice, these mysterious messages will become more and more helpful, so spend some time reading them in tandem with locating the real source of any problems you encounter.

What does .solve_right() do with a system that does have solutions? Lets take a look at again, as we did in . coeff = matrix(QQ, [[ 1, 4, 0, -1, 0, 7, -9], [ 2, 8, -1, 3, 9, -13, 7], [ 0, 0, 2, -3, -4, 12, -8], [-1, -4, 2, 4, 8, -31, 37]]) const = vector(QQ, [3, 9, 1, 4]) coeff.solve_right(const) (4, 0, 2, 1, 0, 0, 0) This vector with 7 entries is indeed a solution to the system of equations (check this!). But from we know this system has infinitely many solutions. Why does Sage give us just one solution? Of the infinitely many solutions, why this one? How can a finite computer ever present us with infinitely many solutions? Do we have the time to read through an infinite list of solutions? Is there a best solution? This behavior should prompt these questions, and maybe more.

In order to totally understand the behavior of the .solve_right() command, we need to understand more of the theory of linear algebra. In good time. So for now, .solve_right() is a curiosity we will fully understand soon specifically in and .
1. How can we easily recognize when a system of linear equations is inconsistent or not?
2. Suppose we have converted the augmented matrix of a system of equations into reduced row-echelon form. How do we then identify the dependent and independent (free) variables?
3. What are the possible solution sets for a system of linear equations?
In the spirit of , describe the infinite solution set for .

For Exercises C21C28, find the solution set of the system of linear equations. Give the values of $n$ and $r$, and interpret your answers in light of the theorems of this section.

The augmented matrix for the given linear system and its row-reduced form are: \begin{bmatrix} \end{bmatrix} \rref \begin{bmatrix} \end{bmatrix}. For this system, we have $n = 4$ and $r = 3$. However, with a leading 1 in the last column we see that the original system has no solution by . The augmented matrix for the given linear system and its row-reduced form are: \begin{bmatrix} \end{bmatrix} \rref \begin{bmatrix} \end{bmatrix}. Thus, we see we have an equivalent system for any scalar $x_2$: For this system, $n = 4$ and $r = 3$. Since it is a consistent system by , guarantees an infinite number of solutions. The augmented matrix for the given linear system and its row-reduced form are: \begin{bmatrix} \end{bmatrix} \rref \begin{bmatrix} \end{bmatrix}. For this system, we have $n = 4$ and $r = 3$. However, with a leading 1 in the last column we see that the original system has no solution by . The augmented matrix for the given linear system and its row-reduced form are: \begin{bmatrix} \end{bmatrix} \rref \begin{bmatrix} \end{bmatrix}. Thus, we see that an equivalent system is and the solution set is $\setparts{\colvector{2 - x_3 + x_4\\ 0 \\ x_3 \\ x_4}}{x_3, x_4 \in\complexes}$. For this system, $n = 4$ and $r = 2$. Since it is a consistent system by , guarantees an infinite number of solutions. The augmented matrix for the given linear system and its row-reduced form are: \begin{bmatrix} \end{bmatrix} \rref \begin{bmatrix} \end{bmatrix}. Since $n = 3$ and $r = 4 = n+1$, guarantees that the system is inconsistent. Thus, we see that the given system has no solution. The augmented matrix for the given linear system and its row-reduced form are: \begin{bmatrix} \end{bmatrix} \rref \begin{bmatrix} \end{bmatrix}. Since $r = n = 3$ and the system is consistent by , guarantees a unique solution, which is The augmented matrix for the given linear system and its row-reduced form are: \begin{bmatrix} \end{bmatrix} \rref \begin{bmatrix} \end{bmatrix}. For this system, we have $n = 3$ and $r = 3$. However, with a leading 1 in the last column we see that the original system has no solution by . The augmented matrix for the given linear system and its row-reduced form are: \begin{bmatrix} \end{bmatrix} \rref \begin{bmatrix} \end{bmatrix}. For this system, $n = 3$ and $r = 2$. Since it is a consistent system by , guarantees an infinite number of solutions. An equivalent system is where $x_3$ is any scalar. So we can express the solution set as \setparts{\colvector{1 - x_3\\ -x_3\\x_3}}{x_3\in\complexes}
The details for include several sample solutions. Verify that one of these solutions is correct (any one, but just one). Based only on this evidence, and especially without doing any row operations, explain how you know this system of linear equations has infinitely many solutions. Demonstrate that the system is consistent by verifying any one of the four sample solutions provided. Then because $n=9>6=m$, gives us the conclusion that the system has infinitely many solutions. Notice that we only know the system will have at least $9-6=3$ free variables, but very well could have more. We do not know know that $r=6$, only that $r\leq 6$. Consider , and specifically the row-reduced version of the augmented matrix of the system of equations, denoted as $B$ here, and the values of $r$, $D$ and $F$ immediately following. Determine the values of the entries (See for a generalization.)

For Exercises M51M57 say as much as possible about each system's solution set. Be sure to make it clear which theorems you are using to reach your conclusions.

A consistent system of 8 equations in 6 variables. Consistent means there is at least one solution (). It will have either a unique solution or infinitely many solutions (). A consistent system of 6 equations in 8 variables. With 6 rows in the augmented matrix, the row-reduced version will have $r\leq 6$. Since the system is consistent, apply to see that $n-r\geq 2$ implies infinitely many solutions. A system of 5 equations in 9 variables. The system could be inconsistent. If it is consistent, then because it has more variables than equations implies that there would be infinitely many solutions. So, of all the possibilities in , only the case of a unique solution can be ruled out. A system with 12 equations in 35 variables. The system could be inconsistent. If it is consistent, then tells us the solution set will be infinite. So we can be certain that there is not a unique solution. A system with 6 equations in 12 variables. The system could be inconsistent. If it is consistent, and since $12>6$, then says we will have infinitely many solutions. So there are two possibilities. allows to state equivalently that a unique solution is an impossibility. A system with 8 equations and 6 variables. The reduced row-echelon form of the augmented matrix of the system has 7 pivot columns. 7 pivot columns implies that there are $r=7$ nonzero rows (so row 8 is all zeros in the reduced row-echelon form). Then $n+1=6+1=7=r$ and allows to conclude that the system is inconsistent.
Without doing any computations, and without examining any solutions, say as much as possible about the form of the solution set for each archetype that is a system of equations.

, , , , , , , , ,
Suppose that $B$ is a matrix in reduced row-echelon form that is equivalent to the augmented matrix of a system of equations with $m$ equations in $n$ variables. Let $r$, $D$ and $F$ be as defined in . What can you conclude, in general, about the following entries? If you cannot conclude anything about an entry, then say so. (See .) An inconsistent system may have $r>n$. If we try (incorrectly!) to apply to such a system, how many free variables would we discover? will indicate a negative number of free variables, but we can say even more. If $r>n$, then the only possibility is that $r=n+1$, and then we compute $n-r=n-(n+1)=-1$ free variables. Suppose that $B$ is a matrix in reduced row-echelon form that is equivalent to the augmented matrix of a system of equations with $m$ equations in $n$ variables. Let $r$, $D$ and $F$ be as defined in . Prove that $d_k\geq k$ for all $1\leq k\leq r$. Then suppose that $r\geq 2$ and and determine what can you conclude, in general, about the following entries. If you cannot conclude anything about an entry, then say so. (See and .) Suppose that the coefficient matrix of a consistent system of linear equations has two columns that are identical. Prove that the system has infinitely many solutions. Since the system is consistent, we know there is either a unique solution, or infinitely many solutions (). If we perform row operations () on the augmented matrix of the system, the two equal columns of the coefficient matrix will suffer the same fate, and remain equal in the final reduced row-echelon form. Suppose both of these columns are pivot columns (). Then there is single row containing the two leading 1's of the two pivot columns, a violation of reduced row-echelon form (). So at least one of these columns is not a pivot column, and the column index indicates a free variable in the description of the solution set (). With a free variable, we arrive at an infinite solution set (). Consider the system of linear equations $\linearsystem{A}{\vect{b}}$, and suppose that every element of the vector of constants $\vect{b}$ is a common multiple of the corresponding element of a certain column of $A$. More precisely, there is a complex number $\alpha$, and a column index $j$, such that $\vectorentry{\vect{b}}{i}=\alpha\matrixentry{A}{ij}$ for all $i$. Prove that the system is consistent. The condition about the multiple of the column of constants will allow you to show that the following values form a solution of the system $\linearsystem{A}{\vect{b}}$, With one solution of the system known, we can say the system is consistent ().

A more involved proof can be built using . Begin by proving that each of the three row operations () will convert the augmented matrix of the system into another matrix where column $j$ is $\alpha$ times the entry of the same row in the last column. In other words, the column multiple property is preserved under row operations. These proofs will get successively more involved as you work through the three operations.

Now construct a proof by contradiction (), by supposing that the system is inconsistent. Then the last column of the reduced row-echelon form of the augmented matrix is a pivot column (). Then column $j$ must have a zero in the same row as the leading 1 of the final column. But the column multiple property implies that there is an $\alpha$ in column $j$ in the same row as the leading $1$. So $\alpha = 0$. By hypothesis, then the vector of constants is the zero vector. However, if we began with a final column of zeros, row operations would never have created a leading 1 in the final column. This contradicts the final column being a pivot column, and therefore the system cannot be inconsistent.