0% found this document useful (0 votes)
5 views5 pages

CS202_week1_lecture

The document outlines the first two lectures of a Discrete Mathematics course, focusing on the basics of logic and sets. It covers propositions, connectives, conditionals, predicates, and quantifiers, providing definitions and examples for each concept. The lectures emphasize the importance of notation and formalization in logical reasoning and inference.

Uploaded by

swayamjit.kundu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views5 pages

CS202_week1_lecture

The document outlines the first two lectures of a Discrete Mathematics course, focusing on the basics of logic and sets. It covers propositions, connectives, conditionals, predicates, and quantifiers, providing definitions and examples for each concept. The lectures emphasize the importance of notation and formalization in logical reasoning and inference.

Uploaded by

swayamjit.kundu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Lectures 1 & 2

Discrete Mathematics (CS 202)

Date: 7th & 8th January 2025 Instructor & Scribe: Anamay Tengse

The first module: the basics of Logic and Sets, contains a fair bit of material that several of you
might have already encountered before. So, it might help to look at this module as more of an
agreement for the notation to be used for the rest of the course. Some pieces of notation may de-
viate from the ones in the textbook; we will point out when that happens.

1 Propositions, Conditionals and Inference


Keeping things simple, let us review the basic building blocks of logic. Towards the end, we
will also introduce some commonly used normal forms for logical expressions. We start with a
commonly used part of logic: making statements and deducing new ones using those we already
know. Consider the following example.
Example 1.1. NokiaG20 is a smartphone. All smartphones are computers. So, NokiaG20 is a computer. ♢
Here the first sentence is a statement of a fact; it is called a proposition. Generally, any sen-
tence or statement that can be assigned a ‘truth value’ (either true or false) is called a proposition.
The second sentence is an implication which is a specific type of proposition called a conditional
statement, even though it is not stated as one. Another way of saying the same thing would be:
if something is a smartphone, then it is a computer. The last sentence is a proposition that states an
inference, as it is a deduction (or calculation) of a new proposition, using the first two.
An example of something that is not a proposition, is what we call an ‘equation’, like x2 − 4 = 2
or x + y = 45. Here, the truth value depends on the values the variables are assigned.
We now introduce notation for propositions, conditionals, etc. This will help us rewrite Exam-
ple 1.1 more formally, so that we can see how the last statement is an inference more clearly.

1.1 Propositions and Connectives

We will use lowercase letters, e.g. p, q, . . ., to denote propositional variables; these are variables that
are placeholders for propositions. Note that every proposition is either true (⊤) or false (⊥), but
not both. The negation of a proposition p is denoted by ¬ p, and its truth value is the opposite of
that of p. Indeed, ¬(¬ p) is the same as saying p.

1
Connectives. Connectives are essentially operators for propositions. That is, the propositions
(or the sentences formed using connectives) will evaluate to either true or false, depending on the
propositions that they connect. There are two basic (and one not-so-basic) connectives.

• Conjunction: This is just the ‘and’ operator, and is denoted by ∧. The conjunction p ∧ q is true
only if both p and q are true.
Note that an empty conjunction is always true (sometimes called ‘vacuously true’). To un-
derstand this, think of always starting with an empty conjunction, and adding propositions
to it. Here is an example: “All the buses I own are red.” (Why is this a conjunction?)

• Disjunction: This is the ‘or’ operator, and is denoted by ∨. The disjunction p ∨ q ∨ r is true if at
least one of p, q or r is true. In the same spirit as above, an empty disjunction is always false
(also called ‘vacuously false’).

• Exclusive or (XOR): This is a commonly used operator, especially in programming, and is


denoted by ⊕. Interestingly, this operator is sort-of the intended meaning sometimes, for
the ‘or’ operator. E.g. When someone says “I’d prefer tea or coffee’, they mean that they would
prefer exactly one of tea or coffee (as opposed to something else), but not both.
The expression p ⊕ q is true when exactly one (but not both) of p and q is true. More gener-
ally, an XOR expression is true whenever an odd number of the propositions it connects are
true. As a result, an empty XOR is always false.

Conditionals. Technically, conditionals are a special type of connectives, but they deserve a spe-
cial category of their own, since they are extremely natural, and almost all spoken languages seem
to have invented them organically.

• Implication: This is the “if-then operator”, denoted by =⇒ . Textbook uses →, we won’t (we
reserve it for functions). In the language of connectives, p =⇒ q ≡ (¬ p ∨ q).
In an implication a =⇒ b, a is said to be the hypothesis (or assumption or premise), and b is
said to be the conclusion (or consequence).
Note that an implication is true if either the hypothesis is false, or if the conclusion is true,
sometimes regardless of what the other evaluates to. We covered some examples is class,
you can construct some of your own for fun.

• Bi-implication: This is the “if and only if operator”, denoted by ⇐⇒ . Textbook uses ↔;
we stay consistent with =⇒ . In other words, p ⇐⇒ q ≡ ( p =⇒ q) ∧ (q =⇒ p) ≡
(¬ p ∨ q) ∧ ( p ∨ ¬q).
Note that whenever a ≡ b, the proposition a ⇐⇒ b evaluates to true, and vice versa.

2
p q ¬p ∨ q p ∨ ¬q (¬ p ∨ q) ∧ ( p ∨ ¬q) p ⇐⇒ q
⊥ ⊥ ⊤ ⊤ ⊤ ⊤
⊥ ⊤ ⊤ ⊥ ⊥ ⊥
⊤ ⊥ ⊥ ⊤ ⊥ ⊥
⊤ ⊤ ⊤ ⊤ ⊤ ⊤

Figure 1: Truth table to check that p ⇐⇒ q ≡ (¬ p ∨ q) ∧ ( p ∨ ¬q)

De Morgan’s Laws. Indeed, these connectives (and negations) can be combined to form more
complex expressions whose truth value depends on the underlying propositions. It is sometimes
useful to rewrite such expressions to simplify them and to decide whether they are true or false.
This can be done as follows. (We use the symbol ≡ to mean that two logical expressions are
equivalent, or that they have the same value.) There are called De Morgan’s laws.

• ¬( p ∨ q) ≡ (¬ p ∧ ¬q), ¬( p ∨ q ∨ r ) ≡ (¬ p ∧ ¬q ∧ ¬r ), and so on.

• ¬( p ∧ q) ≡ (¬ p ∨ ¬q), ¬( p ∧ q ∧ r ) ≡ (¬ p ∨ ¬q ∨ ¬r ), and so on.

Truth Tables. A good way to judge whether two propositions (as in expressions) are equivalent,
is to write their truth tables. For a proposition over k variables, the truth table has 2k rows that list
all the possible combinations of the truth values of the variables. There are at least k + 1 columns,
labelled by the k variables, and the proposition itself. Mostly, it is useful to break down a complex
proposition into smaller ones and have them as columns. See Figure 1 for an example.

Normal Forms. Now that we have seen how one can build complex propositions from simple
ones using different operators (or connectives), it makes sense to talk about simplifying a given
proposition. There are two forms of expressing propositions that can be intuitively understood
as “simple”. One is to write the proposition as a (massive) conjunction of “necessary conditions”,
each of which is written as a disjunction of variables of their negations. The other is the dual: writ-
ing it as a massive disjunction of “sufficient criteria”, each of which is a conjunction of variables
and their negations.

• Conjunctive Normal Form (CNF): Writing the proposition as a conjunction of disjunctions of


variables (and negations). An example is the CNF for p ⊕ q, which is just ( p ∨ q) ∧ (¬ p ∨ ¬q).

• Disjunctive Normal Form (DNF): Writing the proposition as a disjunction of conjunctions of


variables (and negations). An example is the CNF for p ⊕ q, which is just ( p ∧ ¬q) ∨ (¬ p ∧ q).

Inference. This is a process (NOT a type of proposition) of deriving new propositions from those
given or stated. Looking ahead, we will formalize this further via something called resolution, for
now let us return to Example 1.1.

3
• Let p denote the proposition that “NokiaG20 is a smartphone”, and q denote the predicate that
“NokiaG20 is a computer”.

• Now the first sentence tells us that p is true, second sentence tells us that p =⇒ q, and the
third sentence records (the product of) our inference that q is true.

2 Predicates and Quantifiers


It is natural to feel like the so-called formalization of Example 1.1 at the end of previous section was
not up to the mark. Clearly, the second sentence does not even mention NokiaG20, and is saying
something much more general than “If NokiaG20 is a smartphone, then NokiaG20 is a computer.”
Quantifiers are logical tools that are built for this very purpose of formalizing statements that are
general, or more precisely, statements that apply to a set of objects. To make things more readable
and cleaner, we need the notion of predicates.

Predicates. A predicate can be seen as a function (as in programming) that takes some inputs and
outputs true or false. Formally, a predicate is any logical expression that is defined with respect
to a variable; so a predicate “takes” some object as an input, and “outputs” a proposition about
that object. Just as with functions in programs (and propositions), we can define more complex
predicates using the ones we have already defined. And just as with functions in programs, it
helps if the predicates are named appropriately. When talking about a generic predicate, we will
use uppercase letters.
For the case of Example 1.1, let us introduce the following predicates.

• IsSmartphone( x ) - evaluates to true if the proposition “x is a smartphone” is true.


• IsComputer( x ) - evaluates to true if the proposition “x is a computer” is true.

Now, the first sentence in Example 1.1 tells us that ‘IsSmartphone( NokiaG20)’ is true, the second
one tells us that “if IsSmartphone( x ) is true, then IsComputer( x ) is true, for any x”, and the third
statement records the inference that IsComputer( NokiaG20) is also true. Formalizing the “for any
x” part is where we will need a quantifier.

2.1 Quantifiers

Observe that we commonly encounter two kinds of general statements: statements that apply to
every object (from a set we have in mind), and statements that talk about some object (from a set
that we have in mind). Some common examples are “everyone likes chocolate”, or “someone must
know how ChatGPT works”, or more mathematical statements like “all rational numbers are real”, or
“some rhombuses are not squares”. There are two quantifiers that capture these two behaviors.

• Universal quantifier: Denoted by ∀ (rotated A), this is used to make propositions that talk
about every object in some set. The expression ∀ x, P( x ) is read as “for all x, P( x )”, and it says

4
that “every x satisfies the predicate P”.
For instance, ∀ x, LikesChocolate( x ), or ∀ x, Rational( x ) =⇒ Real( x ).

• Existential quantifier: Denoted by ∃ (rotated E), this is used to claim that some object has a
certain property. So ∃ x : Q( x ) is read as “there exists (an) x such that Q( x )”, and it says that
“some x satisfies the predicate Q.”
For example, ∃ x : UnderstandsChatGPT( x ), or ∃y : Rhombus(y) ∧ ¬Square(y).

We can now formalize the statements made in Example 1.1 to a much better extent. (Note that
for any predicate P, the expression P( x ) is the proposition that “x satisfies P”.)

IsSmartphone( NokiaG20), and (∀ x, IsSmartphone( x ) =⇒ IsComputer( x )).


Therefore, IsComputer( NokiaG20).

In the next week, we will formalize this even further, and see how the inference above can be
carried out almost mechanically. Before that, in the next lecture, we will look at how quantifiers
interact with each other and with other logical operations that we have seen.

Q. Can you write an expression for ∃y : Rhombus(y) ∧ ¬Square(y) using an implication? How
would that translate into English?

You might also like