I’ve been working for the past 15 months on repairing my rusty math
skills, ever since I read a biography of Johnny von Neumann. I’ve read a
huge stack of math books, and I have an even bigger stack of unread math
books. And it’s starting to come together.

最近在找一些传统离散数学以外的数学书,想从其他角度补习一下计算机科学相关的数学知识,偶然间就看到一些人都推荐了这篇文章Math
For
Programmers,通读了一遍果然不错。但文章有点长,所以没逐字逐句地翻译,只是对每个部分做一下总结,并标注了一些写得很不错的地方。

2009年9月8日,开学第一天,奥巴马到弗吉尼亚州阿林顿市的一所高中参加集会并发表电视演讲。这篇名为《我们为什么要上学》的演讲,成为万千英文学习者必备的文章。

自从我读了Johnny von
Neumann的传记,我已经为弥补我糟糕的数学技能花了15个月了.读了大量的数学书籍,不过呢,似乎我还有更多没有读.当然我会接着做的.

非常难能可贵地是,作者并没有像老师或者大牛一样说教或者“炫技”,而是一直在强调两点:兴趣热情和解决问题的直觉。不管通篇作者说了多少东西,他都希望你能保持热情,哪怕每天学一点点,只要能有用能进步就好。另外就是我们不是要成为数学家,最重要的是培养直觉,独立发现问题、解决问题的思路。


Let me tell you about it.

遗憾的是,作者只推荐了通过Wiki“泛学”数学这一个途径,没有推荐具体的书籍和资料。目前看Dover系列的书好像比较符合作者的要求,比如《Concepts
of Modern Mathematics》、《Introduction to Graph
Theory》、《Introduction to Probability
Theory》口碑都还不错,但因为还没看过所以也不敢妄自推荐。等读过一些之后,再给大家分享一些心得和建议吧。

Hello, everybody! Thank you. Thank you. Thank you, everybody. All right,
everybody go ahead and have a seat. How is everybody doing today?
(Applause.) How about Tim Spicer? (Applause.) I am here with students at
Wakefield High School in Arlington, Virginia. And we’ve got students
tuning in from all across America, from kindergarten through 12th grade.
And I am just so glad that all could join us today. And I want to thank
Wakefield for being such an outstanding host. Give yourselves a big
round of applause. (Applause.)

现在我就来告诉你这些.

Math For Programmers

作者最近一年半一直在想法恢复自己生疏的数学技巧,于是读了一大堆数学书,还有更大一堆没读的。那就听听作者在这一年半经历后有什么心得吧。

I’ve been working for the past 15 months on repairing my rusty math
skills, ever since I read a biography of Johnny von Neumann. I’ve read a
huge stack of math books, and I have an even bigger stack of unread math
books. And it’s starting to come together. Let me tell you about it.


I know that for many of you, today is the first day of school. And for
those of you in kindergarten, or starting middle or high school, it’s
your first day in a new school, so it’s understandable if you’re a
little nervous. I imagine there are some seniors out there who are
feeling pretty good right now — (applause) — with just one more year
to go. And no matter what grade you’re in, some of you are probably
wishing it were still summer and you could’ve stayed in bed just a
little bit longer this morning.

Conventional Wisdom Doesn’t Add Up

澳门葡萄京官方网站 ,Conventional Wisdom Doesn’t Add Up

作者一上来先谈了一下程序员到底需不需要学点数学知识。语言比较风趣,用词有些戏谑:程序员不需要学数学,极端点说,你甚至不需要会编程,因为你还可以做项目管理、UI设计、技术写作、系统管理员等等非编码或轻编码类的职位。实际上,你不需要知道任何事情,能保证继续活着就行
:)

之后,作者说到其实程序员学数学是很有优势的,你会发现原来数学挺简单的。只是这里说的数学不是我们学校里的数学,或者说学校的教学方法不对。看了这一部分后,对重拾数学建立起了些许的信心。作者后面部分甚至说拿起微积分教材,很快就看完了,我也想试试……

First: programmers don’t think they need to know math. I hear that so
often; I hardly know anyone who disagrees. Even programmers who were
math majors tell me they don’t really use math all that much! They say
it’s better to know about design patterns, object-oriented
methodologies, software tools, interface design, stuff like that.

And you know what? They’re absolutely right. You can be a good, solid,
professional programmer without knowing much math. But hey, you don’t
really need to know how to program, either. Let’s face it: there are a
lot of professional programmers out there who realize they’re not very
good at it, and they still find ways to contribute.

If you’re suddenly feeling out of your depth, and everyone appears to be
running circles around you, what are your options? Well, you might
discover you’re good at project management, or people management, or UI
design, or technical writing, or system administration, any number of
other important things that “programmers” aren’t necessarily any good
at
. You’ll start filling those niches (because there’s always more
work to do), and as soon as you find something you’re good at, you’ll
probably migrate towards doing it full-time. In fact, I don’t think
you need to know anything, as long as you can stay alive somehow
.

So they’re right: you don’t need to know math, and you can get by for
your entire life just fine without it. But a few things I’ve learned
recently might surprise you:

  1. Math is a lot easier to pick up after you know how to program.
    In fact, if you’re a halfway decent programmer, you’ll find it’s
    almost a snap.

  2. They teach math all wrong in school. Way, WAY wrong. If you
    teach yourself math the right way, you’ll learn faster, remember it
    longer, and it’ll be much more valuable to you as a programmer.

  3. Knowing even a little of the right kinds of math can enable you do
    write some pretty interesting programs that would otherwise be too
    hard. In other words, math is something you can pick up a little at
    a time, whenever you have free time.

  4. Nobody knows all of math, not even the best mathematicians. The
    field is constantly expanding, as people invent new formalisms to
    solve their own problems. And with any given math problem, just like
    in programming, there’s more than one way to do it. You can pick the
    one you like best.

  5. Math is… ummm, please don’t tell anyone I said this; I’ll never get
    invited to another party as long as I live. But math, well… I’d
    better whisper this, so listen up: (it’s actually kinda fun.)


I know that feeling. When I was young, my family lived overseas. I lived
in Indonesia for a few years. And my mother, she didn’t have the money
to send me where all the American kids went to school, but she thought
it was important for me to keep up with an American education. So she
decided to teach me extra lessons herself, Monday through Friday. But
because she had to go to work, the only time she could do it was at 4:30
in the morning.

告别传统观念

The Math You Learned (And Forgot)

我们在学校里学习的数学,只是为了让大家以后成为科学家或工程师时能有一些预备知识,而不是专为编程而设计的课程。所以程序员觉得不用学数学也就不足为奇了,因为一提到数学首先想到的就是学校里的,那些感觉对自己编程职业生涯没什么用的“数学”。

Here’s the math I learned in school, as far as I can remember:

  • Grade School: Numbers, Counting, Arithmetic, Pre-Algebra (“story
    problems”)
  • High School: Algebra, Geometry, Advanced Algebra, Trigonometry,
    Pre-Calculus (conics and limits)
  • College: Differential and Integral Calculus, Differential
    Equations, Linear Algebra, Probability and Statistics, Discrete Math

How’d they come up with that particular list for high school, anyway?
It’s more or less the same courses in most U.S. high schools. I think
it’s very similar in other countries, too, except that their students
have finished the list by the time they’re nine years old. (Americans
really kick butt at monster-truck competitions, though, so it’s not a
total loss.)

Algebra? Sure. No question. You need that. And a basic understanding of
Cartesian geometry, too. Those are useful, and you can learn everything
you need to know in a few months, give or take. But the rest of them? I
think an introduction to the basics might be useful, but spending a
whole semester or year on them seems ridiculous.

I’m guessing the list was designed to prepare students for science and
engineering professions. The math courses they teach in and high school
don’t help ready you for a career in programming, and the simple fact is
that the number of programming jobs is rapidly outpacing the demand for
all other engineering roles.

And even if you’re planning on being a scientist or an engineer, I’ve
found it’s much easier to learn and appreciate geometry and trig after
you understand what exactly math is — where it came from, where it’s
going, what it’s for. No need to dive right into memorizing geometric
proofs and trigonometric identities. But that’s exactly what high
schools have you do.

So the list’s no good anymore. Schools are teaching us the wrong math,
and they’re teaching it the wrong way. It’s no wonder programmers
think they don’t need any math: most of the math we learned isn’t
helping us
.


Now, as you might imagine, I wasn’t too happy about getting up that
early. And a lot of times, I’d fall asleep right there at the kitchen
table. But whenever I’d complain, my mother would just give me one of
those looks and she’d say, ‘This is no picnic for me either, buster.’
(Laughter.)

First: programmers don’t think they need to know math. I hear that so
often; I hardly know anyone who disagrees. Even programmers who were
math majors tell me they don’t really use math all that much! They say
it’s better to know about design patterns, object-oriented
methodologies, software tools, interface design, stuff like that.

The Math They Didn’t Teach You

最重要的区别,学校里学的都是连续数学,而我们需要的则是离散数学,关注整数。对程序员来说,最重要的数学分支是概率论,它是你在学校学完算数后最应该立刻学的东西。当你在想有多少种或多大几率时(即计数和计算概率),都是概率问题。此外,还有统计、线性代数、逻辑、信息论也都是对编程很有用的数学分支

如果一门数学课程,能花一整周,用最生动有趣的方式先讲讲这门学科的来龙去脉,为什么我们要学习它的话,那将多美妙!感觉这也应该是很多想求学的人的心声。很多时候,你很想学会一门技术,但当你扎进知识的海洋里迷路时,就会失去最初的冲动和兴趣。正确的引导,有趣的背景知识,让我们知道自己为什么要学,才是正确的方式。不知道这种方式可不可以也类比成“自顶向下”,而不是Dynamic
Programming自底向上的方式
。即有了宏观的、高层次的知识,再向下学习时会事半功倍。

The math computer scientists use regularly, in real life, has very
little overlap with the list above. For one thing, most of the math
you learn in grade school and high school is continuous: that is, math
on the real numbers. For computer scientists, 95% or more of the
interesting math is discrete: i.e., math on the integers
.

I’m going to talk in a future blog about some key differences between
computer science, software engineering, programming, hacking, and other
oft-confused disciplines. I got the basic framework for these (upcoming)
insights in no small part from Richard Gabriel’s Patterns Of Software,
so if you absolutely can’t wait, go read that. It’s a good book.

For now, though, don’t let the term “computer scientist” worry you. It
sounds intimidating, but math isn’t the exclusive purview of computer
scientists; you can learn it all by yourself as a closet hacker, and be
just as good (or better) at it than they are. Your background as a
programmer will help keep you focused on the practical side of things.

The math we use for modeling computational problems is, by and large,
math on discrete integers. This is a generalization. If you’re with me
on today’s blog, you’ll be studying a little more math from now on than
you were planning to before today, and you’ll discover places where the
generalization isn’t true. But by then, a short time from now, you’ll be
confident enough to ignore all this and teach yourself math the way you
want to learn it.

For programmers, the most useful branch of discrete math is
probability theory. It’s the first thing they should teach you after
arithmetic, in grade school
. What’s probability theory, you ask? Why,
it’s counting. How many ways are there to make a Full House in poker? Or
a Royal Flush? Whenever you think of a question that starts with “how
many ways…” or “what are the odds…”, it’s a probability question
. And
as it happens (what are the odds?), it all just turns out to be “simple”
counting. It starts with flipping a coin and goes from there. It’s
definitely the first thing they should teach you in grade school after
you learn Basic Calculator Usage.

I still have my discrete math textbook from college. It’s a bit
heavyweight for a third-grader (maybe), but it does cover a lot of the
math we use in “everyday” computer science and computer engineering.

Oddly enough, my professor didn’t tell me what it was for. Or I didn’t
hear. Or something. So I didn’t pay very close attention: just enough to
pass the course and forget this hateful topic forever, because I didn’t
think it had anything to do with programming. That happened in quite a
few of my comp sci courses in college, maybe as many as 25% of them.
Poor me! I had to figure out what was important on my own, later, the
hard way.

I think it would be nice if every math course spent a full week just
introducing you to the subject, in the most fun way possible, so you
know why the heck you’re learning it
. Heck, that’s probably true for
every course.

Aside from probability and discrete math, there are a few other branches
of mathematics that are potentially quite useful to programmers, and
they usually don’t teach them in school, unless you’re a math minor.
This list includes:

  • Statistics, some of which is covered in my discrete math book,
    but it’s really a discipline of its own. A pretty important one,
    too, but hopefully it needs no introduction.

  • Algebra and Linear Algebra (i.e., matrices). They should teach
    Linear Algebra immediately after algebra. It’s pretty easy, and it’s
    amazingly useful in all sorts of domains, including machine
    learning.

  • Mathematical Logic. I have a really cool totally unreadable book
    on the subject by Stephen Kleene, the inventor of the Kleene closure
    and, as far as I know, Kleenex. Don’t read that one. I swear I’ve
    tried 20 times, and never made it past chapter 2. If anyone has a
    recommendation for a better introduction to this field, please post
    a comment. It’s obviously important stuff, though.

  • Information Theory and Kolmogorov Complexity. Weird, eh? I bet
    none of your high schools taught either of those. They’re both
    pretty new. Information theory is (veeery roughly) about data
    compression, and Kolmogorov Complexity is (also roughly) about
    algorithmic complexity. I.e., how small you can you make it, how
    long will it take, how elegant can the program or data structure be,
    things like that. They’re both fun, interesting and useful.

There are others, of course, and some of the fields overlap. But it just
goes to show: the math that you’ll find useful is pretty different
from the math your school thought would be useful
.

What about calculus? Everyone teaches it, so it must be important,
right? Well, calculus is actually pretty easy. Before I learned it, it
sounded like one of the hardest things in the universe, right up there
with quantum mechanics. Quantum mechanics is still beyond me, but
calculus is nothing. After I realized programmers can learn math
quickly, I picked up my Calculus textbook and got through the entire
thing in about a month, reading for an hour an evening
.

Calculus is all about continuums — rates of change, areas under curves,
volumes of solids. Useful stuff, but the exact details involve a lot of
memorization and a lot of tedium that you don’t normally need as a
programmer. It’s better to know the overall concepts and techniques, and
go look up the details when you need them.

Geometry, trigonometry, differentiation, integration, conic sections,
differential equations, and their multidimensional and multivariate
versions — these all have important applications. It’s just that you
don’t need to know them right this second. So it probably wasn’t a great
idea to make you spend years and years doing proofs and exercises with
them, was it? If you’re going to spend that much time studying math, it
ought to be on topics that will remain relevant to you for life.


So I know that some of you are still adjusting to being back at school.
But I’m here today because I have something important to discuss with
you. I’m here because I want to talk with you about your education and
what’s expected of all of you in this new school year.

首先:程序员不认为他们需要了解数学.我常常听到这样的话;我不知道还有没有不同意的.甚至于以前是主修数学的程序员也告诉我他们真的不是常常使用到数学!他们说
更重要的是要去了解设计模式,面向对象原理,软件工具,界面设计,以及一些其他类似的东西.

The Right Way To Learn Math

前面作者已经列举了一些重要的数学分支,那如何学呢?要广度优先,而不是深度优先。就像图和递归算法里的BFS策略一样,每一门都“浅尝辄止”:忘掉具体的算法和证明,了解它的名字、用处、有什么限制、谁在什么情况下发明的、大概是计算什么的。这里作者用了一个很妙的比喻,将程序员学习数学的方式想象成是数学专业的文科学位

数学最排外的部分可能就是它抽象的符号化,但作者也说这对程序员来说根本不是问题,比如求和符号西格玛与代码里循环的关系。

The right way to learn math is breadth-first, not depth-first. You
need to survey the space, learn the names of things, figure out what’s
what.

To put this in perspective, think about long division. Raise your hand
if you can do long division on paper, right now. Hands? Anyone? I didn’t
think so.

I went back and looked at the long-division algorithm they teach in
grade school, and damn if it isn’t annoyingly complicated. It’s
deterministic, sure, but you never have to do it by hand, because it’s
easier to find a calculator, even if you’re stuck on a desert island
without electricity. You’ll still have a calculator in your watch, or
your dental filling, or something.

Why do they even teach it to you? Why do we feel vaguely guilty if we
can’t remember how to do it? It’s not as if we need to know it anymore.
And besides, if your life were on the line, you know you could perform
long division of any arbitrarily large numbers. Imagine you’re
imprisoned in some slimy 3rd-world dungeon, and the dictator there won’t
let you out until you’ve computed 219308862/103503391. How would you do
it? Well, easy. You’d start subtracting the denominator from the
numerator, keeping a counter, until you couldn’t subtract it anymore,
and that’d be the remainder. If pressed, you could figure out a way to
continue using repeated subtraction to estimate the remainder as decimal
number (in this case, 0.1185678219, or so my Emacs M-x calc tells me.
Close enough!)

You could figure it out because you know that division is just repeated
subtraction. The intuitive notion of division is deeply ingrained now.

The right way to learn math is to ignore the actual algorithms and
proofs
, for the most part, and to start by learning a little bit about
all the techniques: their names, what they’re useful for,
approximately how they’re computed, how long they’ve been around,
(sometimes) who invented them, what their limitations are, and what
they’re related to. Think of it as a Liberal Arts degree in
mathematics
.

Why? Because the first step to applying mathematics is problem
identification
. If you have a problem to solve, and you have no idea
where to start, it could take you a long time to figure it out. But if
you know it’s a differentiation problem, or a convex optimization
problem, or a boolean logic problem, then you at least know where to
start looking for the solution.

There are lots and lots of mathematical techniques and entire
sub-disciplines out there now. If you don’t know what combinatorics is,
not even the first clue, then you’re not very likely to be able to
recognize problems for which the solution is found in combinatorics, are
you?

But that’s actually great news, because it’s easier to read about the
field and learn the names of everything than it is to learn the actual
algorithms and methods for modeling and computing the results. In school
they teach you the Chain Rule, and you can memorize the formula and
apply it on exams, but how many students really know what it “means”? So
they’re not going to be able to know to apply the formula when they run
across a chain-rule problem in the wild. Ironically, it’s easier to know
what it is than to memorize and apply the formula. The chain rule is
just how to take the derivative of “chained” functions — meaning,
function x() calls function g(), and you want the derivative of x(g()).
Well, programmers know all about functions; we use them every day, so
it’s much easier to imagine the problem now than it was back in school.

Which is why I think they’re teaching math wrong. They’re doing it wrong
in several ways. They’re focusing on specializations that aren’t
proving empirically to be useful to most high-school graduates, and
they’re teaching those specializations backwards. You should learn how
to count, and how to program, before you learn how to take derivatives
and perform integration
.

I think the best way to start learning math is to spend 15 to 30 minutes
a day surfing in Wikipedia. It’s filled with articles about thousands of
little branches of mathematics. You start with pretty much any article
that seems interesting (e.g. String theory, say, or the Fourier
transform, or Tensors, anything that strikes your fancy.) Start reading.
If there’s something you don’t understand, click the link and read about
it. Do this recursively until you get bored or tired.

Doing this will give you amazing perspective on mathematics, after a few
months. You’ll start seeing patterns — for instance, it seems that just
about every branch of mathematics that involves a single variable has a
more complicated multivariate version, and the multivariate version is
almost always represented by matrices of linear equations. At least for
applied math. So Linear Algebra will gradually bump its way up your
list, until you feel compelled to learn how it actually works, and
you’ll download a PDF or buy a book, and you’ll figure out enough to
make you happy for a while.

With the Wikipedia approach, you’ll also quickly find your way to the
Foundations of Mathematics, the Rome to which all math roads lead. Math
is almost always about formalizing our “common sense” about some domain,
so that we can deduce and/or prove new things about that domain.
Metamathematics is the fascinating study of what the limits are on math
itself: the intrinsic capabilities of our formal models, proofs,
axiomatic systems, and representations of rules, information, and
computation.

One great thing that soon falls by the wayside is notation.
Mathematical notation is the biggest turn-off to outsiders
. Even if
you’re familiar with summations, integrals, polynomials, exponents,
etc., if you see a thick nest of them your inclination is probably to
skip right over that sucker as one atomic operation.

However, by surveying math, trying to figure out what problems people
have been trying to solve (and which of these might actually prove
useful to you someday), you’ll start seeing patterns in the notation,
and it’ll stop being so alien-looking. For instance, a summation sign
(capital-sigma) or product sign (capital-pi) will look scary at first,
even if you know the basics. But if you’re a programmer, you’ll soon
realize it’s just a loop
: one that sums values, one that multiplies
them. Integration is just a summation over a continuous section of a
curve, so that won’t stay scary for very long, either.

Once you’re comfortable with the many branches of math, and the many
different forms of notation, you’re well on your way to knowing a lot of
useful math. Because it won’t be scary anymore, and next time you see a
math problem, it’ll jump right out at you. “Hey,” you’ll think, “I
recognize that. That’s a multiplication sign!”

And then you should pull out the calculator. It might be a very fancy
calculator such as R, Matlab, Mathematica, or a even C library for
support vector machines. But almost all useful math is heavily
automatable, so you might as well get some automated servants to help
you with it.


Now, I’ve given a lot of speeches about education. And I’ve talked about
responsibility a lot.

And you know what? They’re absolutely right. You can be a good, solid,
professional programmer without knowing much math.

When Are Exercises Useful?

如何练习和实践呢?就像读代码一样!了解作者的意图、设计思想,主要是要解决什么问题,计算什么数据。读数学资料也是一样的,让直觉引导你,了解大意,当你发现一些东西与你的直觉不一致时,再深入进去了解。最重要的,不要让任何东西削减你的热情

After a year of doing part-time hobbyist catch-up math, you’re going to
be able to do a lot more math in your head, even if you never touch a
pencil to a paper. For instance, you’ll see polynomials all the time, so
eventually you’ll pick up on the arithmetic of polynomials by osmosis.
Same with logarithms, roots, transcendentals, and other fundamental
mathematical representations that appear nearly everywhere.

I’m still getting a feel for how many exercises I want to work through
by hand. I’m finding that I like to be able to follow explanations
(proofs) using a kind of “plausibility test” — for instance, if I see
someone dividing two polynomials, I kinda know what form the result
should take, and if their result looks more or less right, then I’ll
take their word for it. But if I see the explanation doing something
that I’ve never heard of, or that seems wrong or impossible, then I’ll
dig in some more
.

That’s a lot like reading programming-language source code, isn’t it?
You don’t need to hand-simulate the entire program state as you read
someone’s code; if you know what approximate shape the computation will
take, you can simply check that their result makes sense. E.g. if the
result should be a list, and they’re returning a scalar, maybe you
should dig in a little more. But normally you can scan source code
almost at the speed you’d read English text (sometimes just as fast),
and you’ll feel confident that you understand the overall shape and that
you’ll probably spot any truly egregious errors.

I think that’s how mathematically-inclined people (mathematicians and
hobbyists) read math papers, or any old papers containing a lot of math.
They do the same sort of sanity checks you’d do when reading code, but
no more, unless they’re intent on shooting the author down
.

With that said, I still occasionally do math exercises. If something
comes up again and again (like algebra and linear algebra), then I’ll
start doing some exercises to make sure I really understand it.

But I’d stress this: don’t let exercises put you off the math. If an
exercise (or even a particular article or chapter) is starting to bore
you, move on. Jump around as much as you need to. Let your intuition
guide you. You’ll learn much, much faster doing it that way, and your
confidence will grow almost every day
.


I’ve talked about teachers’ responsibility for inspiring students and
pushing you to learn.

你了解吗?他们完全正确.你不需要了解很多数学你就能做个很棒,很专业的程序员.

How Will This Help Me?

经过不断地学习,作者本人已经能够写一些“数学味”比较浓重的代码了,比如神经网络、基因算法、贝叶斯分类器、聚类算法、图像匹配等等非常酷的东西,之后还可以拿给朋友炫耀
:)

当你掌握了足够多的知识后,你会发现那些数学符号其实是在让事情变简单而不是让你冒冷汗,就像一段优雅的代码一样。不了解语法语义时可能摸不着头脑,熟悉之后就能看出其简洁和美妙。

最后作者反复强调的一点,一定要保持兴趣。你可以花整个周末看数学,也可能几个月都没继续,但只要每次你看一点都能有所收获,就可以了。不要让任何规矩束缚你,学到了就好

Well, it might not — not right away. Certainly it will improve your
logical reasoning ability; it’s a bit like doing exercise at the gym,
and your overall mental fitness will get better if you’re pushing
yourself a little every day.

For me, I’ve noticed that a few domains I’ve always been interested in
(including artificial intelligence, machine learning, natural language
processing, and pattern recognition) use a lot of math
. And as I’ve
dug in more deeply, I’ve found that the math they use is no more
difficult than the sum total of the math I learned in high school; it’s
just different math, for the most part. It’s not harder. And learning
it is enabling me to code (or use in my own code) neural networks,
genetic algorithms, bayesian classifiers, clustering algorithms, image
matching, and other nifty things that will result in cool applications I
can show off to my friends
.

And I’ve gradually gotten to the point where I no longer break out in
a cold sweat when someone presents me with an article containing math
notation: n-choose-k, differentials, matrices, determinants, infinite
series, etc. The notation is actually there to make it easier, but (like
programming-language syntax) notation is always a bit tricky and
daunting on first contact
. Nowadays I can follow it better, and it no
longer makes me feel like a plebian when I don’t know it. Because I know
I can figure it out.

And that’s a good thing.

And I’ll keep getting better at this. I have lots of years left, and
lots of books, and articles. Sometimes I’ll spend a whole weekend
reading a math book, and sometimes I’ll go for weeks without thinking
about it even once. But like any hobby, if you simply trust that it will
be interesting, and that it’ll get easier with time, you can apply it as
often or as little as you like and still get value out of it
.

Math every day. What a great idea that turned out to be!

I’ve talked about your parents’ responsibility for making sure you stay
on track, and you get your homework done, and don’t spend every waking
hour in front of the TV or with the Xbox.

But hey, you don’t really need to know how to program, either. Let’s
face it: there are a lot of professional programmers out there who
realize they’re not very good at it, and they still find ways to
contribute.

I’ve talked a lot about your government’s responsibility for setting
high standards, and supporting teachers and principals, and turning
around schools that aren’t working, where students aren’t getting the
opportunities that they deserve.

但是呢,同时你也不是真的需要知道如何来编程.我们要面对的是:有很多专业的程序员,他们认识到他们不是非常擅长数学,但他们还是寻找方法去提升.

But at the end of the day, we can have the most dedicated teachers, the
most supportive parents, the best schools in the world — and none of it
will make a difference, none of it will matter unless all of you fulfill
your responsibilities, unless you show up to those schools, unless you
pay attention to those teachers, unless you listen to your parents and
grandparents and other adults and put in the hard work it takes to
succeed. That’s what I want to focus on today: the responsibility each
of you has for your education.

If you’re suddenly feeling out of your depth, and everyone appears to be
running circles around you, what are your options? Well, you might
discover you’re good at project management, or people management, or UI
design, or technical writing, or system administration, any number of
other important things that “programmers” aren’t necessarily any good
at. You’ll start filling those niches (because there’s always more work
to do), and as soon as you find something you’re good at, you’ll
probably migrate towards doing it full-time.

I want to start with the responsibility you have to yourself. Every
single one of you has something that you’re good at. Every single one of
you has something to offer. And you have a responsibility to yourself to
discover what that is. That’s the opportunity an education can provide.

如果你突然觉得自己好烂,周围的人都远远的超过你,你会怎么想呢?好,你可能会发现
自己善于项目管理,或人事管理,或界面设计,或技术写作,或系统管理,还有许多其他程序员不必去精通的.你会开始堆积那些想法(因为工作永远干不完),当你发现一些你能掌握的东西时,你很可能会转移去全职的做这个工作.

Maybe you could be a great writer — maybe even good enough to write a
book or articles in a newspaper — but you might not know it until you
write that English paper — that English class paper that’s assigned to
you. Maybe you could be an innovator or an inventor — maybe even good
enough to come up with the next iPhone or the new medicine or vaccine —
but you might not know it until you do your project for your science
class. Maybe you could be a mayor or a senator or a Supreme Court
justice — but you might not know that until you join student government
or the debate team.

In fact, I don’t think you need to know anything, as long as you can
stay alive somehow.

And no matter what you want to do with your life, I guarantee that
you’ll need an education to do it. You want to be a doctor, or a
teacher, or a police officer? You want to be a nurse or an architect, a
lawyer or a member of our military? You’re going to need a good
education for every single one of those careers. You cannot drop out of
school and just drop into a good job. You’ve got to train for it and
work for it and learn for it.

实际上,我认为有些东西你不需要了解,当前你还能够赖以生存的话.

And this isn’t just important for your own life and your own future.
What you make of your education will decide nothing less than the future
of this country. The future of America depends on you. What you’re
learning in school today will determine whether we as a nation can meet
our greatest challenges in the future.

So they’re right: you don’t need to know math, and you can get by for
your entire life just fine without it.

You’ll need the knowledge and problem-solving skills you learn in
science and math to cure diseases like cancer and AIDS, and to develop
new energy technologies and protect our environment. You’ll need the
insights and critical-thinking skills you gain in history and social
studies to fight poverty and homelessness, crime and discrimination, and
make our nation more fair and more free. You’ll need the creativity and
ingenuity you develop in all your classes to build new companies that
will create new jobs and boost our economy.

所以他们是对的:你不需要了解数学,并且没有数学你也能过的很好.

We need every single one of you to develop your talents and your skills
and your intellect so you can help us old folks solve our most difficult
problems. If you don’t do that — if you quit on school — you’re not
just quitting on yourself, you’re quitting on your country.

But a few things I’ve learned recently might surprise you:

Now, I know it’s not always easy to do well in school. I know a lot of
you have challenges in your lives right now that can make it hard to
focus on your schoolwork.

但是最近我学到一些东西可能会让你也感到惊喜:

I get it. I know what it’s like. My father left my family when I was two
years old, and I was raised by a single mom who had to work and who
struggled at times to pay the bills and wasn’t always able to give us
the things that other kids had. There were times when I missed having a
father in my life. There were times when I was lonely and I felt like I
didn’t fit in.

Math is a lot easier to pick up after you know how to program. In fact,
if you’re a halfway decent programmer, you’ll find it’s almost a snap.

So I wasn’t always as focused as I should have been on school, and I did
some things I’m not proud of, and I got in more trouble than I should
have. And my life could have easily taken a turn for the worse.

在你知道如何编程之后,数学更容易学会.实际上,如果你先学数学,然后半路出家做程序员的话,你会发现编程简直就是小菜一碟.

But I was — I was lucky. I got a lot of second chances, and I had the
opportunity to go to college and law school and follow my dreams. My
wife,our First Lady Michelle Obama, she has a similar story. Neither of
her parents had gone to college, and they didn’t have a lot of money.
But they worked hard, and she worked hard, so that she could go to the
best schools in this country.

They teach math all wrong in school. Way, WAY wrong. If you teach
yourself math the right way, you’ll learn faster, remember it longer,
and it’ll be much more valuable to you as a programmer.

Some of you might not have those advantages. Maybe you don’t have adults
in your life who give you the support that you need. Maybe someone in
your family has lost their job and there’s not enough money to go
around. Maybe you live in a neighborhood where you don’t feel safe, or
have friends who are pressuring you to do things you know aren’t right.

学校里教数学的方式都错了.仅仅是教学的方法错了,不是教数学本身错.如果你以正确的方式学习数学的话,你会学的更快,记住这点,对你,作为一个程序员来说很有价值.

But at the end of the day, the circumstances of your life — what you
look like, where you come from, how much money you have, what you’ve got
going on at home — none of that is an excuse for neglecting your
homework or having a bad attitude in school. That’s no excuse for
talking back to your teacher, or cutting class, or dropping out of
school. There is no excuse for not trying.

Knowing even a little of the right kinds of math can enable you do write
some pretty interesting programs that would otherwise be too hard. In
other words, math is something you can pick up a little at a time,
whenever you have free time.

Where you are right now doesn’t have to determine where you’ll end up.
No one’s written your destiny for you, because here in America, you
write your own destiny. You make your own future.

哪怕了解一点点相关的数学知识,就能让你写出可爱有趣的程序,否则会有些小难度.换句话讲,数学是可以慢慢学的,只要你有时间.

That’s what young people like you are doing every day, all across
America.

Nobody knows all of math, not even the best mathematicians. The field is
constantly expanding, as people invent new formalisms to solve their own
problems. And with any given math problem, just like in programming,
there’s more than one way to do it. You can pick the one you like
best.

Young people like Jazmin Perez, from Roma, Texas. Jazmin didn’t speak
English when she first started school. Neither of her parents had gone
to college. But she worked hard, earned good grades, and got a
scholarship to Brown University — is now in graduate school, studying
public health, on her way to becoming Dr. Jazmin Perez.

没人能了解所有的数学,就是最棒的数学家也不是.当人们发明新的形式去解决自己的问题时,数学领域就不断的扩展.一些给出的数学问题,也正如编程,不止一种方法可以去解决他.你可以挑个你最喜欢的方式.

I’m thinking about Andoni Schultz, from Los Altos, California, who’s
fought brain cancer since he was three. He’s had to endure all sorts of
treatments and surgeries, one of which affected his memory, so it took
him much longer — hundreds of extra hours — to do his schoolwork. But
he never fell behind. He’s headed to college this fall.

Math is… ummm, please don’t tell anyone I said this; I’ll never get
invited to another party as long as I live. But math, well… I’d better
whisper this, so listen up: (it’s actually kinda fun.)

And then there’s Shantell Steve, from my hometown of Chicago, Illinois.
Even when bouncing from foster home to foster home in the toughest
neighborhoods in the city, she managed to get a job at a local health
care center, start a program to keep young people out of gangs, and
she’s on track to graduate high school with honors and go on to college.
And Jazmin, Andoni, and Shantell aren’t any different from any of you.
They face challenges in their lives just like you do. In some cases
they’ve got it a lot worse off than many of you. But they refused to
give up. They chose to take responsibility for their lives, for their
education, and set goals for themselves. And I expect all of you to do
the same.

数学是……嗯,请别告诉别人我说过这个哈;当然我也不指望谁能邀请我参加这样的派对,在我还活着的时候.但是,数学其实就是……我还是小声的说吧,听好了:(她其实就是一种乐趣啦!)

That’s why today I’m calling on each of you to set your own goals for
your education — and do everything you can to meet them. Your goal can
be something as simple as doing all your homework, paying attention in
class, or spending some time each day reading a book. Maybe you’ll
decide to get involved in an extracurricular activity, or volunteer in
your community. Maybe you’ll decide to stand up for kids who are being
teased or bullied because of who they are or how they look, because you
believe, like I do, that all young people deserve a safe environment to
study and learn. Maybe you’ll decide to take better care of yourself so
you can be more ready to learn. And along those lines, by the way, I
hope all of you are washing your hands a lot, and that you stay home
from school when you don’t feel well, so we can keep people from getting
the flu this fall and winter.

The Math You Learned (And Forgot)

But whatever you resolve to do, I want you to commit to it. I want you
to really work at it. I know that sometimes you get that sense from TV
that you can be rich and successful without any hard work — that your
ticket to success is through rapping or basketball or being a reality TV
star. Chances are you’re not going to be any of those things.

你学到的数学(和你忘了的数学)

The truth is, being successful is hard. You won’t love every subject
that you study. You won’t click with every teacher that you have. Not
every homework assignment will seem completely relevant to your life
right at this minute. And you won’t necessarily succeed at everything
the first time you try.

Here’s the math I learned in school, as far as I can remember:

That’s okay. Some of the most successful people in the world are the
ones who’ve had the most failures. J.K. Rowling’s — who wrote Harry
Potter — her first Harry Potter book was rejected 12 times before it
was finally published. Michael Jordan was cut from his high school
basketball team. He lost hundreds of games and missed thousands of shots
during his career. But he once said, ‘I have failed over and over and
over again in my life. And that’s why I succeed.’

这儿是我能记得的在学校学到的数学:

These people succeeded because they understood that you can’t let your
failures define you — you have to let your failures teach you. You have
to let them show you what to do differently the next time. So if you get
into trouble, that doesn’t mean you’re a troublemaker, it means you need
to try harder to act right. If you get a bad grade, that doesn’t mean
you’re stupid, it just means you need to spend more time studying.

Grade School: Numbers, Counting, Arithmetic, Pre-Algebra (“story
problems”)

No one’s born being good at all things. You become good at things
through hard work. You’re not a varsity athlete the first time you play
a new sport. You don’t hit every note the first time you sing a song.
You’ve got to practice. The same principle applies to your schoolwork.
You might have to do a math problem a few times before you get it right.
You might have to read something a few times before you understand it.
You definitely have to do a few drafts of a paper before it’s good
enough to hand in.

初中:数,数数,算术知识,初级代数(“带问题的小故事”)

Don’t be afraid to ask questions. Don’t be afraid to ask for help when
you need it. I do that every day. Asking for help isn’t a sign of
weakness, it’s a sign of strength because it shows you have the courage
to admit when you don’t know something, and that then allows you to
learn something new. So find an adult that you trust — a parent, a
grandparent or teacher, a coach or a counselor — and ask them to help
you stay on track to meet your goals.

High School: Algebra, Geometry, Advanced Algebra, Trigonometry,
Pre-Calculus (conics and limits)

And even when you’re struggling, even when you’re discouraged, and you
feel like other people have given up on you, don’t ever give up on
yourself, because when you give up on yourself, you give up on your
country.

高中:代数,几何,高等代数,三角学,微积分先修课 (二次曲线论和极限)

The story of America isn’t about people who quit when things got tough.
It’s about people who kept going, who tried harder, who loved their
country too much to do anything less than their best.

College: Differential and Integral Calculus, Differential Equations,
Linear Algebra, Probability and Statistics, Discrete Math

It’s the story of students who sat where you sit 250 years ago, and went
on to wage a revolution and they founded this nation. Young people.
Students who sat where you sit 75 years agowho overcame a Depression and
won a world war; who fought for civil rights and put a man on the moon.
Students who sat where you sit 20 years ago who founded Google and
Twitter and Facebook and changed the way we communicate with each other.

大学:微积分,微分公式,线性代数,概率和统计,离散数学

So today, I want to ask all of you, what’s your contribution going to
be? What problems are you going to solve? What discoveries will you
make? What will a President who comes here in 20 or 50 or 100 years say
about what all of you did for this country?

How’d they come up with that particular list for high school, anyway?
It’s more or less the same courses in most U.S. high schools. I think
it’s very similar in other countries, too, except that their students
have finished the list by the time they’re nine years old. (Americans
really kick butt at monster-truck competitions, though, so it’s not a
total loss.)

Now, your families, your teachers, and I are doing everything we can to
make sure you have the education you need to answer these questions. I’m
working hard to fix up your classrooms and get you the books and the
equipment and the computers you need to learn. But you’ve got to do your
part, too. So I expect all of you to get serious this year. I expect you
to put your best effort into everything you do. I expect great things
from each of you. So don’t let us down. Don’t let your family down or
your country down. Most of all, don’t let yourself down. Make us all
proud.

上面那个关于高中数学课程单子上所列的,怎么来着?美国高中几乎都是这样的课程设置.我认为其他国家也会很相似的,除了那些在9岁之前就掌握了这些课程的学生.(美国小孩同时却在热衷于玩魔鬼卡车竞赛,虽然如此,整个来说也算不上什么大损失.)

Thank you very much, everybody. God bless you. God bless America. Thank
you.

Algebra? Sure. No question. You need that. And a basic understanding of
Cartesian geometry, too. Those are useful, and you can learn everything
you need to know in a few months, give or take. But the rest of them? I
think an introduction to the basics might be useful, but spending a
whole semester or year on them seems ridiculous.


代数?是的.没问题.你需要代数.和一些理解解析几何的知识.那些很有用,并且在以后
几个月里,你能学到一切你想要的,十拿九稳的.剩下的呢?我认为一个基本的介绍可能会有用,但是在这上面花整个学期或一年就显得很荒谬了.

I’m guessing the list was designed to prepare students for science and
engineering professions. The math courses they teach in and high school
don’t help ready you for a career in programming, and the simple fact is
that the number of programming jobs is rapidly outpacing the demand for
all other engineering roles.

我现在意识到那个书单列表原是设计来准备给那些以后要当科学家和工程师的学生的.他们在高中里所教的数学课程并不是为你的编程生涯做准备的,简单的事实是,多数的编程工作所需要的数学知识相比其他作为工程师角色的人所需要的数学增长的更快.

And even if you’re planning on being a scientist or an engineer, I’ve
found it’s much easier to learn and appreciate geometry and trig after
you understand what exactly math is — where it came from, where it’s
going, what it’s for. No need to dive right into memorizing geometric
proofs and trigonometric identities. But that’s exactly what high
schools have you do.

即使你打算当一名科学家或者一名工程师,在你理解了什么是数学之后–
数学它如何而来,如何而去,为何而生,我发现这更加容易去学习和欣赏几何学和三角学.不必去专研记住几何上的证明和三角恒等式,虽然那确实是高中学校要求你必须去做的.

So the list’s no good anymore. Schools are teaching us the wrong math,
and they’re teaching it the wrong way. It’s no wonder programmers think
they don’t need any math: most of the math we learned isn’t helping
us.

所以这样的书单列表不再有什么用了.学校教给我们的不是最合适的数学,并且方式也不对.不奇怪程序员认为他们不再需要数学:我们学的大部分数学知识对我们的工作没什么大的帮助.

The Math They Didn’t Teach You

他们没有教给你的那部分数学

The math computer scientists use regularly, in real life, has very
little overlap with the list above. For one thing, most of the math you
learn in grade school and high school is continuous: that is, math on
the real numbers. For computer scientists, 95% or more of the
interesting math is discrete: i.e., math on the integers.

在现实中,计算机科学家正式的使用数学,跟上面单子里列的有点小小重叠.
举个例子,你在中学里学的大部分数学是连续性的:也就是说,那是作为实数的数学.而对于计算机科学家来说,他们所感兴趣的95%也许更多的是离散性的:比如,关于整数的数学.

I’m going to talk in a future blog about some key differences between
computer science, software engineering, programming, hacking, and other
oft-confused disciplines. I got the basic framework for these (upcoming)
insights in no small part from Richard Gabriel’s Patterns Of Software,
so if you absolutely can’t wait, go read that. It’s a good book.

我打算在以后的博客中再谈一些有关计算机科学,软件工程,编程,搞些有趣的东东,和其他常常令人犯晕的训练.我已经从Richard
Gabriel的 软件的模式
这本书中洞察到一个无关巨细的基本框架.如果你明显的等不下去的话,去读吧.是本不错的书.

For now, though, don’t let the term “computer scientist” worry you. It
sounds intimidating, but math isn’t the exclusive purview of computer
scientists; you can learn it all by yourself as a closet hacker, and be
just as good (or better) at it than they are. Your background as a
programmer will help keep you focused on the practical side of things.

到现在为止,不要让”计算机科学家”这个词困扰到你.它听上去很可怕,其实数学不是计算机科学家所独有的领域,你也能作为一个黑客自学它,并且能做的和他们一样棒.你作为一个程序员的背景将会帮助你保持只关注那些有实践性的部分.

The math we use for modeling computational problems is, by and large,
math on discrete integers. This is a generalization. If you’re with me
on today’s blog, you’ll be studying a little more math from now on than
you were planning to before today, and you’ll discover places where the
generalization isn’t true. But by then, a short time from now, you’ll be
confident enough to ignore all this and teach yourself math the way you
want to learn it.

我们用来建立计算模型的,大体上是离散数学.这是普遍的做法.如果正好今天你在看这篇博客,从现在起你正了解到更多的数学,并且你会认识到那样的普遍做法是不对的.从现在开始,你将有信心认为可以忽略这些,并以你想要的方式自学.

For programmers, the most useful branch of discrete math is probability
theory. It’s the first thing they should teach you after arithmetic, in
grade school. What’s probability theory, you ask? Why, it’s counting.
How many ways are there to make a Full House in poker? Or a Royal Flush?
Whenever you think of a question that starts with “how many ways…” or
“what are the odds…”, it’s a probability question. And as it happens
(what are the odds?), it all just turns out to be “simple” counting. It
starts with flipping a coin and goes from there. It’s definitely the
first thing they should teach you in grade school after you learn Basic
Calculator Usage.

对程序员来说,最有效的离散数学的分支是概率理论.这是你在学校学完基本算术后的紧接着的课.你会问,什么是概率理论呢?你就数啊,看有多少次出现满堂彩?或者有多次是同花顺.
不管你思考什么问题如果是以”多少种途径…”或”有多大几率的…”,那就是离散问题.当他发生时,都
转化成”简单”的计数.抛个硬币看看…?
毫无疑问在他们教你基本的计算用法后他们会教你概率理论.

I still have my discrete math textbook from college. It’s a bit
heavyweight for a third-grader (maybe), but it does cover a lot of the
math we use in “everyday” computer science and computer engineering.

我还保存着大学里的离散数学课本.可能他只占了三分之一的课程,但是它却涵盖了我们几乎每天计算机编程工作大部分所用到的数学.

Oddly enough, my professor didn’t tell me what it was for. Or I didn’t
hear. Or something. So I didn’t pay very close attention: just enough to
pass the course and forget this hateful topic forever, because I didn’t
think it had anything to do with programming. That happened in quite a
few of my comp sci courses in college, maybe as many as 25% of them.
Poor me! I had to figure out what was important on my own, later, the
hard way.

也真是够奇怪的,我的教授从没告诉我数学是用来干吗的.或者我也从来没有听说过.种种原因吧.所以我也从没有给以足够的注意:只是考试及格然后把他们都忘光,因为我不认为她还和编程有啥关系.事情变化是我在大学学完一些计算机科学的课程之后,也许是25%的课程.可怜啊!我必须弄明白什么对于自己来说是最重要的,然后再是向深度发展.

I think it would be nice if every math course spent a full week just
introducing you to the subject, in the most fun way possible, so you
know why the heck you’re learning it. Heck, that’s probably true for
every course.

我想,如果每门数学课都花上整整一周的时间,而只是介绍让你如何入门的话,那将非常不错,这是最有意思的一种假设,那么你知道了你正学习的对象是哪种怪物了.怪物,大概对每一门课都合适.

Aside from probability and discrete math, there are a few other branches
of mathematics that are potentially quite useful to programmers, and
they usually don’t teach them in school, unless you’re a math minor.
This list includes:

除了概率和离散数学外,还有不少其他的数学分支,可能对程序员相当的有用,学校通常不会教你的,除非你的辅修科目是数学.这些数目列表包括:

Statistics, some of which is covered in my discrete math book, but it’s
really a discipline of its own. A pretty important one, too, but
hopefully it needs no introduction.

统计学,其中一些包括在我的离散数学课里,她的某些训练只限于她自身.自然也是相当重要的,但想学的话不需要什么特别的入门.
Algebra and Linear Algebra (i.e., matrices). They should teach Linear
Algebra immediately after algebra. It’s pretty easy, and it’s amazingly
useful in all sorts of domains, including machine learning.

代数和线性代数(比如,矩阵).他们会在教完代数后立即教线性代数.这也简单,这但相当多的领域非常有用,包括机器学习.
Mathematical Logic. I have a really cool totally unreadable book on the
subject by Stephen Kleene, the inventor of the Kleene closure and, as
far as I know, Kleenex. Don’t read that one. I swear I’ve tried 20
times, and never made it past chapter 2. If anyone has a recommendation
for a better introduction to this field, please post a comment. It’s
obviously important stuff, though.

数理逻辑.我有相当完整的关于这门学科的书没有读,是Stephen
Kleene写的,克林闭包的发明者,我所知道的还有就是Kleenex.这个就不要读了.我发誓我已经尝试了不下20次,却从没有读完第二章.如果哪位牛掰有什么更好的入门建议的话可以给我推荐.虽然,这明显是非常重要的一部分.

Information Theory and Kolmogorov Complexity. Weird, eh? I bet none of
your high schools taught either of those. They’re both pretty new.
Information theory is (veeery roughly) about data compression, and
Kolmogorov Complexity is (also roughly) about algorithmic complexity.
I.e., how small you can you make it, how long will it take, how elegant
can the program or data structure be, things like that. They’re both
fun, interesting and useful.

信息理论和柯尔莫戈洛夫复杂性理论.真不可思议,不是么?我敢打赌没哪个高中会教你其中任何一门课程.她们都是新兴的学科.信息理论是(相当相当相当相当难懂)关于数据压缩,柯尔莫戈洛夫复杂性理论是(同样非常难懂)关于算法复杂度的.也就是说,你要把它压缩的尽量小,你所要花费的时间也就变的越长,同样的,程序或数据结构要变得多优雅也有同样的代价.他们都很有趣,也很有用.

There are others, of course, and some of the fields overlap. But it just
goes to show: the math that you’ll find useful is pretty different from
the math your school thought would be useful.

当然,也有其他的一些因素,某些领域是重复的.也拿来说说吧:你所发现有用的那部分数学,不同于那些你在学校里认为有用的数学.

What about calculus? Everyone teaches it, so it must be important,
right?

那微积分呢?每个人都学它,所以它也一定是重要的,不对吗?

Well, calculus is actually pretty easy. Before I learned it, it sounded
like one of the hardest things in the universe, right up there with
quantum mechanics. Quantum mechanics is still beyond me, but calculus is
nothing. After I realized programmers can learn math quickly, I picked
up my Calculus textbook and got through the entire thing in about a
month, reading for an hour an evening.

好吧,微积分实际上是相当容易的.在我学习它之前,它听上去好像是世界上最难的一件事,好像和量子力学差不多.量子力学对我来说真的不是那么容易理解,但是微积分却不是.在我意识到程序员能够快速的学习数学时,我拿起一些微积分课本用一个月通读了整本书,一个晚上读一小时.

Calculus is all about continuums — rates of change, areas under curves,
volumes of solids. Useful stuff, but the exact details involve a lot of
memorization and a lot of tedium that you don’t normally need as a
programmer. It’s better to know the overall concepts and techniques, and
go look up the details when you need them.

微积分都是关于连续统的 — 变化的比率, 曲线的面积,
立体的体积.是些有用的东西,但是实际细节却包含大量的记忆量并且枯燥,作为一个程序员来说根本不需要这些.
更好的方法是从整体上了解那些概念和技术,在必要的时候再去查询那些细节.

Geometry, trigonometry, differentiation, integration, conic sections,
differential equations, and their multidimensional and multivariate
versions — these all have important applications. It’s just that you
don’t need to know them right this second. So it probably wasn’t a great
idea to make you spend years and years doing proofs and exercises with
them, was it? If you’re going to spend that much time studying math, it
ought to be on topics that will remain relevant to you for life.

几何,三角,微分,积分,圆锥曲线,微分方程,和他们的多维和多元 —
这些都有重要的应用.不过这时候不需要你去了解它们.这大概不是个好注意让你年复一年的去做证明和它们的练习题,不是吗?如果你打算花大量的时间去学习数学,那也是和你生活相关的部分.

The Right Way To Learn Math

学习数学的正确方法

The right way to learn math is breadth-first, not depth-first. You need
to survey the space, learn the names of things, figure out what’s
what.

正确学习数学的方法是广度优先,而非深度优先.你要考察的是整个数学世界,学习每个概念的名字,区分出什么是什么.

To put this in perspective, think about long division. Raise your hand
if you can do long division on paper, right now. Hands? Anyone? I didn’t
think so.

具体的来看,考虑用长除法?如果你能在纸上做长整除,现在就举起你的手.会有人举手吗?至少我不这么认为.

I went back and looked at the long-division algorithm they teach in
grade school, and damn if it isn’t annoyingly complicated. It’s
deterministic, sure, but you never have to do it by hand, because it’s
easier to find a calculator, even if you’re stuck on a desert island
without electricity. You’ll still have a calculator in your watch, or
your dental filling, or something,

回头看看在学校里学过的长除法,要是不让你觉得烦恼和愤怒才怪.当然,这是显然的,但你不一定要自己亲自去做,因为很容易用计算器来做,即使你不幸在一座没有电力的荒无人烟的小岛上.你起码还有个计算器,在的手表上,补牙的什么东东,或其他什么上面.

Why do they even teach it to you? Why do we feel vaguely guilty if we
can’t remember how to do it? It’s not as if we need to know it anymore.
And besides, if your life were on the line, you know you could perform
long division of any arbitrarily large numbers. Imagine you’re
imprisoned in some slimy 3rd-world dungeon, and the dictator there won’t
let you out until you’ve computed 219308862/103503391. How would you do
it? Well, easy. You’d start subtracting the denominator from the
numerator, keeping a counter, until you couldn’t subtract it anymore,
and that’d be the remainder. If pressed, you could figure out a way to
continue using repeated subtraction to estimate the remainder as decimal
number (in this case, 0.1185678219, or so my Emacs M-x calc tells me.
Close enough!)

为什么他们还教你这些呢?为什么我们感到含混心虚讷,如果我们不能记住怎样去做?这不是好像我们需要再次知道她.除此以外,如果你命悬一线,你可以运用任意大的数来做长除法.相象你被囚禁在第三世界的地牢里,那儿的独裁者是不会放你出来的,除非你计算出219308862/103503391.你会怎么做呢?好吧,很容易.你开始从分子减去分母,直到不能再减只剩余数为止.若实在有压力,你可以想个办法,继续使用反复减,估算作为十进制的余数(这种情况下,0.1185678219,Emacs
M-x calc 告诉我的.够精确了! )

You could figure it out because you know that division is just repeated
subtraction. The intuitive notion of division is deeply ingrained now.

你或许明白,除法就是反复的减.这样从直觉上对除法概念的理解就根深蒂固啦!

The right way to learn math is to ignore the actual algorithms and
proofs, for the most part, and to start by learning a little bit about
all the techniques: their names, what they’re useful for, approximately
how they’re computed, how long they’ve been around, (sometimes) who
invented them, what their limitations are, and what they’re related to.
Think of it as a Liberal Arts degree in mathematics.

学习数学的正确方法是忽略实际的算法和证明,对于大部分情况来说,
…:他们的名字,他们的作用,他们计算的大致步骤,
(有时是)谁发明了他们,发明了多久了,他们的缺陷是什么,和他们相关的有什么.把数学当文科来学.

Why? Because the first step to applying mathematics is problem
identification. If you have a problem to solve, and you have no idea
where to start, it could take you a long time to figure it out. But if
you know it’s a differentiation problem, or a convex optimization
problem, or a boolean logic problem, then you at least know where to
start looking for the solution.

为什么呢?因为第一步反应在数学上的是问题的确定.如果你有一个问题去解决,并且假设你没有头绪如何开始,
这将花费你很长的时间来弄明白.但如果你知道这是个变异的问题,或者是一个凸优化问题,或者一个布尔的逻辑问题,然后你起码能知道从哪着手开始寻找解决方案.

There are lots and lots of mathematical techniques and entire
sub-disciplines out there now. If you don’t know what combinatorics is,
not even the first clue, then you’re not very likely to be able to
recognize problems for which the solution is found in combinatorics, are
you?

现在有许许多多的数学技术和整个的学科分支.如果你不知道组合逻辑是什么,甚至连听都没听说过,
那么你是不可能意识到在组合逻辑中可以找到的解决答案的问题的,难道不是么?

But that’s actually great news, because it’s easier to read about the
field and learn the names of everything than it is to learn the actual
algorithms and methods for modeling and computing the results. In school
they teach you the Chain Rule, and you can memorize the formula and
apply it on exams, but how many students really know what it “means”? So
they’re not going to be able to know to apply the formula when they run
across a chain-rule problem in the wild. Ironically, it’s easier to know
what it is than to memorize and apply the formula. The chain rule is
just how to take the derivative of “chained” functions — meaning,
function x() calls function g(), and you want the derivative of x(g()).
Well, programmers know all about functions; we use them every day, so
it’s much easier to imagine the problem now than it was back in
school.

但那实在是个大新闻哪,因为阅读这些领域,学习实际算法,建模和计算结果的方法,记住这些名字都是容易的.在学校里他们教你链式法则,你也能回忆起他们并能运用在考试题上,但有多少学生能真正的了解他们到底意味着什么呢?
所以当他们遇到变种的链式问题时,他们就不懂得如何运用公式了.让人感到讽刺的是,了解这是什么比记住如何运用公式更为容易.链式法则仅仅是如何对链式函数求导的意思,函数
x() 引用函数 g() ,你要求导 x(g())
.好了,程序员知道所有这些函数相关的;我们每天都使用他们,所以现在比过去在学校更加容易能够想象到问题所在.

Which is why I think they’re teaching math wrong. They’re doing it wrong
in several ways. They’re focusing on specializations that aren’t proving
empirically to be useful to most high-school graduates, and they’re
teaching those specializations backwards. You should learn how to count,
and how to program, before you learn how to take derivatives and perform
integration.

这就是为什么我认为他们以错误的方式在教数学.
对大多数高中毕业生来说,他们专门教授的内容,不是可以靠经验来证明数学是如何如何有用的,他们教的那些恰恰是非经验式的内容.在你学习如何求导和做积分之前,你将要学习如何计数,怎样编程.

I think the best way to start learning math is to spend 15 to 30 minutes
a day surfing in Wikipedia. It’s filled with articles about thousands of
little branches of mathematics. You start with pretty much any article
that seems interesting (e.g. String theory, say, or the Fourier
transform, or Tensors, anything that strikes your fancy.) Start reading.
If there’s something you don’t understand, click the link and read about
it. Do this recursively until you get bored or tired.

我认为学习数学最好的方法是每天花15到30分钟逛维基百科.那上面有数千数学分支的相关文章.
可以从一些你感兴趣的文章着手(比如,弦理论,或者,傅立叶变换,或者张量理论,就是能冲击你相象力的东西)
阅读.如果有什么你不理解的,就去了解那些链接.如此这般直到你累到不行为止.

Doing this will give you amazing perspective on mathematics, after a few
months. You’ll start seeing patterns — for instance, it seems that just
about every branch of mathematics that involves a single variable has a
more complicated multivariate version, and the multivariate version is
almost always represented by matrices of linear equations. At least for
applied math. So Linear Algebra will gradually bump its way up your
list, until you feel compelled to learn how it actually works, and
you’ll download a PDF or buy a book, and you’ll figure out enough to
make you happy for a while.

几个月后,这么做会纵向扩展你的数学知识面.你会发现一些模式,好比,数学的每个分支看上去都包括了一个有着复杂的多元的变量,然后线性代数将会慢慢爬满你的书单列表,直到你强迫自己学会他实际上是怎样工作的,你要下载个电子书或买本书,直到你能从中找到乐趣.

With the Wikipedia approach, you’ll also quickly find your way to the
Foundations of Mathematics, the Rome to which all math roads lead. Math
is almost always about formalizing our “common sense” about some domain,
so that we can deduce and/or prove new things about that domain.
Metamathematics is the fascinating study of what the limits are on math
itself: the intrinsic capabilities of our formal models, proofs,
axiomatic systems, and representations of rules, information, and
computation.

凭借着维基百科,你也能快速的找到一条了解数学基本原理的途径,条条大道通罗马.在某些领域,数学几乎总是形式化我们的”常识”,所以我们能减少或证明那些领域里的新事物.对数学本身的研究就是无止境而且令人着迷的:构造形式模型本质的能力,证明,自明的系统,规则表示,信息,和计算.

One great thing that soon falls by the wayside is notation. Mathematical
notation is the biggest turn-off to outsiders. Even if you’re familiar
with summations, integrals, polynomials, exponents, etc., if you see a
thick nest of them your inclination is probably to skip right over that
sucker as one atomic operation.

符号是个很重大的但很快会令人放弃的东西.数学符号是关闭你通往另一个世界的符咒.即使你熟悉累加,积分,多项式,指数,等等,如果你看到一堆符号堆彻的异常复杂时,你就把他实现的功能简单的当成一个原子操作好了,不要深究太多.

However, by surveying math, trying to figure out what problems people
have been trying to solve (and which of these might actually prove
useful to you someday), you’ll start seeing patterns in the notation,
and it’ll stop being so alien-looking. For instance, a summation sign
(capital-sigma) or product sign (capital-pi) will look scary at first,
even if you know the basics. But if you’re a programmer, you’ll soon
realize it’s just a loop: one that sums values, one that multiplies
them. Integration is just a summation over a continuous section of a
curve, so that won’t stay scary for very long, either.

然而,从观察数学来说,尝试着明白人们正在试图解决的问题(那些已被证明了的问题某天也许会对你有实际用途),
你会开始在符号中看到相同的类型,你也不再排斥他们.比如,累加符号(大写符号-西格马)或者π(大写符号-pi,连乘符号)起初看上去让人心里没底,即时你了解了他们的基本原理.但如果你是个程序员,你会认识到他仅仅是个循环:一个累加值,一个累乘.积分是一段连续曲线的相加,所以那不会让你郁闷太久.

Once you’re comfortable with the many branches of math, and the many
different forms of notation, you’re well on your way to knowing a lot of
useful math. Because it won’t be scary anymore, and next time you see a
math problem, it’ll jump right out at you. “Hey,” you’ll think, “I
recognize that. That’s a multiplication sign!”

一旦你习惯了数学的许多分支,和许多不同的符号的格式,你就走在了解许多数学知识的路上了.因为你不再害怕,你将会发现问题,其实他们会自动跳到你面前.”嗨,”你会思索,”我
了解这个.这是乘法符号!”

And then you should pull out the calculator. It might be a very fancy
calculator such as R, Matlab, Mathematica, or a even C library for
support vector machines. But almost all useful math is heavily
automatable, so you might as well get some automated servants to help
you with it.

这样你就能扔掉计算器了.有一个充满相象的计算器比如
R,Matlab,Mathematica,甚或是支持向量机的C语言库.但几乎所有有用的数学都是重型自动机,所以你能够让一切都变的自动化.

When Are Exercises Useful?

练习有啥用处呢?

After a year of doing part-time hobbyist catch-up math, you’re going to
be able to do a lot more math in your head, even if you never touch a
pencil to a paper. For instance, you’ll see polynomials all the time, so
eventually you’ll pick up on the arithmetic of polynomials by osmosis.
Same with logarithms, roots, transcendentals, and other fundamental
mathematical representations that appear nearly everywhere.

在做了几年的业余数学爱好者之后,你打算做更多的数学,甚至你从没碰过铅笔和纸.比如,
你会一直看到多项式,所以最后你会耳濡目染的做起多项式的运算.同样的,对数,根,超越数,和其他到处出现的基本数学原理.

I’m still getting a feel for how many exercises I want to work through
by hand. I’m finding that I like to be able to follow explanations
(proofs) using a kind of “plausibility test” — for instance, if I see
someone dividing two polynomials, I kinda know what form the result
should take, and if their result looks more or less right, then I’ll
take their word for it. But if I see the explanation doing something
that I’ve never heard of, or that seems wrong or impossible, then I’ll
dig in some more.

我还是生发了一种感觉,我要亲手做许多的练习题.我正在寻找一种能够跟着证明步骤的方法,比如使用一种”貌似可信的测试”,如果他们的结果看上去或多或少是对的,然后我就会拍拍屁股过去了.但如果我看到的那个证明我听都没听说过,亦或看上去是错的或不可能的情况,我就要挖掘更多的东西了.

That’s a lot like reading programming-language source code, isn’t it?
You don’t need to hand-simulate the entire program state as you read
someone’s code; if you know what approximate shape the computation will
take, you can simply check that their result makes sense. E.g. if the
result should be a list, and they’re returning a scalar, maybe you
should dig in a little more. But normally you can scan source code
almost at the speed you’d read English text (sometimes just as fast),
and you’ll feel confident that you understand the overall shape and that
you’ll probably spot any truly egregious errors.

这很像读程序源代码,不是么?当你读某人的代码你不需要手动模拟整个程序状态;如果你知道计算过程大致会发生什么情形,你能靠理智推断出结果.举个例子,如果结果是个列表,他们返回一个标量,可能你会挖的更深一点.但正常情况下你能几乎是以你阅读英文文本的速度(有时仅仅是速度上)扫描源代码,并且你自信你理解了全部状态,与此同时,你也许会发现真正令你震惊的错误。

I think that’s how mathematically-inclined people (mathematicians and
hobbyists) read math papers, or any old papers containing a lot of math.
They do the same sort of sanity checks you’d do when reading code, but
no more, unless they’re intent on shooting the author down.

我认为那就是数学爱好者(数学家和真正的数学迷)怎样读数学论文的,或任何包含了许多数学的论文.他们做了同样的分类检查,正如在你读代码的时候所做的,但不只是这些,除非他们不想把作者的观点扳倒.

With that said, I still occasionally do math exercises. If something
comes up again and again (like algebra and linear algebra), then I’ll
start doing some exercises to make sure I really understand it.

照那样说,我会偶尔做做数学练习.如果某些问题(比如代数和线性代数)又不停的跑过来,我就做些练习去确定我是真正的理解她了.

But I’d stress this: don’t let exercises put you off the math. If an
exercise (or even a particular article or chapter) is starting to bore
you, move on. Jump around as much as you need to. Let your intuition
guide you. You’ll learn much, much faster doing it that way, and your
confidence will grow almost every day.

但我要强调这点:不要让练习使你分心.如果一个练习(甚或是一篇特别的文章或章节)开始让你烦恼,那就暂时丢一边继续前进.该跑路就坚决跑路.让你的直觉引导你.你会学的更多,更快,你的信心也会随之增长.

How Will This Help Me?

这些怎样才能帮到我?

Well, it might not — not right away. Certainly it will improve your
logical reasoning ability; it’s a bit like doing exercise at the gym,
and your overall mental fitness will get better if you’re pushing
yourself a little every day.

也许不是–不能立刻奏效.但确实能帮助提升你的逻辑推理能力;好比是在体育馆做练习,如果你每天都做一点的话,你整体的能力会得到提升.

For me, I’ve noticed that a few domains I’ve always been interested in
(including artificial intelligence, machine learning, natural language
processing, and pattern recognition) use a lot of math. And as I’ve dug
in more deeply, I’ve found that the math they use is no more difficult
than the sum total of the math I learned in high school; it’s just
different math, for the most part. It’s not harder. And learning it is
enabling me to code (or use in my own code) neural networks, genetic
algorithms, bayesian classifiers, clustering algorithms, image matching,
and other nifty things that will result in cool applications I can show
off to my friends.

对我来说,我已经注意到一些我已经感兴趣的领域(包括人工智能,机器学习,自然语言处理,和模式识别)大量的使用到数学.如我已经挖的有点深度的领域,我已经发现他们使用的数学不再比我在中学的学到的数学还要更难;大部分来说仅仅是不同领域.而不是更难了,并且学习使我能写(或者是在我自己的代码里使用)神经网络,基因算法,贝页斯分类器,集群算法,图像识别,和其他时髦的东西,能产生很酷的应用.我常向我的朋友显宝.

And I’ve gradually gotten to the point where I no longer break out in a
cold sweat when someone presents me with an article containing math
notation: n-choose-k, differentials, matrices, determinants, infinite
series, etc. The notation is actually there to make it easier, but (like
programming-language syntax) notation is always a bit tricky and
daunting on first contact. Nowadays I can follow it better, and it no
longer makes me feel like a plebian when I don’t know it. Because I know
I can figure it out.

我已经渐渐意识到这点,当别人给我看一篇包含了数学符号的文章我不再像突然冒了一身冷汗:组合,微分,真值表,定列式,无限系列,等等.那些数学符号现在变得容易相处了,但(像编程语言的语法)一开始的话多少还是有点让人感到有些怪异.现在我能更好的理解了,当我一点不知道正在说什么时,也不再感到自己是个不懂数学的人了.因为我知道自己是能够弄明白的.

And that’s a good thing.

那很好.

And I’ll keep getting better at this. I have lots of years left, and
lots of books, and articles. Sometimes I’ll spend a whole weekend
reading a math book, and sometimes I’ll go for weeks without thinking
about it even once. But like any hobby, if you simply trust that it will
be interesting, and that it’ll get easier with time, you can apply it as
often or as little as you like and still get value out of it.

我会继续加油做的更好滴.我还有不少活头,有好多书和文章要读.有时我会花整个周末来读数学书,有时会数周都不再思索她.也和其他兴趣一样,如果你单纯的信任她你就会有兴趣,也能更容易的消磨时光,你可以经常一点点的尝试应用你觉得有趣的,并从中获益.

Math every day. What a great idea that turned out to be!

好好学习,天天数学!