You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-23Lines changed: 17 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,8 +36,8 @@ For simplicity, many of the code examples here operate on floating point values
36
36
-[common sets `ℝ``ℤ``ℚ``ℕ`](#common-sets)
37
37
-[function `ƒ`](#function)
38
38
-[piecewise function](#piecewise-function)
39
-
-[function notation](#function-notation)
40
39
-[special functions](#special-functions)
40
+
-[function notation](#function-notation)
41
41
-[prime `′`](#prime)
42
42
-[equality arrows `<``>``≪``≫`](#equality-arrows)
43
43
-[more...](#more)
@@ -145,12 +145,14 @@ var result = 3 * k * j
145
145
146
146
To denote multiplication of one vector with a scalar, or element-wise multiplication of a vector with another vector, we typically do not use the dot `·` or cross `×` symbols. These have different meanings in linear algebra, discussed shortly.
147
147
148
-
Let's take our earlier example but apply it to vectors. For element-wise vector multiplication, you might see an open dot `∘` to represent the [Hadamard product](https://en.wikipedia.org/wiki/Hadamard_product_%28matrices%29).<sup>[2]</sup> Or, the author might explicitly define a different symbol, such as a circle with a dot, or a large filled dot.<sup>[3]</sup>
148
+
Let's take our earlier example but apply it to vectors. For element-wise vector multiplication, you might see an open dot `∘` to represent the [Hadamard product](https://en.wikipedia.org/wiki/Hadamard_product_%28matrices%29).<sup>[2]</sup>
149
149
150
150

151
151
152
152
<!-- 3\mathbf{k}\circ\mathbf{j} -->
153
153
154
+
In other instances, the author might explicitly define a different notation, such as a circled dot `⊙` or a filled circle `●`.<sup>[3]</sup>
155
+
154
156
Here is how it would look in code, using arrays `[x, y]` to represent the 2D vectors.
155
157
156
158
```js
@@ -520,7 +522,7 @@ function isInteger (n) {
520
522
521
523
##### `ℕ` natural numbers
522
524
523
-
A natural number, a positive and non-negative integer. The set looks like either of these, depending on the context and field of study:
525
+
A natural number, a positive and non-negative integer. Depending on the context and field of study, the set may or may not include zero, so it could look like either of these:
524
526
525
527
```js
526
528
{ 0, 1, 2, 3, ... }
@@ -530,14 +532,14 @@ A natural number, a positive and non-negative integer. The set looks like either
530
532
The latter is more common in computer science, for example:
531
533
532
534
```js
533
-
functionisNatural (n) {
535
+
functionisNaturalNumber (n) {
534
536
returnisInteger(n) && n >=0
535
537
}
536
538
```
537
539
538
540
##### `ℂ` complex numbers
539
541
540
-
A complex number is a combination of a real number and an imaginary number. For more info, see [A Visual Intuitive Guide to Imaginary Numbers](http://betterexplained.com/articles/a-visual-intuitive-guide-to-imaginary-numbers/).
542
+
A complex number is a combination of a real number and an imaginary number. For more info, see [A Visual, Intuitive Guide to Imaginary Numbers](http://betterexplained.com/articles/a-visual-intuitive-guide-to-imaginary-numbers/).
541
543
542
544
## function
543
545
@@ -617,7 +619,7 @@ function f (x) {
617
619
618
620
There are some "special" functions that are commonplace in mathematics. For a programmer, these might be analogous to "built-in" functions.
619
621
620
-
One such example is the *sgn* function. This is the *signum* or *sign* function. Let's use some earlier notation to describe it:
622
+
One such example is the *sgn* function. This is the *signum* or *sign* function. Let's use [piecewise function](#piecewise-function) notation to describe it:
@@ -658,13 +660,15 @@ It might also be written in the following form:
658
660
659
661
The arrow here with a tail typically means "maps to," as in *x maps to x<sup>2</sup>*.
660
662
661
-
Sometimes, when it isn't obvious, the notation will also describe the *domain* and *codomain* of the function.
663
+
Sometimes, when it isn't obvious, the notation will also describe the *domain* and *codomain* of the function. A more formal definition of *ƒ* might be written as:
662
664
663
-
The above function *ƒ* might have a domain specified like so:
In programming, the *domain* and *codomain* might be seen as the *input* and *output* types of a function. Another example, using our earlier *sgn* function, which outputs an integer:
670
674
@@ -690,17 +694,7 @@ function square (a) {
690
694
691
695
Some tools like [flowtype](http://flowtype.org/) attempt to bring static typing into JavaScript.
692
696
693
-
Other languages, like Java, allow for true method overloading based on the static types of a function's input/output. This is closer to mathematics, since two functions are not the same if they operate in a different *domain*.
694
-
695
-
So, with all of this together, a formal definition of our earlier *ƒ* function could look like this:
Other languages, like Java, allow for true method overloading based on the static types of a function's input/output. This is closer to mathematics, since two functions are not the same if they use a different *domain*.
704
698
705
699
## prime
706
700
@@ -738,7 +732,7 @@ Multiple prime symbols can be used to describe the second derivative *ƒ′′*
738
732
739
733
## equality arrows
740
734
741
-
In math, the `<``>``≤` and `≥` are typically used in the same way we use them in code:
735
+
In math, the `<``>``≤` and `≥` are typically used in the same way we use them in code:*less than*, *greater than*, *less than or equal to* and *greater than or equal to*, respectively.
0 commit comments