numtt=: 3 : '((,~ 0:) + (, 0:)) ^: (2^y) 1’

calculates, for the possible truth-tables of y variables a list of the
those which have 0 1s, 1 1, 2 1s …..

e.g.

    numtt 2
1 4 6 4 1

numtt just produces the appropriate row of Pascal’s Triangle.
It’s a trivial little verb, but I’m bothered by the fact that
I can’t see a way to make it tacit.

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to