Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions

Question

How does bytecode differ from machine language

Answered: 1 week ago