I hope you dont mind that I respond to the original question about the
6x6 matrix.  As I understand it, all elements have to be either 1 or
-1, and product of *every* row and *every* column is 1  => how many
arrangements?

Now a bunch of you seem to think    (nxn)  => 2^((n-1)^2)   gives the
answer, so I'm trying to give it a chance, but already I'm kinda
skeptical that the answer is over 33million .   I wrote a brute force
which I'm trying to test for small case  3x3.  Using the formula you
guys gave,   2^(2^2) == 2^(4) == 16.   My program outputs, for n=3:

[[-1, -1, nil], [-1, -1, nil], [nil, nil, nil]]
[[-1, nil, -1], [-1, nil, -1], [nil, nil, nil]]
[[nil, -1, -1], [nil, -1, -1], [nil, nil, nil]]
[[-1, -1, nil], [nil, nil, nil], [-1, -1, nil]]
[[-1, nil, -1], [nil, nil, nil], [-1, nil, -1]]
[[nil, -1, -1], [nil, nil, nil], [nil, -1, -1]]
[[nil, nil, nil], [-1, -1, nil], [-1, -1, nil]]
[[nil, nil, nil], [-1, nil, -1], [-1, nil, -1]]
[[nil, nil, nil], [nil, -1, -1], [nil, -1, -1]]
10

The nil is just a null value;  imagine it is the 1 in the problem.
The program gives 9 cases, and implied is the "empty set" case, which
would be all nil's, or in our case, contains no  -1's, but instead has
all 1's.  So together it gives 10.   I even drew up the cases so that
it would be easier to see -->  http://i56.tinypic.com/24b5kiq.png

So first I will ask, where are the missing 6 cases?

For each row, we choose 0, 2, 4, ...n    -1's  to fill it with.     If
we fill, for example, matrix[0][0]  and matrix[0][1] with  -1 , to
satisfy the first row requirement, this actually determines the
columns, do not forget.    If we use this example for the simple 3x3
case, it is clearly seen that the first two columns must have
*exactly* one more -1  to fulfill the even requirement  (my output
shows this in case #1 and  case #4).

I think the formula does not cut enough of these intersections off.
I'm getting 962  for  n=6  , so ....   lol

icy`

On Aug 26, 10:34 am, Naren s <sweetna...@gmail.com> wrote:
> varun: can u explain it little further..
>
> On Wed, Aug 10, 2011 at 7:49 PM, varun pahwa <varunpahwa2...@gmail.com>wrote:
>
>
>
>
>
>
>
>
>
> > make two ropes 50m and 100 meter. make a loop kind of thing with that now
> > you have two 50 mtr ropes so get down to 100 mtr point and tie loop rope in
> > downward now cut the loop at 100 mtr you have 100 mtr rope then move down
> > with the help of that. i hope i am clear.
>
> > On Mon, Aug 8, 2011 at 1:52 PM, Shachindra A C <sachindr...@gmail.com>wrote:
>
> >> tie the rope to the peg and hold the rope at a little less than 100m
> >> point. Then jump.
>
> >> On Mon, Aug 8, 2011 at 1:19 PM, Himanshu Srivastava <
> >> himanshusri...@gmail.com> wrote:
>
> >>> @Dave oh i thought some logical concept willl be applied in that
> >>> case.......it is ok!!!
> >>> thanks:)
>
> >>> On Fri, Aug 5, 2011 at 1:47 AM, Dave <dave_and_da...@juno.com> wrote:
>
> >>>> @Himanshu: That is easy for any boy scout. :-) Tie the rope at the top
> >>>> of the tower. Then tie a sheepshank knot of a comfortable length in
> >>>> the rope and cut the middle strand inside the knot. Climb down the
> >>>> rope to the peg and tie the other end of the rope onto the peg. Then,
> >>>> while standing on or hanging from the peg, shake the upper rope to
> >>>> release the sheepshank knot. The upper end will fall down and you can
> >>>> climb the rest of the way down.
>
> >>>> Dave
>
> >>>> On Aug 4, 1:50 pm, Himanshu Srivastava <himanshusri...@gmail.com>
> >>>> wrote:
> >>>> > suppose u tie the rope at 200mt height and now climb down to 100m
> >>>> > height....then u tie the rope at that point then how will you open the
> >>>> rope
> >>>> > at point above 200mt where u have tied it earlier
>
> >>>> > On Thu, Aug 4, 2011 at 11:15 PM, mohit verma <mohit89m...@gmail.com>
> >>>> wrote:
> >>>> > > can't we tie the rope where we are standing (at height of 200
> >>>> meter)?
>
> >>>> > > On Thu, Aug 4, 2011 at 10:26 PM, neeraja marathe <
> >>>> > > neeraja.marath...@gmail.com> wrote:
>
> >>>> > >> this was the puzzle asked to me in NVIDIA interview:
> >>>> > >> you are standing on top of a tower of ht 200 mt. .At 100 mt. ht .
> >>>> from
> >>>> > >> bottom of tower there is a peg where u can tie a rope. You have a
> >>>> rope
> >>>> > >> of length 150 mt. with you and using this rope you have to get down
> >>>> > >> the tower. you can not jump or there is nobody to help you. how
> >>>> will u
> >>>> > >> get down the tower??
>
> >>>> > >> --
> >>>> > >> 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.
>
> >>>> > > --
> >>>> > > ........................
> >>>> > > *MOHIT VERMA*
>
> >>>> > >  --
> >>>> > > 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.-Hide quoted text -
>
> >>>> > - Show quoted text -
>
> >>>> --
> >>>> 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.
>
> >>>  --
> >>> 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.
>
> >> --
> >> Regards,
> >> Shachindra A C
>
> >>  --
> >> 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.
>
> > --
> > Varun Pahwa
> > B.Tech (IT)
> > 7th Sem.
> > Indian Institute of Information Technology Allahabad.
> > Ph : 09793899112
> > Official Email :: rit2008...@iiita.ac.in
> > Another Email :: varunpahwa.ii...@gmail.com
>
> > People who fail to plan are those who plan to fail.
>
> >  --
> > 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.
>
> --
> *Narayanan S,*
> B.E., C.S.E., (final year),
> College Of Engineering Guindy,
> Anna University,
> Chennai-25.

-- 
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