Discrete Math and Programming

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »

53 Replies - 2552 Views - Last Post: 10 July 2013 - 02:24 PM

#1 USC2587  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 29
  • Joined: 04-June 12

Discrete Math and Programming

Posted 07 July 2013 - 11:27 PM

I have read that Computer Science is derived from Discrete Math.I was a Math major in school and took a Discrete Math course. I was thinking about studying my textbook in more depth, because the course only covered half the book. Does this seem like a good time investment to improve my programming?
Is This A Good Question/Topic? 0
  • +

Replies To: Discrete Math and Programming

#2 Flukeshot  Icon User is offline

  • A little too OCD
  • member icon

Reputation: 415
  • View blog
  • Posts: 1,030
  • Joined: 14-November 12

Re: Discrete Math and Programming

Posted 07 July 2013 - 11:45 PM

Reading will only take you quarter of the way in programming, it's mostly about experience. Like any language, the best way to learn is to put it to use, so if you want to boost your knowledge of a programming language, the best thing to do is make lots of small programs and a few medium sized projects.
Was This Post Helpful? 1
  • +
  • -

#3 USC2587  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 29
  • Joined: 04-June 12

Re: Discrete Math and Programming

Posted 08 July 2013 - 12:30 AM

View PostFlukeshot, on 07 July 2013 - 11:45 PM, said:

Reading will only take you quarter of the way in programming, it's mostly about experience. Like any language, the best way to learn is to put it to use, so if you want to boost your knowledge of a programming language, the best thing to do is make lots of small programs and a few medium sized projects.


I'm not studying a programming language. The Discrete Math book I'm talking about is like any other math book. It has content and then practice problems to solve at the end of each section.
Was This Post Helpful? 0
  • +
  • -

#4 depricated  Icon User is offline

  • DLN-000

Reputation: 585
  • View blog
  • Posts: 2,088
  • Joined: 13-September 08

Re: Discrete Math and Programming

Posted 08 July 2013 - 04:30 AM

View PostFlukeshot, on 08 July 2013 - 12:45 AM, said:

Reading will only take you quarter of the way in programming, it's mostly about experience. Like any language, the best way to learn is to put it to use, so if you want to boost your knowledge of a programming language, the best thing to do is make lots of small programs and a few medium sized projects.

Maybe I should try this. I keep going for big project after big project. Got several done but I feel like I still haven't done a lot because I've only got like 5 things to show for years of work.
Was This Post Helpful? 0
  • +
  • -

#5 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5777
  • View blog
  • Posts: 12,591
  • Joined: 16-October 07

Re: Discrete Math and Programming

Posted 08 July 2013 - 05:14 AM

No.

There is theory and there is practice. You can study all the theory in the world and still have no ability to practically apply it. You will learn more from trying, and failing, than from passively observing someone else's success.


View PostUSC2587, on 08 July 2013 - 02:27 AM, said:

I have read that Computer Science is derived from Discrete Math.


This sounds like something a math major might read. It may even have had some validity: 50 years ago. Today, well, math likes to claim all the sciences, doesn't it? Reality tends to be more messy.

Programming is doing. Reading it not doing. You can read all the books written buy all the best chess players and still suck at chess. The kid who never read any of those books but plays games in the park everyday will kick your ass.
Was This Post Helpful? 0
  • +
  • -

#6 WolfCoder  Icon User is offline

  • Isn't a volcano just an angry hill?
  • member icon


Reputation: 782
  • View blog
  • Posts: 7,610
  • Joined: 05-May 05

Re: Discrete Math and Programming

Posted 08 July 2013 - 05:40 AM

Discrete math can make you a better programmer, but you also need to know how to program in the first place. As long as you try applying ideas you read with actual programming, you'll be fine.
Was This Post Helpful? 2
  • +
  • -

#7 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7564
  • View blog
  • Posts: 12,688
  • Joined: 19-March 11

Re: Discrete Math and Programming

Posted 08 July 2013 - 07:21 AM

If you'd said "programming is derived from discrete math" then a lot of the objections above would hold more water. If you say "computer science", that'a little more defensible, though probably still overstating the case. The fundamentals of modern computing do come out of math departments, computer science as a discipline was founded by math guys - particularly Knuth - and is fundamentally mathematical in nature, and much of the thinking in computer science goes back to tools of discrete math. We can see this, for example in algorithm design and analysis and compiler design.

So we can say that there are important areas of CS that take their basis straight from discrete math, true enough. Computer science is a big of a magpie discipline, though. There are areas that are more like engineering lore and wise-men-talking, such as design patterns and "how one should refactor", which I suppose are part of computer science. Some things that come up in a software engineering course come straight out of an MBA program (scheduling and management issues) and other things come out of psychology (UI design, more management tricks). I recognize elements from my linguistics training, and the list goes on and on.
And you also have areas where the discipline has developed its own intellectual infrastructure, which you'll see in arguments about type and scope - I think it would be hard to isolate one or several antecedent disciplines for discussions about lexical versus dynamic scoping, for example.

All that being said, it's still and always true that while theory can be very useful, what makes a programmer is writing lots and lots of programs. If your sink backs up, and you have a choice between two plumbers, do you want the guy who's read every volume ever written on Plumbing Theory, or the guy who's spent twenty years clearing stuck drains?
Was This Post Helpful? 3
  • +
  • -

#8 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10376
  • View blog
  • Posts: 38,415
  • Joined: 27-December 08

Re: Discrete Math and Programming

Posted 08 July 2013 - 07:46 AM

Quote

This sounds like something a math major might read. It may even have had some validity: 50 years ago. Today, well, math likes to claim all the sciences, doesn't it? Reality tends to be more messy.

I'm not sure that's a fair claim. Calculus was developed to deal with Physics problems. It makes sense that a class on differential equations will prepare one for physics. Certainly it's not a perfect substitute, but I found my diff eqs work to be better preparation for physics concepts than my physics classes. Mathematics also evolved to help solve economics problems. Really, the attitude in economics is if you want to do graduate level work (ie., actually be an economist for a living), go get a math degree. Sure Chemistry uses a lot of math, but I wouldn't say that math claims Chemistry.

Regarding CS, I think jon.kiparsky pretty much hit the nail on the head. The origins of CS are rooted in math, and really to a large extent EE. If one studies Theory of Computation, the circuitry crosses over with Linear Algebra, Boolean Algebras, and EE. Linguistics plays a huge role, as Jon pointed out. AI is all Graph Theory, Statistics, and Game Theory. Software Engineering is probably the only major field in CS not dominated by math at some level.

The important thing to remember about a Discrete Math textbook is that it is designed to survey Discrete Mathematics. Being well rounded is great, but you'll be missing out on a fair amount of depth. As you go along, the graph problems will really help a ton. Implement things like Dijkstra's algorithm, Prim's and Kruskal's MST algorithms, Ford-Fulkerson, etc. Write a program to bit-sieve primes, compute partitions, etc. I'm a big fan of math and theory, but make sure you use the theory to generate better solutions rather than just taking the BFI approach.
Was This Post Helpful? 2
  • +
  • -

#9 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7564
  • View blog
  • Posts: 12,688
  • Joined: 19-March 11

Re: Discrete Math and Programming

Posted 08 July 2013 - 08:00 AM

View PostUSC2587, on 08 July 2013 - 01:27 AM, said:

I was thinking about studying my textbook in more depth, because the course only covered half the book. Does this seem like a good time investment to improve my programming?


With everything that has been said on this, I think you deserve a clear and concise answer to this:

Yes, it's a good investment provided it doesn't preclude writing programs. If you have to choose, write programs. If you can do both, do both.
Was This Post Helpful? 0
  • +
  • -

#10 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5777
  • View blog
  • Posts: 12,591
  • Joined: 16-October 07

Re: Discrete Math and Programming

Posted 08 July 2013 - 08:19 AM

View Postmacosxnerd101, on 08 July 2013 - 10:46 AM, said:

Calculus was developed to deal with Physics problems.


Not quite. Calculus was developed. It happens to be eminently applicable to physics problems and Newton offered good examples of this.

Interestingly, the other calc guy, Leibniz, defined the modern binary number system. Oddly, he did not develop it to deal with computers.

Will a deep understanding of mathematics help you understand aspects computer science? Absolutely! Is the study of mathematics the most efficient route if your goal is to improve programming skills? No.
Was This Post Helpful? 0
  • +
  • -

#11 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2889
  • View blog
  • Posts: 10,010
  • Joined: 08-August 08

Re: Discrete Math and Programming

Posted 08 July 2013 - 08:29 AM

Didn't Newton develop Calculus specifically to solve a physics problem?

Studying math as well as many other subjects can help you be a better programmer since the more you know the more you can write (literature or code) about. Steve Jobs credited liberal arts people with much of the important parts of the original Macintosh user interface design. Techies at the time for instance, couldn't even see a use for proportionally spaced fonts. Now they're almost everywhere.
Was This Post Helpful? 0
  • +
  • -

#12 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10376
  • View blog
  • Posts: 38,415
  • Joined: 27-December 08

Re: Discrete Math and Programming

Posted 08 July 2013 - 08:31 AM

That's interesting. I always thought that Newton developed Calculus as a tool to work on his Physics problems. Interestingly enough, a lot of the physics applications came later when the limit and definition of continuity were introduced, and Analysis became a more defined field (no pun intended).

Quote

Interestingly, the other calc guy, Leibniz, defined the modern binary number system. Oddly, he did not develop it to deal with computers.

I read about that! It reminds me of Number Theory to a certain extent, which was largely thought of as useless until the development of public-key cryptography.

Quote

Is the study of mathematics the most efficient route if your goal is to improve programming skills? No.

I would absolutely agree.
Was This Post Helpful? 0
  • +
  • -

#13 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7564
  • View blog
  • Posts: 12,688
  • Joined: 19-March 11

Re: Discrete Math and Programming

Posted 08 July 2013 - 08:35 AM

View Postbaavgai, on 08 July 2013 - 10:19 AM, said:

View Postmacosxnerd101, on 08 July 2013 - 10:46 AM, said:

Calculus was developed to deal with Physics problems.


Not quite. Calculus was developed. It happens to be eminently applicable to physics problems and Newton offered good examples of this.


If you really want to get pedantic, Mac's statement is not false. Newton invented calculus to model problems in physics. Leibniz invented calculus, but not to model problems in physics. Since one of the inventions of calculus was for modeling physics, it's true that "calculus was developed to deal with physics problems". :)
Was This Post Helpful? 2
  • +
  • -

#14 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7564
  • View blog
  • Posts: 12,688
  • Joined: 19-March 11

Re: Discrete Math and Programming

Posted 08 July 2013 - 08:43 AM

View PostCTphpnwb, on 08 July 2013 - 10:29 AM, said:

Steve Jobs credited liberal arts people with much of the important parts of the original Macintosh user interface design. Techies at the time for instance, couldn't even see a use for proportionally spaced fonts. Now they're almost everywhere.


DEK released TeX in 1978, and a complete revision appeared in 1982. The Macintosh was released in 1984.
Was This Post Helpful? 0
  • +
  • -

#15 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2889
  • View blog
  • Posts: 10,010
  • Joined: 08-August 08

Re: Discrete Math and Programming

Posted 08 July 2013 - 09:02 AM

View Postjon.kiparsky, on 08 July 2013 - 11:43 AM, said:

View PostCTphpnwb, on 08 July 2013 - 10:29 AM, said:

Steve Jobs credited liberal arts people with much of the important parts of the original Macintosh user interface design. Techies at the time for instance, couldn't even see a use for proportionally spaced fonts. Now they're almost everywhere.


DEK released TeX in 1978, and a complete revision appeared in 1982. The Macintosh was released in 1984.

I wasn't saying that proportional fonts didn't exist. I was saying they didn't exist in the computers of the day and that most (nearly all) computer people couldn't see the need for them. The point being that if all you focus on is writing code then your vision will be too narrow to be useful to you or your employer.
Was This Post Helpful? 0
  • +
  • -

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »