If you fill the upper 5x5 submatrix in any way, the two conditions can
be met by setting the last element of each row to the product of the
first five elements of that row, and likewise with the columns. The
lower right element can be formed using either the product of the last
column or last row. They are certain to be the same because either one
is the product of all 25 elements of the upper submatrix. So the
question comes down to this:

How many ways can you fill the upper 5x5 submatrix?

As others have said, the answer is 2^((n-1)^2) or 33,545,432.

Don

On Jul 27, 11:57 pm, vetri <natarajananitha...@gmail.com> wrote:
> given a 6x6 matrix with all the elements as either 1 or -1.
> find the number of ways the elements can b arranged such that
>
> 1.the product of all elements of all columns is 1
> 2.the product of all elements of all rows is 1
>
> can u pls post the answer if u no...

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to