What is the condition for infinitely many solutions?

As we know that we can represent them in a matrix form , having a coefficient matrix multiplied by the variable matrix , and on the right side we have the constant matrix, in the form $AX=B$.

Now suppose we have a system of three such equations where the coefficient of a variable in one of the equations is unknown and we need to find the condition on that variable such that the given system has

1)unique solution

2) infinite solutions.

now I understand that for a system $AX=B$ to have unique solutions , the coefficient matrix should be non singular because only then $X=A^{-1}B$ will exist .

However here’s the part that’s confusing. If we solve the coefficient matrix and equate it to zero we get the value of unknown coefficient that makes $|A|=0$. , for which we do get infinite solutions , or in some cases no solutions.

But , I have two questions

1) why does the condition for infinite solutions overlap with that of no solution ? Isn’t the system required to have atleast a unique solution before having infinite solutions?

2) is it necessary , for such a system to have infinite solutions , that the determinant of the coefficient matrix should always be zero ? Or can we get infinite solutions even if the coefficient matrix is non-singular?

The example shown previously in this module had a unique solution. The structure of the row reduced matrix was

\[\begin{split}\begin{vmatrix} 1 & 1 & -1 & | & 5 \\ 0 & 1 & -5 & | & 8 \\ 0 & 0 & 1 & | & -1 \end{vmatrix}\end{split}\]

and the solution was

\[x = 1\]

\[y = 3\]

\[z = -1\]

As you can see, each variable in the matrix can have only one possible value, and this is how you know that this matrix has one unique solution


No solution

Let’s suppose you have a system of linear equations that consist of:

\[x + y + z = 2\]

\[y - 3z = 1\]

\[2x + y + 5z = 0\]

The augmented matrix is

\[\begin{split}\begin{vmatrix} 1 & 1 & 1 & | & 2 \\ 0 & 1 & -3 & | & 1 \\ 2 & 1 & 5 & | & 0 \end{vmatrix}\end{split}\]

and the row reduced matrix is

\[\begin{split}\begin{vmatrix} 1 & 0 & 4 & | & 1 \\ 0 & 1 & -3 & | & 1 \\ 0 & 0 & 0 & | & -3 \end{vmatrix}\end{split}\]

As you can see, the final row states that

\[0x + 0y + 0z = -3\]

which impossible, 0 cannot equal -3. Therefore this system of linear equations has no solution.

Let’s use python and see what answer we get.

In [1]:

import numpy as py
from scipy.linalg import solve

A = [[1, 1, 1], [0, 1, -3], [2, 1, 5]]
b = [[2], [1], [0]]

x = solve(A,b)
x

---------------------------------------------------------------------------
LinAlgError                               Traceback (most recent call last)
 in ()
      5 b = [[2], [1], [0]]
      6
----> 7 x = solve(A,b)
      8 x

C:\Users\Said Zaid-Alkailani\Anaconda3\lib\site-packages\scipy\linalg\basic.py in solve(a, b, sym_pos, lower, overwrite_a, overwrite_b, debug, check_finite, assume_a, transposed)
    217         return x
    218     elif 0 < info <= n:
--> 219         raise LinAlgError('Matrix is singular.')
    220     elif info > n:
    221         warnings.warn('scipy.linalg.solve\nIll-conditioned matrix detected.'

LinAlgError: Matrix is singular.

As you can see the code gives us an error suggesting there is no solution to the matrix.


Infinite Solutions

Let’s suppose you have a system of linear equations that consist of:

\[-3x - 5y + 36z = 10\]

\[-x + 7z = 5\]

\[x + y - 10z = -4\]

The augmented matrix is

\[\begin{split}\begin{vmatrix} -3 & -5 & 36 & | & 10 \\ -1 & 0 & 7 & | & 5 \\ 1 & 1 & -10 & | & -4 \end{vmatrix}\end{split}\]

and the row reduced matrix is

\[\begin{split}\begin{vmatrix} 1 & 0 & -7 & | & -5 \\ 0 & 2 & -3 & | & 1 \\ 0 & 0 & 0 & | & 0 \end{vmatrix}\end{split}\]

As you can see, the final row of the row reduced matrix consists of 0. This means that for any value of Z, there will be a unique solution of x and y, therefore this system of linear equations has infinite solutions.

Let’s use python and see what answer we get.

In [2]:

import numpy as py
from scipy.linalg import solve

A = [[-3, -5, 36], [-1, 0, 7], [1, 1, -10]]
b = [[10], [5], [-4]]

x = solve(A,b)
x

C:\Users\Said Zaid-Alkailani\Anaconda3\lib\site-packages\scipy\linalg\basic.py:223: RuntimeWarning: scipy.linalg.solve
Ill-conditioned matrix detected. Result is not guaranteed to be accurate.
Reciprocal condition number: 3.808655316038273e-19
  ' condition number: {}'.format(rcond), RuntimeWarning)

Out[2]:

array([[-12.],
       [ -2.],
       [ -1.]])

As you can see we get a different type of error from this code. It states that the matrix is ill-conditioned and that there is a RuntimeWarning. This means that the computer took to long to find a unique solution so it spat out a random answer. When RuntimeWarings occur, the matrix is likely to have infinite solutions.