Brian
RE Boss has reminded us of 2 x: , but as for your requirement
of a boolean of 7 ones in 10, this does it randomly, though not
necessarily evenly:
+/7>10?10
1 0 1 0 1 1 1 1 1 0
If that's what you need, a tacit verb to do it is:
(>?~ )/@(2&x:)
as in
(>?~ )/@(2&x:)3r20
0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
Mike
Brian Schott wrote:
Here is a continuation of the previous question.
Once I know how to define ndfr, then I want to create a
binary mask from the result. For example if the I got the
result 4 5 from ndfr 4r5 then I could produce the following
mask (1 1 1 1 0), but I want the 1's and 0's more evenly
distributed, like 1 1 0 1 1.
(]{.#&[EMAIL PROTECTED])/4 5 NB. this produces an unbalanced result.
1 1 1 1 0
From 7r10 I would like one of the following results.
1 1 0 1 1 0 1 1 0 1
1 0 1 1 0 1 1 0 1 1
Ideas?
On Sun, 3 Feb 2008, Brian Schott wrote:
+ In the spirit of Real/Imaginary as follows, I am
+ looking for a verb ndfr to replace +. .
+ +. 2j3
+ 2 3
+
+ That is, I cannot remember how to get a result like
+ the following.
+
+ ndfr 2r3
+ 2 3
+
+ And by the way, in the spirit of the currentjdoc
+ chat thread, I have looked in the docs using keys like
+ rational and numerator.
+
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm