We know that any magic square matrix of odd order is not singular. When each element of the matrix is subtracted by the sum-average of the total elements, then this perturbed matrix becomes singular, and the determinant of the resulted matrix is zero. That is,
det(magic(n)-ones(n)*((1+n*n)/2)) = 0, for any odd n.
Can anyone help me the proof or find literture in this subject?
No products are associated with this question.
I don't think details are required since
is changed into an antisymmetric matrix, any such A matrix must satisfy (basic math.. etc)
det(A) = -1^n * det(A)
since n is odd, det(A) must be zero (thus, A is singular). Changing A from magic(n) to (magic(n)-ones(n)*((1+n*n)/2) ) as mentioned in the question is enough to destroy the symmetry of A.
Yet, since this is too basic, and it works the same for magic(n) with n is odd or even, (also, produces antisymmetric), I'm afraid you already know this. I tried (quickly, to be honest) other means like the nice arguments above, but didn't got anything useful so I thought to share, it might help. Regards.
The row-sum, column-sum and diag-sum of a magic square are all the same, and the magic square uses all the integeres 1:n^2. Thus, the sum of all elements must be n^2*(n^2+1)/2, and each row, column, diag sum must be n*(n^2+1)/2.
Now look at what you wrote, multiply it from the right by ones(n,1), and you'll see that you will get zero. Voila, thus the matrix is singular.
I have already accepted the expected simple answer from Ahmed A Selman, so I would like to conclude this "Question-Answer" contribution.
Also I would like to thank Walter Roberson, Matt J and Jonathan Epperl for the further extensive discussion related to the subject.
It gives me the great opportunity to find the interesting result unexpectedly. Hope anyone can see it.
For any n x n non-singular square matrix A, I can make it singular by perturbing the same amount to each of the matrix elements. That is
det(A-ones(n)/sum(sum(inv(A))) == 0
I would like to extend "the making a matrix singular" further to include the perturbation of any single element, any row or coulumn elements, or even the entire matrix elements in the prescribed distribution. Please watch my contribution in MATLAB Files Exchange in the near future.
For now, please try the followings:
for n=1:9, A=rand(n); P=A-1/sum(sum(inv(A))); detP=det(P); n,A,P,detP, end;
Feng Cheng Chang 04/06/2013