superprismatic Posted September 6, 2011 Report Share Posted September 6, 2011 (edited) How many N×N matrices are there which satisfy the following? 1. All entries are non-negative integers 2. Every row and every column sums to 3 3. There are no more than two non-zero entries in any row and any column. Find the number of N×N matrices satisfying the conditions as a function of N. Edited September 6, 2011 by superprismatic : for clarification Quote Link to comment Share on other sites More sharing options...
0 bonanova Posted September 6, 2011 Report Share Posted September 6, 2011 Several. N=1: 3 N=2. 1 2 2 1 And its symmetrical equivalents. N=3. 1 2 0 2 0 1 0 1 2 And its symmetrical equivalents. N=4. 1 2 0 0 0 1 2 0 0 0 1 2 2 0 0 1 I guess you could keep going on like that.. Quote Link to comment Share on other sites More sharing options...
0 CaptainEd Posted September 6, 2011 Report Share Posted September 6, 2011 (edited) 3 0 0 3 2 1 0 0 2 1 1 0 2 3 0 0 0 3 0 0 0 3 2 1 0 0 0 2 1 0 0 0 2 1 1 0 0 2 2 0 1 0 0 2 0 1 1 0 2 0 0 1 0 2 Edited September 6, 2011 by CaptainEd Quote Link to comment Share on other sites More sharing options...
0 bonanova Posted September 6, 2011 Report Share Posted September 6, 2011 Some of those have more than 2 non-zero elements per row and column. But I think there is no limit, based on the model of those that don't. Quote Link to comment Share on other sites More sharing options...
0 CaptainEd Posted September 6, 2011 Report Share Posted September 6, 2011 Yes, once I learned to read English, I saw and removed the ones with 3 1's per row. But, it does seem that you could make N as large as you want with a 2 and a 1 in each row, doesn't it? (Or even a single 3). Maybe I still don't understand the OP. Quote Link to comment Share on other sites More sharing options...
0 bonanova Posted September 6, 2011 Report Share Posted September 6, 2011 I think so. Quote Link to comment Share on other sites More sharing options...
0 superprismatic Posted September 6, 2011 Author Report Share Posted September 6, 2011 Yes, once I learned to read English, I saw and removed the ones with 3 1's per row. But, it does seem that you could make N as large as you want with a 2 and a 1 in each row, doesn't it? (Or even a single 3). Maybe I still don't understand the OP. Sorry, I made a clarification on the OP. What I'm looking for is the number of N×N matrices satisfying the conditions as a function of N. Quote Link to comment Share on other sites More sharing options...
0 EventHorizon Posted September 6, 2011 Report Share Posted September 6, 2011 (N!)2 I looked at a number of approaches to the problem, but it turned out to be much simpler than I initially thought (assuming I'm correct in my thinking). First, take the identity matrix and scramble it while keeping a 1 in each row and column. There are N! of these since it is equivalent to choosing the column for the top 1, then choosing from the remaining columns for the second, etc. Second, take a matrix with 2's along the diagonal and zeros elsewhere (e.g., 2I, where I is the identity matrix) and do the same thing. Again N! Now add element-wise each possibility of the first scramble to each possibility for the second, and you get (N!)2 possibilities. And just because I haven't written any proofs recently, here's an attempt. Let me know if I mess up somewhere. Do all these satisfy the constraints? (my set is a subset of the solution set) 1. All entries are non-negative integers The element wise addition will only result in 0's to 3's 2. Every row and every column sums to 3 Element-wise adding a matrix that had every row/column add to 1 to one that every row/column added to 2 = a matrix with every row/column adding to 3. 3. There are no more than two non-zero entries in any row and any column. Similar reasoning to 2. Since I added element-wise two matrices that had at 1 non-zero element in each row/column, you cannot have an element-wise sum with more than two non-zero elements in a given row/column. Does this method miss any? (the solution set is a subset of my set) Assume I miss matrix M. Deconstruct it into two matrices M1 and M2 by the following: -If there is a 1 in M, put a 1 in the corresponding position in M1 -If there is a 2 in M, put a 2 in the corresponding position in M2 -If there is a 3 in M, put a 1 in the corresponding position in M1 and a 2 in the corresponding position in M2 There will be a 1 in each row/column in M1 since M must have a 3 or both a 1 and a 2 in each row/column since there can only be at most two non-zero elements that sum to 3. This means M1 should have exactly one 1 in each column and row and zeros elsewhere, and similarly for M2 but with 2's. Therefore M1 should have been included in the scrambling of the identity matrix, and M2 should have been included in the scrambling of the 2I matrix, so my method shouldn't have missed it and we reach a contradiction. Since my set is a subset of the solution set, and the solution set is a subset of my set, they must be the same set. Quote Link to comment Share on other sites More sharing options...
0 superprismatic Posted September 7, 2011 Author Report Share Posted September 7, 2011 (N!)2 I looked at a number of approaches to the problem, but it turned out to be much simpler than I initially thought (assuming I'm correct in my thinking). First, take the identity matrix and scramble it while keeping a 1 in each row and column. There are N! of these since it is equivalent to choosing the column for the top 1, then choosing from the remaining columns for the second, etc. Second, take a matrix with 2's along the diagonal and zeros elsewhere (e.g., 2I, where I is the identity matrix) and do the same thing. Again N! Now add element-wise each possibility of the first scramble to each possibility for the second, and you get (N!)2 possibilities. And just because I haven't written any proofs recently, here's an attempt. Let me know if I mess up somewhere. Do all these satisfy the constraints? (my set is a subset of the solution set) 1. All entries are non-negative integers The element wise addition will only result in 0's to 3's 2. Every row and every column sums to 3 Element-wise adding a matrix that had every row/column add to 1 to one that every row/column added to 2 = a matrix with every row/column adding to 3. 3. There are no more than two non-zero entries in any row and any column. Similar reasoning to 2. Since I added element-wise two matrices that had at 1 non-zero element in each row/column, you cannot have an element-wise sum with more than two non-zero elements in a given row/column. Does this method miss any? (the solution set is a subset of my set) Assume I miss matrix M. Deconstruct it into two matrices M1 and M2 by the following: -If there is a 1 in M, put a 1 in the corresponding position in M1 -If there is a 2 in M, put a 2 in the corresponding position in M2 -If there is a 3 in M, put a 1 in the corresponding position in M1 and a 2 in the corresponding position in M2 There will be a 1 in each row/column in M1 since M must have a 3 or both a 1 and a 2 in each row/column since there can only be at most two non-zero elements that sum to 3. This means M1 should have exactly one 1 in each column and row and zeros elsewhere, and similarly for M2 but with 2's. Therefore M1 should have been included in the scrambling of the identity matrix, and M2 should have been included in the scrambling of the 2I matrix, so my method shouldn't have missed it and we reach a contradiction. Since my set is a subset of the solution set, and the solution set is a subset of my set, they must be the same set. That is a very clear proof of the correct function. Nice! Quote Link to comment Share on other sites More sharing options...
0 bonanova Posted September 7, 2011 Report Share Posted September 7, 2011 Bravo EH. Quote Link to comment Share on other sites More sharing options...
0 bushindo Posted September 7, 2011 Report Share Posted September 7, 2011 (N!)2 I looked at a number of approaches to the problem, but it turned out to be much simpler than I initially thought (assuming I'm correct in my thinking). First, take the identity matrix and scramble it while keeping a 1 in each row and column. There are N! of these since it is equivalent to choosing the column for the top 1, then choosing from the remaining columns for the second, etc. Second, take a matrix with 2's along the diagonal and zeros elsewhere (e.g., 2I, where I is the identity matrix) and do the same thing. Again N! Now add element-wise each possibility of the first scramble to each possibility for the second, and you get (N!)2 possibilities. And just because I haven't written any proofs recently, here's an attempt. Let me know if I mess up somewhere. Do all these satisfy the constraints? (my set is a subset of the solution set) 1. All entries are non-negative integers The element wise addition will only result in 0's to 3's 2. Every row and every column sums to 3 Element-wise adding a matrix that had every row/column add to 1 to one that every row/column added to 2 = a matrix with every row/column adding to 3. 3. There are no more than two non-zero entries in any row and any column. Similar reasoning to 2. Since I added element-wise two matrices that had at 1 non-zero element in each row/column, you cannot have an element-wise sum with more than two non-zero elements in a given row/column. Does this method miss any? (the solution set is a subset of my set) Assume I miss matrix M. Deconstruct it into two matrices M1 and M2 by the following: -If there is a 1 in M, put a 1 in the corresponding position in M1 -If there is a 2 in M, put a 2 in the corresponding position in M2 -If there is a 3 in M, put a 1 in the corresponding position in M1 and a 2 in the corresponding position in M2 There will be a 1 in each row/column in M1 since M must have a 3 or both a 1 and a 2 in each row/column since there can only be at most two non-zero elements that sum to 3. This means M1 should have exactly one 1 in each column and row and zeros elsewhere, and similarly for M2 but with 2's. Therefore M1 should have been included in the scrambling of the identity matrix, and M2 should have been included in the scrambling of the 2I matrix, so my method shouldn't have missed it and we reach a contradiction. Since my set is a subset of the solution set, and the solution set is a subset of my set, they must be the same set. Clear and elegant as well. Good job! Quote Link to comment Share on other sites More sharing options...
0 CaptainEd Posted September 7, 2011 Report Share Posted September 7, 2011 I am boggled both by the interestingness of the problem and the clarity of the solution. Way to go! Quote Link to comment Share on other sites More sharing options...
Question
superprismatic
How many N×N matrices are there which satisfy the following?
1. All entries are non-negative integers
2. Every row and every column sums to 3
3. There are no more than two non-zero entries in any row and any column.
Find the number of N×N matrices satisfying the conditions as a function of N.
Edited by superprismatic: for clarification
Link to comment
Share on other sites
11 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.