Question: Please use matlab for this problem 3. Generate a random 7 x 7 matrix A with integer entries by setting A = floor(20*rand (7)); and

Please use matlab for this problem

Please use matlab for this problem 3. Generate a random 7 x

3. Generate a random 7 x 7 matrix A with integer entries by setting A = floor(20*rand (7)); and generate a 7x1 vector b by setting b = floor(40*rand (7,1))-20; Note: the command floor(40*rand (7,1)) generates a random 7 x 1 vector with entries between 0 and 39. We subtract 20 to each entry so that the vector b will have entries between -20 and 19. (a) Since A was generated randomly, we would expect it to be nonsingular. The system Ax = b should have a unique solution. Find the solution using the "\" operation (if MATLAB gives a warning about the matrix being close to singular, generate the matrix A again). (b) Enter U = rref ([A, b]) to compute the reduced row echelon form, U, of the augmented matrix [A b]. Note that, in exact arithmetic, the last column of U and the solution x from part (a) should be the same since they are both solutions to the system Ax = b. (c) To compare the solutions from part (a) and part (b), compute the difference between the last column of U and the vector x: U(:,8) - x (d) Let us now change A so as to make it singular. Set A(:,5) = 3*A(:,3)+8*A(:,1); (the above command replaces column 5 of A with a linear combination of columns 3 and 1: a5 = 3a3 + 8aj where ai is the ith column of A.) Use MATLAB to compute rref ([A b]). How many solutions will the system Ax=b have? Explain. Hint: Look at the last row(s) of the RREF. (e) Generate two vectors, y and c by setting y = floor(40*rand (7,1)) - 20; c = A*y; (here A is the matrix from part (d)). The way the vector c is defined guarantees that the system Ax = c is consistent, that is, it has at least one solution. Explain why that is the case. (f) Compute the reduced row echelon form U of [A c]. How many solutions does the system Ax = c have? Explain. Hint: Look at the last row(s) of the RREF

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!