Developing good logic skills

This is a discussion on Developing good logic skills within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Hello everyone, I would like to develop my logic skills because I feel they are quite on the lower average ...

  1. #1
    fsx
    fsx is offline
    Registered User fsx's Avatar
    Join Date
    Apr 2009
    Posts
    29

    Developing good logic skills

    Hello everyone,

    I would like to develop my logic skills because I feel they are quite on the lower average level.
    I believe I need some low-level thinking skill with few instruments to solve the tricks.

    Can you suggest me some techniques to do so? Book titles are very welcome too...

    Best regards and thank you in advance!

    FSX

  2. #2
    Complete Beginner
    Join Date
    Feb 2009
    Posts
    312
    Book titles are very welcome too...
    The standard text on the topic is "Introduction to Mathematical Logic" by Elliott Mendelson.
    Citing from the book cover:

    - propositional logic
    - first-order logic
    - first-order number theory and the incompleteness and undecidability theorems of G÷del, Rosser, Church and Tarski
    - axiomatic set theory
    - theory of computability


    If you want the focus to be on computational logic, see http://www.ps.uni-sb.de/courses/cl-ss08/script/icl.pdf

    Greets,
    Philip
    All things begin as source code.
    Source code begins with an empty file.
    -- Tao Te Chip

  3. #3
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by fsx View Post
    I would like to develop my logic skills because I feel they are quite on the lower average level.
    I believe I need some low-level thinking skill with few instruments to solve the tricks.

    Can you suggest me some techniques to do so? Book titles are very welcome too...
    Make them programming books. Your logical thinking will improve with practice. Computer programming is logic -- just look at what your computer is.

    I absolutely and very strongly disagree with Snafuist about this. You will be much much better off putting twice as much time into K&R (or whatever) than spending that time reading philosophy (even math philosophy).

    Even most "algorithm analysis" and abstraction is far removed from real programming, altho people who find it interesting will of course argue endlessly about how important and fundamental it is. It is not; it may or may not be useful to you after you develop some programming expertise. Otherwise, it seems to me (by observation) that in many (could be most!) cases this leads to more confusion, not less.

    I love philosophy (and booze). I love computer programming (and driving). Hmmm.

    Actually to be honest I do not like driving
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  4. #4
    Registered User
    Join Date
    Feb 2009
    Posts
    278
    I love driving. And programming.

    As to the discussion, I take somewhat of a middle ground. I think to be able to program more than the most basic programs, you have to already have some logic skills. Learning to program builds on the fundamental logical thinking skills that exist already within the aspiring programmer. That being said, I don't think that reading the book Snafuist suggested will help you develop these skills either, although I do think that mathematical logic is essential to computer programming, once again, I think a base must already exist. Mostly this base is built in and is hard to develop by learning. One must have a logical brain to begin with. Given the fact that the OP is on this forum and asking for help in this area, I would assume that the individual is blessed with at least a basic logic understanding.

    In my experience, I have found that working basic logic puzzles is the best way to train the mind to think logically (you can find them at any bookstore). They are fun and you can start small and get harder as you go. Once you have got your brain churning through those with ease, that's when to start reading books to further your understanding.

  5. #5
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Fence sitter! I just want to drive my point home a little bit further.
    Quote Originally Posted by Bladactania View Post
    I do think that mathematical logic is essential to computer programming, once again, I think a base must already exist. Mostly this base is built in and is hard to develop by learning. One must have a logical brain to begin with.
    I remember seeing a poster about the mentally handicapped that said "Any human being who can speak is capable of learning math", which I had never thought about, but I guess LOGICALLY, that would be (and apparently is) true.

    If you want to do puzzles to improve your ability to think logically, I bet the best sort of "puzzle" for this would be to make a puzzle using a computer program.

    If you don't know what they are, google "logic gates and transistors". That's how your computer works. The computer does not implement different schools of thought about it, either. The closest you will ever be to raw logic (which is an extra human thing from which math is abstracted) is to program a computer. If that's what you want to do, doing anything else will be taking a step backward (except that it provides a historical context for the existence of computers, which is interesting and enlightening).

    ps. I may be a hypocrit since I already have a BA that involved logical thinking stuff...and don't consider that to have been a waste of time
    Last edited by MK27; 04-21-2009 at 10:12 AM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  6. #6
    Registered User
    Join Date
    Feb 2009
    Posts
    278
    If the goal is to simply improve logical thinking, then using computer programming is like learning how to build cars to improve your understanding of metal working.

    I have seen the poster you mentioned (or at least a variation) and what it says is true, but I doubt a mentally handicapped person could learn advanced calculus or contribute to the advancement of mathematical theory. They might be able to learn addition, multiplication and maybe even basic algebra depending on the level of their handicap.

    A good way to think about it is to turn it around the other way and think about, say art. I can study art till I'm blue in the face. I can practice painting until my fingers bleed. But none of my work will ever be hanging in the Louvre! To be able to produce great works of art, yes there has to be training and education and practice. But there has to be a fundamental, built in skill already there to build upon. It all depends on the way an individuals brain is built!

  7. #7
    Registered User
    Join Date
    Apr 2009
    Posts
    187
    its best to read K&R like I M doing now I also lack some programming logic
    but reading K&R made me improve lil bit and i m only at page 30 even though it takes time understanding stuff but its worth it in the end like there is a say ask the patient than asking the doctor :P .

  8. #8
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,744
    There is a collection of logic puzzles over at logicpuzzles.com. While this is not directly related to computer programming I think, I suppose that site would help you fsx.

  9. #9
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by Bladactania View Post
    But none of my work will ever be hanging in the Louvre! To be able to produce great works of art, yes there has to be training and education and practice.
    The reason nothing you do will ever be in the Louvre is because the Louvre is a museum. It's about history. It's also full of mediocrity.

    Of course there has to be training and education and practice! It may never end (I kind of like it)! But if you are interested in formal logic, study it. DO NOT study it just because you think it will help with your programming. The fact that they both appeal to the same kinds of people is not surprising; the fact that people feel they are the sum of their parts is also not surprising. But people should not be told "an understanding of formal logic is essential to computer programming"; that is a lie. Formal logic is it's own field with it's own institutionalized language and methods.

    My point about the mental handicapped is that you already have a logical brain -- nobody has to make it over that way.

    ps. the book Sharke refers to in the next post sounds perfect to me...except for that last sentence, which is a bit troubling.
    Last edited by MK27; 04-21-2009 at 11:29 AM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  10. #10
    Registered User Sharke's Avatar
    Join Date
    Jun 2008
    Location
    NYC
    Posts
    303
    I'm always disappointed when I pick a book off the shelf that purports to be about computer algorithms and yet when I open it there doesn't seem to be one line of code, just a bunch of very complicated looking math.

    I have seen a couple of good non-mathematical books on algorithms however. One I have - "Practical Algorithms" by Andrew Binstock and John Rex - is intended for those without a mathematical background who just want to learn some basic algorithmic skills without the egg-headed symbolic treatment found in more formal texts. It covers things like lists, trees, hashing, compression, string searches etc.

    All it requires is a basic working knowledge of C. Most of the book is code, with shortish explanations before and after. Just reading through someone else's code will be enormously beneficial since you learn how to follow and interpret code logic and you will learn many paradigms along the way. In the case of this book, I'm also learning a lot about how to track down bugs since the printed code doesn't work properly in a few cases.

  11. #11
    Registered User
    Join Date
    Feb 2009
    Posts
    278
    Quote Originally Posted by Sharke View Post
    I'm always disappointed when I pick a book off the shelf that purports to be about computer algorithms and yet when I open it there doesn't seem to be one line of code, just a bunch of very complicated looking math.
    Computer algorithms has little to nothing to do with actual code. The implementation of an algorithm is language dependent. Granted a little pseudo code might be helpful, but a study of algorithms specifically, doesn't require code. When writing a program, you should know the algorithm BEFORE you write any code. The algorithm is the step by step process of solving a particular problem.

    All it requires is a basic working knowledge of C. Most of the book is code, with shortish explanations before and after. Just reading through someone else's code will be enormously beneficial since you learn how to follow and interpret code logic and you will learn many paradigms along the way.
    All it requires? So someone needs to learn C before learning about algorithms? Seems backwards to me!

    In the case of this book, I'm also learning a lot about how to track down bugs since the printed code doesn't work properly in a few cases.
    This disturbs me as well! Granted there are typos etc in every programming text, but there should be no more than 2 or 3 in an entire text!

  12. #12
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Bladactania, it would be stupid or crazy to try reading about computer algorithms if you did not have at least some grounding in at least one language.

    How an algorithm is presented doesn't matter; the "egghead" stuff Sharke refers to is probably the worst way to do it though. I believe the purpose is generally not explanatory anyway; it's academic analysis.

    So all that being said, the best and most practical explanation of a process is bound to be in real code -- plus, you can count on the fact that the source is an actual programmer. Beat that logic...
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  13. #13
    Registered User
    Join Date
    Apr 2009
    Location
    Turkey
    Posts
    12
    Quote Originally Posted by elwad View Post
    its best to read K&R like I M doing now I also lack some programming logic
    but reading K&R made me improve lil bit and i m only at page 30 even though it takes time understanding stuff but its worth it in the end like there is a say ask the patient than asking the doctor :P .
    +1
    K&R is one of the best books which develop you, of course if you practice what you read.

  14. #14
    Registered User
    Join Date
    Apr 2009
    Location
    Turkey
    Posts
    12
    Quote Originally Posted by fsx View Post
    Hello everyone,

    I would like to develop my logic skills because I feel they are quite on the lower average level.
    I believe I need some low-level thinking skill with few instruments to solve the tricks.

    FSX
    If you think so, you should develop your mathematical & analytical skills.

  15. #15
    Registered User
    Join Date
    Feb 2009
    Posts
    278
    Question : Write an algorithm for solving the following problem : A human-like robot is sitting in a chair at the end of a hallway. At the other end of the hallway is a ball. Get the robot to pick up the ball and sit back down.

    The answer requires absolutely no programming knowledge whatsoever. An algorithm could be one about how to bake a cake, get to the local grocery store, or building a house. It doesn't have to be computer, or really even math related at all.

    from dictionary.com
    al⋅go⋅rithm
       /ˈŠlgəˌrɪ­əm/ Show Spelled Pronunciation [al-guh-rith-uhm] Show IPA
    –noun
    a set of rules for solving a problem in a finite number of steps, as for finding the greatest common divisor.

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MURK - a small preview
    By Mario F. in forum Game Programming
    Replies: 27
    Last Post: 12-18-2006, 07:22 AM
  2. Opinion on GOOD digicam
    By Shadow in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-22-2003, 05:37 PM
  3. Question about atheists
    By gcn_zelda in forum A Brief History of Cprogramming.com
    Replies: 160
    Last Post: 08-11-2003, 11:50 AM
  4. Circular Logic
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 10-15-2001, 08:10 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21