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

Before you start

There are a few administrative things that need to be taken care of before we actually start the course: selecting your lab shift and options for the tutorial time. Please do it as soon as possible by clicking on the links above, by Saturday Sep 12 at the latest.

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 (first-order) logic with applications, including the Resolution proof technique, which is the basis of most modern-day automated problem solvers. We will spend a lot of time on basic proof techniques including 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, strings 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 about 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 prerecorded lectures, and several types of exercises: labs, drills, and practice exercises. Additionally, every week we will have a tutorial (a one-hour Zoom lecture in which we will review this week's material and solve some problems together); please try to view the lectures before the corresponding tutorial. Weekly labs will also be on Zoom; during those labs, you will work through lab questions and activities in small groups, with TAs and a lab instructor at hand to help you.

As you open each unit, read the introduction to that unit and then go over prerecorded 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 exercises and drills 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. It helps to work out the solutions on paper first (especially for drills, quizzes and exams).

We plan to have a tutorial each week before the corresponding labs. Please look at the corresponding videos and try solving some exercises before coming to tutorial: that would make the tutorial much more useful for you, and will give you a chance to think of questions you can ask.

Labs and exercises do not have solutions provided, except for a few examples. 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 of solving a problem. email me directly. You are also welcome to see me in the office hours (time TBD). 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 exercises you will be asked to do exactly that. If you are not sure if your solution for an exercise is correct, please ask at the discussion board, or, if you are wondering about a solution to a graded exercise that appeared on a quiz or a test, then

There are many ways other 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, and all odd-numbered exercises have a solution provied), 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.

Much 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 exercises, doing drills multiple times, doing labs, and 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.