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

lecture 2

The document covers the applications of propositional logic, detailing logical connectives such as negation, conjunction, disjunction, implication, and biconditional, along with their meanings and examples. It also explains key properties of logical equivalences, including De Morgan's Laws and various properties like commutative, associative, and distributive laws. Additionally, it discusses predicates and quantifiers, illustrating how they relate to propositions and provide a foundation for logical reasoning.

Uploaded by

Radwa Essam
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 views13 pages

lecture 2

The document covers the applications of propositional logic, detailing logical connectives such as negation, conjunction, disjunction, implication, and biconditional, along with their meanings and examples. It also explains key properties of logical equivalences, including De Morgan's Laws and various properties like commutative, associative, and distributive laws. Additionally, it discusses predicates and quantifiers, illustrating how they relate to propositions and provide a foundation for logical reasoning.

Uploaded by

Radwa Essam
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/ 13

Lecture 2: Applications of Propositional Logic

English meaning of each Logical Connectives:


Negation (¬): Reverses the truth value.
Conjunction (∧): True when both propositions are true.
Disjunction (∨): True when at least one proposition is true.
Exclusive Disjunction (XOR, ⊕): True when exactly one proposition is true.
Implication (→): False only when the first proposition is true and the second is false.
Biconditional (↔): True when both propositions have the same truth value.

1. Negation (¬): "not"

• Example Sentence: If P is "It is raining," then ¬P is "It is not raining."


• Meaning: Negation denies the truth of a statement. If the original statement is true, the
negation is false, and vice versa.

2. Conjunction (∧): "and"

• Example Sentence: If P is "I am hungry" and Q is "I am tired," then P ∧ Q is "I am


hungry and tired."
• Meaning: Conjunction requires both conditions to be true. The combined statement is
only true if both individual statements are true.

3. Disjunction (∨): "or" (inclusive or)

• Example Sentence: If P is "I will go to the park" and Q is "I will watch a movie," then
P ∨ Q is "I will go to the park or watch a movie."
• Meaning: Disjunction allows for either one or both conditions to be true. The statement
is true if at least one part is true.

4. Exclusive Disjunction (XOR, ⊕): "either...or" (but not both)

• Example Sentence: If P is "I will have tea" and Q is "I will have coffee," then P ⊕ Q
is "I will have either tea or coffee, but not both."
• Meaning: Exclusive disjunction is true only when one of the statements is true, but not
both. If both statements are true or both are false, the combined statement is false.

5. Implication (→): "if...then"

• Example Sentence: If P is "It is sunny" and Q is "We will go to the beach," then P →
Q is "If it is sunny, then we will go to the beach."
• Meaning: Implication suggests that the first condition leads to the second. The
statement is only false if the first part is true and the second part is false.
6. Biconditional (↔): "if and only if"

• Example Sentence: If P is "I will pass the test" and Q is "I study hard," then P ↔ Q is
"I will pass the test if and only if I study hard."
• Meaning: Biconditional indicates that both conditions are dependent on each other.
The combined statement is true only if both parts are true or both are false.

These examples illustrate how each logical connective works in everyday language, which

1. Key Properties of Logical Equivalences


2. De Morgan’s Laws:

a. ¬(P∧Q)≡¬P∨¬Q
b. ¬(P∨Q)≡¬P∧¬Q
3. Implication: P→Q≡¬P∨Q

Commutative Property
Law:
P∧Q≡Q∧P
P∨Q≡Q∨P

Explanation: The order of statements in a conjunction or disjunction does not


matter; the result remains the same.

Associative Property
Law:
(P ∧ Q) ∧ R ≡ P ∧ (Q ∧ R)
(P ∨ Q) ∨ R ≡ P ∨ (Q ∨ R)

Explanation: When combining three or more statements, the grouping doesn’t


affect the outcome, making it easier to restructure expressions.
Distributive Property
Law:
P ∧ (Q ∨ R) ≡ (P ∧ Q) ∨ (P ∧ R)
P ∨ (Q ∧ R) ≡ (P ∨ Q) ∧ (P ∨ R)

Explanation: This property allows us to distribute conjunctions over disjunctions


and vice versa.

Identity Property
Law:
P ∧ True ≡ P
P ∨ False ≡ P

Explanation: Combining a statement with True through ∧ or with False through ∨


doesn’t change the statement.

Domination Property
Law:
P ∨ True ≡ True
P ∧ False ≡ False

Explanation: Any statement combined with True through ∨ or with False through
∧ results in a constant outcome.

Idempotent Property
Law:
P∧P≡P
P∨P≡P

Explanation: Combining a statement with itself yields the same statement.

Negation Property
Law:
P ∨ ¬P ≡ True
P ∧ ¬P ≡ False

Explanation: A statement combined with its negation through ∨ results in True,


and through ∧ results in False.
Example of Using Logical Equivalences
Now that we’ve covered these properties, let’s apply them to simplify a logical
expression step-by-step. We’ll simplify the following expression:

¬ ((P → Q) ∧ (¬P ∨ ¬Q))

Let’s go through the steps together:

Apply the Implication Law


Law: P → Q ≡ ¬P ∨ Q

Expression: ¬ ((¬P ∨ Q) ∧ (¬P ∨ ¬Q))

Apply De Morgan’s Law


Law: ¬ (A ∧ B) ≡ ¬A ∨ ¬B

Expression: ¬ (¬P ∨ Q) ∨ ¬ (¬P ∨ ¬Q)

Apply De Morgan’s Law to Each Term


Law: For ¬ (¬P ∨ Q), we get: P ∧ ¬Q
For ¬ (¬P ∨ ¬Q), we get: P ∧ Q

Expression: (P ∧ ¬Q) ∨ (P ∧ Q)

Apply the Distributive Property


Expression: P ∧ (¬Q ∨ Q)

Simplify with the Identity Property


Law: ¬Q ∨ Q ≡ True

Expression: P ∧ True ≡ P

Example 2:
Show that ¬(𝑝 ∨ (¬𝑝 ∧ 𝑞)) and ¬𝑝 ∧ ¬𝑞 are logically equivalent.
1. Translating English Sentences:
There are numerous justifications for translating English sentences into
expressions that incorporate logical connectives and propositional variables.
Particularly, English (and all other Other human languages are frequently
ambiguous. Transcription sentences into compound statements (and other forms
of logical expressions, which we will introduce later in this chapter) eliminates
the ambiguity.

Example 1
(You can access the Internet from campus) only if (you are a computer science
major or you are not a student). Let 𝑝, 𝑞 and 𝑟 be the propositions: 𝑝 → 𝑞

𝑝: You can access the Internet from campus. 𝑞: You are a computer science
major. 𝑟: You are a student.

The sentence can be represented by logic as 𝑝 → (𝑞 ∨ ¬𝑟)

Example 2
(The automated reply cannot be sent) when (the file system is full.)

Let 𝑝 and 𝑞 be the propositions:

𝑝: The automated reply can be sent.


𝑞: The file system is full.

The sentence can be represented by logic as 𝑞 → ¬𝑝, 𝑝 → q

2 Binary Representation of Truth Values


In propositional logic, we typically work with two truth values: true and false.
These can be represented as binary values where true is 1 and false is 0. This
connection allows us to apply logical operations to binary data, just like we do
with propositions.

Logical Operators and Their Bitwise Equivalents


AND ( ∧ )
The logical AND operation in propositional logic is true if both propositions are
true. Similarly, in bitwise operations, the AND operation between two bits results
in 1 only if both bits are 1.

OR ( ∨ )
For OR, a proposition is true if at least one of the propositions is true. In bitwise
terms, OR results in 1 if either bit is 1.

NOT ( ¬ )
The NOT operation inverts the truth value in propositional logic. In bitwise
terms, it flips the bit: 0 becomes 1, and 1 becomes 0.

Exclusive OR (XOR)
Another useful operation is XOR, or exclusive OR, which is not as common in
basic propositional logic but is very important in digital logic. XOR is true only if
one of the propositions is true, not both. In bitwise operations, XOR gives 1 if
one of the bits is 1, but not both.

Applications in Digital Logic and Computer Science


Logical operations form the basis for all digital systems. They’re crucial in
designing circuits and performing computations. Bitwise operations allow us to
manipulate binary data directly, which is essential in many areas, like data
compression, cryptography, and networking.
Truth Tables and Bitwise Operations
The truth tables for these logical operations are identical whether we're dealing
with propositional logic or single-bit binary operations. This parallel allows us to
apply our understanding of logical operations to work directly with binary data in
computing.

Example: Find the bitwise OR, bitwise AND, and bitwise XOR of the bit strings
01 1011 0110 and
11 0001 1101. (Here, and throughout this book, bit strings will be split into
blocks of four bits to make them easier to read.)
Solution: The bitwise OR, bitwise AND, and bitwise XOR of these strings are
obtained by taking the OR, AND, and XOR of the corresponding bits,
respectively. This gives us
01 1011 0110
11 0001 1101
11 1011 1111 bitwise OR
01 0001 0100 bitwise AND
10 010 1011 bitwise XOR

2. Logic Circuits
• A logic circuit (or digital circuit) receives input signals 𝑝1 , 𝑝2 , … , 𝑝𝑛 , each a bit
[either 0 (off) or 1 (on)], and produces output signals 𝑠1 , 𝑠2 , … , 𝑠𝑛 , each a bit.

• In this course, we will restrict our attention to logic circuits with a single output
signal; in general, digital circuits may have multiple outputs.
Logic Circuits
• Complicated digital circuits can be constructed from three basic circuits, called
gates

Example 1
• Determine the output for the combinatorial circuit in the following figure.

Example 2
Build a digital circuit that produces the output (𝑝 ∨ ¬𝑟) ∧ (¬𝑝 ∨ (𝑞 ∨ ¬𝑟))
when given input bits 𝑝, 𝑞, and 𝑟.
A compound proposition that is always true, no matter what the truth
values of the propositional variables that occur in it, is called a
tautology. A compound proposition that is always
false is called a contradiction. A compound proposition that is neither a tautology
nor a contradiction is called a contingency.
Example : (𝑝 ∧ 𝑞 → 𝑝)

Let’s start by reviewing some essential properties of logical equivalences that we


will frequently use in simplifying expressions.

Predicates and Quantifiers:


Predicates and propositions are both foundational concepts in logic, but they serve
different roles:
1. Propositions:
• A proposition is a statement that is definite in nature—it is either true or false, but
not both.
• Propositions are complete statements that do not contain any variables.
• Example: "The sky is blue" and "2 + 2 = 4" are propositions because they have a
clear truth value.
2. Predicates:
• A predicate is a statement that contains variables and becomes a proposition when
specific values are assigned to those variables.
• Predicates are incomplete statements because their truth value depends on the
value(s) of the variable(s).
• Predicates can express properties or conditions about objects.
• Example: "x is greater than 3" is a predicate because it depends on the value of x.
It becomes a proposition once x is given a specific value, like "4 is greater than 3,"
which is true.
Relation Between Predicates and Propositions:
• Predicates generalize propositions. While propositions are complete statements
with definite truth values, predicates are statements that can be true or false
depending on the values of their variables.
• When specific values are substituted for the variables in a predicate, the predicate
becomes a proposition.
• In other words, a predicate can be thought of as a template for propositions. Each
specific assignment of values to the variables in a predicate result in a proposition
with a specific truth value.

Predicates and quantifiers are fundamental concepts in mathematical logic,


especially within the study of formal systems and reasoning. They help us
construct and analyze statements about objects within a specific domain.
Predicates
A predicate is a statement or a function that contains variables and becomes
either True or False when specific values are substituted for these variables.
Essentially, predicates are used to express properties or relationships among
objects. For example:
P(x): "x is an even number" – Here, P is a predicate, and x is a variable. If x=4,
then P(x) is True, but if x=5, P(x) is False.
Predicates allow us to make generalized statements and reason about sets of
objects, not just individual instances.

Example1:

Let P(x) denote the statement "x > 3."


What are the truth values of P(4) and P(2)? T,F
Example2:
Let Q(x, y) denote the statement "x = y + 3."
What are the truth values of the propositions Q(1, 2) and Q(3, 0)?
Quantifiers:
Tells you how true a predicate is for a certain set of items.

THE UNIVERSAL QUANTIFIER: ∀xP (x)


The universal quantification of P (x) for a particular domain is the proposition that
asserts that P (x) is true for all values of x in this domain.

THE EXISTENTIAL QUANTIFIER: ∃xP (x)


The proposition that is true if and only if P (x) is true for at least one value of
x in the domain.

THE UNIQUENESS QUANTIFIER: ∃!xP (x) [or ∃1xP (x)] states “There
exists a unique x such that P (x) is true.
Example1:
Let P(x) be the statement "x + 1 > x." What is the truth value of the
quantification Vx P(x), where the domain consists of all real numbers?
Solution: Because P(x) is true for all real numbers x, the quantification
VxP(x) is true.

Example2:
Let Q(x) be the statement "x < 2." What is the truth value of the
quantification Vx Q(x), where the domain consists of all real numbers?
Solution: Q(x) is not true for every real number x, because, for instance,
Q(3) is false. That is, x = 3 is a counterexample for the statement Vx Q(x).
VxQ(x) is false.

Example3:
Let P(x) denote the statement "x > 3." What is the truth value of the
quantification 3x P(x), where the domain consists of all real numbers?
Solution: Because "x > 3" is sometimes true-for instance,
when x = 4-the existential quantification of P(x), which is 3x P(x), is true.

Example4:
What is the truth value of 3x P (x), where P(x) is the statement "x2 > 10"
and the universe of discourse consists of the positive integers not exceeding
4?
Solution: Because the domain is {1, 2, 3, 4}, the proposition 3x P(x) is the
same as the disjunctior P(1) v P(2) v P(3) v P(4). Because P(4), which is the
statement "42 > 10," is true, it follows that 3x P(x) is true.

Translate into/from English


Example1:g 64
Express the statement “Every student in this class has studied calculus”.
Solution 𝑃(𝑥): 𝑥 has studied calculus.
𝑆(𝑥): 𝑥 is in this class. The statement can be expressed as x(S(x) → p(x))
Example2
Translate the statement ∀𝑥 𝐶 (𝑥) ∨ ∃𝑦 𝐶 (𝑦 ∧ 𝐹 (𝑥, 𝑦))into
English, where 𝐶(𝑥) is "x has a computer", 𝐹(𝑥, 𝑦) is "x and y are friends," and
both x and y is the set of all students in your school.
Every student in your school has a computer or has a friend who has a computer.
Negating Quantified Expressions:
• 𝑃(𝑥) is the statement "𝑥 has taken a course in calculus" and the domain
consists of the students in your class. ∀𝒙𝑷(𝒙) : "Every student in your
class has taken a course in calculus"
• The negation of this statement is
"There is at least one student in your class who has not taken a course in
calculus" ¬∀𝒙𝑷(𝒙) ≡ ∃𝒙¬𝑷(𝒙).

• 𝑃(𝑥) is the statement "𝑥 has taken a course in calculus" and the domain
consists of the students in your class.
∃𝒙𝑷(𝒙) : “At least one student in your class has taken a course in calculus"
• The negation of this statement is
"Every student in this class has not taken calculus" ¬∃𝒙𝑷(𝒙) ≡ ∀𝒙¬𝑷(𝒙)
Thank you

You might also like