If A is a 3*3 matrix whose elements can be from the set {0,1,2,3}, then find the maximum value of determinant of A.
The maximum determinant is 54, from
0 3 3
3 0 3
3 3 0
lim=base2dec('333333333',4);
mx=0;
for n=1:lim
m=dec2base(n,4,9);
m=reshape(m,3,3)-'0';
if det(m)>mx
savem=m;
mx=det(m);
end
end
mx
savem
mx =
54
savem =
0 3 3
3 0 3
3 3 0
|
Posted by Charlie
on 2024-09-30 20:20:41 |