When we went on to differential equations, I tried to convince them that e^(ix) is meaningful using your #2: it is a path around the unit circle since it's the solution to z'=iz, and we already agreed multiplication by i is a 90 degree rotation, and circles are what you get when velocity is orthogonal to vector position. It's a bit tougher to convince someone that x is arclength, though, especially when they aren't too comfortable with complex numbers yet.
For some reason, I've been dreaming about negative numbers lately. I think they deserve their own number set notation.
Now, there's an exponent and a fraction, too. I've been playing around with how to do these numbers with logic gates (and verilog!) and you can either two's complement the whole thing and work with absolute values, or you can keep the fraction part as a two's complement...
So I just redid multiplication using two's complemented fractions! And addition/subtraction too, which for floating points in general is significantly harder than multiplication. The nice thing about two's complemented floating points is you don't need separate algorithms for addition and subtraction; you can just do everything with one algorithm.
If you liked that lecture, I'm already starting on some verilog implementations.
This is an example multiplication 8 bit * 8 bit -> 16 bit unpacked (20 bits). It differs from standard floating point in that the fractions are stored as two's complement. It takes a little bit of wrapping your head around, but the hidden bit for negative numbers is actually -2 ! Moment of zen.
https://github.com/interplanetary-robot/mullinengine/blob/ma...
Has there been much traction for getting major chip manufacturers to implement this? I know they're all looking for the next big thing and Intel is working on specialized neuromorphic chips. A general "drop-in" replacement for floating point seems like an opportunity for a general-purpose win from low-hanging fruit:
Intel Gets Serious About Neuromorphic, Cognitive Computing Future https://news.ycombinator.com/item?id=13623846
I do have a hardware architecture in mind for how to very effectively and efficiently execute machine learning calculations using posits.
How efficient do you think regular C or GPU code (on existing hardware) can be made for compressing a 32-bit float to e.g. a 16-bit posit, and for expanding the posit back into a 32-bit float?
To actually do computation I would convert the posits back into 32-bit floats (or e.g. in the Javascript case, 64-bit floats), and then take the inverse stereographic projection.
[Stereographic projection is extremely cheap; for each data point only requires one division and some additions and multiplications.]
I’ll do some experimenting at some point.
Edit: Well. I see it would result in losing the values 0 and 1. Another question: Since it is fixed length of 4 bits (for N=32) why don't we just extract the 4 bit value, then we could represent 2^4 regimes this time without losing 0 and 1.
In my software posit library (which is intentionally strictly binary and not backended by IEEE floats), (https://github.com/interplanetary-robot/SigmoidNumbers) I did everything by first inverting negative numbers and doing decode in the positive domain.
As I design the hardware, it's actually better to NOT do a two's complement inversion to do the decode, and keep the fraction as two's complement!
Also the 4 bit posit was just a simplification to help you understand the structure from a constructive point of view. posits can be of arbitrary length; they have a property I call isomorphic - so appending zeros exactly preserves the value of a short posit when increased in length; conversely, rounding a long posit to a shorter one reports the "nearest representable value".
http://web.stanford.edu/class/ee380/Abstracts/170201-slides....
I never understood why complex numbers are considered one. I mean, yes they "are" a set, but besides that they are completely different.
All number sets I learned about did fill some gaps in one dimension, but complex numbers somehow added a new dimension.
Like real numbers stood in an entirely different context to rational numbers than complex numbers stood to real numbers.
In my head a one dimensional thing like R is fundamentally different from a multidimensional thing like C.
Edit: FWIW, I consider the terminology of 'real' vs 'imaginary' completely stupid and misleading. This terminology didn't really make it to other languages, e.g. in Russian it's 'material' vs 'complex' numbers, but they don't use the term 'imaginary'.
There exists no logical path to the statement from the previous definition of e^x because, up to this point, e^x is a function on real numbers. e^ix is nonsense until you define e^x in complex coordinates, at which point the proof needs to rely on properties of that definition.
what you have posted misses the nature of the insight.
If two analytic functions on the complex numbers agree on uncountably infinitely many points, then they agree everywhere they are defined. This means that there is a unique analytic function that maps (ix)[x \in R] to the circle and (x)[x \in R] to the natural exponential, and they are the same complex function. Without the knowledge that analytic continuations are unique, the statement is entirely (pun intended) meaningless.
For f(x)=e^(kx), double derivative d^2f/dx^2 = k^2 f(x)
Meanwhile for g(x)=sin(kx), d^2g/dx^2 = -k^2 g(x), and similarly for cosine.
So if k is imaginary, from a differential equations point of view, the exponential behaves exactly like a sine or cosine.
That shows the general idea, and further consideration of boundary conditions gives e^ix = cos(x) + isin(x).
In any case, thanks! I don't need to watch the video now, as you've very clearly explained it in only four lines of text!
I was wondering if it was basically the same thing with nice animations...
So really we should be writing z = x * [[1 0][0 1]] + y * [[0 -1][1 0]], but since it's tedious we just call 1 == [[1 0] [0 1]] the 2x2 identity matrix and i == [[0 -1][1 0]], and check that i^2 = -1.
Then no more magical i number, the complex product can be derived from the matrix product, the exponential becomes the 2x2 matrix exponential, and so on.
If you plot all the integer powers of 'a', they all belong to a curve and the exponential simply fills-in the gaps for non-integer exponents.
Now, there are many possible ways to fill the gaps but the exponential does it so that a^m * a^n = a^{m+n} holds even for non-integer numbers m and n.
Similarly, if you take integer powers of a complex number, they all lie on some curve and the exponential fills-in the gaps, again turning sums into products. The same works with matrices, and so on.
Thank you for that.
The complex plane can be thought of as being made up of two-dimensional geometric transformations consisting of rotation and scaling (Tristan Needham calls such transformations “amplitwists”), with 1 as the identity transformation, and i as a quarter turn anticlockwise, and i^2 = –1 as a half turn. To compose two such transformations, you multiply the scales and add the angle measures of the rotations. Because such operations are linear, you can also break them into a part parallel to 1 and a part perpendicular to 1 (some multiple of i), and multiply two such transformations component-wise, using the distributive law (a + bi)(c + di) = (ac – bd) + (ad + bc)i.
exp z is a complex function which maps (in an angle-preserving way, i.e. conformally) from an infinite two-ended cylinder to a whole plane minus one point (the “origin”). The exp function maps negative infinity on the cylinder to the origin on the plane, and it maps the zero point on the cylinder to a given “unit” point in the plane, and the “zero” circular slice through that point on the cylinder to the “unit circle” on the plane, containing the unit point and concentric with the origin. The coordinate system on the cylinder has 2πi measuring one loop around a circular slice, and 1 pointed along the cylinder axis. The coordinate system in the plane is the customary square grid. Addition of coordinates in the geometry of the cylinder (if you like, rotating and/or sliding the cylinder) corresponds to multiplication of complex numbers (composition of amplitwists) in the plane. That is, exp(w + z) = (exp w)(exp z).
In particular, exp iy for some real number y maps points at distance y along the zero circle in the cylinder to points on the unit circle in the complex plane at a proportional distance around the circle; that is, to rotation operators which correspond to the given angle measure in radians.
So πi is halfway around the zero slice in the cylinder, and exp maps it to the operator in the complex plane corresponding to a half-turn rotation, i.e. exp πi = –1.
The log function is the inverse map, from the plane to the cylinder; it is a multi-valued function because we can make multiple “straight” helical connections between arbitrary points on the cylinder, which wrap around different numbers of times.
Once we have this general concept for how we want the exp map to work, we can work out the details to find that the unique such function is the solution to a particular differential equation f'(z) = f(z), or alternately the Taylor series we are all familiar with, exp z = 1 + z + z^2/2 + z^3/6 + ...
2) e^ix is a function whose derivative is equal to its value rotated by 90 degrees (ie^ix).
3) As x goes from 0 to pi, the trajectory of e^ix always has a velocity vector perpendicular to its current position. For example, when x = 0, the current position is 1 and the velocity vector is i.
4) So the trajectory a circle arc of length pi, which ends at -1.