Problem

We can generate a random 6 × 6 matrix A whose entries consist entirely of 0’s and 1’s by...

We can generate a random 6 × 6 matrix A whose entries consist entirely of 0’s and 1’s by setting

A = round(rand(6))

(a) What percentage of these random 0–1 matrices are singular? You can estimate the percentage in MATLAB by setting

y = zeros(1, 100);

and then generating 100 test matrices and setting y( j ) = 1 if the j th matrix is singular and 0 otherwise. The easy way to do this in MATLAB is to use a for loop. Generate the loop as follows:

for j = 1 : 100

A = round(rand(6));

y ( j ) = (det(A) == 0);

end

(Note: A semicolon at the end of a line suppresses printout. It is recommended that you include one at the end of each line of calculation that occurs inside a for loop.) To determine how many singular matrices were generated, use the MATLAB command sum(y). What percentage of the matrices generated were singular?

(b) For any positive integer n, we can generate a random 6 × 6 matrix A whose entries are integers from 0 to n by setting

A = round(n rand(6))

What percentage of random integer matrices generated in this manner will be singular if n = 3? If n = 6? If n = 10? We can estimate the answers to these questions by using MATLAB. In each case, generate 100 test matrices and determine how many of the matrices are singular.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search