28.1 |
Predict與test results of following expressions:
*/''
<./''
>./''
>./0 4 4 $ 0
+/ . */ 0 4 4 $ 0
1 2 3 4 +&.^./ 5 6 7 8
|
28.2 |
Experiment with 雙邊 {@; and
give term used to describe it in mamatics.
解答:Cartesian product
|
28.3 |
Test assertion that 單邊 (%:@~. +/ . * =)
and %: are equivalent,與state utility of
former when applied to a list such as 1 4 1 4 2 that has
repeated 分子.
解答:函數 %: (which could be a 函數
costly to execute) is applied only to distinct 分子
引數(as selected by nub 函數 ~.).
|
28.4 |
Comment on following experiments before reading
comments on 右:
a=: 2 3 5 [ b=: 1 2 4 |
a (f=: *:@+) b |
Square of sum |
a (g=: +&*: + +:@*) b |
Sum of squares plus double product |
a (f=g) b |
Expression of identity of 函數 |
a (f-:g) b |
f and g in a tautology (whose result is |
taut=: f-:g |
always true;亦即, 1). |
|
28.5 |
A 片語such as f-:g may be a tautology
for 雙邊case only, for 單邊case only, or for both.
Use following tautologies as reading與writing exercises,
including statements of applicability (雙邊only, etc.):
t1=: >: -: > +. = |
(雙邊only) 基本單字 >: is
identical to greater than or equal |
t2=: <. -: -@>.&- |
(Both) Lesser-of is neg on greater-of on neg; 下整數is neg
on 上整數on neg |
t3=: <. -: >.&.- |
Same as t2 but uses under |
t4=: *:@>: -: *: + +: + 1: |
(單邊) Square of a+1 is square of a plus
twice a plus 1 |
t5=: *:@>: -: #.&1 2 1"0 |
Same as t4 using 多項式 |
t6=: ^&3@>: -: #.&1 3 3 1"0 |
Like t5 for cube |
bc=: i.@>: ! ] |
Binomial係數 |
t7=: (>:@]^[) -: (]#.bc@[)"0 |
Like t6 with k&t7 for kth power |
s=: 1&o. [. c=: 2&o. |
Sine與Cosine |
t8=: s@+-:(s@[*c@])+(c@[*s@]) |
(雙邊) Addition與Subtraction |
t9=: s@--:(s@[*c@])-(c@[*s@]) |
Formulas for sine |
det=: -/ . * |
行列式 |
perm=: +/ . * |
Permanent |
sct=: 1 2&o."0@(,"0) |
Sine與cosine表格 |
t10=: s@- -: det@sct |
Same as t9 but using 行列式 of
sin與cos表格 |
t11=: s@+ -: perm@sct |
Like t8 using permanent |
S=: 5&o. [. C=: 6&o. |
Hyperbolic sine與cosine |
SCT=: 5 6&o."0@(,"0) |
Sinh與Cosh表格 |
t12=: S@+ -: perm@SCT |
Addition orem for sinh |
SINH=: ^ .: - |
Odd part of 指數 |
COSH=: ^ .. - |
Even part of 指數 |
t13=: SINH -: S |
Sinh is odd part of 指數 |
t14=: COSH -: C |
Cosh is even part of 指數 |
sine=: ^&.j. .: - |
Sine is odd part of 指數 |
t15=: sine -: s |
under multiplication by 0j1 |
|
28.6 |
Comment on following expressions before
reading comments on 右:
g=: + > >. |
Test if sum exceeds maximum |
5 g 2 |
True for positive引數 |
5 g _2 _1 0 1 2 |
but not true in general |
f=: *.&(0&<) |
Test if both引數exceed 0 |
orem=: f <: g |
truth value of result of f does not exceed that
of g .This may also be stated as "if f
(is true) n g (is true)" or as "f implies g"
|
5 orem _2 _1 0 1 2 |
|