Yes Glenn, it really depends on what kind of extremum you are looking for.
There are different possibilities.
1. Your case belongs to the class of so-called frequent itemsets task in
Data Mining. (One of the most prolific authors is M.Zaki)
Sometimes it is useful to transpose the data table (|: t) before acting
with Oleg's brilliant program.
2. In general data analysis people are more interested in finding
so-called dicliques (R.Haralick) or bicliques. That is the k*j has to be
maximal, not k or j.
3. In the graph theory the second case is more interesting because you can
find for a symmetric adjacency graph the maximum clique that way.
(In our example the 5*5 clique)
4. Sometimes you are more interested in an general reordination
(reordering) of your data table so that you will see the hidden systematic
parts of your data (graph or data table visualization)
All those tasks belong to the NP class and every effective algorithm
would be of interest.
With best regards Leo
> If I'm not mistaken, your combination would only match 5 columns,
> whereas Oleg's example matches 6, which is what I want.
> -- Glenn
>
>
> Leo Vo~handu wrote:
>> Sorry, but j has to be 0 2 3 5 6, exactly as k
>> Leo
>>
>>
>>
>>
>>> Wow!!! That is very impressive! I tried pulling apart the line (by
>>> executing tiny bits at a time and displaying the line in boxed
>>> format), and I still don't fully understand it yet, but I was able to
>>> tweak it slightly to get it to produce a result... Here's my minor
>>> tweak:
>>>
>>> t
>>> 1 0 1 1 1 1 1 0
>>> 0 1 1 1 1 0 1 1
>>> 1 1 1 1 0 1 1 0
>>> 1 1 1 1 0 1 1 1
>>> 1 1 0 0 1 1 1 1
>>> 1 0 1 1 1 1 1 1
>>> 1 1 1 1 1 1 1 0
>>> 0 1 0 1 1 0 1 1
>>> ]j=. i,I.s{~i=.(i.>./)@:(+/) s=.(= >./@,)(-.=i.1{$t)*.+/@:="1/~t
>>> 0 5 6
>>> ]k=. I.*./ j{t
>>> 0 2 3 4 5 6
>>>
>>> Thanks a bunch, Oleg! Hopefully before my next birthday I will have
>>> figured out what you just wrote. :-)
>>> -- Glenn
>>>
>>> Oleg Kobchenko wrote:
>>>
>>>> If you mean length error, that's an exercise to the reader.
>>>>
>>>>
>>>> --- Leo Vo~handu <[EMAIL PROTECTED]> wrote:
>>>>
>>>>
>>>>
>>>>> Hei, Oleg,
>>>>> try your J-line with a table
>>>>> 1 0 1 1 1 1 1 0
>>>>> 0 1 1 1 1 0 1 1
>>>>> 1 1 1 1 0 1 1 0
>>>>> 1 1 1 1 0 1 1 1
>>>>> 1 1 0 0 1 1 1 1
>>>>> 1 0 1 1 1 1 1 1
>>>>> 1 1 1 1 1 1 1 0
>>>>> 0 1 0 1 1 0 1 1
>>>>>
>>>>> Leo
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Sorry, not quite. Here it is:
>>>>>>
>>>>>> ]j=. i,I.s{~i=.(i.>./)@:(+/) s=.(= >./@,)(-.=i.6)*.+/@:="1/~ t
>>>>>> 0 3
>>>>>> ]k=. I.*./ j{t
>>>>>> 1 2 5 7 8
>>>>>> (<j;k) { t
>>>>>> 1 1 1 1 1
>>>>>> 1 1 1 1 1
>>>>>>
>>>>>>
>>>>>> --- Oleg Kobchenko <[EMAIL PROTECTED]> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>> i,I.s{~i=.(i.>./)@:(+/) s=.(= >./@,)(-.=i.6)*.+/@:="1/~ (#"1~
>>>>>>> (=>./)@:(+/)) t
>>>>>>> 0 3
>>>>>>>
>>>>>>> Are there more and interesting examples?
>>>>>>>
>>>>>>>
>>>>>>> --- "Glenn M. Lewis" <[EMAIL PROTECTED]> wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> I apologize for replying to my own message, but I just realized
>>>>>>>> that
>>>>>>>>
>>>>>>>>
>>>>>>> I must choose to either maximize the columns or maximize the
>>>>>>> rows... not both. So let's say I wish to maximize the columns.
>>>>>>> It appears that the three tied answers are still valid.
>>>>>>>
>>>>>>>
>>>>>>>> Thanks again!
>>>>>>>> -- Glenn
>>>>>>>>
>>>>>>>> Glenn M. Lewis wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> Hi all!
>>>>>>>>>
>>>>>>>>> Say I have a table with shape 'm n' (m rows, n columns)
>>>>>>>>>
>>>>>>>>>
>>>>>>> populated
>>>>>>>
>>>>>>>
>>>>>>>>> with ones and zeros.
>>>>>>>>>
>>>>>>>>> Let's say I would like to create the largest table possible
>>>>>>>>> by
>>>>>>>>> selecting the most rows and the most columns where all
>>>>>>>>>
>>>>>>>>>
>>>>>>> intersections of said rows and columns consist of all ones.
>>>>>>>
>>>>>>>
>>>>>>>>> I'm having difficulties coming up with an expression that
>>>>>>>>> gives
>>>>>>>>>
>>>>>>>>>
>>>>>>> me
>>>>>>>
>>>>>>>
>>>>>>>>> two lists... one for the rows and one for the columns that
>>>>>>>>>
>>>>>>>>>
>>>>>>> 'selects' the rows/columns that would make up this maximal
>>>>>>> table.
>>>>>>>
>>>>>>>
>>>>>>>>> Wow... I probably didn't explain that very well. Let me
>>>>>>>>> try
>>>>>>>>>
>>>>>>>>>
>>>>>>> an
>>>>>>>
>>>>>>>
>>>>>>>>> example.
>>>>>>>>>
>>>>>>>>> t =. 6 10 $ 0 1 1 0 0 1
>>>>>>>>> t
>>>>>>>>> 0 1 1 0 0 1 0 1 1 0
>>>>>>>>> 0 1 0 1 1 0 0 1 0 1
>>>>>>>>> 1 0 0 1 0 1 1 0 0 1
>>>>>>>>> 0 1 1 0 0 1 0 1 1 0
>>>>>>>>> 0 1 0 1 1 0 0 1 0 1
>>>>>>>>> 1 0 0 1 0 1 1 0 0 1
>>>>>>>>>
>>>>>>>>> By inspection, it appears that one of three solutions is
>>>>>>>>>
>>>>>>>>>
>>>>>>> possible
>>>>>>>
>>>>>>>
>>>>>>>>> that all tie for the maximum-sized table of all-ones (in this
>>>>>>>>>
>>>>>>>>>
>>>>>>> case, a shape '2 5' table.
>>>>>>>
>>>>>>>
>>>>>>>>> rows 0 and 3 with columns 1,2,5,7,8 or in J:
>>>>>>>>>
>>>>>>>>> (< 0 3 ; 1 2 5 7 8) { t
>>>>>>>>> 1 1 1 1 1
>>>>>>>>> 1 1 1 1 1
>>>>>>>>>
>>>>>>>>> or
>>>>>>>>>
>>>>>>>>> (< 1 4 ; 1 3 4 7 9) { t
>>>>>>>>> 1 1 1 1 1
>>>>>>>>> 1 1 1 1 1
>>>>>>>>>
>>>>>>>>> or
>>>>>>>>>
>>>>>>>>> (< 2 5 ; 0 3 5 6 9) { t
>>>>>>>>> 1 1 1 1 1
>>>>>>>>> 1 1 1 1 1
>>>>>>>>>
>>>>>>>>> The problem I'm having is coming up with these lists
>>>>>>>>> algorithmically...
>>>>>>>>>
>>>>>>>>> Any ideas on how to solve this?
>>>>>>>>>
>>>>>>>>> Thanks!
>>>>>>>>> -- Glenn Lewis
>>>>>>>>>
>>>>>>>>> ----------------------------------------------------------------------
>>>>>>>>>
>>>>>>>>>
>>>>>>> For information about J forums see
>>>>>>> http://www.jsoftware.com/forums.htm
>>>>>>>
>>>>>>>
>>>>>>>> ----------------------------------------------------------------------
>>>>>>>>
>>>>>>>>
>>>>>>> For information about J forums see
>>>>>>> http://www.jsoftware.com/forums.htm
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ____________________________________________________________________________________
>>>>>>> Food fight? Enjoy some healthy debate
>>>>>>> in the Yahoo! Answers Food & Drink Q&A.
>>>>>>> http://answers.yahoo.com/dir/?link=list&sid=396545367
>>>>>>> ----------------------------------------------------------------------
>>>>>>> For information about J forums see
>>>>>>> http://www.jsoftware.com/forums.htm
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> ____________________________________________________________________________________
>>>>>> Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s
>>>>>> user panel and lay it on us.
>>>>>> http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
>>>>>>
>>>>>> ----------------------------------------------------------------------
>>>>>> For information about J forums see
>>>>>> http://www.jsoftware.com/forums.htm
>>>>>>
>>>>>>
>>>>> ----------------------------------------------------------------------
>>>>> For information about J forums see
>>>>> http://www.jsoftware.com/forums.htm
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> ____________________________________________________________________________________
>>>> Sick sense of humor? Visit Yahoo! TV's
>>>> Comedy with an Edge to see what's on, when.
>>>> http://tv.yahoo.com/collections/222
>>>> ----------------------------------------------------------------------
>>>> For information about J forums see
>>>> http://www.jsoftware.com/forums.htm
>>>>
>>>>
>>>>
>>>>
>>> ----------------------------------------------------------------------
>>> For information about J forums see
>>> http://www.jsoftware.com/forums.htm
>>>
>>
>>
>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>>
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm