一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

程序員怎樣學(xué)數(shù)學(xué)

英文原文: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. 

自從我讀了Johnny von Neumann的傳記,我已經(jīng)為彌補我糟糕的數(shù)學(xué)技能花了15個月了。讀了大量的數(shù)學(xué)書籍,不過呢,似乎我還有更多沒有讀,當(dāng)然我會接著做的。

Let me tell you about it. 
現(xiàn)在我就來告訴你這些。
Conventional Wisdom Doesn't Add Up 
告別傳統(tǒng)觀念
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. 

首先: 程序員不認(rèn)為他們需要了解數(shù)學(xué)。我常常聽到這樣的話。我不知道還有沒有不同意的,甚至于以前是主修數(shù)學(xué)的程序員也告訴我,他們真的不是常常使用到數(shù)學(xué)!他們說更重要的是要去了解設(shè)計模式,面向?qū)ο笤恚浖ぞ?,界面設(shè)計,以及一些其他類似的東西。

And you know what? They're absolutely right. You can be a good, solid, professional programmer without knowing much math. 
你了解嗎?他們完全正確。你不需要了解很多數(shù)學(xué),你就能做個很棒,很專業(yè)的程序員。
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. 
但是呢,同時你也不是真的需要知道如何來編程。我們要面對的是:有很多專業(yè)的程序員,他們認(rèn)識到他們不是非常擅長數(shù)學(xué),但他們還是尋找方法去提升。
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. 

如果你突然覺得自己好爛,周圍的人都遠遠的超過你,你會怎么想呢?好,你可能會發(fā)現(xiàn)自己善于項目管理,或人事管理,或界面設(shè)計,或技術(shù)寫作,或系統(tǒng)管理,還有許多其他程序員不必去精通的。你會開始堆積那些想法(因為工作永遠干不完),當(dāng)你發(fā)現(xiàn)一些你能掌握的東西時,你很可能會轉(zhuǎn)移去全職的做這個工作。
In fact, I don't think you need to know anything, as long as you can stay alive somehow. 
實際上,我認(rèn)為有些東西你不需要了解,當(dāng)前你還能夠賴以生存的話。
So they're right: you don't need to know math, and you can get by for your entire life just fine without it. 
所以他們是對的:你不需要了解數(shù)學(xué),并且沒有數(shù)學(xué)你也能過的很好。
But a few things I've learned recently might surprise you: 
但是最近我學(xué)到的一些東西可能會讓你感到驚訝:
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. 
在你知道如何編程之后,數(shù)學(xué)更容易學(xué)會。實際上,如果你先學(xué)數(shù)學(xué),然后半路出家做程序員的話,你會發(fā)現(xiàn)編程簡直就是小菜一碟。
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. 
學(xué)校里教數(shù)學(xué)的方式都錯了。僅僅是教學(xué)的方法錯了,不是教數(shù)學(xué)本身錯了。如果你以正確的方式學(xué)習(xí)數(shù)學(xué)的話,你會學(xué)的更快,記住這點,對你,作為一個程序員來說很有價值。
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. 
哪怕了解一點點相關(guān)的數(shù)學(xué)知識,就能讓你寫出可愛有趣的程序,否則會有些小難度。換句話講,數(shù)學(xué)是可以慢慢學(xué)的,只要你有時間。
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. 
沒人能了解所有的數(shù)學(xué),就是最棒的數(shù)學(xué)家也不能。當(dāng)人們發(fā)明新的形式去解決自己的問題時,數(shù)學(xué)領(lǐng)域就不斷的擴展。和編程一樣,一些給出的數(shù)學(xué)問題,不止一種方法可以去解決它。你可以挑個你最喜歡的方式。
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.) 
數(shù)學(xué)是......嗯,請別告訴別人我說過這個哈;當(dāng)然我也不指望誰能邀請我參加這樣的派對,在我還活著的時候。但是,數(shù)學(xué)其實就是......我還是小聲的說吧,聽好了:(她其實就是一種樂趣啦!)
The Math You Learned (And Forgot) 
你學(xué)到的數(shù)學(xué)(和你忘了的數(shù)學(xué)) 。
Here's the math I learned in school, as far as I can remember: 
這兒是我能記得的在學(xué)校學(xué)到的數(shù)學(xué): 
Grade School: Numbers, Counting, Arithmetic, Pre-Algebra ("story problems") 
初中:數(shù),數(shù)數(shù),算術(shù)知識,初級代數(shù)("帶問題的小故事") 。
High School: Algebra, Geometry, Advanced Algebra, Trigonometry, Pre-Calculus (conics and limits) 
高中:代數(shù),幾何,高等代數(shù),三角學(xué),微積分先修課 (二次曲線論和極限)。
College: Differential and Integral Calculus, Differential Equations, Linear Algebra, Probability and Statistics, Discrete Math 
大學(xué):微積分,微分公式,線性代數(shù),概率和統(tǒng)計,離散數(shù)學(xué)。
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.) 
上面那個關(guān)于高中數(shù)學(xué)課程單子上所列的,怎么來著?美國高中幾乎都是這樣的課程設(shè)置。我認(rèn)為其他國家也會很相似的,除了那些在9歲之前就掌握了這些課程的學(xué)生。(美國小孩同時卻在熱衷于玩魔鬼卡車競賽,雖然如此,整個來說也算不上什么大損失。) 
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. 
代數(shù)?是的,沒問題。你需要代數(shù),和一些理解解析幾何的知識。那些很有用,并且在以后幾個月里,你能學(xué)到一切你想要的,十拿九穩(wěn)的。剩下的呢?我認(rèn)為一個基本的介紹可能會有用,但是在這上面花整個學(xué)期或一年就顯得很荒謬了。

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. 

我現(xiàn)在意識到那個書單列表是設(shè)計給那些以后要當(dāng)科學(xué)家和工程師的學(xué)生的。他們在高中里所教的數(shù)學(xué)課程并不是為你的編程生涯做準(zhǔn)備的,簡單的事實是,多數(shù)的編程工作所需要的數(shù)學(xué)知識,相比其他工程師角色增長的更快。
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. 
即使你打算當(dāng)一名科學(xué)家或者一名工程師,在你理解了什么是數(shù)學(xué)之后——數(shù)學(xué)從何而來,走向哪里,為何而生,你會發(fā)現(xiàn)學(xué)習(xí)和欣賞幾何學(xué)和三角學(xué)變得更容易了。不必去記住幾何上的證明和三角恒等式,雖然那確實是高中學(xué)校要求你必須去做的。
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. 
所以,這樣的書單列表不再有什么用了。學(xué)校教給我們的不是最合適的數(shù)學(xué),并且方式也不對,難怪程序員認(rèn)為他們不再需要數(shù)學(xué):我們學(xué)的大部分?jǐn)?shù)學(xué)知識對我們的工作沒什么大的幫助。
The Math They Didn't Teach You 
他們沒有教給你的那部分?jǐn)?shù)學(xué)。
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. 

在現(xiàn)實中,計算機科學(xué)家經(jīng)常使用的數(shù)學(xué),跟上面所列的數(shù)學(xué)僅有很小的重疊。舉個例子,你在中學(xué)里學(xué)的大部分?jǐn)?shù)學(xué)是連續(xù)性的,也就是說,那是作為實數(shù)的數(shù)學(xué)。而對于計算機科學(xué)家來說,他們所感興趣的95%也許更多的是離散性的,比如,關(guān)于整數(shù)的數(shù)學(xué)。
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. 

我打算在以后的博客中再談一些有關(guān)計算機科學(xué),軟件工程,編程,搞些有趣的東東,和其他常常令人犯暈的訓(xùn)練。我已經(jīng)從Richard Gabriel的《軟件的模式》這本書中洞察到一個無關(guān)巨細(xì)的基本框架。如果你明顯的等不下去的話,去讀吧,是本不錯的書。
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. 
從現(xiàn)在開始,不要再讓"計算機科學(xué)家"這個詞困擾到你。它聽上去很可怕,其實數(shù)學(xué)不是計算機科學(xué)家所獨有的領(lǐng)域。你也能作為一個黑客自學(xué)它,并且能做的和他們一樣棒。你作為一個程序員的背景,將會幫助你保持只關(guān)注那些有實踐性的部分。
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. 
我們用來建立計算模型的,大體上是離散數(shù)學(xué),這是普遍的做法。如果正好今天你在看這篇博客,從現(xiàn)在起你正了解到更多的數(shù)學(xué),并且你會認(rèn)識到那樣的普遍做法是不對的;從現(xiàn)在開始,你將有信心認(rèn)為可以忽略這些,并以你想要的方式自學(xué)。
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. 
對程序員來說,最有效的離散數(shù)學(xué)的分支是概率理論。這是你在學(xué)校學(xué)完基本算術(shù)后緊接著的課。你會問,什么是概率理論呢?你就數(shù)啊,看有多少次出現(xiàn)滿堂彩?或者有多少次是同花順。不管你思考什么問題,如果是以"多少種途徑..."或"有多大幾率的...",那就是離散問題。當(dāng)它發(fā)生時,都轉(zhuǎn)化成"簡單"的計數(shù),拋個硬幣看看...? 毫無疑問,在他們教你基本的計算用法后,他們會教你概率理論。
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. 
我還保存著大學(xué)里的離散數(shù)學(xué)課本,可能它只占了三分之一的課程,但是它卻涵蓋了我們幾乎每天計算機編程工作大部分所用到的數(shù)學(xué)。
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. 
也真是夠奇怪的,我的教授從沒告訴我數(shù)學(xué)是用來干嗎的,或者我也從來沒有聽說過,種種原因吧。所以我也從沒有給以足夠的注意,只是考試及格,然后把他們都忘光,因為我不認(rèn)為它還和編程有啥關(guān)系。事情變化是我在大學(xué)學(xué)完一些計算機科學(xué)的課程之后,也許是25%的課程,可憐啊!我必須弄明白什么對于自己來說是最重要的,然后再是向深度發(fā)展。
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. 
我想,如果每門數(shù)學(xué)課都花上整整一周的時間,而只是介紹讓你如何入門的話,那將非常不錯。這是最有意思的一種假設(shè),那么你知道了你正學(xué)習(xí)的對象是哪種怪物了。怪物,大概對每一門課都合適。
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: 
除了概率和離散數(shù)學(xué)外,還有不少其他的數(shù)學(xué)分支,可能對程序員相當(dāng)?shù)挠杏谩W(xué)校通常不會教你的,除非你的輔修科目是數(shù)學(xué),這些數(shù)目列表包括:

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. 
統(tǒng)計學(xué),其中一些包括在我的離散數(shù)學(xué)課里,它的某些訓(xùn)練只限于它自身,自然也是相當(dāng)重要的,但想學(xué)的話不需要什么特別的入門。
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. 
代數(shù)和線性代數(shù)(比如:矩陣),他們會在教完代數(shù)后立即教線性代數(shù)。這也簡單,但這在相當(dāng)多的領(lǐng)域非常有用,包括機器學(xué)習(xí)。
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. 
數(shù)理邏輯,我有相當(dāng)完整的關(guān)于這門學(xué)科的書沒有讀,是Stephen Kleene寫的,克林閉包的發(fā)明者。我所知道的還有就是Kleenex, 這個就不要讀了,我發(fā)誓我已經(jīng)嘗試了不下20次,卻從沒有讀完第二章。如果哪位牛掰有什么更好的入門建議的話,可以給我推薦。顯然,這門學(xué)科明顯是非常重要的一部分。
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. 
信息理論和柯爾莫戈洛夫復(fù)雜性理論,真不可思議,不是么?我敢打賭沒哪個高中會教你其中任何一門課程。它們都是新興的學(xué)科。信息理論(相當(dāng)相當(dāng)相當(dāng)相當(dāng)難懂)是關(guān)于數(shù)據(jù)壓縮,柯爾莫戈洛夫復(fù)雜性理論(同樣非常難懂)是關(guān)于算法復(fù)雜度的。也就是說,你要把它壓縮的盡量小,你所要花費的時間也就變的越長;同樣的,程序或數(shù)據(jù)結(jié)構(gòu)要變得多優(yōu)雅,也有同樣的代價。它們都很有趣,也很有用。
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. 
當(dāng)然,也有其他的一些因素,某些領(lǐng)域是重復(fù)的。也拿來說說吧,你所發(fā)現(xiàn)有用的那部分?jǐn)?shù)學(xué),不同于那些你在學(xué)校里認(rèn)為有用的數(shù)學(xué)。
What about calculus? Everyone teaches it, so it must be important, right? 
那微積分呢?每個人都學(xué)它,所以它也一定是重要的,對嗎? 
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. 

好吧,微積分實際上是相當(dāng)容易的。在我學(xué)習(xí)它之前,它聽上去好像是世界上最難的一件事,好像和量子力學(xué)差不多。量子力學(xué)對我來說真的不是那么容易理解,但是微積分卻不是。在我意識到程序員能夠快速的學(xué)習(xí)數(shù)學(xué)時,我拿起一些微積分課本用一個月通讀了整本書,一個晚上讀一小時。
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. 

微積分都是關(guān)于連續(xù)統(tǒng)的 -- 變化的比率,曲線的面積,立體的體積,是些有用的東西,但是實際細(xì)節(jié)卻包含大量的記憶量并且枯燥,作為一個程序員來說根本不需要這些。更好的方法是從整體上了解那些概念和技術(shù),在必要的時候再去查詢那些細(xì)節(jié)。
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. 
幾何,三角,微分,積分,圓錐曲線,微分方程,和他們的多維和多元 -- 這些都有重要的應(yīng)用。不過這時候不需要你去了解它們,這大概不是個好注意,讓你年復(fù)一年的去做證明和它們的練習(xí)題,不是嗎?如果你打算花大量的時間去學(xué)習(xí)數(shù)學(xué),那也是和你生活相關(guān)的部分。
The Right Way To Learn Math 
學(xué)習(xí)數(shù)學(xué)的正確方法 。
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. 
正確學(xué)習(xí)數(shù)學(xué)的方法是廣度優(yōu)先,而非深度優(yōu)先。你要考察的是整個數(shù)學(xué)世界,學(xué)習(xí)每個概念的名字,區(qū)分出什么是什么。
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. 
具體來看,考慮用長除法?如果你能在紙上做長整除,現(xiàn)在就舉起你的手。會有人舉手嗎?至少我不這么認(rèn)為。
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, 

回頭看看在學(xué)校里學(xué)過的長除法,要是不讓你覺得煩惱和憤怒才怪。當(dāng)然,這是顯然的,但你不一定要自己親自去做,因為很容易用計算器來做。即使你不幸在一座沒有電力的荒無人煙的小島上,你起碼還有個計算器,在你的手表上,補牙的什么東東,或其他什么上面。 
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!) 

為什么他們還教你這些呢?如果我們不能記住怎樣去做,為什么會感到含糊心虛呢?好像我們不需要再次知道它。除此以外,如果你命懸一線,你可以運用任意大的數(shù)來做長除法。想象你被囚禁在第三世界的地牢里,那兒的獨裁者是不會放你出來的,除非你計算出219308862/103503391。你會怎么做呢?好吧,很容易,你開始從分子減去分,,直到不能再減只剩余數(shù)為止。若實在有壓力,你可以想個辦法,繼續(xù)使用反復(fù)減,估算作為十進制的余數(shù)(這種情況下,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. 
你或許明白,除法就是反復(fù)的減,這樣從直覺上對除法概念的理解就根深蒂固啦! 

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. 

學(xué)習(xí)數(shù)學(xué)的正確方法是忽略實際的算法和證明,對于大部分情況來說,他們的名字,他們的作用,他們計算的大致步驟,(有時是)誰發(fā)明了他們,發(fā)明了多久了,他們的缺陷是什么,和他們相關(guān)的有什么,把數(shù)學(xué)當(dāng)文科來學(xué)。
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. 
為什么呢?因為第一步反應(yīng)在數(shù)學(xué)上的是問題的確定。如果你有一個問題去解決,并且假設(shè)你沒有頭緒如何開始,這將花費你很長的時間來弄明白。但如果你知道這是個變異的問題,或者是一個凸優(yōu)化問題,或者一個布爾的邏輯問題,然后你起碼能知道從哪著手開始尋找解決方案。

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? 
現(xiàn)在有許許多多的數(shù)學(xué)技術(shù)和整個的學(xué)科分支。如果你不知道組合邏輯是什么,甚至連聽都沒聽說過,那么你是不可能意識到在組合邏輯中可以找到的答案解決的是什么問題,難道不是么? 
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. 
但那實在是個大新聞,因為閱讀這些領(lǐng)域,學(xué)習(xí)實際算法,建模和計算結(jié)果的方法,記住這些名字都是容易的。在學(xué)校里他們教你鏈?zhǔn)椒▌t。你也能回憶起他們并能運用在考試題上,但有多少學(xué)生能真正的了解他們到底意味著什么呢? 所以當(dāng)他們遇到變種的鏈?zhǔn)絾栴}時,他們就不懂得如何運用公式了。讓人感到諷刺的是,了解這是什么比記住如何運用公式更為容易。鏈?zhǔn)椒▌t僅僅是如何對鏈?zhǔn)胶瘮?shù)求導(dǎo)的意思,函數(shù) x() 引用函數(shù) g() , 你要求導(dǎo) x(g()) 。好了,程序員知道所有這些函數(shù)相關(guān)的,我們每天都使用它們,所以現(xiàn)在比過去在學(xué)校更容易想象到問題所在。
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. 

這就是為什么我認(rèn)為他們以錯誤的方式在教數(shù)學(xué)。老師們向大多數(shù)高中畢業(yè)生專門教授的內(nèi)容,不是靠經(jīng)驗來證明數(shù)學(xué)是如何如何有用的,而恰恰是相反。在你學(xué)習(xí)如何求導(dǎo)和做積分之前,你應(yīng)該學(xué)習(xí)如何計數(shù),怎樣編程。
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. 
我認(rèn)為學(xué)習(xí)數(shù)學(xué)最好的方法是每天花15到30分鐘逛維基百科,那上面有數(shù)千數(shù)學(xué)分支的相關(guān)文章,可以從一些你感興趣的文章著手(比如弦理論,或者傅立葉變換,或者張量理論,就是能沖擊你想象力的東西) 閱讀。如果有什么你不理解的,就去了解那些鏈接,如此這般直到你累到不行為止。
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. 
幾個月后,這么做會縱向擴展你的數(shù)學(xué)知識面。你會發(fā)現(xiàn)一些模式,好比數(shù)學(xué)的每個分支看上去都包括了一個有著復(fù)雜的多元的變量,然后線性代數(shù)將會慢慢爬滿你的書單列表,直到你強迫自己學(xué)會它實際上是怎樣工作的,你要下載個電子書或買本書,直到你能從中找到樂趣。 
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. 
憑借著維基百科,你也能快速的找到一條了解數(shù)學(xué)基本原理的途徑,條條大道通羅馬。在某些領(lǐng)域,數(shù)學(xué)幾乎總是形式化我們的"常識",所以我們能減少或證明那些領(lǐng)域里的新事物。對數(shù)學(xué)本身的研究就是無止境而且令人著迷的,構(gòu)造形式模型本質(zhì)的能力,證明,自明的系統(tǒng),規(guī)則表示,信息和計算。
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. 
數(shù)學(xué)符號很重要,但卻容易讓人放棄。對于門外漢來說,數(shù)據(jù)符號是巨大的障礙。即使你熟悉累加,積分,多項式,指數(shù)等等,如果你看到堆徹的異常復(fù)雜的符號時,你就把它實現(xiàn)的功能當(dāng)成一個原子操作好了,不要深究太多。
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. 
不管怎樣,認(rèn)真去了解數(shù)學(xué),嘗試著理解人們正在試圖解決的問題(那些已被證明了的問題某天也許會對你有實際用途),你會在符號中看到模式,你也不再排斥它們。比如,累加符號(大寫符號-西格馬)或者π(大寫符號-pi,連乘符號)起初看上去讓人心里沒底,即使你了解了它們的基本原理。但如果你是個程序員,你會認(rèn)識到他僅僅是個循環(huán):一個累加值,一個累乘,積分是一段連續(xù)曲線的相加,所以那不會讓你郁悶太久。
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!" 

一旦你習(xí)慣了數(shù)學(xué)的許多分支,和許多不同格式的符號,你就走在了知道很多有用數(shù)學(xué)知識的路上。因為你不再害怕,你將會發(fā)現(xiàn)問題,其實它們會自動跳到你面前。“嗨,”你會思索,“我了解這個,這是乘法符號!”
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語言庫,但幾乎所有有用的數(shù)學(xué)都是重型自動機,所以你能夠讓一切都變的自動化。
When Are Exercises Useful? 
練習(xí)有啥用處呢? 
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. 

在做了幾年的業(yè)余數(shù)學(xué)愛好者之后,你可以在腦海里做很多數(shù)學(xué)題,即使你從沒碰過筆和紙。比如,你會一直看到多項式,所以你會耳濡目染的做起多項式的運算。同樣的,對數(shù),根,超越數(shù),和其他到處出現(xiàn)的基本數(shù)學(xué)原理。

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. 
對于我要親手做多少練習(xí)題,我有一種直覺。我用一種“真實性測試”跟隨證明步驟。比如,我看到有人除以兩個多項式,我大概知道結(jié)果是什么,如果它們的結(jié)果看上去差不多是對的,我就相信他們了。但如果我看到的那個證明我聽都沒聽說過,亦或看上去是錯的或者不可能的,我就要挖掘更多的東西了。
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. 
這很像讀程序源代碼,不是么?當(dāng)你讀某人的代碼,你不需要手動模擬整個程序狀態(tài);如果你知道計算過程大致會發(fā)生什么情形,你就能推斷出結(jié)果。舉個例子,如果結(jié)果應(yīng)該是個列表,但返回的是一個標(biāo)量,可能你就會更深入地研究。但正常情況下,你幾乎是以你閱讀英文文本的速度(有時僅僅是速度上)掃描源代碼,并且你確信理解了整個結(jié)構(gòu),但與此同時,你也許會發(fā)現(xiàn)令你震驚的錯誤。 
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. 

我認(rèn)為數(shù)學(xué)愛好者(數(shù)學(xué)家和真正的數(shù)學(xué)迷)也是這樣閱讀數(shù)學(xué)論文的。和你讀代碼時一樣,他們也會做同樣的檢查,除非他們不想把作者的觀點駁倒。
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. 
照那樣說,我會偶爾做做數(shù)學(xué)練習(xí)。如果某些問題(比如代數(shù)和線性代數(shù))一次又一次的出現(xiàn),我就做些練習(xí)去確認(rèn)我是否真正的理解它了。
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.
但我要強調(diào)這點:不要讓練習(xí)使你分心。如果一個練習(xí)(甚或是一篇特別的文章或章節(jié))開始讓你煩惱,那就暫時丟一邊繼續(xù)前進,該奔跑就堅決奔跑。讓你的直覺引導(dǎo)你。你會學(xué)到更多,更快,你的信心也會隨之增長。
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. 
也許不能--不能立刻奏效。但確實能幫助提高你的邏輯推理能力;好比是在健身房進行鍛煉,如果你每天都做一點的話,你的身體素質(zhì)肯定會得到提高。
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. 
對我來說,我已經(jīng)注意到一些我感興趣的領(lǐng)域(包括人工智能,機器學(xué)習(xí),自然語言處理和模式識別)大量用到數(shù)學(xué)。對于我研究的更深的領(lǐng)域,我發(fā)現(xiàn)它們所用的數(shù)學(xué)并不比我在中學(xué)學(xué)到的更難;多半是不同的數(shù)學(xué),而不是更難了。并且學(xué)習(xí)數(shù)學(xué)使我能寫(或者是在我自己的代碼里使用)神經(jīng)網(wǎng)絡(luò),基因算法,貝頁斯分類器,集群算法,圖像識別,和其他時髦的東西,能產(chǎn)生很酷的應(yīng)用,我可以向我的朋友炫耀。
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. 
我逐漸意識到這點,當(dāng)別人給我看一篇包含數(shù)學(xué)公式的文章時,我不再突然冒出一身冷汗:組合,微分,真值表,定列式,無限系列等等。那些數(shù)學(xué)公式現(xiàn)在變得容易相處了,但(像編程語言的語法)剛開始接觸的時候多少還是讓人覺得復(fù)雜?,F(xiàn)在我能更好的理解了,即使遇到不懂的地方,也不再感到自己是個不懂?dāng)?shù)學(xué)的人了。因為我知道自己是能夠弄明白的。
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. 
我會繼續(xù)加油做的更好滴。我還有不少活頭,有好多書和文章要讀。有時我會花整個周末來讀數(shù)學(xué)書,有時會數(shù)周都不再思考它。和其他興趣一樣,如果你相信它是有趣的,能通過它更容易的消磨時光,你就會時不時地去做,并從中獲益。
Math every day. What a great idea that turned out to be! 
好好學(xué)習(xí),天天數(shù)學(xué)!

原文標(biāo)題:Math For Programmers

原文來源:http://steve-yegge.blogspot.com/2006/03/math-for-programmers.html

it知識庫程序員怎樣學(xué)數(shù)學(xué),轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 91热视频| 久久综合久久伊人 | 欧美色网络 | 色老板在线永久免费视频凹凸 | 国产毛片在线看 | 欧亚精品一区二区三区 | 亚洲国产精品日韩高清秒播 | 欧洲精品一区二区三区在线观看 | 国产精品麻豆一区二区三区v视界 | 亚洲精品香蕉婷婷在线观看 | 青青热久久综合网伊人 | 久久精品99无色码中文字幕 | 91精品国产自产在线观看高清 | 国产三区二区 | 日韩久久一区二区三区 | 天天拍夜夜添久久精品免费 | 91婷婷| 色哟哟哟在线观看www | 国产一级做a爰片久久毛片 国产一级做a爰片久久毛片99 | 欧美色就是色 | 亚洲欧美日韩视频一区 | 亚洲国产中文字幕在线观看 | 91免费片| 色婷婷激情五月 | 四虎免费视频 | 97精品伊人久久大香线蕉 | 色米奇777| 国产精品视频第一区二区 | 中文字幕成人免费视频 | 黑人一级毛片 | 人人做天天爱夜夜爽中字 | 午夜国产情侣拍视频 | 色呦色呦色精品 | 亚洲天堂图片 | 激性欧美激情在线aa | 婷婷亚洲视频 | 欧美成在线观看 | 久久国产乱子伦免费精品 | 久久66久这里精品99 | 一二三四视频在线社区7 | 中文字幕色网站 |