Pascal, you wondered what the code was about. It comes from combinations in probability. There are 32 row you can arrange two different colors of beads so they are unique from left to right. If a 1 is a blue bead, then there can be 0 1 2 3 4 5 blue beads in each row. However there are 1 5 10 10 5 1 of each of the numbers. (In this case 10 ways for 2 of 5 to be blue) This happens to be a row in Pascal's Triangle! (any relation?)
Linda -----Original Message----- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Raul Miller Sent: Saturday, November 28, 2015 1:29 PM To: Programming forum Subject: Re: [Jprogramming] dyadic J On Sat, Nov 28, 2015 at 1:10 PM, 'Pascal Jasmin' via Programming <programm...@jsoftware.com> wrote: > tcr=: [ ((= +/"1) # ]) #:@i.@^ > > The only ambivalent verb in this expression is ^ . Note that there is no meaningful distinction in the behavior of this verb if you replace (^) with ([: : ^). Also, I should note that Lippu Esa had posted a roughly equivalent expression long before I posted mine (http://jsoftware.com/pipermail/programming/2015-November/043384.html). (I hadn't seen it when I posted, but that is a different story...). Thanks, -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm