Comparison with traditional mathematics: Difference between revisions
Jump to navigation
Jump to search
m (1 revision imported) |
(Convert LaTeX symbols to commands) |
||
Line 7: | Line 7: | ||
<source lang=apl inline>((x + y) × (x - y)) = (f ∘ g)(x, y)</source> | <source lang=apl inline>((x + y) × (x - y)) = (f ∘ g)(x, y)</source> | ||
<math>((x + y) | <math>((x + y) \times (x - y)) = (f \circ g)(x, y)</math> | ||
</div> | </div> | ||
Now note that they are identical, letter for letter | Now note that they are identical, letter for letter. Computer Scientists tend to have great difficulty in approaching APL until they let go of the notion that APL is just another programming language (despite its name!) and instead look at it as an executable mathematical notation. | ||
It is notable that APL traditionally was written with a font wherein letters were always italicised, while everything else wasn't. Here is how it looks in the default font for [[SAX]]: | It is notable that APL traditionally was written with a font wherein letters were always italicised, while everything else wasn't. Here is how it looks in the default font for [[SAX]]: | ||
Line 18: | Line 18: | ||
! style="width:33%" | Traditional notation !! style="width:33%" | APL !! Article | ! style="width:33%" | Traditional notation !! style="width:33%" | APL !! Article | ||
|- | |- | ||
| <math>\sim q</math> | | <math>\sim q</math> || <source lang="apl" inline>~ q</source> || [[Not]] | ||
|- | |- | ||
| <math> | | <math>p \wedge q</math> || <source lang="apl" inline>p ∨ q</source> || [[Or]] | ||
|- | |- | ||
| <math> | | <math>p \vee q</math> || <source lang="apl" inline>p ∧ q</source> || [[And]] | ||
|- | |- | ||
| <math> | | <math>a \times b</math> || <source lang="apl" inline>a × b</source> || [[Multiply]] | ||
|- | |- | ||
| <math> | | <math>a \div b</math> || <source lang="apl" inline>a ÷ b</source> || [[Divide]] | ||
|- | |- | ||
| <math>a \in S</math> || <source lang="apl" inline>a ∊ S</source> || [[Membership]] | | <math>a \in S</math> || <source lang="apl" inline>a ∊ S</source> || [[Membership]] | ||
|- | |- | ||
| <math>A | | <math>A \cup B</math> || <source lang="apl" inline>A ∪ B</source> || [[Union]] | ||
|- | |- | ||
| <math>A | | <math>A \cap B</math> || <source lang="apl" inline>A ∩ B</source> || [[Intersection]] | ||
|} | |} | ||
Line 42: | Line 42: | ||
! style="width:25%" | Traditional notation !! style="width:25%" | <small>Parenthesised<br></small>APL !! style="width:25%" | <small>Normal<br></small>APL !! Article | ! style="width:25%" | Traditional notation !! style="width:25%" | <small>Parenthesised<br></small>APL !! style="width:25%" | <small>Normal<br></small>APL !! Article | ||
|- | |- | ||
| <math>[ | | <math>[a \equiv b]</math> || <source lang="apl" inline>(a ≡ b)</source> || <source lang="apl" inline>a ≡ b</source> || [[Match]] | ||
|- | |- | ||
| <math>[a=b]</math> | | <math>[a=b]</math> || <source lang="apl" inline>(a = b)</source> || <source lang="apl" inline>a = b</source> || [[Equal]] | ||
|- | |- | ||
| <math>[ | | <math>[a \ne b]</math> || <source lang="apl" inline>(a ≠ b)</source> || <source lang="apl" inline>a ≠ b</source> || [[Not Equal]] | ||
|- | |- | ||
| <math>[ | | <math>[a \le b]</math> || <source lang="apl" inline>(a ≤ b)</source> || <source lang="apl" inline>a ≤ b</source> || [[Less Than or Equal]] | ||
|- | |- | ||
| <math>( | | <math>(f \circ g)(x)</math> || <source lang="apl" inline>(f ∘ g)(x)</source> || <source lang="apl" inline>f ∘ g x</source> || [[Bind]] | ||
|- | |- | ||
| <math>f(g(x))</math> | | <math>f(g(x))</math> || <source lang="apl" inline>f(g(x))</source> || <source lang="apl" inline>f g x</source> || | ||
|- | |- | ||
| <math>(f+g)(x)</math> || <source lang="apl" inline>(f+g)(x)</source> || <source lang="apl" inline>(f+g) x</source> || [[Train]]s | | <math>(f+g)(x)</math> || <source lang="apl" inline>(f+g)(x)</source> || <source lang="apl" inline>(f+g) x</source> || [[Train]]s | ||
|} | |} | ||
Line 68: | Line 68: | ||
! style="width:33%" | Traditional notation !! style="width:33%" | APL !! Article | ! style="width:33%" | Traditional notation !! style="width:33%" | APL !! Article | ||
|- | |- | ||
| <math>n \pi</math> || <source lang="apl" inline>○n</source> || [[Pi Times]] | | <math>n \pi</math> || <source lang="apl" inline>○n</source> || [[Pi Times]] | ||
|- | |- | ||
| <math>x!</math> | | <math>x!</math> || <source lang="apl" inline>!x</source> || [[Factorial]] | ||
|- | |- | ||
| <math>|x|</math> | | <math>|x|</math> || <source lang="apl" inline>|x</source> || [[Magnitude]] | ||
|- | |- | ||
| <math> | | <math>\lceil x \rceil</math> || <source lang="apl" inline>⌈x</source> || [[Ceiling]] | ||
|- | |- | ||
| <math> | | <math>\lfloor x \rfloor</math> || <source lang="apl" inline>⌊x</source> || [[Floor]] | ||
|} | |} | ||
Line 178: | Line 178: | ||
| <math>\prod_{n=1}^{N} n</math> || <source lang="apl" inline>×/ ⍳N </source> | | <math>\prod_{n=1}^{N} n</math> || <source lang="apl" inline>×/ ⍳N </source> | ||
|- | |- | ||
| <math> | | <math>\forall x, P(x)</math> || <source lang="apl" inline>∧/P(x)</source> | ||
|- | |- | ||
| <math> | | <math>\exists x, P(x)</math> || <source lang="apl" inline>∨/P(x)</source> | ||
|} | |} | ||
{{APL syntax}} | {{APL syntax}} |