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 withoutit 所以他们是对的:你不需要了解数学,并且没有数学你也能过的很好 But a few things I've learned recently might surprise you: 但是最近我学到一些东西可能会让你也感到惊喜: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 US 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 onething, 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: ie, 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 Thisis 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 ofa 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 acoin 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 themost 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 (ie, 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 Ie, 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 那微积分呢每个人都学它,所以它也一定是重要的,不对吗
看你要做什么样的程序员。
如果就是一般的做计算机软件的程序员,几乎不需要什么数学基础,当然,如果你有一些离散数学的基础是最好不过了。
但如果你要做计算机特殊领域的程序员,比如,人工智能,模式识别,数据加密,数据压缩,数字图像等等,那就需要相关的数学基础了,包括微积分、线性代数、概率论、统计学、数论等等。
盖茨曾经说过,不要过分夸大数学对软件的重要性。
人工智能听起来好像很酷炫,说白了在金融上的应用主要就三件事:
第一,是对于金融数据的高级统计学的应用和分析。比如说,对于传统的线性回归没有办法进行有效的分析归纳的,通过AI、机器学习的算法可以对同样的一组数据用不同纬度去做分析,从而在中间找出它的规律。这个数据在机器学习的算法下可以变成是一个可以支持你决策的东西。
第二,是机器自我学习演变的能力。人每天也会接触到大量的信息,但是人很难对每天接触到的信息都做一个归纳、并对自己今天做的决定基于新的信息做一个复盘,因为这种学习的能力需要大量的计算,但机器可以做到这个。
第三,是对数据的及时处理。传统银行也会对一些高级客户做资产配置推荐,就是所谓的“银行观点”。这个观点的更新频次是固定的,比较常见的情况是三个月更新一次。在这三个月之中,客户任意时间点进来,得到的建议都是一样的,这个就很成问题。及时性的风控建议将成为贷款业务中后期的关键。
学好了数学或者成为了一个优秀的程序员绝对不等于对统计学有很好的了解。还有一些案例中显示有扎实的统计能力的优秀科学家也不一定总是在统计方面能做好——科学家也是人,他们也会在统计学领域犯错,这里有些例子:
1 非常草率的处理数据,例如:数据误读,错误标注,未能正确清理数据,合并不正确项,不存档等等。
2 对概率论的理解不足,过分依赖少数概率分布,如常态。
3 对取样理论和取样方法的无知:从一个小的自选择样本推广到一个大的异质群体就是一个例子。对数据加权的误解也很常见。第三个例子使用复杂抽样方法时,将数据视为一个简单的随机样本。
4 对统计推断的把握不严,如混淆统计意义和实际意义。另一个例子是对人口数据进行重要性测试。例如,如果我们对A国有五十年的季度GDP数据,这200个数据点是该时间段内国家的人口数据,而不是人口的样本。例如,进行t检验,看看线性趋势是否与零有统计学上的差异,在这种情况下是没有意义的。
5 利用机会寻找重大差异(p-hacking),却不考虑已经进行的显著性测试的数量。
6 在学术期刊上,要获得学术期刊的认可,通常需要达到统计上的重要性,而出版偏倚是一个严重的后果。 Meta-Analysis (Borenstein et al) 和Methodsof Meta-Analysis (Schmidt and Hunter)这2本书中的对应方法很管用值得一看。
7 从一个没有被复制甚至交叉验证的单一研究中得出戏剧性的结论。
8 对贝叶斯统计,非参数统计,心理计量学和潜在变量模型的理解太表面。
9 对分析时间序列和纵向数据的方法,以及空间统计和多层次混合模型理解不充分。
10 许多工具,如支持向量机和人工神经网络,以及数据挖掘和预测分析中常用的Boosting和bagging等概念,对许多尚未开发的科学领域有潜在的实用价值。
11 没有对广义线性模型方程给予足够的关注,例如忽略交互术语。
12 在量化回归、回归样条、广义相加模型或其他方法时,对一组特定的数据进行线性化。
13 不理解(或忽略)重要的统计假设。回归分析被普遍滥用。
14 测量误差:统计显着性测试不考虑测量误差,但测量误差可能会对统计模型的解释造成很大影响。
15 忽略回归到平均值:一个非常古老而又非常危险的错误!
16 出于各种动机对连续变量进行分类,以满足统计假设,但这样做是不对的。另一个原因是它是一种输出结果的方法——一些“效应”是年龄真正的代理或年龄大大缓和。连续年龄有时被故意地分组到广泛的年龄范围,使其效果减弱。这样,一个不负责任的研究者可以得出结论:他们试图建立的效果在控制年龄后是“显着的”。
17 已经知道结果后才提出假设:这个现象很普遍,以至于“人人都做,所以没关系”。
18 用数据子集支持一个假设:“调整”数据直到它支持一个假设。
19 混淆因果关系:对因果机制的误解并不罕见。
20 埋藏在评论里的错误:有成千上万的“学术”出版物,但很少有期刊审稿人是具备专业的统计知识。
21 将模拟数据当作实际数据处理,并将计算机模拟解释为使用真实数据的实验。
22 基于假设而不是数据来进行粗略的估计,这在学术文献中很常见,我们很少注意到。随机模型有时也被误解为确定性模型。
23 试图 “从石头里挤血” :当数据越少,研究人员就越要 “填写空白”。有许多(通常是复杂的)方法来处理过少的数据量,但都增加了进入建模过程的主观性。反过来,这也为不负责人的科学家提供了更多的余地。
24 元分析和倾向分数分析的不当使用。
25 “从小见大”——用少量信息去证实假设。
26 不跟上统计数据的最新发展,不与专业统计人员交流。这是上面列出的许多问题的根本原因。
总的概括:R主要在学术界流行,python(numpy scipy)在工程和人工智能方面比较实用。
R是S(Splus)的开源版本,或者下一代。发源地在新西兰奥克兰。这个软件的统计背景很浓烈。我这里浓烈的意思是,如果你不熟习统计知识(历史)的话,R的帮助文档看起来是很累的。由统计背景的人开发。R的维护组叫CRAN-R。在生物信息方便,有个叫bioconductor的组织,里面有很多生物信息方面可以用的软件包,他们有一套自己维护package系统。
Python是个综合语言(这里特指指CPython解释器),numpy scipy是数值计算的扩展包,pandas是主要用来做数据处理(numpy依赖),sympy做符号计算(类似mathematica?)此外还有一些不太成熟的包如sciki learn,statistical models。成熟度不如R。但是已经到了可用的水平了。是读计算机的人写的统计包。ipython 更新到10以后,功能基本完善,其notebook非常强大(感觉就像mathematica)而且还是基于web,在合作分享方面非常好用。黑马程序员的PYthon是国内最早开设的真正人工智能课程,现在互联网发展的大方向都指向人工智能,而人工智能的第一开发语言是Python。
以上就是关于程序员怎样学数学全部的内容,包括:程序员怎样学数学、程序员应具备怎样得数学基础、如何从程序员成为一名数据科学家 巫银良等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)