0% found this document useful (0 votes)
31 views

Lecture Notes-Section 1.1

Uploaded by

Sajila MuBembe
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)
31 views

Lecture Notes-Section 1.1

Uploaded by

Sajila MuBembe
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/ 10

Section 1.

1: Propositional Logic

1. A Proposition is a declarative sentence (that


is, a sentence which declares a fact) that is either
true or false, but NOT both.

Propositions are sometimes denoted by lower-case


letters such as p, q, r, s, · · · which are called propo-
sitional variables (or statement variables).

Compound Propositioins are new propositions


formed from existing propositions, using logical op-
erators.

Example: The following sentences are propositions:

(1) Washington, D. C. is the capital of the United


States of America.

(2) Toronto is the capital of Canada.

(3) 1 + 1 = 2.

(4) 2 + 2 = 3.

Note: Propositions 1 and 3 are true, wheras pro-


postions 2 and 4 are false.
1
2

Example 2: The following sentences are NOT


propositions. Explain the reason.

(1) What time is it?

(2) Read this carefully.

(3) x + 1 = 2.

(4) x + y = z.

2. Truth Value of a Proposition: The truth


value of a true proposition is true and denoted by T;
and the truth value of a false proposition is false and
denoted F.

3. The Negation of a Proposition: Let p be


a proposition. The Negation of the proposition p,
denoted by ¬p (also denoted by p̄), is the statement:
“It is NOT the case that p”.

The proposition ¬p is read “ not p”. The truth value


of ¬p, is the opposite of the truth value of p. The
relation between the truth values of p and its nega-
tion ¬p is depicted as follows:

p ¬p
T F
F T
3

Example: Find the negation of the proposition:


“Michael’s PC runs Linux” and express it in simple
English.

The Negation is the proposition: “Michael’s PC


does not run Linux.” or “It is NOT the case that
Michael’s PC runs Linux”.

Example: Find the negation of the proposition:


“Vandana’s smartphone has at least 32GB of mem-
ory” and express in simple English.

The Negation is the proposition: “Vandana’s smart-


phone does NOT have at least 32 GB of memory.”
or “It is NOT the case that Vandana’s smartphone
has at least 32 GB of memory.”

4. The Conjunction of Propositions: Let p


and q be propositions. The conjunction of p and
q, denoted by p ∧ q, is the proposition: “p and q”.
The conjunction p ∧ q is true only if both p and q
are true; otherwise p ∧ q is false. Indeed, we have the
following truth table:

p q p∧q
T T T
T F F
F T F
F F F
4

5. The Disjunction of Propositions: Let p


and q be propositions. The disjunction of p and q,
denoted by p ∨ q, is the proposition: “either p or q”.
The disjunction p ∨ q is false when both p
and q are false; otherwise, p ∨ q is true. We
have the following truth table:

p q p∨q
T T T
T F T
F T T
F F F

Examples: Let p be the proposition: “Rebecca’s


PC has more than 16 GB free hard disk space” and q
be the proposition: “The processor in Rebecca’s PC
runs faster than 1 GHz.”. Find the conjunction and
disjunction of p and q:

Conjunction p ∧ q: “Rebecca’s PC has more than


16 GB free hard disk space, AND the processor in
her PC runs faster than 1 GHz.”

Disjunction p ∨ q: “Rebecca’s PC has more than


16 GB free hard disk space, OR the processor in her
PC runs faster than 1 GHz.”

6. Exclusive Or: Let p and q be propositions.


The Exclusive Or (XOR) of p and q, denoted by
5

p ⊕ q (p XOR q), is the proposition that is true when


exactly one of p and q is true and is false otherwise.
We have the following truth table:

p q p⊕q
T T F
T F T
F T T
F F F

7. Conditional Statement: Let p and q be


propositions. The Conditional Statement p →
q is the proposition “if p, then q.”
The conditional statement p → q is false when p is
true and q is false; p → q is true otherwise.
In the conditional statement p → q, p is called the
hypothesis (or antecedent or premise), and q is
called the conclusion (or consequence). A condi-
tional statement is also called an implication.

We have the following truth table for the conditional


statement:
p q p→q
T T T
T F F
F T T
F F T
6

Note there are many ways in English to express the


conditional proposition p → q:
• if p, then q; or p implies q.

• if p, q; or p only if q.

• p is sufficient for q; or a sufficient condition for


q is p.

• q if p; or q whenever p.

• q when p; or q is necessary for p.

• a necessary condition for p is q; or q follows


from p.

• q unless ¬p;

Example: Let p be the statement “Maria learns


discrete mathematics,” and q be the statement “Maria
will find a good job”. Express the statement p → q
in English.

p → q: “If Maria learns discrete mathematics, then


she will find a good job.”

Example: What is the value of the variable x after


the statement: “If 2 + 2 = 4, then x : = x + 1” if
7

x = 0 before this statement is encountered?

Since the condition 2 + 2 = 4 is true, we have x =


x+1. Therefore, the new value of x is x = 0+1 = 1.
8. Converse, Contrapositive, and Inverse
of a Conditional Proposition:

The Converse of p → q is the proposition q → p.

The Contrapositive of p → q is ¬q → ¬p.

The Inverse of p → q is ¬p → ¬q.

We have the following truth table:

p q p → q q → p ¬q → ¬p ¬p → ¬q
T T T T T T
T F F T F T
F T T F T F
F F T T T T

Two compound propositions are called equivalent


if they always have the truth value. Since the contra-
positive ¬q → ¬p always has the same truth value
as p → q, p → q is equivalent to ¬q → ¬p.

Example: What are the contrapositive, the con-


verse, and the inverse of the conditional statement:
8

“The home team wins whenever it is raining.”

Note: The original conditional statement is NOT


in the standard form of “if–, then–”, so we will rephrase
it as: “If it is raining, then the home team wins.” Now
let q be the proposition: “The home team wins,” and
p be the proposition: “It is raining.” The original
proposition is written as: p → q.

Converse q → p: “If the home team wins, then it


is raining.”

Contrapositive ¬q → ¬p: “If the home team


does not win, then it is not raining.”

Inverse ¬p → ¬q: “If it is not raining, the home


team does not win.”

9. Biconditional Statement: Let p and q be


propositions. The Biconditional statement p ↔
q is the proposition “p if and only if q”. The bicon-
ditional statement p ↔ q is true when p and
q have the same truth values, and is false
otherwise. We have the following truth table:
p q p↔q
T T T
T F F
F T F
F F T
9

Example: Let p be the statement “You can take


the flight.” and let q be the proposition “You buy a
ticket.” Then p ↔ q is the proposition: “You can
take the flight if and only if you buy a ticket.”.

Example: Find the truth table for the compound


proposition: (p∨¬q) → (p∧q). It is given as follows:

p q ¬q p ∨ ¬q p ∧ q (p ∨ ¬q) → (p ∧ q)
T T F T T T
T F T T F F
F T F F F T
F F T T F F

10. Precedence of Logical Operators or


Connectives (∧, ∨, ¬, →, ↔): We always first carry
out the operators with parentheses and then use the
following precedence of operators:1.¬; 2.∧; 3.∨; 4. →
; 5. ↔. We have the following table:
Operator Precedence
¬ 1
∧ 2
∨ 3
→ 4
↔ 5

11. Logic and Bit Operators: A bit is sym-


bol with two possible values, namely, 0 (zero) and
1 (one). We use 1 bit to represent True and 0 bit
10

to represent False. We have the following truth-bit


table:
Truth Value Bit
T 1
F 0
And
x y x∨y x∧y x⊕y
0 0 0 0 0
0 1 1 0 1
1 0 1 0 1
1 1 1 1 0

12. A bit string is a sequence of zero or more


bits. The length of the string is the number of bits
in the string.

Example: The string 101010011 is a string of length


nine.

Example: Find the bitwise operations OR (∨),


AND(∧) and XOR(⊕) of the strings: 0110110110
and 1100011101:

0110110110
1100011101
1110111111 OR
0 1 0 0 0 1 0 1 0 0 AND
1 0 1 0 1 0 1 0 1 1 XOR

You might also like