3-7 How common are singular matrices? Because of the emphasis on singular matric
ID: 3920395 • Letter: 3
Question
3-7
How common are singular matrices? Because of the emphasis on singular matrices in matrix theory, it might seem thatthey are quite common. In this exercise, randomly generate 100 matrices, calculate the determinant of each, and then make a rough assessment as to how likely encountering a singular matrix would be. The following MATLAB loop will generate the determinant values for 100randomly chosen matrices: determ = zeros (1,100) ; for i 1 100 A = round (20+rand (5,5) determ(,i)det (A) -10*ones (5, 5) ) ; end After executing this loop, list the vector determinant to display the 100 determinant values calculated. Are any of the 100 matrices singular? Repeat the experiment using 1000 randomly generated matrices insteadof 100. Rather than listing the vector determinant, use the min (abs (determ)) command to find the smallest determinant in absolute value. Did you encounter any singular matrices?Explanation / Answer
Here is the modified code that works according to specifications in question. As seen in the output, none of the matrices generated had a determinant of 0. i.e. there were no singular matrix at all. (for 100 or 1000 randomly generated matrices).
So singular matrices are not so common over a continuous uniform distribution on its entries.
===========
format long
determ = zeros(1, 100);
for i = 1 : 100
A = round(20 * rand(5, 5)) - 10 * ones (5, 5);
determ(1, i) = det(A);
end
determ' %list the determinants of 100 random matrices
%repeat for 1000 matrices
determ = zeros(1, 1000);
for i = 1 : 1000
A = round(20 * rand(5, 5)) - 10 * ones (5, 5);
determ(1, i) = det(A);
end
fprintf('For 1000 matrices, the minimum absolute determinant value is %f ', min(abs(determ)))
=========
output
======
ans =
-18017.000000000004
28323.000000000000
-55116.000000000015
63492.000000000015
-738.000000000000
43110.000000000007
13680.000000000002
41380.999999999993
32059.000000000007
14144.000000000002
-1762.000000000000
52806.000000000007
-8598.999999999998
19312.000000000004
-9280.000000000002
132974.000000000000
38607.000000000000
69363.999999999985
36888.000000000007
-39010.000000000000
-19865.999999999993
22175.999999999989
-17249.999999999978
-10384.000000000002
19054.000000000000
200955.000000000029
-24289.000000000000
83113.000000000000
54195.000000000022
-17833.000000000000
-27226.999999999993
-127691.999999999985
-36332.999999999993
21802.000000000004
-112.000000000018
9625.000000000000
-747.000000000001
26473.000000000004
-21086.000000000000
-2128.000000000001
119230.000000000044
-10850.000000000007
21168.000000000011
-35472.000000000015
29063.999999999993
-14742.000000000002
-34848.000000000007
-41153.999999999993
32995.999999999993
-34684.000000000000
21511.999999999989
-48469.000000000022
24864.000000000007
-18462.000000000000
-13366.000000000000
-61645.999999999985
-4862.000000000000
-92075.999999999985
-131682.000000000058
882.999999999999
28892.999999999996
4429.000000000002
-84767.999999999971
-62699.999999999993
17456.000000000004
-7956.000000000001
-24408.000000000000
110892.000000000044
19635.000000000000
-47454.000000000000
2684.000000000008
-55529.999999999993
26998.000000000015
-94711.000000000029
-71965.999999999985
-35189.000000000000
-4494.000000000005
-44261.999999999993
22623.999999999989
57594.000000000000
139380.000000000000
1719.999999999999
36431.999999999993
300.000000000000
78741.999999999985
3319.999999999998
245099.999999999913
30998.999999999996
-111930.000000000000
148077.999999999942
-69892.999999999985
54439.000000000015
-34018.000000000007
1888.000000000000
8514.000000000005
-7938.000000000001
-107092.999999999985
-57428.000000000007
120754.999999999971
-60267.999999999993
For 1000 matrices, the minimum absolute determinant value is 10.000000
?
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.