-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy patharithmetic.theory.txt
284 lines (265 loc) · 7.65 KB
/
arithmetic.theory.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
┏━━━━━━━━━━━━━━━━┓
┃ ARITHMETIC ┃
┗━━━━━━━━━━━━━━━━┛
Arithmetic operations:
- algebraic operations on numbers
- addition, subtraction, multiplication, division, exponeniation
Addition:
- for a given x|y, bijective
- unital (0)
- invertible
- cancellative
- commutative
- associative
- closed
- special values:
- x + 0 = x (additive identity)
- x + Inf = Inf
- Inf + Inf = indeterminate
Subtraction:
- inverse function of addition
- special values:
- x - 0 = x (additive identity)
- 0 - x = -x
- x - Inf = -Inf
- Inf - x = Inf
- Inf - Inf = indeterminate
Absolute value:
- notation: |x|
- f(x)->y: if x >= 0, x = y, otherwise x = -y
Plus-minus:
- notation: ± or +- (in my notes)
- means either +x or -x
- minus-plus:
- notation: -+ or -+ (in my notes)
- if expression has both +- and -+, means they are opposite
- formulas:
- -+x = -(+-x)
- x + +-y = x +- y
- +-x + +-y = +-(x + y)
- +-x - +-y = +-(x - y)
- +-x + +-y = +-x - -+y
- +-x * y = +-xy
- +-x * +-y = xy
- +-x * -+y = -xy
- +-x / y = +-x/y
- +-x / +-y = x/y
- +-x / -+y = -x/y
- (+-x)^n = x^n if n even, +-(x^n) if odd
Summation:
- [capital-]sigma notation:
- notation:
- ∑ [CONDITION,...] [MAX] EXPR
- CONDITION is below, MAX above, EXPR on the right
- CONDITION,... is sum of sum
- like ∑ CONDITION ... ∑ CONDITION2 ...
- ∑[_CONDITION][^MAX] EXPR
- ∑[(CONDITION; MAX)] EXPR (in my notes)
- sums EXPR + ... for every EXPR where CONDITION is true, over a set of numbers (def: Z)
- variables in CONDITION can be re-used in EXPR
- when CONDITION is VAR = VAL:
- VAR is index of summation (often noted i)
- VAL is lower bound of summation (often noted m)
- MAX can be used:
- upper bound of summation (often noted n)
- def: n
- adds to CONDITION: & VAR <= MAX
- def CONDITION: i = 1
- formulas:
- ∑(i=m;n) i = (n^2+n+m-m^2)/2
Multiplication:
- notation:
- x (multiplication sign)
- *
- . or · (dot operator)
- nothing, when one operand is variable
- for a given x|y, bijective
- unital (1)
- invertible
- cancellative
- commutative
- associative
- distributive over +
- closed
- factorization:
- (x+y)^2 = xx + xy + xy + yy
- (x-y)*(x+y) = xx - yy
- special values:
- x * 1 = x (multiplicative identity)
- x * -1 = -x
- x * 0 = 0 (absorbing element)
- Inf * 0 = 0
- +-Inf * +-x = +-Inf
Product:
- [capital-]pi notation:
- notation: ∏...
- like ∑... but using * instead of +
Numerical division:
- algebraic division where:
- operands and results ∈ R
- inverse of multiplication
- special values:
- x / 1 = x (multiplicative identity)
- x / -1 = -x
- x / 0 = indeterminate
- +-Inf / +-x = +-Inf
- x / Inf = 0
- Inf / Inf = indeterminate
Euclidean division:
- also named division with remainder
- like numerical division but result is split into two numbers:
- x/y = v*y + w
- v∈ Z
- v is quotient
- w is remainder|residue
- remainder is as small as possible:
- +w:
- named floored division, F-division or least positive remainder
- quotient is rounding towards -Inf
- -w:
- named ceiling division or least negative remainder
- quotient is rounding towards Inf
- +w or -w depending on signedness of result
- named truncated division, T-division
- quotient is rounding towards 0
- +w or -w depending on signedness of y
- named Euclidean division
- quotient is rounding towards -Inf|Inf depending on signedness
- |w|:
- named centered division or least absolute remainder
- quotient is rounding to nearest
- |w| < |y/2|
Integer division:
- like Euclidean division, but only keeping quotient, not remainder
Modulo:
- like Euclidean division, but only keep remainder, not quotient
- notation:
- x % y
- x mod y
- idempotent
- left-absorbing zero:
- 0 % x = 0
- formulas:
- xy % x = 0
- x^n % x = 0
- ((x % z) + (y % z)) % z = (x + y) % z
- ((x % z) * (y % z)) % z = (x * y) % z
- depends in remainder algorithm:
- (x % y) + (-x % y) = x || 0
Exponeniation:
- also named antilogarithm
- notation:
- xⁿ or x^n or x**n
- x is base
- n is exponent|power
- means if n is:
- > 0: 1 * x * x * ... n times
- = 0: 1
- < 0: 1 / x / x / ... n times
- signedness of result:
- if n even -> positive
- if n odd and x positive|negative -> positive|negative
- expression name, depending on degree:
- 0: constant
- 1|2|3|4|5: linear|quadratic|cubic|quartic|quintic|...
- for a given x|n, injective
- unital (1)
- invertible
- closed
- formulas:
- x^(m + n) = x^m * x^n
- x^(m - n) = x^m / x^n (if x != 0)
- x^mn = (x^m)^n
- (x^n)^m = (x^m)^n
- (x^n)^(1/n) = x
- x^-n = 1/x^n
- (xy)^n = x^n * y^n
- (x/y)^n = x^n / y^n
- specific values:
- x^0 = 0
- x^1 = x (exponential identity)
- 1^n = 1
- 0^+n = 0
- 0^0 = 1 (sometimes considered indeterminate)
- 0^-n = Inf
- Inf^+n = Inf
- Inf^0 = indeterminate
- Inf^-n = 0
- x^Inf = Inf|1|0 if |x| >|=|< 1
- x^-Inf = 0|1|Inf if |x| >|=|< 1
nth root:
- pronunced: square|cube root for n=2|3
- names:
- √ sign is radical|radix
- n is index
- x is radicand
- notation:
- ₙ√x
- √x: same as ₂√x
- √(n& x)
- right algebraic division of x^n
- ₙ√x = x^(1/n)
- (ₙ√x)^n = x
- ₙ√(x^n) = x
- signedness of result:
- if n even and x positive -> either negative or positive
- if n even and x negative -> complex
- if n odd and x positive|negative -> positive|negative
- since only alternative notation for x^(1/n), follows same rules
- simplified form: when m * ₙ√x and:
- no nested root in n|x
- x,m∈ Q
- x as small as possible
- formulas:
- x^(m/n) = (ₙ√x)^m
Logarithms:
- notation:
- logₙ(x) or log_n(x)
- n is base
- left algebraic division of n^x
- log_n(n^x) = x
- n^log_n(x) = x
- common bases:
- log_10: decimal
- log_e|ln: natural
- log_2|lg: binary
- signedness of result (for n|x positive):
- if both n|x > 1: positive
- if both n|x < 1: positive
- if only one of n|x < 1: negative
- formulas:
- log_n(xy) = log_n(x) + log_n(y)
- log_n(x/y) = log_n(x) - log_n(y)
- log_n(x^y) = log_n(x) * y
- log_n(x^(1/y)) = log_n(x)/y
- log_n(y) / log_n(x) = log_x(y)
- log_n(y) / log_n(x) = log_m(y) / log_m(x)
- x^log_n(y) = y^log_n(x)
- special values:
- log_n(1) = 0
- log_n(n) = 1
- log_n(0) = -Inf
- log_n(Inf) = Inf
- log_1(x) = +-Inf
- log_0(x) = 0
Infinity:
- notations: ∞ or Inf
Imaginary unit:
- notation: i
- i^2 = -1
- formulas:
- √-x = i√x
- log_n(-x) = (log_e(x) + i*pi)/log_e(n)
- √i = +-(i+1)/√2
Complex number:
- a + bi
- a,b∈ R
- bi named imaginary number
- complex plane:
- geometric representation:
- abscissa:
- real axis
- a
- ordinate:
- imaginary axis
- bi, where only b varies