Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Theory: In this exercise, you will analyze the solution set of a homogeneous linear system Ax=0, where A is an mxn matrix and xe. If

image text in transcribed

image text in transcribed

image text in transcribed

Theory: In this exercise, you will analyze the solution set of a homogeneous linear system Ax=0, where A is an mxn matrix and xe". If the system has only the trivial solution (there are no free variables), the spanning set for the solution set consists of the zero vector only. If the system has non-trivial solutions (there is at least one free variable), we obtain the spanning set for the solution set by solving the system by row reduction algorithm - this set will be also linearly independent and, therefore, forms a basis for the solution set. Later on, we will call the solution set of a homogeneous system Ax=0 the Null space of the matrix A; thus, in this exercise, we are creating a basis for the Null space of a matrix A when the Null space contains non-zero vectors. Note: Before you proceed with the programming, it is advisable to solve a sample homogeneous system by hand (apply row reduction algorithm to the matrices (a)-(h) listed at the end of this exercise). It will help with understanding of the instructions given below. **Create a function in MATLAB starting with these lines: function C = homobasis (A) format Iman] =size (A); redech form=ref. (A) Note: The reduced echelon form of A has to be displayed (do not place a semicolon at the end of the command redeshaferm=rKeEJA)). This form will allow you to verify by inspection whether your results are accurate. **First, your function has to check if the system Ax=0 has only the trivial solution x=0. It happens if and only if all columns of A are pivot columns (no free variables). If this is the case, output the message: 'the homogeneous system has only the trivial solution, assign C=zerra in, 1) (display C), and terminate the program. **If the system has nontrivial solutions, that is, there are free variables in the system and non- pivot columns in A output the message the homogeneous system has non-trivial solutions', and your code will continue with constructing a basis for the Null space of A. In order to proceed with this task, we need to find the ordered sets of indexes of the pivot and non-pivot columns. The command that gives the ordered set of indexes of the pivot columns is: [- BXRESDEERESA); The commands below S=1;n; Posetdi. (SRXRES); calculate the ordered set of indexes of the non-pivot columns (P). The next set of commands will help you to output the messages that list free variables: a= length ); j=1:9 Errinte 'A free variable is xilablj)); **Second, after you have identified the free variables and non-pivot columns, you can proceed with constructing a basis for the solution set in the form of an nxg matrix C. Hint: the matrix C has to be constructed using matrices tref(A) and eye(Q). Specifically, if a matrix B is obtained by removing the pivot columns and zero rows from tref(A), then, the rows of C, whose indexes are pixats, match the rows of matrix (-B), and the rows of C whose indexes are from the set P (or non-pivot columns) match the rows of eye(Q). Important: After you have coded the matrix C, please make sure that you will run your code some matrices and check Con correctness (by inspection) using the output redueche Farm **Finally, you need to code a check that you did find a basis for the solution set of a homogeneous system in the form of a matrix C. The following two conditions must hold: (1) the set of columns of C is linearly independent (equivalently, rank(C) is equal to the number of the columns of C); (2) the columns of C are solutions of Ax=0, or, equivalently, A*C is an mxq zero matrix. Note: Due to a round off error in calculation of the matrix product, you will need to use the function cheretozereegundoff with the parameter p=5. **If both conditions. (1) and (2), hold, the output has to be a message: 'the columns of C form a basis for the solution set of the homogeneous system' and the matrix C has to be displayed; otherwise, the output message should be something like that: 'Not a basis? Impossible! (Receiving the last message should prompt you to look for the errors in your code and correct them.) **Type the functions closetozerergundeff and homekesia in your Live Script **Run the function C = banakasis.(A) on the following matrices: (a) A=1-3 4-8 2;-2 5 4 41 (b) A=I1 2 -3] (c) A=magis (3) (d) A=magis 4) (e) A=10 1 2 3;0 2 4 6] (E) ALO 1 0 2 0 3; 0 2 0 4 0 6; 0 40 90 6] (g) A=[0 0 1 2 3;0 0 2 4 5] (h) A=10 0 1 2 3;0 0 2 4 6] %Notice that the matrices in (g) and (h) differ by only one entry. Write a comment that would explain the differences in the bases by comparing the sets of free variables of the systems. Theory: In this exercise, you will analyze the solution set of a homogeneous linear system Ax=0, where A is an mxn matrix and xe". If the system has only the trivial solution (there are no free variables), the spanning set for the solution set consists of the zero vector only. If the system has non-trivial solutions (there is at least one free variable), we obtain the spanning set for the solution set by solving the system by row reduction algorithm - this set will be also linearly independent and, therefore, forms a basis for the solution set. Later on, we will call the solution set of a homogeneous system Ax=0 the Null space of the matrix A; thus, in this exercise, we are creating a basis for the Null space of a matrix A when the Null space contains non-zero vectors. Note: Before you proceed with the programming, it is advisable to solve a sample homogeneous system by hand (apply row reduction algorithm to the matrices (a)-(h) listed at the end of this exercise). It will help with understanding of the instructions given below. **Create a function in MATLAB starting with these lines: function C = homobasis (A) format Iman] =size (A); redech form=ref. (A) Note: The reduced echelon form of A has to be displayed (do not place a semicolon at the end of the command redeshaferm=rKeEJA)). This form will allow you to verify by inspection whether your results are accurate. **First, your function has to check if the system Ax=0 has only the trivial solution x=0. It happens if and only if all columns of A are pivot columns (no free variables). If this is the case, output the message: 'the homogeneous system has only the trivial solution, assign C=zerra in, 1) (display C), and terminate the program. **If the system has nontrivial solutions, that is, there are free variables in the system and non- pivot columns in A output the message the homogeneous system has non-trivial solutions', and your code will continue with constructing a basis for the Null space of A. In order to proceed with this task, we need to find the ordered sets of indexes of the pivot and non-pivot columns. The command that gives the ordered set of indexes of the pivot columns is: [- BXRESDEERESA); The commands below S=1;n; Posetdi. (SRXRES); calculate the ordered set of indexes of the non-pivot columns (P). The next set of commands will help you to output the messages that list free variables: a= length ); j=1:9 Errinte 'A free variable is xilablj)); **Second, after you have identified the free variables and non-pivot columns, you can proceed with constructing a basis for the solution set in the form of an nxg matrix C. Hint: the matrix C has to be constructed using matrices tref(A) and eye(Q). Specifically, if a matrix B is obtained by removing the pivot columns and zero rows from tref(A), then, the rows of C, whose indexes are pixats, match the rows of matrix (-B), and the rows of C whose indexes are from the set P (or non-pivot columns) match the rows of eye(Q). Important: After you have coded the matrix C, please make sure that you will run your code some matrices and check Con correctness (by inspection) using the output redueche Farm **Finally, you need to code a check that you did find a basis for the solution set of a homogeneous system in the form of a matrix C. The following two conditions must hold: (1) the set of columns of C is linearly independent (equivalently, rank(C) is equal to the number of the columns of C); (2) the columns of C are solutions of Ax=0, or, equivalently, A*C is an mxq zero matrix. Note: Due to a round off error in calculation of the matrix product, you will need to use the function cheretozereegundoff with the parameter p=5. **If both conditions. (1) and (2), hold, the output has to be a message: 'the columns of C form a basis for the solution set of the homogeneous system' and the matrix C has to be displayed; otherwise, the output message should be something like that: 'Not a basis? Impossible! (Receiving the last message should prompt you to look for the errors in your code and correct them.) **Type the functions closetozerergundeff and homekesia in your Live Script **Run the function C = banakasis.(A) on the following matrices: (a) A=1-3 4-8 2;-2 5 4 41 (b) A=I1 2 -3] (c) A=magis (3) (d) A=magis 4) (e) A=10 1 2 3;0 2 4 6] (E) ALO 1 0 2 0 3; 0 2 0 4 0 6; 0 40 90 6] (g) A=[0 0 1 2 3;0 0 2 4 5] (h) A=10 0 1 2 3;0 0 2 4 6] %Notice that the matrices in (g) and (h) differ by only one entry. Write a comment that would explain the differences in the bases by comparing the sets of free variables of the systems

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro Oracle Fusion Applications Installation And Administration

Authors: Tushar Thakker

1st Edition

1484209834, 9781484209837

More Books

Students also viewed these Databases questions