It's surprising to me that a programming language would have started out following engineering conventions rather than mathematical conventions, even if there's a strong overlap between EE and CS. That said (and speaking as a mathematician) I think it's foolish to use j over i, especially since in some cases (e.g. quaternions) it will be very confusing.
Physicists, on the other hand, have come to terms with the fact that they have fewer letters in the English and Greek alphabets than concepts they need to express, and so happily overload i and everything else, hoping to always figure it out from context.
Indeed, the use of aleph for transfinite numbers seems to be the only use of the Hebrew alphabet in the sciences that I know.
Looking at it, it seems like it would be rather hard to introduce. Any symbol which isn't already a bit too close to a misdrawn version of a Greek or Roman letter (I see three letters which look like misdrawn πs) is pretty hard to draw without practice.
Not really. Python only supports the second square root of -1 instead of the first at the moment. They are indistinguishable from each other until you introduce the other two. It's just convention that the first one is what's in common use when you don't need all three.
The decision to use "j" was made quite a long time ago by Guido. There as a fairly short discussion about it and he made his decision. As other people have said, this is a bike shed issue. BTW, Guido's MSc is in math.
j vs i gets really confusing when you're doing a dual electrical engineering / computer science degree, since you have to remember which classes use which: electrical engineering uses j (since i is already taken to mean current), CS math uses i :)
I said something about j in my number theory class after 3 years of EE and my professor looked at me like I was an idiot. He apparently had never heard of j once in his life.
I know that cooler heads will prevail, and that python won't get this silly syntax change, but...
...everyone seems to be forgetting that i == -j (either squared is 1). Physicists usually describe traveling waves (of whatever) as something proportional to exp(kx-iwt) where that's an omega, not a w, and electrical engineers for whatever reason prefer the notation exp(kx+jwt) (note the minus sign difference). Except ee's sometimes write exp(kx-jwt), depending on the convention in use at the time.
This discussion is talking about the notation ambiguity of i and j in denoting a classical complex number with only one real and one imaginary part. As far as I can tell, this python bug report has absolutely nothing to do with quaternions, which is an extension on complex numbers.
i == j, not i == -j in most applications. If you take the number z = a + ib and turn it into z = a - jb, and just take Im(z), you end up with two different answers otherwise.
j is often used instead of i in engineering and physics.
When you start talking about charge density, current, phase and frequency, you almost always start reverting back to engineering notation (i == j). In QM we used i. In Complex Analysis, we used i. In CM, with regards to oscillators/harmonic motion, we used i.
The wikipedia article on imaginary units talks about interchanging i and -j denoting the reversal of plane waves, but we never did that in advanced electrodynamics. However, I wouldn't be surprised if some people do, but as far as I know it's not that common. It's probably find for determining the EM field at some point for some time, but for the problems where you have to find the charge density on a surface of conductor induced by a EM wave, this notation would start to get confusing.
In the Python community, agreement with a proposed change (“this is a good idea”) is indicated by +1, disagreement (“this is a bad idea”) is indicated by -1, and mostly indifference leaning slightly for or against (as in “I (dis)approve but don’t really care”) is indicated by +0 or -0. My guess is that -0.small is intended to mean something like “I slightly disapprove but this is utterly insignificant”.
Edit: much more amusing is Antoine’s comment “[...] Otherwise +11j from me”
probably a representation of a value smaller than 0 but larger than the nearest-to-0 possible value that can be encoded as a floating point number (that still isn't 0). or something like that.
I think it was a valid (though poorly worded) question. Not really deserving -4. Thanks for the answers anyway -- I haven't touched imaginary numbers since high school.
If you rotate your phone's keypad 90 degrees, you can call Hogwarts!
To actually answer your question, complex numbers make signal processing algorithms much more tractable, and also make it easy to visualize many commonplace quantities and phenomena in electrical engineering. Anytime a value has both a magnitude and a time- or phase-based aspect, chances are you can use complex numbers to represent it.
Put another way: just as negative numbers allow you to specify movement along an axis, complex numbers allow you to specify rotation around an axis. Both are obviously pretty fundamental.
Not exactly. Complex numbers greatly simplify math in that they allow us to represent phase and amplitude, for instance, using only a single term. Usually this appears as e raised to some power of i (or j) that is multiplied by an angle. x and y coordinates can't really accomplish the same thing. If I had an (x, y) pair, y would tell me something about amplitude, but I wouldn't really know anything about phase without comparing x to something else.
The complex numbers form a ring that is isomorphic to the cross product of the ring of real numbers and itself....
C≅R×R
For those who haven't done abstract algebra:
This means your can map a complex number to (x,y), that every complex number maps to a unique (x,y), and that if you add or multiply two complex numbers and then convert the result to (x,y), you can convert the two complex numbers to (x,y) and then multiply getting the same answer. (it is also bijective, meaning it works both ways).
Importance: Complex numbers can be dealt with as coordinates and coordinates can be dealt with as complex numbers.
That's not true: the multiplication is different. (x1,y1) × (x2,y2) would have to be (x1x2 - y1y2, x1y2 + y1x2), not (x1y1, x2y2).
The addition does work as you suggest, so a more correct formal statement would be: the complex numbers form an additive group that is isomorphic to the cartesian product of the additive group of real numbers and itself; the complex numbers also happen to form a ring (indeed a field).
"That could work; it's a bit late to do this in 3.2, though. How about the following transition strategy for the complex output.
Python 3.3: Introduce PYTHONIMAGINARYSYMBOL environment variable (and possibly also a related command-line option to the interpreter?).
Python 3.4: Show a warning on startup if this environment variable isn't used.
Python 3.5: Make the environment variable mandatory.
Python 3.6: Make the environment variable optional again, but this time with the default output being 'i' rather than 'j'.
Python 3.7: Deprecate use of PYTHONIMAGINARYSYMBOL. (Warning on startup if it's set.)
Python 3.8: Error on startup if PYTHONIMAGINARYSYMBOL is set.
Python 3.9: Go back to ignoring PYTHONIMAGINARYSYMBOL."