Introduction to COMP 1002 -- Logic for Computer Scientists

Science is what we understand well enough to explain to a computer. Art is everything else we do.
Donald Knuth

What this course is about

Logic has been called the "calculus of computer science": just as sciences such as physics that deal with continuous realm rely on calculus techniques, we rely on logic. Indeed, so many areas of our field are based on logic: from designing circuits to determining complexity of problems; from verifying correctness of algorithms and devising database queries to automated reasoning in artificial intelligence.

This course is an introduction to mathematical logic with emphasis on Computer Science applications and methodologies. We will cover propositional and predicate logic with applications, including the Resolution proof technique, which is the basis of most modern-day automated problem solvers. Then we will discuss basic proof techniques such as mathematical induction, again with computer science applications. We will also cover basic combinatorics, counting methods and probability, and some theory of computation.

Much of this course is focused on developing the skills of understanding a given problem or a concept, formulating it in a precise way, and reasoning about its properties. Computers usually do what you tell them to do, which may or may not be what you intended, so being able to state unambiguously what we want to achieve is crucial for computer scientists. We also introduce ways of data representation such as sets and graphs; you will encounter (and program) these structures in your algorithms and data structures courses and beyond.

How to study

The course material is split into 10 units, where each unit is roughly a week's worth of material. In almost every unit, you will find slides and videos of the lectures, and several types of exercises: labs, online exercises, and practice problems. Ever lab has a quiz, usually due the following week. As you open each unit, read the introduction to that unit and then go over videos and slides. As you do, make notes for yourself: which definitions were new to you and where they appeared? Think of your own examples of each concept you encounter, and think about these examples as you are working on the concepts.

After each video, look at the lab exercises, practice problems and online exercises for this unit and try to solve ones that were covered in the video you just watched. Do this after you watched the video once. Until you try to solve the problems, you would not know what you have learned so far. If you are not sure about a a word or a symbol, look it up in the slides and try to solve the problems again. If you don't know how to approach it, look at examples in the video/slides, and try to follow a similar-looking example. There is no specific order in which you should do the three types of problems, though you might try lab exercises first. You should revisit your lab exercises after you try online exercises and practice problems and try solving the lab again before you do the lab quiz. In general, you will often find that subsequent problems help you understand the ones you did before: it is very useful to go back and revisit (and maybe change) your solutions. When you are comfortable that you can solve similar problems, then do the lab quiz: you only get one chance at each lab quiz, and each quiz has to be submitted before its deadline (generally one quiz per week).

Lab exercises and practice problems do have solutions provided. However, especially later in the course and for practice problems with longer answers, your solutions are likely to be different from the given ones, and yet be perfectly correct. Many times in this course you will see that there are multiple ways for solving a problem. If you are not sure if your solution is correct, please ask at the discussion board. An important skill that this course aims to train is to be able to come up with your own examples, and in a number of lab exercises you will be asked to do exactly that. In this case, solutions would usually show a similar solved problem, or give one of many possible answers.

There are many ways to get more information if you need it. You can read the textbook (it has a lot more examples and explanations that we have time to do in the lectures), or google for it (though take what you see online with a grain of salt). But please only do it if you attempted problems multiple times and still not sure what is going on. You will learn much more doing exercises for half an hour than watching youtube videos on the subject the whole day.

Another good way of learning this kind of material is discussing it with your peers. Please make use of the discussion board, and not only post questions, but also try to answer others' questions and participate in the discussion.

The first part of this course is a lot like learning a language. Once you have the basic vocabulary, you gain much more trying to communicate than memorizing tables of conjugations. Overall, even though you will see a fair bit of new terminology, especially at the beginning, to succeed in this course you need to learn to solve problems; relying on memorization will not get you very far. And to solve problems, you need to practice: solving lab exercises, doing online exercises multiple times, doing practice problems, and then explaining your solutions to your peers, to make sure you really got the concepts.

TL;DR: Learn by doing exercises and discussing with your peers.