5 ms·
I'm also under the impression that mathematicians generally work much more deeply with a smaller set of variables, so you actually don't need to name that many
by Quekid5 5y ago
I'm also under the impression that mathematicians generally work much more deeply with a smaller set of variables, so you actually don't need to name that many individual concepts.
A typical program contains thousands and thousands of "named things", so you're naturally going to see a proliferation of names. That just doesn't seem to be that necessary in math once you're working in a particular context (e.g. statistics).
- kennywinker 5y agoTranslation: i learned my domain’s variable names, so you should have to as well. Currently learning some dsp. One of the biggest barriers to entry has been the inscrutable variable names inherited from the field’s math connections.
- kaba0 5y agoFeel free to reason about a complex statistics formula with full-blown variable names. There are reasons for short variable names. Pass into a specific function a descriptive name of what you do, but do use the mathematically "accepted" writing mode in the implementation of a well-known function.
- kennywinker 5y ago> There are reasons for short variable names Which are? I suspect the reasons are a combination of the price of paper and ink, the history of teaching using chalkboards. None of those mean we can’t make the canonical version of an equation the expanded representation. Why do we all know e=mc2 and not energy = mass * lightspeed^2. The broader the base of people that have to interact with a formula, the less mathy the terminology tends to be. Think of trigonometry. Instead of greek letters the sides of a triangle and the functions get real world names. Sine(angle) = opposite / hypotenuse. Sure when you write that out you use sin ϴ = O/H but that’s just a compressed representation of human-readable variable names.
- kaba0 5y agoHow about Gauss’s distribution’s density function? Or a numerically stable version of a simpler formula? Also, you forgot the usual case of implementing a whitepaper with mathematical notation. It is much easier to proof read that, when you copy largely the same in your program as well. And if you pass in the readable energy, mass, etc variables, inside the function you can use the domain-specific mathematical notation. That way it will be readable both outside and inside.
- kennywinker 5y agoI think we might be arguing different points. I'm not saying use different variable names from the canonical math version - I'm saying the canonical math version should use variable names instead of symbols. So per your point - I'm not qualified to re-define mathematical notation so I won't go very far with it, but taking the formula you mentioned, Gaussian distribution density function (not focusing on the fact that I had to re-write it in pseudocode to represent it in a text format): f(x) = 1/(σ * sqrt(2*pi))*e^(-1/2*((x-μ)/σ)^2) I would suggest a couple changes: - change σ to `standard_deviation`, or if you don't like snake_case I could handle `stddev` - change μ to `mean`. - change x to `input` - there may be a better name than that, and x is pretty widely used in math so I'm not married to this one. - e should probably stay the same - e means e no matter the mathematical context, while μ means different things in different fields of math. f(input) = 1/(standard_deviation * sqrt(2*pi))*e^(-1/2*((input-mean)/standard_deviation)^2) This doesn't make it more or less readable, but it does mean I don't have to _just know_ or look up that μ is `mean` to parse it.
- kaba0 5y agoI accept your position, and perhaps my examples for a difficult formula was not difficult enough — my point is more along the line that the underlying structure of a formula becomes more easily visible with shorter symbols — and for syntactic manipulation one can more easily see patterns emerge.