CUT u ;. n _ 1/2 _ CUT The fret 0{y (the leading item of y) marks the start of an interval of items of y; the phrase u;. 1 y applies u to each such interval. The phrase u;._1 y differs only in that frets are excluded from the result. In u;.2 and u;._2 the fret is the last item, and marks the ends of intervals.u;.0 y applies u to y after reversing y along each axis; it is equivalent to(0 _1 */$y) u;.0 y.The monads u;.3 and u;._3 apply u to tessellation by maximal cubes, that is, they are defined by their dyadic cases using the left argument ($$y)$<./$y. x u;.0 y applies u to a rectangle or cuboid of y with one vertex at the point in y indexed by v=.0{x, and with the opposite vertex determined as follows: the dimension is |1{x, but the rectangle extends back from v along any axis for which the index k{v is negative. Finally, the order of the selected items is reversed along each axis k for which k{1{x is negative. If x is a vector. it is treated as the matrix 0,:xThe frets in the dyadic cases 1, _1, 2, and _2 are determined by the 1s in the boolean argument x. The cases u;.3 and u;._3 yield (possibly overlapping) tessellations. x u;._3 y applies u to each complete rectangle of size |1{x beginning at integer multiples of (each item of) the movement vector 0{x. As in the monad u;.0, reversal occurs along each axis for which the size 1{x is negative. The degenerate case of a list x is equivalent to 1,:x, and therefore provides a complete tesselation of sizex . The case u;.3 differs in that shards o f length less than |1{x are included. <;.2 y=.'worlds on worlds ' õýýýýýýýÃýýýÃýýýýýýýÀ þworlds þon þworlds þ ÁýýýýýýýÂýýýÂýýýýýýýã ($;._2 y) ; (3 5 $ i.10) ; (+/ ;.1 (3 5 $ i.10)) õýÃýýýýýýýýýÃýýýýýýýýýýýÀ þ6þ0 1 2 3 4þ5 7 9 11 13þ þ2þ5 6 7 8 9þ0 1 2 3 4þ þ6þ0 1 2 3 4þ þ ÁýÂýýýýýýýýýÂýýýýýýýýýýýã x ; (x=. 1 _2,:_2 3) +;.0 i. 5 5 õýýýýýÃýýýýýýýýÀ þ 1 _2þ11 12 13þ þ_2 3þ 6 7 8þ ÁýýýýýÂýýýýýýýýã (y=. a. {~ (a. i. 'a') + i. 4 4);(a=. 1 1 ,: 2 2) õýýýýÃýýýÀ þabcdþ1 1þ þefghþ2 2þ þijklþ þ þmnopþ þ ÁýýýýÂýýýã (<;.3 y);(((($$y)$<./$y)<;.3 y));(a <;.3 y);<(a <;._3 y) õýýýýýýýýýýýýýýýÃýýýýýýýýýýýýýýýÃýýýýýýýýýýýýÃýýýýýýýýýýÀ þõýýýýÃýýýÃýýÃýÀþõýýýýÃýýýÃýýÃýÀþõýýÃýýÃýýÃýÀþõýýÃýýÃýýÀþ þþabcdþbcdþcdþdþþþabcdþbcdþcdþdþþþabþbcþcdþdþþþabþbcþcdþþ þþefghþfghþghþhþþþefghþfghþghþhþþþefþfgþghþhþþþefþfgþghþþ þþijklþjklþklþlþþþijklþjklþklþlþþÈýýÊýýÊýýÊý³þÈýýÊýýÊýý³þ þþmnopþnopþopþpþþþmnopþnopþopþpþþþefþfgþghþhþþþefþfgþghþþ þÈýýýýÊýýýÊýýÊý³þÈýýýýÊýýýÊýýÊý³þþijþjkþklþlþþþijþjkþklþþ þþefghþfghþghþhþþþefghþfghþghþhþþÈýýÊýýÊýýÊý³þÈýýÊýýÊýý³þ þþijklþjklþklþlþþþijklþjklþklþlþþþijþjkþklþlþþþijþjkþklþþ þþmnopþnopþopþpþþþmnopþnopþopþpþþþmnþnoþopþpþþþmnþnoþopþþ þÈýýýýÊýýýÊýýÊý³þÈýýýýÊýýýÊýýÊý³þÈýýÊýýÊýýÊý³þÁýýÂýýÂýýãþ þþijklþjklþklþlþþþijklþjklþklþlþþþmnþnoþopþpþþ þ þþmnopþnopþopþpþþþmnopþnopþopþpþþÁýýÂýýÂýýÂýãþ þ þÈýýýýÊýýýÊýýÊý³þÈýýýýÊýýýÊýýÊý³þ þ þ þþmnopþnopþopþpþþþmnopþnopþopþpþþ þ þ þÁýýýýÂýýýÂýýÂýãþÁýýýýÂýýýÂýýÂýãþ þ þ ÁýýýýýýýýýýýýýýýÂýýýýýýýýýýýýýýýÂýýýýýýýýýýýýÂýýýýýýýýýýã Word Formation ;: 1 ;:y is the list of boxed words in the list y according to the rhematic rules of Section I. The function also applies reasonably well to ordinary text. For example: s=. '*: @ -: @ i. 2 3' do=. ". do s 0 0.25 1 2.25 4 6.25 ;: s õýýÃýÃýýÃýÃýýÃýýýÀ þ*:þ@þ-:þ@þi.þ2 3þ ÁýýÂýÂýýÂýÂýýÂýýýã ; ;: s *:@-:@i.2 3 p=. 'When eras die, their legacies/' q=. 'are left to strange police' r=. 'Professors in New England guard' s=. 'the glory that was Greece' ;: p õýýýýÃýýýýÃýýýÃýÃýýýýýÃýýýýýýýýÃýÀ þWhenþerasþdieþ,þtheirþlegaciesþ/þ ÁýýýýÂýýýýÂýýýÂýÂýýýýýÂýýýýýýýýÂýã > ;: p,q When eras die , their legacies / are left to strange police |.&.;: p / legacies their , die eras When Tally # _ 1 _ Copy #y is the number of items in y. Thus: (#'');(#'a');(#'ab')õýÃýÃýÀþ0þ1þ2þÁýÂýÂýã (#3);(#,3);(# 3 4)õýÃýÃýÀþ1þ1þ2þÁýÂýÂýã (#i.4 5 6);(#$i.4 5 6)õýÃýÀþ4þ3þÁýÂýã If the arguments have an equal number of items, then x#y copies +/x items from y, with i{x repetitions of item i{y. Otherwise, if one is an atom it is repeated to make the item count of the arguments equal. The complex left argument a j. b copies a items followed by b fills.The fit conjunction provides specified fills, as in #!.f . Copy is illustrated by the following examples: 0 1 2 3 4 5 # 0 1 2 3 4 5 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 t=. 3 4 $'abcdefghijkl' [ n=. i. 3 4 t ; n ; (3 0 1 # t);(3 0 1 # n) õýýýýÃýýýýýýýýýÃýýýýÃýýýýýýýýýÀ þabcdþ0 1 2 3þabcdþ0 1 2 3þ þefghþ4 5 6 7þabcdþ0 1 2 3þ þijklþ8 9 10 11þabcdþ0 1 2 3þ þ þ þijklþ8 9 10 11þ ÁýýýýÂýýýýýýýýýÂýýýýÂýýýýýýýýýã k=. 2j1 0 1j2 (k # t);(k # n);(k #!.'*' t);(k #!.4 n) õýýýýÃýýýýýýýýýÃýýýýÃýýýýýýýýýÀ þabcdþ0 1 2 3þabcdþ0 1 2 3þ þabcdþ0 1 2 3þabcdþ0 1 2 3þ þ þ0 0 0 0þ****þ4 4 4 4þ þijklþ8 9 10 11þijklþ8 9 10 11þ þ þ0 0 0 0þ****þ4 4 4 4þ þ þ0 0 0 0þ****þ4 4 4 4þ ÁýýýýÂýýýýýýýýýÂýýýýÂýýýýýýýýýã Base Two #. 1 1 1 Base #.y is the base-2 value of y, that is, 2#.y. For example: #. 1 0 1 010 #. 2 3$ 0 0 1,1 0 11 5 x#.y is a weighted sum of the items of y; that is, +/w*y, where w is the product scan */\.}.x,1. For example, if a=.1 2 3, and b=.24á60 60, then 10 #. a is 123, and b #. a is 3723. Further examples: ]a=. i. 3 4 0 1 2 3 4 5 6 7 8 9 10 11 10 #.a 123 4567 9011 8 #. a 83 2423 4763 ]time=. 0 1 3,1 1 3,:2 4 6 0 1 3 1 1 3 2 4 6 x=. 24 60 60 x #. time 63 3663 7446 x,1 24 60 60 1 ]w=. */\.}. x,1 3600 60 1 w *"1 time 0 60 3 3600 60 3 7200 240 6 +/"1 w *"1 time 63 3663 7446 w +/@:* "1 time 63 3663 7446 Antibase Two #: _ 1 0 Antibase #: y is the binary representation of y, and is equivalent to (m#2)#:y, where m is the maximum of the number of digits needed to represent the atoms of y in base 2. For example: i. 80 1 2 3 4 5 6 7 #: i. 80 0 00 0 10 1 00 1 11 0 01 0 11 1 01 1 1 In simple cases, r&#: is inverse tor&#. . Thus, if r=.24 60 60, thenr #: r #. 2 3 4 is 2á3á4. But ifr #. y exceeds (*/r)-1 (the largest integer representable in the radix r), then the result of r #: y is reduced modulo */r. For example: r #: r #. 29 3 45 3 4 A representation in an arbitrary base that is analogous to the base-2 representation provided by the monadic use of #: may be provided as illustrated below: ndr=. 1: + <.@^. Number of digits required 10 ndr y=. 9 10 11 100 99 100 1 2 2 3 2 3 (y#:~10 #~ >./10 ndr y);(y#:~8 #~ >./8 ndr y) õýýýýýÃýýýýýÀ þ0 0 9þ0 1 1þ þ0 1 0þ0 1 2þ þ0 1 1þ0 1 3þ þ1 0 0þ1 4 4þ þ0 9 9þ1 4 3þ þ1 0 0þ1 4 4þ ÁýýýýýÂýýýýýã Factorial ! _ 0 0 Out Of (Combinations) For a non-negative integer argument y, the definition is */>:i.y. In general, !y is (1+y). Thus: (*/1 2 3 4 5) , (!5)120 120 ]x=. 2 %~ 3 -~ i. 2 4_1.5 _1 _0.5 0 0.5 1 1.5 2 !x_3.54491 _ 1.77245 10.886227 1 1.32934 2 ]fi=.!^:_1(24 25 2.1 9876)4 4.02705 2.05229 7.33019 ! fi24 25 2.1 9876 For non-negative arguments x!y is the number of ways that x things can be chosen out of y. More generally, x!y is (!y)%(!x)*(!y-x) with the under-standing that infinities (occasioned by ! on a neg ative integer) cancel if they occur in both numerator and denominator. Thus: 3!510 (!5)%(!3)*(!5-3)10 2&!^:_1 (45 4.1 30 123)10 3.40689 8.26209 16.1924 !&10^:_1 (2.5 45)0.3433618 2 The first table below illustrates the relation between the dyad ! and the table of binomial coefficients; the last two illustrate its relation to the figurate numbers: h=. 0,i=. i.5 [ j=. -1+i.5 [k=. 5#1 tables=. (,.h);(i,i!/i);(j,i!/j);(k,i(+/\^:)k) format=. ({.,:&<}.)@":&.> format tables õýýýÃýýýýýýýýýýýÃýýýýýýýýýýýýýýýýýýýÃýýýýýýýýýýýýýýÀ þõýÀþõýýýýýýýýýÀþõýýýýýýýýýýýýýýýýýÀþõýýýýýýýýýýýýÀþ þþ0þþþ0 1 2 3 4þþþ_1 _2 _3 _4 _5þþþ1 1 1 1 1þþ þÈý³þÈýýýýýýýýý³þÈýýýýýýýýýýýýýýýýý³þÈýýýýýýýýýýýý³þ þþ0þþþ1 1 1 1 1þþþ 1 1 1 1 1þþþ1 1 1 1 1þþ þþ1þþþ0 1 2 3 4þþþ_1 _2 _3 _4 _5þþþ1 2 3 4 5þþ þþ2þþþ0 0 1 3 6þþþ 1 3 6 10 15þþþ1 3 6 10 15þþ þþ3þþþ0 0 0 1 4þþþ_1 _4 _10 _20 _35þþþ1 4 10 20 35þþ þþ4þþþ0 0 0 0 1þþþ 1 5 15 35 70þþþ1 5 15 35 70þþ þÁýãþÁýýýýýýýýýãþÁýýýýýýýýýýýýýýýýýãþÁýýýýýýýýýýýýãþ ÁýýýÂýýýýýýýýýýýÂýýýýýýýýýýýýýýýýýýýÂýýýýýýýýýýýýýýã Figurate numbers of order zero are all ones, and those of successive orders result from successive applications of subtotals (that is, sums over prefixes, or +/\). Consequently, those of order two are the triangular numbers, resulting from subtotals over the integers beginning with one. FIT (CUSTOMIZE) !. This conjunction modifies certain verbs in ways prescribed in their definitions. For example, =!.t is the relation of equality using tolerance t, and ^!.r is the factorial function so defined that x ^!.r n is */x + r * i. n . Consequently, ^!._1 is the falling factorial function. Fit applies to the following verbs (to produce variants). The monadic case is shown before a bullet, and the dyadic case after it: < <: >: > -: | +. *. E. i. Tolerance <. >. * Tolerance +. *. #: Tolerance = ~. #: e. ~: Tolerance Tolerance ^ p. Stope function and polynomial based thereon $ |. # {. Fill ": Print precision FOREIGN !: This conjunction is used to communicate with the host system as well as with the keyboard (as an input file) and with the screen (as an output file). It is also used to provide a variety of extra-lingual facilities, such as setting the form of function display, determining the class of a name (noun, verb, adverb, or conjunction), and listing all existing names in specified classes. (mean=. +/ % #) a=. 2 3 5 7 11 13 6.83333 mean +/ % # 9!:3 (4) mean õý / ýýý + Tree display of verb ýýÊý % Áý # 9!:3 (2 4 5) mean õýýýýýÃýÃýÀ Boxed display þõýÃýÀþ%þ#þ þþ+þ/þþ þ þ þÁýÂýãþ þ þ ÁýýýýýÂýÂýã õý / ýýý + Tree display ýýÊý % Áý # +/ % # Linear display 4!:0 'a';'mean' Classes of names (noun 0, verb 3) 0 3 4!:1 (3) List of names in class 3 õýýýýÀ þmeanþ Áýýýýã The appendix shows all uses of the foreign conjunction. INSERT m / u / _ _ _ TABLE If m is a gerund, then m/y inserts successive verbs from m between items of y. Thus, +`*/i.6 is 0+1*2+3*4+5. The gerund m may extend cyclically. For the verb case, u/y applies the dyad u between the items of y. Thus: m=. i. 3 2 m;(+/m);(+/"1 m);(+/2 3 4)õýýýÃýýýÃýýýýýÃýÀþ0 1þ6 9þ1 5 9þ9þþ2 3þ þ þ þþ4 5þ þ þ þÁýýýÂýýýÂýýýýýÂýã If x and y are numeric lists, then xá*/ y is their multiplication table.For example: 1 2 3 */ 4 5 6 7 4 5 6 7 8 10 12 1412 15 18 21In general, each cell of x is applied to the entire y. Thus x u/ y is equivalent to xáu"(lu,_) y.The case */ is called outer product in tensor analysis. If y has no items (that is, 0=#y), the result of u/y is the identity elementáof the function u. An identity element of a function u is a value e such that either xáuáeáis x, or eáuáx is x for every x in the domain (or perhaps some significant sub-domain such as boolean) of u. This definition of insertion over an argument having zero items extends partitioning identities of the form (+/y) is (+/k{.y)+ +/k}.y to the cases k=.0 and k=.#y. The identity function of u is a function ifu such that (ifu y) is (u/y) if 0=#y. The identity functions used are: Identity function For $&0@}.@$ < > + - +. ~: | (2 4 5 6 b.) $&1@}.@$ = <: >: * % *. %: ^ ! (1 9 11 13 b.) $&_@}.@$ <. $&__@}.@$ >. i.@(0&,)@(2&}.)@$ , i.@(1&{.)@}.@$ C. { =@i.@(1&{.)@}.@$ %. +/ . * ifu@# u/ $&(v^:_1 ifu$0)@}.@$ u&.v OBLIQUE m /. u /. _ _ _ KEY m/.y applies each element of the gerund m to each item of y. Thus: !`*:/. 3 is 6 9. Also see `:.u/.y applies u to each of the oblique lines of a table y. For example: ;: 'When eras die' j=. <./UcLc i."1 _ x x ; (x/:x) ; (x/:j) ; UcLc õýýýýÃýýýýÃýýýýÃýýýýýýýýýýýýýýýýýýýýýýýýýýýÀ þWhenþWhenþdie þ ABCDEFGHIJKLMNOPQRSTUVWXYZþ þerasþdie þerasþ abcdefghijklmnopqrstuvwxyzþ þdie þerasþWhenþ þ ÁýýýýÂýýýýÂýýýýÂýýýýýýýýýýýýýýýýýýýýýýýýýýýã TRAIN m \ _ _ _ (see next topic) m\ is equivalent to the train of verbs represented by the gerund m. For example: ] g=. ]`-`(+/)`%`# õýÃýÃýýýýýýýÃýÃýÀ þ]þ-þõýÃýýýÀþ%þ#þ þ þ þþ/þõýÀþþ þ þ þ þ þþ þþ+þþþ þ þ þ þ þþ þÁýãþþ þ þ þ þ þÁýÂýýýãþ þ þ ÁýÂýÂýýýýýýýÂýÂýã g\ ] - +/ % # g\ a=. 2 3 4 5 6 _2 _1 0 1 2 (1}.g)\ a _2 _1 0 1 2 (2}.g)\ a 4 PREFIX u \ _ 0 _ INFIX (see previous) u\y has #y items resulting from applying u to each of the prefixes k{.y, for k from 1 to #y. If a>0, the items of a u\ y result from applying u to each infix of length a. If a is negative, u is applied to non-overlapping infixes of length |a, including any final shard. +/\a=. 1 2 4 8 16 Subtotals, or partial sums 1 3 7 15 31 */\a Partial products 1 2 8 64 1024 <\a õýÃýýýÃýýýýýÃýýýýýýýÃýýýýýýýýýýÀ þ1þ1 2þ1 2 4þ1 2 4 8þ1 2 4 8 16þ ÁýÂýýýÂýýýýýÂýýýýýýýÂýýýýýýýýýýã <\i.3 4 õýýýýýýýÃýýýýýýýÃýýýýýýýýýÀ þ0 1 2 3þ0 1 2 3þ0 1 2 3þ þ þ4 5 6 7þ4 5 6 7þ þ þ þ8 9 10 11þ ÁýýýýýýýÂýýýýýýýÂýýýýýýýýýã +/\^:_1 +/\ a */\.^:_1 a 1 2 4 8 16 0.5 0.5 0.5 0.5 16 The following examples illustrate the use of the dyad infix: ((2: -/\ ]) ; (2: -~/\ ])) a Backward and forward differences õýýýýýýýýýýýÃýýýýýýýÀ þ_1 _2 _4 _8þ1 2 4 8þ ÁýýýýýýýýýýýÂýýýýýýýã ((3: <\ ]) ,&< (_3: <\ ])) b=. 'abcdefgh' õýýýýýýýýýýýýýýýýýýýýýýýýýÃýýýýýýýýýýýýÀ þõýýýÃýýýÃýýýÃýýýÃýýýÃýýýÀþõýýýÃýýýÃýýÀþ þþabcþbcdþcdeþdefþefgþfghþþþabcþdefþghþþ þÁýýýÂýýýÂýýýÂýýýÂýýýÂýýýãþÁýýýÂýýýÂýýãþ ÁýýýýýýýýýýýýýýýýýýýýýýýýýÂýýýýýýýýýýýýã SUFFIX u \. _ 0 _ OUTFIX u\.y has #y items resulting from applying u to suffixes of y, beginning with one of length #y (that is, y itself), and continuing through a suffix of length 1. If x>0 in x u\. y, then u applies to outfixes of y obtained by suppressing successive infixes of length x. If x<0, the outfixes result from suppressing non-overlapping infixes, the last of which may be a shard. */\. y=. 1 2 3 4 5 120 120 60 20 5 <\. y õýýýýýýýýýÃýýýýýýýÃýýýýýÃýýýÃýÀ þ1 2 3 4 5þ2 3 4 5þ3 4 5þ4 5þ5þ ÁýýýýýýýýýÂýýýýýýýÂýýýýýÂýýýÂýã ((3: <\. ]) ; (_3: <\.])) b=. 'abcdefgh' õýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýÃýýýýýÃýýýýýÃýýýýýýÀ þõýýýýýÃýýýýýÃýýýýýÃýýýýýÃýýýýýÃýýýýýÀþdefghþabcghþabcdefþ þþdefghþaefghþabfghþabcghþabcdhþabcdeþþ þ þ þ þÁýýýýýÂýýýýýÂýýýýýÂýýýýýÂýýýýýÂýýýýýãþ þ þ þ ÁýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýÂýýýýýÂýýýýýÂýýýýýýã