News for hackers. Stuff that matters.
Re:Translating math into code with examples in Java, Racket,... by enriquto on Tuesday May 28, 2019 @11:41AM (#20031231)
you will take single letter variables from my cold, dead, hands!

I'm more used to math than to code, and I find multiple-letter variables ridiculous when not unreadable.

In the ancient times, mathematicians used to write formulas using latin sentences. Even the simplest arithmetic result occupied a few lines of text. Are you proposing that we go back to that age?

Re:Translating math into code with examples in Java, Racket,... by jerf on Tuesday May 28, 2019 @12:00PM (#20031400)
" Even the simplest arithmetic result occupied a few lines of text. Are you proposing that we go back to that age? "

What if students learned "Force = mass * acceleration", and only later moved to "F = ma" once they'd gotten tired of writing it, instead of smacking students in the face with "F = ma" right out of the gate, to say nothing of all the other stuff we smack them with right away?

Re:Translating math into code with examples in Java, Racket,... by throwawaymath on Tuesday May 28, 2019 @12:10PM (#20031506)
That's precisely how I learned that formula. In fact that's basically the pedagogy that's been presented to me for almost all the mathematics I've learned.

Sets? Define a set semantically, then replace "set" with S. Vector spaces? Define a vector space semantically, then replace "vector space" with V. Limits? Define a limit semantically, then replace the word with "lim".

Moreover mathematicians typically use jargon in a more reader-friendly way than simply throwing obtuse equations at them. Expressions, equations, inequalities and identities are complements to the proof, not the proofs themselves. Best practice holds that you present a theorem in plain language alongside the necessary notation, then break its proof down into as many atomic units (lemmas, propositions, corollaries, etc) as possible. Here is a blog post[1] from Terence Tao giving general advice for why that's useful. Tao has written a bunch[2] of these on the theme of emphasizing exposition and clarity.

Also contrary to popular belief, well-written mathematics papers actually have quite a lot of exposition in them. For a famous example, look at Yitang Zhang's proof[3] that there are infinitely many primes with 70 million numbers (or fewer) in between them. He spends a full five pages on introduction, background results used to develop the proof, and (most importantly) notation. He also includes a "sketch" of the proof in broad strokes so that a reader can follow his arguments at both a high level and in gritty detail.

That doesn't mean papers like Zhang's are accessible to most people. The jargon is still there and you can't really change that unless you want papers to become self-contained monographs. But the point is that what you're proposing - concepts defined in a straightforward way before moving on to dense notation - is already the general practice.

__________________________________

1. https://terrytao.wordpress.com/advice-on-writing-papers/crea...

2. https://terrytao.wordpress.com/advice-on-writing-papers/

3. http://annals.math.princeton.edu/2014/179-3/p07

Re:Translating math into code with examples in Java, Racket,... by gus_massa on Tuesday May 28, 2019 @01:09PM (#20032081)
Usually the problem is that the students don't understand the difference between force and energy, or the difference between mass and weight (or what is linear momentum). It is easy to remember that [in that class] a capital F means force.

Anyway, in sometimes it is useful to write more. For example teaching https://en.wikipedia.org/wiki/Consistent_and_inconsistent_eq... I try to write the full name of the classification at least for two clases. It is painful, but it is worth. I teach in Spanish, so we have also the problem that underdetermined is "indeterminado", so a capital "I" can mean "Inconsistent" or "[I]underdetermined" or in one of the following clases "Independent" (like in a linear independent set of vectors, yes they mix this too). So it is important to use the full name (or a long enough abbreviation) until you are sure that everyone can understand which "I" you are writing.

Re:Translating math into code with examples in Java, Racket,... by enriquto on Tuesday May 28, 2019 @12:14PM (#20031536)
but even "force = mass * acceleration" uses those sneaky single-letter symbols that are not even letters! In appropriate, user friendly notation it would be "force equals mass multiplied by acceleration".

But this is not clear enough. What force? What acceleration? More precisely, what is the direction of the acceleration? The original statement of this law is less ambiguous: "Mutationem motus proportionalem esse vi motrici impressae, et fieri secundum lineam rectam qua vis illa imprimitur. "

Or, in plain english: "The alteration of motion is ever proportional to the motive force impress'd; and is made in the direction of the right line in which that force is impress'd"

There! we are good to go. Now write the fundamental theorem of calculus in english, readable by everybody, without those ugly, unreadable variables and fancy symbols...

Re:Translating math into code with examples in Java, Racket,... by jerf on Tuesday May 28, 2019 @01:13PM (#20032113)
I'm not seeking abstract philosophical purity, or trying to make the mistake of including a complete transitive concept closure in every equation [1]. I'm seeking pragmatic high-quality education that doesn't blow our student's cognitive resources on stupid shit instead of the stuff I want them to learn. By the time they get to physics, they know what multiplication and equality are. It's just the "force", "mass", and "acceleration" that they don't know yet, so we don't abbreviate them until they do.

[1]: AIUI, the actual problem the original "New Math" had. The original "New Math" tried to start students with set theory, because that was the foundations of mathematics, so obviously, the best place to start an education, right? (Hint: No.) This is why parents said they didn't understand "New Math". By comparison "Common Core" math is all-but-identical to what I learned in school 30 years ago.

Re:Translating math into code with examples in Java, Racket,... by enriquto on Tuesday May 28, 2019 @01:20PM (#20032185)
I do not disagree with you. When you learn the stuff, it is perfectly OK to explain equations with words and even write equations with words. But this is akin to the comments of a program. Once you get down to work, in a professional setting, all mathematics uses single-letter variables

(and I may add that all programming should do the same).

I also agree with you that starting math with set theory is utterly ridiculous and even harmful. You should start with arithmetic and with geometry (obviously, using single-letter variables when needed).

Re:Translating math into code with examples in Java, Racket,... by nixonpjoshua1 on Tuesday May 28, 2019 @12:20PM (#20031591)
Seems like this would be sensible, the multiplication symbol is one any student learning this should already be familiar with. To generalize, keep using well-learned symbols so things don't get out of hand in verbosity and slowly introducing new ones seems logical. I know when I was in school there were certain math and physics classes where I kept having to ask myself what a symbol meant that was introduced 5 minutes ago so writing it out fully would have been helpful often.