h -: f&.g asserts that h is the dual of f under (or with respect to) g
m0 =: A=: +/ % # | Arithmetic mean |
m1 =: H=: A &. (%"_) | Harmonic mean |
m2 =: M=: A &. (^&p) | Generalized mean |
a3 =: N=: (^&) (A&.) | L-x norm; 3-norm is 3 N y |
m4 =: +/ &. (*:"_) @ +. | Magnitude | e.g. m4 3j4 |
a5 =: each=: &.> | Each (f each applies f to each box) |
m6 =: ^ .: -&.j. | Sine |
m7 =: sin -: sinh&.j. | Tautology |
m8 =: tan -: tanh&.j. | " |
m9 =: sinh -: sin&.j. | " |
m10=: cosh -: cos& j. | " |
m11=: tanh -: tan&.j. | " |
v12=: <. -: >.&.- | Tautologies |
v13=: >. -: <.&.- | Tautologies |
d14=: * -: +&.^. | Tautology |
d15=: * -: +&.(10&^.) | Tautology |
v16=: % -: -&.^. | Tautologies |
d17=: + -: *&.^ | Tautology |
d18=: + -: *&.(10&^) | Tautology |
v19=: - -: %&.^ | Tautologies |
v20=: %. -: %.&.|: | Tautologies |
v21=: %. -: %.&.(+@|:) | Tautologies |
m22=: +/\ -: +/\.&.|. | Tautology |
m23=: +/\. -: +/\ &.|. | Tautology |
a24=: BW=: /&.#: | Bitwise adverb |
m25=: *. BW | Bitwise AND. e.g. m25 _1 100 200 |
m26=: +. BW | Bitwise OR e.g. m26 100 200 |
m27=: ~: BW | Bitwise XOR e.g. m27 100 200 |
m28=: i.&.(p:^:_1) | The primes less than n |
m29=: totient=: * -.@%@~.&.q: | Euler's totient function |
m30=: |.&.;: | Reverse the words; e.g. m30 'three score and ten years' |
n31=: a=: ' abcdefghijklmnopqrstuvwxyz' | Space and alphabet |
m32=: encrypt=: (#a)&|@>: &. (a&i.) | Julius Caesar's cypher. e.g. |
m33=: decrypt=: (#a)&|@<: &. (a&i.) | decrypt encrypt x=:'from sea to sea' |
m34=: J=: 1&|.&.#: | Survivor number in the Josephus problem of order n |
m35=: ar=: >:@] | Increment right argument |
m36=: dr=: <:@[ | Decrement right argument |
m37=: dl=: <:@[ | Decrement left argument |
m38=: test =: #.@(,&*) | Ackermann test |
m35=: ack=: ar`ar`(dl ack 1:)`(dl ack[ack dr)@.test | Ackermann fn |
m36=: 0&ack -: >:&.(3&+) | Ackermann 0 |
m37=: 1&ack -: 2&+&.(3&+) | Ackermann 1 |
m38=: 2&ack -: 2&*&.(3&+) | Ackermann 2 |
m39=: 3&ack -: 2&^&.(3&+) | Ackermann 3 |
m40=: 4&ack -: ^/@#&2&.(3&+) | Ackermann 4 |
m41=: 5&ack -: 3 : '^/@#&2^:(1+y.)&.(3&+) 1' | Ackermann 5 |