4 ms·
Well, let's use that attitude in mathematics: a*x^2+b*x+c = 0 -> x1 = (-b + sqrt(b^2-4*a*c))/2*a Given an equation that relates given values a, b and c (wh
by beagle3 16y ago
Well, let's use that attitude in mathematics:
a*x^2+b*x+c = 0 -> x1 = (-b + sqrt(b^2-4*a*c))/2*a
Given an equation that relates given values a, b and c (which we shall hereby refer to as the "equation constants") and unknown variable x ("the unknown"), one solution to x that satisfies said equation is given by: taking the square root (which is the inverse of the square operation) on 4 times a times c subtracted from b squared, subtracting b from this result, and dividing all of this by 2 and then by a again.
Oh my. If mathematicians really thought that way, we would still not have discovered transcendental numbers.
APL is a mathematical notion for expressing algorithms. It does that quite well - as well, or better, than standard mathematical notation does for equations.
Have you ever met someone working in math or physics who would prefer english text to equations?
- Natsu 16y agoAnd yet you left out one of the solutions to that equation. It's not always helpful to increase the density of information. In general, you only want to do that once you have everything worked out. We rarely have everything worked out in programming. But it's great to simplify the proofs and equations once we've worked things out in mathematics.
- beagle3 16y ago> And yet you left out one of the solutions to that equation. Well, I left it out because I didn't have the +/- sign on the keyboard, and I didn't want to repeat the whole thing twice. > It's not always helpful to increase the density of information. In general, you only want to do that once you have everything worked out. I agree with this (and the original post), but not with the grandparent. In general I prefer a dense statement readable to someone "skilled in the art", with a textual description for those who don't. However, most programming lore equates the "full description" with a "good solution", leaving the mathematical conciseness an impossibility with few exceptions; notable exceptions are the APL (A+, J, K, Q) family.
- vog 16y ago> Well, I left it out because I didn't have the +/- sign on the keyboard HN supports unicode characters. You could have simply copied it from somewhere else, e.g. the Wikipedia (http://en.wikipedia.org/wiki/Plus-minus_sign http://en.wikipedia.org/wiki/Plus-minus_sign): ± However, simply writing "+/-" would also have been good enough for this purpose. Ugly formulas are preferable to wrong formulas.
- beagle3 16y agoNote that in the text I wrote: > one solution to x that satisfies said equation is given by: Which is in agreement with the mathematical equation given above it.
- vog 16y agoI'm afraid it isn't, because the given notation a*x^2+b*x+c = 0 -> x1 = (-b + sqrt(b^2-4*a*c))/2*a uses "->" which means implication. So it says: From "a*x^2+b*x+c = 0" follows "x1 = (-b + sqrt(b^2-4*a*c))/2*a" indicating that the second part is the only solution. Strictly speaken, since no equivalence has been used, this even means that there is either no solution, or if there is a solution, it must have the form "x1 = (-b + sqrt(b^2-4ac))/2*a". However, I'm willing to admit that this is nitpicking.
- beagle3 16y ago> indicating that the second part is the only solution. I'm not familiar with a notation in which implication means "only". As in: x = 4 -> x > 3 does not in any way imply that x is the only number larger than 3, or that x is only larger than 3. I specifically wrote "x1" to indicate _a_ solution, not _the_ solution; if it was _the_ solution, there would have been no need for the "1" index. > it must have the form "x1 = (-b + sqrt(b^2-4ac))/2*a". Alternatively, since sqrt could be the multi valued function with no specific branch selected, this actually does give all the solutions. > However, I'm willing to admit that this is nitpicking. And I can't even find any appreciation for it - Because you picked a set of assumptions (x is Real or Complex, sqrt is a specific branch of a multi-branch function, no natural order for solutions) treated as axioms, but question others, where said axioms actually determine correctness. Are you sure I was not, in fact, describing an equation in Z_2? Nitpicking at this level, especially if you do it often, might make you feel good about yourself, but doesn't actually get you anywhere. -- beagle3, who started professional life as a mathematician and switched to engineering at a later stage.
- vog 16y ago> And yet you left out one of the solutions to that equation. It's not always helpful to increase the density of information. This mistake (forgotten second solution) demonstrates quite the opposite: It is very visible in the compact version, but would be almost hidden in the full-blown text. (Note that the text is in fact correct because it differs slightly from the formula. Nevertheless, if the text had the same mistake, it wouldn't be nearly as obvious as in the formula.)
- Natsu 16y ago> Note that the text is in fact correct because it differs slightly from the formula. Afraid not. When it said "taking the square root (which is the inverse of the square operation)", it was incorrect for implying that the square operation has a single inverse. See also: http://mathworld.wolfram.com/SquareRoot.html http://mathworld.wolfram.com/SquareRoot.html And note their use of scare quotes when talking about "the" square root.