/ is an adverb and u/y applies the dyad u between the items of y . For example, +/y computes the sum. This differs from conventional mathematical notation in making explicit that there is an adverb and that no special symbol is required for u/ for each function u . For example, in conventional notation sum is
and product is
.
The more general m/y inserts successive verbs from the gerund m between items of y , extending m cyclically as required.
Some examples of insert:
+/ y |
sum |
*/ y |
product; (!n) = */1+i.n |
-/ y |
alternating sum; e.g. -/ z (^%!@]) 1+2*i.n approximates sin z |
>./ y |
maximum |
<./ y |
minimum |
(+%)/ y |
continued fraction; e.g. (+%)/n$1 approximates |
+`%/ y |
generalized continued fraction; e.g. +`%/ 3,6,.~*:1+2*i.n approximates |
+`*/ }:,x,.y |
computation of x p. y by Horner's rule |
y {~ /:@/:@,/ ((-i.)#y)#:x |
computation of x A. y ; see Permutation Index |
(<@i.@>:@I.~ C. ,)/ y |
an O(n2) sort of vector y |
*./ #&> C. p |
the size of the subgroup generated by permutation p |
*./ b |
Are all of b true? |
+./ b |
Is any of b true? |
~:/ b |
1 iff the number of 1s is odd |
=/ b |
1 iff the number of 0s is even |
</ b |
1 iff b is all 0s followed by a 1 |
Contributed by RogerHui.
