程序員怎樣學數學:半路出家也能讓編程是小菜一碟

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.

自從我讀了Johnny von Neumann的傳記,我已經爲彌補我糟糕的數學技能花了15個月了.讀了大量的數學書籍,不過呢,似乎我還有更多沒有讀.當然我會接着做的.

Let me tell you about it.

現在我就來告訴你這些.

Conventional Wisdom Doesn't Add Up

這並不包括傳統的智慧

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:

但是最近我學到一些東西可能會讓你也感到驚喜:

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.

在你知道如何編程之後,數學更容易學會.實際上,如果你先學數學,然後半路出家做程序員的話,你會發現編程簡直就是小菜一碟.

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.

學校裏教數學的方式都錯了.僅僅是教學的方法錯了,不是教數學本身錯.如果你以正確 的方式學習數學的話,你會學的更快,記住這會更長,但對你作爲一個程序員來說也更有價值.

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.

哪怕瞭解一點點相關的數學知識就能讓你寫出可愛有趣的程序,否則會有些小難度.換 句話講,數學是可以慢慢學的,只要你有時間.

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.

沒人能瞭解所有的數學,就是最棒的數學家也不是.數學領域正不斷的擴展,當人們發明 新的形式去解決自己的問題時.一些給出的數學問題,也正如編程,不止一種方法可以去 解決他.你可以挑個你最喜歡的.

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.)

數學是......嗯,請別告訴別人我說過這個哈;當然我也不指望誰能邀請我參加這樣的 派對,當我還活着的時候.但是,數學其實就是......我還是小聲的說吧,聽好了:(她其 實就是一種樂趣啦!)



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.)

上面那個關於高中數學課程單子上所列的,怎麼來着?美國高中幾乎都是這樣的課程設置.我認爲其他國家也會很相似的,除了那些在9歲之前就掌握了這些課程的學生.(美國人同時卻在熱衷於玩魔鬼卡車競賽,雖然如此,整個來說也算不上什麼大損失.)

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.

我打算在我以後blog中再談一些在計算機科學,軟件工程,編程,hacking,和其他常常迷惑的管理的之間的關鍵差異.我已經從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寫的,Kleene closure 的發明者,我所知道的還有就是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!)

爲什麼他們還教你這些呢?爲什麼我們感到含混心虛訥,如果我們不能記住怎樣去做?這不是好像我們需要再次知道她.除此以外, if your life were on the line,你可以運用任意大的數來做長除法.相象你被囚禁在第三世界的地牢裏,那兒的獨裁者是 不會放你出來的,除非你計算出 219308862/103503391.你會怎麼做呢?好吧,很容易.你開始從分子減去分母,直到不能再減 只剩餘數爲止.if pressed,你可以想個辦法估計好作爲十進制的餘數反覆來減(這種情況下,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.

然而,從觀察數學來說,嘗試着明白人們正在試圖解決的問題(那些已被證明了的問題某天也許會對你有實際用途), 你會開始在符號中看到相同的類型,你也不再排斥他們.比如,累加符號(大寫符號-西格馬)或者 product sign(大寫符號-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!

好好學習,天天數學!

原作者: Steve Yegge    譯者: puto   

  原文鏈接  

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章