wu :: forums
« wu :: forums - binary matrix transformation »

Welcome, Guest. Please Login or Register.
Nov 24th, 2024, 8:50am

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   cs
(Moderators: william wu, Eigenray, ThudnBlunder, SMQ, Icarus, Grimbal, towr)
   binary matrix transformation
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: binary matrix transformation  (Read 3298 times)
ic10503
Junior Member
**





   


Gender: male
Posts: 57
binary matrix transformation  
« on: Sep 22nd, 2009, 10:39am »
Quote Quote Modify Modify

How do i convert a binary matrix(containing only 0s and 1s) to a complete zero matrix? Only operations allowed are u can toggle a whole row or a whole column. The conversion has to be done in minimum number of steps(a step is defined as toggling a whole row or whole column).
IP Logged
ic10503
Junior Member
**





   


Gender: male
Posts: 57
Re: binary matrix transformation  
« Reply #1 on: Sep 23rd, 2009, 1:59am »
Quote Quote Modify Modify

any repliesHuh??/
IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: binary matrix transformation  
« Reply #2 on: Sep 23rd, 2009, 2:31am »
Quote Quote Modify Modify

If both dimensions of the matrix are even, and the number of 1s is odd, then it's impossible. Because every step conserves parity.
 
In general, you don't need to toggle the same row or column more than once. So you can pick a column (or row), and split into the cases where you toggle it and one where you don't. And then toggle all the rows (or columns) that have a 1 in that column (row). After that you can only toggle rows (columns), because otherwise you mess up the first row (column).  Pick any column (row) to decide which remaining rows (columns) need to be toggled, and you're done.
IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
Eigenray
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 1948
Re: binary matrix transformation  
« Reply #3 on: Sep 23rd, 2009, 3:51am »
Quote Quote Modify Modify

As towr points out, there are at most 2 solutions for any configuration.  But given any solution, toggling every row and every column gives another solution.  Therefore any configuration has either no solutions, or exactly two solutions, which are complements of each other.  So one can simply assume, WLOG, that the first column is not flipped and then deduce all the moves; if this gives a solution with more than n moves, take the complement.  But only 22n-1 out of 2n^2 configuration will have solutions at all.
IP Logged
Grimbal
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 7527
Re: binary matrix transformation  
« Reply #4 on: Sep 24th, 2009, 7:15am »
Quote Quote Modify Modify

on Sep 23rd, 2009, 2:31am, towr wrote:
... (working solution) ...

And if that doesn't solve it, nothing does.  I.e. if that doesn't work, then there is no solution.
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board