Re:Ask HN: What is your favorite equation?
by kurthr on Saturday December 24, 2016 @01:39AM
(#13248897)
Euler's equation is cool...
Written properly it contains addition, negation, multiplication, exponentiation, the imaginary unit, the additive identity, the multiplicative identity, the natural anti-derivative identity, and two irrational transcendental numbers in a most compact form with holomorphic continuity.
Re:Ask HN: What is your favorite equation?
by fusiongyro on Saturday December 24, 2016 @01:22AM
(#13248870)
It looks like an equation, but it's really almost a Y combinator, almost in Haskell:
y f = f (y f)
Though this won't exactly type check, it's a pithy reminder of what I found so powerful about functional programming, which is that _any_ repetition in the code ought to be something you could factor out. The Y combinator shows you that _even the idea of a function calling itself_ can be factored out. It's hard to imagine you would really ever be forced to repeat yourself if this can be factored out.
Of course that isn't the real point of the Y combinator, but this thought, this "equation" completely changed the way I think about programming.
Re:Ask HN: What is your favorite equation?
by harpocrates on Saturday December 24, 2016 @03:27AM
(#13249096)
This works in Haskell just fine, thank you very much!
ghci> y f = f (y f)
ghci> factorial = y (\f x -> if x == 0 then 1 else x * f (x-1))
ghci> factorial 5
120
However, the Y combinator as defined in a non-recursive form is tougher to implement in Haskell [1][2]. It looks a lot better in Racket (and this is coming from someone who doesn't particularly like Racket).
The first time I saw it I was in high school and I was watching Andrew Ng's machine learning class for the first time.
My Math background was not the best and I didn't fully understand it until a couple of years later when I took MIT's free online course on linear algebra (OCW 18.06)
Re:Ask HN: What is your favorite equation?
by gajomi on Saturday December 24, 2016 @01:09AM
(#13248826)
At some point in my past I became biased towards inequalities over equalities; they somehow seemed more fundamental (I have no intention to defend this sentiment... its probably insubstantial). So there are lots of fun inequalities, but probably my favorite is the bound on the support of eigenvalues of a matrix given by the Gershgorin circle theorem (https://en.wikipedia.org/wiki/Gershgorin_circle_theorem).
Re:Ask HN: What is your favorite equation?
by emjoes1 on Saturday December 24, 2016 @08:01AM
(#13249636)
I like the wavelength formula because of it's simplicity and practicality.
λ = c / f
It is a cool way to demonstrate the importance of the speed of light to figure out the optimal length of an antenna for a given radio frequency.
My son, when asking why knowing the speed of light matters, was impressed when I showed him we could make our own wifi antenna by using this to figure out the length it needed to be. Of course antenna design can be complex but this was still cool to show.
Re:Ask HN: What is your favorite equation?
by harpocrates on Saturday December 24, 2016 @01:04AM
(#13248814)
Your link is slightly misleading - it shows ways of approximating solutions to the equation. The equation itself is a partial differential equation [1].
Re:Ask HN: What is your favorite equation?
by ammmir on Saturday December 24, 2016 @12:17AM
(#13248689)
euler's identity e^ipi+1=0 of course. it connects all the dots (e, pi, sqrt(-1), 1, 0), is fun to prove, and just plain cool. i have no idea of its practical applications though.
Re:Ask HN: What is your favorite equation?
by harpocrates on Saturday December 24, 2016 @12:53AM
(#13248792)
A math professor of mine once said of this (paraphrased): yes it is cool, but really it is just a trivial consequence of how we defined our extension of the real exponential map to complex numbers. The really cool part, is that this extension is the _only_ possible holomorphic (differentiable for complex numbers) extension. All that to say that the really nifty part of this identity is the uniqueness of analytic continuations (on the whole complex plane).
Re:Ask HN: What is your favorite equation?
by SAI_Peregrinus on Wednesday December 28, 2016 @07:58AM
(#13270172)
Well, pi in there is a special case. The general case for any angle $\theta$ is $e^{\i\theta}=\cos(\theta)+\i\sin(\theta)$ It lets you transform between rectangular and polar representations of complex numbers. That allows for things like phasors [1] which are used quite a lot in electrical engineering. It's also used in Fourier analysis, IE all sorts of digital signal processing. Basically anywhere you get complex numbers, sines, or cosines, Euler's formula shows up. That's a lot of places in math/physics/engineering.
Re:Ask HN: What is your favorite equation?
by pmiller2 on Saturday December 24, 2016 @12:47AM
(#13248773)
In the form you wrote it, there are no real applications. But, written as $e^{i\theta} = \cos \theta + i \sin \theta$, it's frequently used in complex analysis and other areas.
Re:Ask HN: What is your favorite equation?
by jfmiller28 on Saturday December 24, 2016 @12:36AM
(#13248740)
Same here. I'm with Heisenberg, "When I meet God, I am going to ask him two questions: Why relativity? And why turbulence? I really believe he will have an answer for the first."
Re:Ask HN: What is your favorite equation?
by softc on Saturday December 24, 2016 @02:16AM
(#13248980)
d^2/dx^2 sin(x) = -sin(x)
This means that sin(x) is an eigenfunction of the second derivative operator in the infinite dimensional vector space of functions.
This little fact makes numerically solving second-order differential equations using a sin(x) basis really cheap, just need to pay the upfront FFT cost... (O(n log n))
Re:Ask HN: What is your favorite equation?
by pmiller2 on Saturday December 24, 2016 @12:21AM
(#13248701)
V - E + F = 2 - 2g, the defining equation for the genus/Euler characteristic of a surface. It has applications all throughout topology and graph theory.
Re:Ask HN: What is your favorite equation?
by japhyr on Saturday December 24, 2016 @06:06PM
(#13252016)
I don't do graffiti often, but when I do this is what I write:
∇ ‧B = 0
I love the simplicity of the equation, and the implications that come from it.
(I only write it in places where graffiti has become acceptable, like some hike-in cabins. I also occasionally leave it in small writing in the corner of random whiteboards.)
Re:Ask HN: What is your favorite equation?
by jayajay on Saturday December 24, 2016 @01:43AM
(#13248909)
Euler's formula. This one formula is the most practical formula I've ever encountered. Once you learn it, you will never stop using it. The Schrodinger equation is a lot of fun, but you will likely stop using it if you stop doing quantum mechanics. Maxwell's equations are beautifully simple and tend to appear in many other contexts other than classical electrodynamics. For example, in the absence of charge, Maxwell's equations describe free waves -- which can appear in many contexts other than electromagnetic fields.
Re:Ask HN: What is your favorite equation?
by RaitoBezarius on Sunday December 25, 2016 @06:18AM
(#13253739)
Riemann Zeta function, so mysterious. How could complex numbers and complex analysis provide so many insights on number theory? That's so intriguing to me.
Re:Ask HN: What is your favorite equation?
by rimunroe on Saturday December 24, 2016 @09:12AM
(#13249815)
I can't really pick between the equation giving the Hamiltonian of a system, or the Euler-Lagrange equation. I'll go with the latter, because I learned it first. Learning about these in my classical mechanics course suddenly made an entire class of problems which was previously incredibly tedious to solve fall away into trivially easy forms. I got a similar feeling to when I learned about using Laplace transforms in my ordinary differential equations class.
Re:Ask HN: What is your favorite equation?
by micaksica on Saturday December 24, 2016 @12:14AM
(#13248684)
While not really a mathematical "equation", the Drake equation, simply for the debate it causes and the ramifications of parameter changes on what we think of as a race.
Re:Ask HN: What is your favorite equation?
by IndianAstronaut on Saturday December 24, 2016 @05:39PM
(#13251924)
This equation was the first serious attempt to quantify the number of civilizations in our universe. As we explore Europa and others, we will get some serious data points to improve our understanding of the origin of life in the universe.
Re:Ask HN: What is your favorite equation?
by mmmBacon on Saturday December 24, 2016 @01:41AM
(#13248903)
Del dot B = 0
Gauss's law for magnetism is so simultaneously simple and profound at the same time. It says that there is no such thing as magnetic charge (monopole).
Re:Ask HN: What is your favorite equation?
by jbpetersen on Saturday December 24, 2016 @02:44AM
(#13249018)
// since typing it out like this is preferable to reteaching myself LaTeX right now
let favoriteEquation = arr => {
let total = 0;
for(let x of arr)
total += Math.abs(x);
let normalizedArr = [];
for(let x of arr)
normalizedArr.push(Math.abs(x/total));
return normalizedArr;
};
Re:Ask HN: What is your favorite equation?
by softc on Saturday December 24, 2016 @02:08AM
(#13248964)
Just to clarify, mass-energy equivalence implies nothing about mass-energy conversion. We've never witnessed such a conversion nor do we know if it's possible. The implication is that mass difference of an atom after energy absorption is directly proportional to the energy absorbed. Energy is still energy in that case, no conversion has taken place.
Re:Ask HN: What is your favorite equation?
by Nevermark on Saturday December 24, 2016 @02:59AM
(#13249041)
This equation, and an unanswered question about it, has fascinated me most of my life:
a * b = exp(log a + log b)
Equivalently: a + b = log(exp a * exp b)
The reason I like this is that it is the numerical equivalent to De Morgan's Law of Boolean logic:
a and b = not(not a or not b)
Equivalently: a or b = not(not a and not b)
They are both dualities, where AND and PRODUCT can be thought of as intersections, with OR and PLUS being unions.
However their is one crucial difference, in the Boolean case the duality is based on a symmetric operation, in the numerical case they are not.
a = not b, b = not a
a = log b, b = exp a
It is very interesting that if you:
1) take a set of symbols, then define various adds and subtractions of those symbols you will get some result, which will be a sum of positive/negative versions of those symbols,
2) then replace all your additions and subtractions with multiplications and divisions of the same symbols,
...you will get an answer with exactly the same form, and with the same symbols, except with products/divisions instead of additions/subtractions. In isolation, addition and product behave exactly the same way!
We could call the addition/multiplier operator the combiner operator and the subtraction/divisor operator the remover operator, and forget about whether we were doing addition or multiplication and would still get the right answer either way.
It is only when you combine BOTH additions with multiplications in equations, that they operate different RELATIVE to each other, with the LOG/EXP relation "adjusting" values between their additive to multiplicative forms and back.
INSIGHT
So add and multiply are the same operations, but on values that are either the log or exp version of themselves respectively.
INSIGHT TAKES US TO AN ODD PLACE
Looked at that way, numbers live on an "Addition Ladder" where numbers start at the bottom rung where addition happens and to move up to multiplication we apply EXP before continuing to combine them with addition and then LOG them to get back to our home rung again.
Now that we have two rungs, why not operate at more levels up (EXP EXP) or below (LOG). The math is easy to do this, but for some reason nature doesn't seem to give us much use for "super-multiplication" or "sub-addition".
MY UNANSWERED QUESTION
Why doesn't nature use super-multiplication or sub-addition? Or does it somewhere and I am just not aware of it?
* If anyone has any insight on this, please pass it on! nevermark.mail at marks.house
Re:Ask HN: What is your favorite equation?
by softc on Saturday December 24, 2016 @04:25AM
(#13249169)
I think the similarity to de Morgan's law falls out naturally as a consequence of Boolean algebra having many similar properties to real number algebra, both for the multiplication operation and addition operation. Have you studied abstract algebra? Category theory?
Re:Ask HN: What is your favorite equation?
by rebootthesystem on Saturday December 24, 2016 @12:15PM
(#13250605)
In thinking about this I wanted to reach for something that fundamentally affected humanity. And then I came up with nothing. Literally. 0.
Quoting from Amazon:
"The Babylonians invented it, the Greeks banned it, the Hindus worshiped it, and the Church used it to fend off heretics. Now it threatens the foundations of modern physics. For centuries the power of zero savored of the demonic; once harnessed, it became the most important tool in mathematics. For zero, infinity's twin, is not like other numbers. It is both nothing and everything.
In Zero, Science Journalist Charles Seife follows this innocent-looking number from its birth as an Eastern philosophical concept to its struggle for acceptance in Europe, its rise and transcendence in the West, and its ever-present threat to modern physics. Here are the legendary thinkers—from Pythagoras to Newton to Heisenberg, from the Kabalists to today's astrophysicists—who have tried to understand it and whose clashes shook the foundations of philosophy, science, mathematics, and religion. Zero has pitted East against West and faith against reason, and its intransigence persists in the dark core of a black hole and the brilliant flash of the Big Bang. Today, zero lies at the heart of one of the biggest scientific controversies of all time: the quest for a theory of everything."
Chapter 0 intro from the book:
"Zero hit the USS Yorktown like a torpedo.
On September 21, 1997, while cruising off the coast of Virginia, the billion-dollar missile cruiser shuddered to a halt. Yorktown was dead in the water.
Warships are designed to withstand the strike of a torpedo or the blast of a mine. Though it was armored against weapons, nobody had thought to defend the Yorktown from zero. It was a grave mistake.
The Yorktown's computers had just received new software that was controlling the engines. Unfortunately, nobody had spotted the time bomb lurking in the code, a zero the engineers were supposed to remove while installing software. But for one reason or another, the zero was overlooked, and it stayed hidden in the code. Hidden, that is, until the software called it into memory --and choked."
This is a book about the history and issues surrounding the concept of nothing and it's mathematical representation, the number zero. It isn't a book about computers or programming. It's about zero from ancient times to physics.
Great book. Read it years ago. Going to read it again.
I immediately guessed Euler's identity and wrote "$e^{i\pi}+1=0$"
That was when we knew it was serious.
I got lucky (in more ways than one) because she'd nearly gone with her other choice, the continuum hypothesis
Of course that isn't the real point of the Y combinator, but this thought, this "equation" completely changed the way I think about programming.
used to find the line of best fit.
The first time I saw it I was in high school and I was watching Andrew Ng's machine learning class for the first time. My Math background was not the best and I didn't fully understand it until a couple of years later when I took MIT's free online course on linear algebra (OCW 18.06)
Proof: Since `B` is a minimum, the derivative of the expression minimized wrt `B` must be zero (the "derivative" is taken in the matrix sense here).
Solving for `B` you get the result.[1] https://isites.harvard.edu/fs/docs/icb.topic515975.files/OLS...
One of my favourite math lectures.
https://en.wikipedia.org/wiki/Mandelbrot_set
My son, when asking why knowing the speed of light matters, was impressed when I showed him we could make our own wifi antenna by using this to figure out the length it needed to be. Of course antenna design can be complex but this was still cool to show.
Oh so many reasons to love it and hate it
[1] http://www.espenhaug.com/black_scholes.html
[1] https://en.wikipedia.org/wiki/Phasor
This little fact makes numerically solving second-order differential equations using a sin(x) basis really cheap, just need to pay the upfront FFT cost... (O(n log n))
For equation, probably, Maxwell's equations, because I use them in my research.
∇ ‧B = 0
I love the simplicity of the equation, and the implications that come from it.
(I only write it in places where graffiti has become acceptable, like some hike-in cabins. I also occasionally leave it in small writing in the corner of random whiteboards.)
It just really took me by surprise when I learned it, and it's useful too.
N = R* • fp • ne • fl • fi • fc • L
https://en.wikipedia.org/wiki/Drake_equation
An excellent use of rough statistics to shatter long held beliefs. Even if life is incredibly rare, it most certainly exists somewhere else.
Gauss's law for magnetism is so simultaneously simple and profound at the same time. It says that there is no such thing as magnetic charge (monopole).
Using Einstein summation notation and covariant (raising and lowering operator) derivatives the curvature of spacetime can be compactly described.
Just the fact that energy can be converted to mass and mass can be converted into energy is very interesting
We sure have, LHC creates matter/anti-matter particle pairs using enormous amounts of concentrated energy.
E² = m²c⁴ + p²c²
v^2 = GM(2/r - 1/a)
It's so simple, and at the same time so useful for orbital mechanics.
It comes up so often! Whenever someone asks what's new, the answer, of course, is "E over h." :-)
https://en.wikipedia.org/wiki/Planck%E2%80%93Einstein_relati...
Probably the most important equation in my field (ecology).
However their is one crucial difference, in the Boolean case the duality is based on a symmetric operation, in the numerical case they are not.
It is very interesting that if you:1) take a set of symbols, then define various adds and subtractions of those symbols you will get some result, which will be a sum of positive/negative versions of those symbols,
2) then replace all your additions and subtractions with multiplications and divisions of the same symbols,
...you will get an answer with exactly the same form, and with the same symbols, except with products/divisions instead of additions/subtractions. In isolation, addition and product behave exactly the same way!
We could call the addition/multiplier operator the combiner operator and the subtraction/divisor operator the remover operator, and forget about whether we were doing addition or multiplication and would still get the right answer either way.
It is only when you combine BOTH additions with multiplications in equations, that they operate different RELATIVE to each other, with the LOG/EXP relation "adjusting" values between their additive to multiplicative forms and back.
INSIGHT
So add and multiply are the same operations, but on values that are either the log or exp version of themselves respectively.
INSIGHT TAKES US TO AN ODD PLACE
Looked at that way, numbers live on an "Addition Ladder" where numbers start at the bottom rung where addition happens and to move up to multiplication we apply EXP before continuing to combine them with addition and then LOG them to get back to our home rung again.
Now that we have two rungs, why not operate at more levels up (EXP EXP) or below (LOG). The math is easy to do this, but for some reason nature doesn't seem to give us much use for "super-multiplication" or "sub-addition".
MY UNANSWERED QUESTION
Why doesn't nature use super-multiplication or sub-addition? Or does it somewhere and I am just not aware of it?
* If anyone has any insight on this, please pass it on! nevermark.mail at marks.house
Shannon entropy
Quoting from Amazon:
"The Babylonians invented it, the Greeks banned it, the Hindus worshiped it, and the Church used it to fend off heretics. Now it threatens the foundations of modern physics. For centuries the power of zero savored of the demonic; once harnessed, it became the most important tool in mathematics. For zero, infinity's twin, is not like other numbers. It is both nothing and everything.
In Zero, Science Journalist Charles Seife follows this innocent-looking number from its birth as an Eastern philosophical concept to its struggle for acceptance in Europe, its rise and transcendence in the West, and its ever-present threat to modern physics. Here are the legendary thinkers—from Pythagoras to Newton to Heisenberg, from the Kabalists to today's astrophysicists—who have tried to understand it and whose clashes shook the foundations of philosophy, science, mathematics, and religion. Zero has pitted East against West and faith against reason, and its intransigence persists in the dark core of a black hole and the brilliant flash of the Big Bang. Today, zero lies at the heart of one of the biggest scientific controversies of all time: the quest for a theory of everything."
Chapter 0 intro from the book:
"Zero hit the USS Yorktown like a torpedo.
On September 21, 1997, while cruising off the coast of Virginia, the billion-dollar missile cruiser shuddered to a halt. Yorktown was dead in the water.
Warships are designed to withstand the strike of a torpedo or the blast of a mine. Though it was armored against weapons, nobody had thought to defend the Yorktown from zero. It was a grave mistake.
The Yorktown's computers had just received new software that was controlling the engines. Unfortunately, nobody had spotted the time bomb lurking in the code, a zero the engineers were supposed to remove while installing software. But for one reason or another, the zero was overlooked, and it stayed hidden in the code. Hidden, that is, until the software called it into memory --and choked."
This is a book about the history and issues surrounding the concept of nothing and it's mathematical representation, the number zero. It isn't a book about computers or programming. It's about zero from ancient times to physics.
Great book. Read it years ago. Going to read it again.
Here's the link:
https://www.amazon.com/Zero-Biography-Dangerous-Charles-Seif...