If each entry of a three by three matrix can either be a 0 or a 5, what is the largest determinant possible?
-
Welcome to MSE. You'll get a lot more help, and a lot fewer down votes, if you supply some context for your questions. What have you done so far, and where are are you stuck? – saulspatz Feb 25 '18 at 03:06
1 Answers
Consider your matrix as a binary array with nine entries but instead of $1$ you have $5$. This is a discrete problem. So simply you can write a computer code that produce whole its $2^9=512$ matrices which can be produce by $0 , 5$ and compare their determinants. In order to write the code you can produce $000000000-000000001-000000010-...$ change the value of $1$ by $5$ and separate these array as $3$ rows of the matrix. for example for the $000000001$ we have the matrix: $$ \begin{matrix} 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 5 \\ \end{matrix} $$ By doing this whole of the possible value of the matrix will be produced. in each step calculate the determinant of the matrix and save these in a vector. at the end find the maximum of the vector and the step(s) it has happened and reproduce the matrix. By doing this you will find that the maximum is $$max=250$$ which happen at three matrices: $$ \begin{matrix} 0 & 5 & 5 \\ 5 & 0 & 5 \\ 5 & 5 & 0 \\ \end{matrix} $$ $$ \begin{matrix} 5 & 0 & 5 \\ 5 & 5 & 0 \\ 0 & 5 & 5 \\ \end{matrix} $$ $$ \begin{matrix} 5 & 5 & 0 \\ 0 & 5 & 5 \\ 5 & 0 & 5 \\ \end{matrix} $$ Here you can see the matlab code: clear;clc;$ $ s=zeros(1,512); for i=0:511 a=dec2base(i,2); a=double(a)-48*ones(1,length(a)); for j=1:8 if length(a)<9 a=[0 a]; end end B=[a(1:3);a(4:6);a(7:9)]; for k=1:3 for l=1:3 if B(k,l)==1 B(k,l)=5; end end end s(i+1)=det(B); end MAX=max(s) Ja=find(s==MAX); i=Ja(1)-1; a=dec2base(i,2); a=double(a)-48*ones(1,length(a)); for j=1:8 if length(a)<9 a=[0 a]; end end B=[a(1:3);a(4:6);a(7:9)]; for k=1:3 for l=1:3 if B(k,l)==1 B(k,l)=5; end end end B i=Ja(2)-1; a=dec2base(i,2); a=double(a)-48*ones(1,length(a)); for j=1:8 if length(a)<9 a=[0 a]; end end B=[a(1:3);a(4:6);a(7:9)]; for k=1:3 for l=1:3 if B(k,l)==1 B(k,l)=5; end end end B i=Ja(3)-1; a=dec2base(i,2); a=double(a)-48*ones(1,length(a)); for j=1:8 if length(a)<9 a=[0 a]; end end B=[a(1:3);a(4:6);a(7:9)]; for k=1:3 for l=1:3 if B(k,l)==1 B(k,l)=5; end end end B
- 161
- 4