CS 2742
Winter, 2014
Homework Assignment #1
Due: Jan 29, 2014, by 12:00pm
(at the beginning of the lecture)
[25]
1. Translations
Consider the following propositions:
p: COMP 2742 is a prerequisite to COMP 2711
q : Induction is studied in COMP 2742
r: Ther
CS 2742 (Logic in Computer Science) Winter 2014
Lecture 5
Antonina Kolokolova
January 27, 2014
1.1
Proof techniques
Example 1. Consider the sentence if n is divisible by 4, then n is divisible by 2 (we
will use the notation n|4 to mean n is divisible by 4
CS 2742 (Logic in Computer Science)
Lecture 6
Antonina Kolokolova
January 29, 2014
1.1
More about implications
In the previous lecture we had the following knights-and-knaves puzzle:
A said: If I am a knight Ill eat my hat!. Show that A will eat his hat.
CS 2742 (Logic in Computer Science)
Lecture 7
Antonina Kolokolova
January 31, 2014
3
Normal forms of propositional formulas.
Any formula has an equivalent one in a normal form. In computer science, the two normal
forms we are interested in are conjunctive
CS 2742 (Logic in Computer Science)
Lecture 4
Antonina Kolokolova
January 17, 2014
1.1
Simplifying propositional formulas.
In the last class, we talked about logical equivalences, and listed a few most notable logical
identities. Now we can apply these id
CS 2742 (Logic in Computer Science)
Lecture 3
Antonina Kolokolova
January 15, 2014
1.1
Logical equivalences
Recall the puzzle from the previous class: on some island, there are knights (who always tell
the truth) and knaves (who always lie). You meet two
CS 2742
Winter, 2014
Homework Assignment #2
Due: Feb 12, 2014, by 12:00pm
(at the beginning of the lecture)
[15]
1. Modus ponens and valid arguments
Fill in the blanks in the following:
(a) If it is February then it is winter
It is February
.
(b) If it i
CS 2742 (Logic in Computer Science)
Lecture 1
Antonina Kolokolova
Jan 10, 2014
1
What is logic in Computer Science?
Why do we study mathematical logic? Natural languages (such as English) are too ambiguous:
Every student knows this and Any student knows
CS 2742 (Logic in Computer Science) Winter 2014
Lecture 2
Antonina Kolokolova
January 13, 2014
2.1
Logical connectives (continuing)
We will also use logical connectives (p q is p only if q , where if q is true then p must
also be true) and meaning that p
CS 2742 (Logic in Computer Science)
Lecture 8
Antonina Kolokolova
February 3, 2014
3
Resolution.
Recall that a formula is in the CNF (conjunctive normal form) if it is a of s of literals
(variables or their negation.)
In this lecture we will talk about pr
CS2742 nal exam study sheet
Propositional logic:
Propositional statement : expression that has a truth value (true/false). It is a tautology if it is always
true, contradiction if always false.
Logic connectives : negation (not) p, conjunction (and) p q
CS 2742 (Logic in Computer Science)
Lecture 9
Antonina Kolokolova
February 5, 2014
4
Boolean functions and circuits
The propositional logic is a special case of Boolean algebra. In Boolean algebra 0 corresponds
to false (F), 1 to true (T), + is and it ; h
CS2742 midterm test 1 study sheet
Propositional logic:
Propositional statement : expression that has a truth value (true/false). It is a tautology if it is always
true, contradiction if always false.
Logic connectives : negation (not) p, conjunction (an
CS2742 midterm test 2 study sheet
Predicate logic:
A predicate is like a propositional variable, but with free variables, and can be true or false depending
on the value of these free variables. A domain of a predicate is a set from which the free variab
CS2742 nal exam study sheet
Propositional statement : expression that has a truth value (true/false). It is a tautology if it is always
true, contradiction if always false.
Logic connectives : negation (not) p, conjunction (and) p q , disjunction (or) p
CS 2742 (Logic in Computer Science) Winter 2014
Lecture 13
Antonina Kolokolova
February 14, 2014
Recall from the last class that predicates are essentially propositions with parameters (that
is, they become true or false depending on the values of the par
CS 2742 (Logic in Computer Science) Winter 2014
Lecture 10
Antonina Kolokolova
February 7, 2014
How to describe a set? List elements, or list a property that elements have.
S = cfw_John, Bob, M ary, George, Alex. Another set is S = cfw_2, 3, 4, which is t
CS 2742 (Logic in Computer Science) Winter 2014
Lecture 11
Antonina Kolokolova
February 10, 2014
Before continuing, let us look at a simple example of sets:
Example 1 (Intervals on a real line). Let (1, 0] and [0, 1) be two intervals on a real line.
(1, 0
CS 2742 (Logic in Computer Science) Winter 2014
Lecture 12
Antonina Kolokolova
February 12, 2014
5.4
Building new sets: power set, Cartesian product, relations.
A power set of a set A, denoted 2A , is a set of all subsets of A. For example, if A = cfw_1,
CS2742 midterm test study sheet
Propositional statement : expression that has a truth value (true/false). It is a tautology if it is always
true, contradiction if always false.
Logic connectives : negation (not) p, conjunction (and) p q , disjunction (o