Intro 5. Forks

>> << Ndx Usr Pri Phr Dic Rel Voc !: wd Help Dictionary

5. Forks

As illustrated above, an isolated sequence of three verbs is called a fork; its monadic and dyadic cases are defined by:

`` | `g / \ f g | | y y` | `` | `g / \ f h / \ / \ x y x y` | `` | `(f g h) y` ↔`(f y) g (h y)` `x (f g h) y` ↔`(x f y) g (x h y)`

The diagrams above provide visual images of the fork.
Before reading the notes at the right (and by using the facts that`%:` denotes the root function and`]` denotes the identity function), try to state in English the significance of each of the following sentences:

       a=: 8 7 6 5 4 3
       b=: 4 5 6 7 8 9
       2 %: b                     Square root of b
    2 2.23607 2.44949 2.64575 2.82843 3

       3 %: b                     Cube root of b
    1.5874 1.70998 1.81712 1.91293 2 2.08008

       (+/ % #) b                 Arithmetic mean or average
    6.5

       (# %: */) b                Geometric mean
    6.26521

       (] - (+/ % #)) b           Centre on mean (two forks)
    _2.5 _1.5 _0.5 0.5 1.5 2.5

       (] - +/ % #) b             Two forks (fewer parentheses)
    _2.5 _1.5 _0.5 0.5 1.5 2.5

       a (+ * -) b                Dyadic case of fork
    48 24 0 _24 _48 _72

       (a^2)-(b^2)
    48 24 0 _24 _48 _72

       a (< +. =) b               Less than or equal
    0 0 1 1 1 1

       a<b
    0 0 0 1 1 1

       a=b
    0 0 1 0 0 0

       a (<: = < +. =) b          A tautology (<: is less than or equal)
    1 1 1 1 1 1

       2 ([: ^ -) 0 1 2           Cap yields monadic case
    7.38906 2.71828 1

       evens=: [: +: i.           +: is double
       evens 7
    0 2 4 6 8 10 12

       odds=: [: >: evens         >: is increment
       odds 7
    1 3 5 7 9 11 13

Exercises

5.1 | Enter`5#3` and similar expressions to determine the definition of the dyad`#` and then state the meaning of the following sentence:
    (# # >./) b=: 2 7 1 8 2
Answer:`#b` repetitions of the maximum over`b`
5.2 | Cover the comments on the right, write your own interpretation of each sentence, and then compare your statements with those on the right:
    (+/ % #) b                    Mean of b
    (# # +/ % #) b                (n=:#b) repetitions of mean
    +/(##+/%#) b                  Sum of n means
    (+/b)=+/(##+/%#) b            Tautology
    (*/b)= */(###%:*/) b          The product over b is the product over n
                                  repetitions of the geometric mean of b

>> << Ndx Usr Pri Phr Dic Rel Voc !: wd Help Dictionary