PDA

View Full Version : Developing good logic skills



fsx
04-21-2009, 08:46 AM
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

Snafuist
04-21-2009, 09:09 AM
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

MK27
04-21-2009, 09:36 AM
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 ;)

Bladactania
04-21-2009, 09:51 AM
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.

MK27
04-21-2009, 10:05 AM
Fence sitter! I just want to drive my point home a little bit further.

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

Bladactania
04-21-2009, 10:23 AM
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!

elwad
04-21-2009, 10:24 AM
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 .

whiteflags
04-21-2009, 10:26 AM
There is a collection of logic puzzles over at logicpuzzles.com (http://www.logicpuzzles.com). While this is not directly related to computer programming I think, I suppose that site would help you fsx.

MK27
04-21-2009, 10:35 AM
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.

Sharke
04-21-2009, 11:23 AM
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.

Bladactania
04-21-2009, 12:18 PM
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!

MK27
04-21-2009, 12:35 PM
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...

zhankal
04-21-2009, 12:39 PM
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.

zhankal
04-21-2009, 12:41 PM
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.

Bladactania
04-21-2009, 12:53 PM
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.

laserlight
04-21-2009, 01:05 PM
*Moved to General Discussions*

Snafuist
04-21-2009, 01:15 PM
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).


But you don't have to: we're sharing the exact same opinion here. fsx got what he asked for, namely book titles.

Greets,
Philip

whiteflags
04-21-2009, 01:21 PM
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...

Eh, your painting readers and authors with a wide paintbrush there. I find a contradiction that how an algorithm is presented doesn't matter to you but you are here defending a specific approach. This topic in particular is similar to floating point in that you do not need to understand how floating point works internally to use it on a regular basis but knowing how it works is still imperative, because it is easy to abuse a specific circumstance.

That egghead stuff is actually asymptotic analysis, and as you will see notations around other resources to detail an algorithm's run time, it is important to understand. No, the explanation does not need to be complex or even that correct in a mathematical sense. That's why computer science is applied science. You may not even rely on a deep mathematical understanding unless the platform demands that you be stringent with your choices (such as programming a wristwatch). But you should know enough to know what O(n) means and how to classify your own algorithms as O(n). Hence there are nontechnical resources in some texts and online (http://www.eternallyconfuzzled.com/arts/jsw_art_bigo.aspx) besides technical ones.

That does not make in-depth resources bad or "the worst way to go about it." It depends on the reader's aptitude and circumstance.

edit: fsx was not looking for an algorithm book or anything like that. We're off topic.