# What is a good route for a math student to self study computer science systematically and efficiently? [closed]

I'm aware that this kind of question should be asked in Computer Science Stack Exchange. But I decided to ask here because there should be more effective answers here with more experienced people with solid math background that might have taught themselves some computer science.

I decided to ask this question after being attracted by how much one can do with the knowledge in computer science, including iOS application development, game(or mods) development, website creating, etc., but having trouble with matching what I learned with what I really understood.

Realizing the lack of knowledge in programming, I once decided to learn programming in a specific language, like Objective-C and Swift. After I tried every single textbook on OC programming, I found myself wasting time in the "explanation" part and getting lost with the real "theoretical" part. It seems to me that those textbooks prefer a long and loose explanation in describing a concept without telling me what exactly it is(Like the notion of "Object" and "Pointer") and skip the real important "thinking" before the implementation of the code. Although after many times of reading I could create a very simple application(like a simple calculator), I was still very lost in how it really works.

That reminds me how I began to learn mathematics. In middle school "function" is just "$$y=f(x)$$", where $$f(x)$$ can be $$x^2$$, $$\sin(x)$$, and other operations about $$x$$. However, now for me $$f$$ is a set of tuples satisfying the unique mapping property, or an arrow with domain and codomain. More generally, I can give a affirmative response to every question like "what is (the definition of) this?(in a math sentence.)" So I asked myself, "what is most basic among all subjects in computer science"?

Based on the belief that computer system and programming can be completely theoretical, I decided to learn from the very basic. Where is the code for my programming environment?(For me, Xcode) and how can I understand it? What is a computer made of (up to the transistors), and how do them work together? But then I found out that there is no book with the name similar to "how a computer works" that reach my satisfaction, which I thought is my vocabulary problem.

I hope that in the book I'm looking for, every keyword is rigorously defined, and without any waste of time in explaining what a notion "means" or how it is developed stage by stage historically. I expect that it gives only the goals(like the adding machine) and how to build it from the given definitions(a graph with the nodes of value "0" or "1"). Every textbooks in mathematics(like the GTM series) reach this goal, and for me, that is MUCH easier to read and understand. I think most of the math student like me will prefer this style of learning.

What is a good (book) route for a math student to self study computer science from the basic? I wish there are some theoretical textbooks that build the whole operation system, compiler, or some of this kind, that is readable to math students. Any answer would be much appreciated. Thank you.

• It sounds vaguely like what you want is a computer architecture textbook. Jan 2, 2019 at 0:20
• I would start here if you have never programmed. Jan 2, 2019 at 0:27
• This is the gentlest computer architecture book I know of but I still think it requires a programming background to fully appreciate and finish the computer. Jan 2, 2019 at 0:31
• Did your math courses involve logic and formal languages, or are those courses in CS (or philosophy)? Jan 2, 2019 at 4:45
• How is this a math question? Jan 2, 2019 at 8:56

Based on the belief that computer system and programming can be completely theoretical, I decided to learn from the very basic.

It's a bit arrogant to stick too tightly to such a belief when you're still learning the field don'tcha think?

Some areas of computer science can be called "completely theoretical". Computability theory and complexity theory come close, as do some of the more wild-eyed branches of programming language research. They merge into parts of logic and category theory that could be called "computer science by conquest" because computer scientists are interested in them -- though at the best conferences you will also find people with Dept. of Mathematics affiliations, and some even use blackboards for their talks!

However, in most of computer science as a field, the lifeblood of the science is the tension between nice theoretical models on one hand, and the need to build systems that work on actual physical devices that can be produced economically on the other hand. To insist on studying only the theoretical side amounts to throwing out not just half of the field, but the entire crunchy middle too.

In your position you probably ought to start by a computer architecture textbook, and then learn (really learn) a low-level programming language such as C. Though this will offer you copious opportunity to shoot yourself in the foot, it might also be the only way to satisfy your (in itself laudable) desire to understand the entire stack of abstractions all the way down. And the mistakes you'll make with C might help you understand the point of the more abstract concepts of more modern languages.

• I have been calling $C$ a low level language for years for its close relationship to the instruction set architecture. I believe the convention is to call $C$ a high level language in which you can program at a low level. Jan 2, 2019 at 0:58
• Or an algorithms textbook, maybe? In the days of good king Charlemagne there was a book by Aho, Hopcroft, and Ullman; nowadays there is one by Corman, Leiserson, Rivest, and Stein. Jan 2, 2019 at 1:10
• @kimchilover: Perhaps? To my disgrace, I've never read a dedicated algorithms textbook, so I don't know how much practical familiarity with Von Neumann machines they tend to assume. Jan 2, 2019 at 1:21
• @JohnDouma: C was high-level in 1980, simply by virtue of not being assembler. But the goalposts have shifted considerably since then. Jan 2, 2019 at 1:23
• @HenningMakholm Do you have a source for that? I have been a software developer for a long time and have not received that update until now. Is this because it doesn't run on a VM like Java? Jan 2, 2019 at 1:27

If you are at a university offering computer science degrees, you could find out the names of a few courses that are required for 2nd or 3d year students, get a copy of the text book for one of them, and try to read it.

One thing making your task harder is that computer science is a very wide field, and no one book covers everything important. In part because "computer science" is an amalgam of computer engineering, of computer practice, of applied mathematics, and so on: unlike (say) linear algebra, there is no small set of basic axioms that can be neatly explained and exploited in a few hundred pages. Rather, imagine you wanted to systematically and efficiently learn automobile science. You might find a book that explains car engines and the related chemistry of combustion and pollution control, but says nothing about motion planning or an automobile's HVAC system, etc.

Added, after a few minutes. The comments following Henning Makholm's completely reasonable answer seem to me to illustrate the point I made above: computer science is so complex a subject that it is hard to agree what is most essential.

Let me add a particular recommendation: I have noticed that some of my colleagues do not know about the connection between DFAs and regular languages. This seems to me to be as fundamental a result in theoretical CS as (say) the Pythagorean theorem is in geometry, or as integration by parts in calculus. And more important than many computer hardware implementation details. If you don't know that, you don't know squat. So your goal might be, read enough of Aho, Hopcroft, and Ullman (or equivalent textbook) to understand this important result.

• ... not to mention road design, congestion modeling or predictive models for used-car prices, or policy debates about speed limit enforcement -- all of which would be part of our hypothetical analogue to computer science too. Jan 2, 2019 at 0:54

I wish there are some theoretical textbooks that build the whole operation system, compiler, or some of this kind, that is readable to math students.

I highly recommend reading The Elements of Computing Systems by Nisan and Schocken, and doing all the projects. You make a computer from scratch, starting with NAND gates. Along the way you make a compiler and a simple operating system. In the end you make a simple video game such as Tetris that can run on the computer you've designed. The book's companion website is www.nand2tetris.org.

It is my favorite textbook on any subject.

You might also be interested in Knuth's The Art of Computer Programming, though I haven't read it myself.

• IMHO, Knuth's book is a wonderful recreational read for someone who already knows what's what, but not a good introductory textbook. Jan 2, 2019 at 1:55
• The jump from "The Elements of Computing Systems" to Knuth is like going from building circuits from a STEM kit to attending a graduate program in Electrical Engineering. Jan 2, 2019 at 4:02
• @kimchilover For most of us there is nothing recreational about Knuth. Bill Gates had his to say about it. "If you think you're a really good programmer... read (Knuth's) Art of Computer Programming... You should definitely send me a résumé if you can read the whole thing," Here is my source. Jan 2, 2019 at 4:06
• I meant recreational in the sense that free climbing is recreational: if you are an expert in (say) sorting, you will find his chapter on sorting very hard and very insightful and lots of fun; similarly for random number generation, for floating point arithmetic, and so on. I suspect that DEK's selection of topics was based on his own personal taste rather than on a judgement of importance of topics. Jan 2, 2019 at 5:30