combinatorial operator

Let it all hang out

combinatorial operator

PostPosted by drab » Thu May 04, 2017 11:52 am

This is very cool stuff.

I'm not crazy about the syntax, but I appreciate the problem of needing to use 3 arguments.

So I usually prefer to use it like this ...

(⍳7)∘.{110‼⍺ ⍵} ⍳11
1 2 3 4 5 6 7 8 9 10 11
0 2 6 12 20 30 42 56 72 90 110
0 0 6 24 60 120 210 336 504 720 990
0 0 0 24 120 360 840 1680 3024 5040 7920
0 0 0 0 120 720 2520 6720 15120 30240 55440
0 0 0 0 0 720 5040 20160 60480 151200 332640
0 0 0 0 0 0 5040 40320 181440 604800 1663200

Then it's a "regular" dyadic function.
drab
 
Posts: 295
Joined: Thu Oct 09, 2014 6:23 am

Re: combinatorial operator

PostPosted by forummaster » Thu May 04, 2017 12:54 pm

drab wrote:This is very cool stuff.

I'm not crazy about the syntax, but I appreciate the problem of needing to use 3 arguments.

So I usually prefer to use it like this ...

(⍳7)∘.{110‼⍺ ⍵} ⍳11
1 2 3 4 5 6 7 8 9 10 11
0 2 6 12 20 30 42 56 72 90 110
0 0 6 24 60 120 210 336 504 720 990
0 0 0 24 120 360 840 1680 3024 5040 7920
0 0 0 0 120 720 2520 6720 15120 30240 55440
0 0 0 0 0 720 5040 20160 60480 151200 332640
0 0 0 0 0 0 5040 40320 181440 604800 1663200

Then it's a "regular" dyadic function.
I'm glad you like the idea. There's nothing to say we can't do both syntaxes, although that would look a little odd.

The reason I prefer the monadic derived function syntax is that it requires one fewer set of parentheses, and as you point out the dyadic derived function is easily constructed from the monadic case.
forummaster
 
Posts: 555
Joined: Wed Jan 23, 2013 1:00 pm

Re: combinatorial operator

PostPosted by drab » Thu May 04, 2017 2:19 pm

How about making it a dyadic function that requires an "axis", which is the function number ...

L ‼[f] R

Then, you would not need parens except for nested operators ...

(⍳7) ∘.(‼[110]) ⍳11
1 2 3 4 5 6 7 8 9 10 11
0 2 6 12 20 30 42 56 72 90 110
0 0 6 24 60 120 210 336 504 720 990
0 0 0 24 120 360 840 1680 3024 5040 7920
0 0 0 0 120 720 2520 6720 15120 30240 55440
0 0 0 0 0 720 5040 20160 60480 151200 332640
0 0 0 0 0 0 5040 40320 181440 604800 1663200
drab
 
Posts: 295
Joined: Thu Oct 09, 2014 6:23 am

Re: combinatorial operator

PostPosted by drab » Thu May 04, 2017 4:34 pm

And, using the bracket notation, there would less advantage to jamming together the 3 parts of the function descriptor.

It could be a vector of different lengths, and the individual elements could even have default values.

I suggest this arrangement ...

L [flag distinctballs distinctboxes capacity] R

The descriptor vector could have length 0, 1, 2, 3, or 4.

All elements for length < 4 could default to 0, like 4↑A .
drab
 
Posts: 295
Joined: Thu Oct 09, 2014 6:23 am

Re: combinatorial operator

PostPosted by drab » Fri May 05, 2017 4:23 am

Also ...

In the 12-fold way, there are 3 important choices for the capacity parameter.

But there could be a further generalization by splitting the capacity parameter into 2 parameters : atleast,atmost.

In these terms, the current 3 choices mean:
0 -- 0,1
1 -- 0,∞
2 -- 1,∞

But there are many other possibilities for the 2 parameters, requiring only that atleast ≤ atmost.
For example 2,4 means a capacity of 2 or 3 or 4.
There are lots of degenerate cases, and the individual degeneracy depends on the values of L and R.
But there are some potentially interesting possibilities when atleast ≤ L ≤ atmost ≤ R.

There is a minor implementation complication, since there is actually no infinite integer value.
But an atmost value of 0 could be used to mean atmost = ∞ .
Zero might even be the most common choice, and it is also what your get if you use 5↑f to get the default values.
drab
 
Posts: 295
Joined: Thu Oct 09, 2014 6:23 am

Re: combinatorial operator

PostPosted by forummaster » Sat May 06, 2017 2:47 am

drab wrote:Also ...

In the 12-fold way, there are 3 important choices for the capacity parameter.

But there could be a further generalization by splitting the capacity parameter into 2 parameters : atleast,atmost.

In these terms, the current 3 choices mean:
0 -- 0,1
1 -- 0,∞
2 -- 1,∞

But there are many other possibilities for the 2 parameters, requiring only that atleast ≤ atmost.
For example 2,4 means a capacity of 2 or 3 or 4.
There are lots of degenerate cases, and the individual degeneracy depends on the values of L and R.
But there are some potentially interesting possibilities when atleast ≤ L ≤ atmost ≤ R.

There is a minor implementation complication, since there is actually no infinite integer value.
But an atmost value of 0 could be used to mean atmost = ∞ .
Zero might even be the most common choice, and it is also what your get if you use 5↑f to get the default values.

It's natural to want to extend a good idea and there have been several other attempts

* Kenneth Bogart has a Twentyfold Way (his tables are incomplete -- that is, he doesn't have a Combinatorial Algorithm to back up each of his twenty ways)
* Robert Proctor has a Thirtyfold Way (this URL is invalid: I had to go to the WayBack machine to find a copy -- if you're interested, I can email mine)

The idea behind the Twelvefold Way is that the artifice of Balls in Boxes provides a framework to translate the 2x2x3 array of choices into fundamental Combinatorial Algorithms. Expanding the Capacity choices beyond At Most 1, Unrestricted, and At Least 1, should be accompanied by some other Combinatorial Algorithms to which those new choices map. To some extent, this is what Proctor has done with a category a[i] Batches which contain i items. I mentioned Proctor's paper in my original paper on the topic (in the section on Future Work), but decided at least for the initial release to limit the breadth and depth to just Rota's ideas.

BTW, although infinity is a floating point number, there's nothing wrong with using 1 ∞. It'll be recognized correctly for what it is.
forummaster
 
Posts: 555
Joined: Wed Jan 23, 2013 1:00 pm

Re: combinatorial operator

PostPosted by forummaster » Sat May 06, 2017 12:28 pm

Here is the link to Proctor's Thirtyfold Way paper:

http://web.archive.org/web/200609010749 ... oldWay.pdf
forummaster
 
Posts: 555
Joined: Wed Jan 23, 2013 1:00 pm


Return to Open Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron