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

Lecture_Note_Discrete_Spring2024

Uploaded by

aishorjoshuchi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Lecture_Note_Discrete_Spring2024

Uploaded by

aishorjoshuchi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

East West University, CSE 106

Notes on Discrete Mathematics

Instructor: Dr. Mohammad Salah Uddin

CSE106 DSU
Spring 2024
Contents

Contents

1 Discrete Mathematics 3
1.1 Discrete Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Propositional Logic 4
2.1 Propositional logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1.1 What is proposition . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1.2 Why a question is not a proposition? . . . . . . . . . . . . . . . . . . . 7
2.1.3 Propositional logic in Computer Science . . . . . . . . . . . . . . . . . 7
2.2 Logical Connectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3 Truth Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3.1 Truth table construction . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4 Examples of compound proposition . . . . . . . . . . . . . . . . . . . . . . . . 13
2.4.1 Truth value of compound proposition . . . . . . . . . . . . . . . . . . 16
2.4.2 More Compound Proposition Examples with Truth Values . . . . . . . 16
2.5 Contrapositive, Converse, and Inverse Examples . . . . . . . . . . . . . . . . . 20
2.5.1 Original Statement: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.5.2 Contrapositive: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.5.3 Converse: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.5.4 Inverse: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.6 Some Mathematical Statements (examples) . . . . . . . . . . . . . . . . . . . . 21
2.6.1 Original Statement: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.6.2 Original Statement: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.6.3 Original Statement: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.7 Bitwise Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.8 Translating English sentences . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.8.1 General rules for translation . . . . . . . . . . . . . . . . . . . . . . . . 24
2.9 Tautology and contradiction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.10 Logical equivalences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

2
1 Discrete Mathematics

1 Discrete Mathematics

1.1 Discrete Mathematics


Discrete mathematics is a branch of mathematics that studies mathematical structures that are
discrete, meaning made up of distinct, separate values or elements, rather than continuous. It
includes topics such as combinatorics, graph theory, number theory, and algorithms.
In contrast to continuous mathematics, which deals with objects that can take on any value in
a continuous range, discrete mathematics is concerned with objects that have only a finite or
countable number of values. This makes discrete mathematics useful in the study of computer
science, as many problems in computer science can be modeled as discrete structures.
Some of the important areas in discrete mathematics are:
• Combinatorics: The study of counting and arrangement of objects, such as permutations
and combinations.
• Graph theory: The study of graphs, networks, and their properties, such as connectivity
and path length.
• Number theory: The study of the properties of numbers, such as prime numbers and
divisibility.
• Algorithms: The study of how to solve problems by step-by-step procedures, such as
sorting and searching algorithms.
Discrete mathematics is essential for many areas of computer science, including computer
algorithms, computer architecture, and the theory of computation. It is also used in areas such
as operations research, coding theory, and cryptography.

3
2 Propositional Logic

2 Propositional Logic

2.1 Propositional logic


Propositional logic, also known as sentential logic or proposition logic, is a branch of mathemati-
cal logic that deals with manipulating and analyzing propositions or statements. In propositional
logic, propositions are used to express assertions about the world and are either true or false.
The basic building blocks of propositional logic are propositions, connectives, and logical
operators. Propositions are statements that can be evaluated as true or false. Connectives are
symbols that are used to connect propositions and form more complex statements, such as
“and,” “or,” “not,” “implies,” and “if and only if.” Logical operators are symbols that can be used to
manipulate propositions and connectives to form more complex expressions.
The rules and principles of propositional logic can be used to determine the truth or falsity of
statements and infer new statements based on given information. This makes propositional
logic a fundamental tool in many areas of mathematics, computer science, philosophy, and
artificial intelligence.

2.1.1 What is proposition


A proposition is a statement that can be evaluated as true or false. In propositional logic,
propositions serve as the basic building blocks for expressing assertions about the world.
Propositions are used to make claims about reality and can be used to convey information,
express beliefs, or ask questions.
Examples of propositions include “The sky is blue,” “All dogs are mammals,” “2 + 2 = 4,” “John is
taller than Jane,” and “Today is Monday.”
In propositional logic, the focus is not on the actual truth values of propositions but rather on
the logical relationships between them. The rules and principles of propositional logic can be
used to determine the truth or falsity of statements, as well as to infer new statements based
on given information. This makes propositional logic a fundamental tool in many areas of
mathematics, computer science, philosophy, and artificial intelligence. Here are some more
examples of propositions:
1. The sky is blue.
2. All dogs are mammals.
3. 2 + 2 = 4.

4
2 Propositional Logic

4. John is taller than Jane.


5. Today is Monday.
6. The number of planets in our solar system is 8.
7. Grass is green.
8. Rome is the capital of Italy.
9. The moon is a natural satellite of the Earth.
10. Water freezes at 0 degrees Celsius.
11. The sun rises in the east.
12. All birds can fly.
13. 5 x 5 = 25.
14. Paris is the capital of France.
15. Apples are a type of fruit.
16. The Earth rotates around the sun.
17. Elephants are the largest land animals.
18. The Pythagorean theorem states that the square of the length of the hypotenuse of a right
triangle is equal to the sum of the squares of the lengths of the other two sides.
19. Cats have sharp claws.
20. The shortest day of the year is December 21st.
21. Mount Everest is the highest mountain in the world.
22. Tigers are carnivores.
23. Humans have ten fingers.
24. Jupiter is the largest planet in our solar system.
25. Fish live in water.
26. London is the capital of England.
27. The speed of light is constant.
28. Dogs have a keen sense of smell.
29. Plants need sunlight to grow.
30. The capital of Australia is Canberra.
31. The Sahara is the largest hot desert in the world.
32. Lions are the king of the jungle.

5
2 Propositional Logic

33. The equator runs through the middle of the Earth.


34. The moon is a celestial body.
35. The Amazon is the largest river in the world.
36. Kangaroos are native to Australia.
37. Snakes are reptiles.
38. The Earth has a magnetic field.
39. The capital of China is Beijing.
40. Vultures are scavengers.
41. The Atlantic Ocean is the second largest ocean in the world.
42. The human brain is the control center of the body.
43. The capital of Germany is Berlin.
44. Sharks are carnivorous fish.
45. The Earth has one natural satellite, the moon.
46. Birds have feathers.
47. The capital of Russia is Moscow.
48. The longest river in the world is the Nile.
49. Ants are social insects.
50. The Earth has four seasons.
51. The capital of India is New Delhi.
52. Horses are domesticated animals.
53. The Earth has a tilted axis.
54. The capital of Canada is Ottawa.
55. The Pacific Ocean is the largest ocean in the world.
56. Butterflies undergo metamorphosis.
57. The capital of Brazil is Brasília.
58. The Great Barrier Reef is the largest coral reef system in the world.
59. Chimpanzees are highly intelligent primates.
60. The Earth has a molten core.
61. The capital of South Africa is Pretoria.

6
2 Propositional Logic

62. Giraffes have long necks.


63. The Earth has a thin atmosphere.
64. The capital of Argentina is Buenos Aires.
65. The Himalayas are the highest mountain range in the world.
66. Squirrels gather food for the winter.
67. The Earth has a strong gravitational pull.
68. The capital of Mexico is Mexico City.
69. Crocodiles are reptiles.
70. The Earth has a unique biosphere.

2.1.2 Why a question is not a proposition?


A proposition is a statement that is either true or false, but not both. It is a declarative sen-
tence that can be either verified or falsified through evidence or reasoning. In other words,
a proposition is a type of statement that can be considered as the building block of logical
arguments.
On the other hand, a question is not a proposition because it is not a statement that can be
verified or falsified. A question is an inquiry that seeks information or clarification, and it
typically begins with words such as “what,” “when,” “where,” “who,” “why,” or “how.” A question
does not make a definite claim, and it does not have a truth value.
For example, the statement “The sky is blue” is a proposition because it can be verified as true
or false through observation. On the other hand, the question “What color is the sky?” is not
a proposition because it does not make a definite claim and it seeks information rather than
asserting a truth value.
The key difference between a proposition and a question is that a proposition is a statement
that can be verified or falsified, while a question is an inquiry that seeks information and does
not have a truth value.

2.1.3 Propositional logic in Computer Science


Propositional logic is a fundamental concept in computer science and plays an important role
in many areas of the field. Here are some of the reasons for the necessity of propositional logic
in computer science:
1. Theoretical foundations: Propositional logic provides a mathematical foundation for
the study of algorithms, computability, and complexity. It helps to establish a formal
framework for reasoning about algorithms and computing systems.

7
2 Propositional Logic

2. Design of computer hardware: Propositional logic is used to design digital circuits


and computer hardware. Logical operations such as AND, OR, NOT, and XOR can
be implemented as gate-level circuits, and the design of these circuits is based on the
principles of propositional logic.
3. Compiler design: Compilers, which translate high-level programming languages into
machine code, use propositional logic to perform various tasks, such as type checking,
symbol table management, and code generation.
4. Artificial intelligence: Propositional logic is a fundamental concept in artificial intelli-
gence and is used to represent and reason about knowledge in many applications, such
as expert systems, natural language processing, and planning systems.
5. Verification and validation: Propositional logic is used to formally verify and validate
the correctness of computer systems and algorithms. For example, model checking, a
technique for automatically checking the correctness of finite-state systems, is based on
propositional logic.
In summary, propositional logic is a crucial tool in computer science for reasoning about
algorithms, hardware, software, and knowledge representation.

2.2 Logical Connectives


Logical connectives, also known as logical operators, are symbols or words used to connect
propositions in a logical expression. They are used to combine simple propositions into more
complex statements and to express the relationships between propositions. The most common
logical connectives are:
1. Negation (NOT): A negation, represented by the symbol “¬” or the word “not,” is used
to negate or reverse the truth value of a proposition. For example, the statement “It is not
the case that John is tall” is true if “John is tall” is false, and vice versa.
2. Conjunction (AND): A conjunction, represented by the symbol “∧” or the word “and,”
is used to connect two propositions in such a way that the resulting statement is true
only if both of the original propositions are true. For example, the statement “John is tall
and Jane is short” is true if and only if both “John is tall” and “Jane is short” are true.
3. Disjunction (OR): A disjunction, represented by the symbol “∨” or the word “or,” is used
to connect two propositions in such a way that the resulting statement is true if either
one of the original propositions is true. For example, the statement “John is tall or Jane is
short” is true if either “John is tall” or “Jane is short” is true.
4. Implication (IF-THEN): An implication, represented by the symbol “→” or the phrase
“if-then,” is used to express a relationship between two propositions in which the truth
of the first proposition (the antecedent) implies the truth of the second proposition (the
consequent). For example, the statement “If it rains, then the streets will be wet” means

8
2 Propositional Logic

Figure 2.1: Logical Connective symbols(source: google photos).

that if the antecedent “it rains” is true, then the consequent “the streets will be wet” must
also be true.
5. Bi-Implication (IF AND ONLY IF): A bi-implication, represented by the symbol “↔”
or the phrase “if and only if,” is used to express a relationship between two propositions
in which both propositions must be true or false together. For example, the statement
“John is tall if and only if Jane is short” means that “John is tall” and “Jane is short” must
have the same truth value.
6. Exclusive OR (XOR): logical connective represents a logical operation that outputs true
only when one and only one of its inputs is true. It can also be represented by the symbol
“⊕”.
Here are some examples of using XOR:
• In digital circuit design, XOR can be used to compare two binary signals and produce
a high output only when the signals are different.
• In cryptography, XOR can be used as a simple encryption technique by XORing a
plaintext message with a secret key to produce the ciphertext. The ciphertext can
be decrypted by XORing it with the same key.
• XOR can be used in error detection and correction. For example, in a binary code,
the parity bit can be generated by XORing all the bits in a data word. If the parity
bit is incorrect, it indicates that there is an error in the data word.
• XOR can be used in Boolean logic operations, where it is used to implement logic
gates that perform the XOR operation.
• XOR can be used to toggle a binary value. For example, if we XOR a binary number

9
2 Propositional Logic

with 1, we will get the complement of that number.


These logical connectives can be used to create more complex statements and to reason about
the relationships between propositions. Propositional logic provides rules for determining the
truth or falsity of statements that use logical connectives, and it can be used to analyze the
structure and relationships of statements in natural languages, as well as in formal mathematical
and computational systems.
The contrapositive of a proposition is a logical equivalent of the original proposition that can
be derived by negating both the antecedent and the consequent of an implication and then
switching the order of the terms. The contrapositive of a proposition “if p then q” is “if not q
then not p”.
The contrapositive of a proposition “𝑝 → 𝑞” is represented as “¬𝑞 → ¬𝑝”.
For example, consider the proposition “if it rains, then the roads will be wet”. The contrapositive
of this proposition is “if the roads are not wet, then it did not rain”. This contrapositive is logically
equivalent to the original proposition. Both the original proposition and its contrapositive have
the same truth value, meaning that if one is true, then so is the other, and if one is false, then so
is the other.
The converse of a proposition is the reverse of the original proposition. Given a proposition
“𝑝 → 𝑞”, the converse of the proposition would be “𝑞 → 𝑝”. In other words, the converse
changes the direction of the implication from the original proposition.
For example, the original proposition “If it rains, then the streets will be wet” has the converse
“If the streets are wet, then it must have rained”. It is important to note that the truth value
of the converse of a proposition is not necessarily the same as the truth value of the original
proposition.
The inverse of a proposition is the negation of the antecedent and consequent of the original
proposition. Given a proposition “𝑝 → 𝑞”, the inverse of the proposition would be “¬𝑝 → ¬q”.
In other words, the inverse of a proposition takes the negation of both the antecedent and
consequent of the original proposition.
For example, the original proposition “If it rains, then the streets will be wet” has the inverse “If
it does not rain, then the streets will not be wet”. It is important to note that the truth value
of the inverse of a proposition is not necessarily the same as the truth value of the original
proposition.

2.3 Truth Table


A truth table is a tool used in logic and mathematics to determine the truth values of complex
propositions based on the truth values of their component propositions. A truth table lists all
possible combinations of truth values for the component (elementary) propositions, along with
the resulting truth value of the whole proposition.

10
2 Propositional Logic

For example, consider the proposition “P ∧ Q,” where “P” and “Q” are two propositions. A truth
table for this proposition would have two columns, one for “P” and one for “Q,” and four rows
corresponding to the four possible combinations of truth values for “P” and “Q”:
The truth value of the proposition “P ∧ Q” is given in the last column of the truth table. The
truth value is “T” (true) only when both “P” and “Q” are true, and it is “F” (false) in all other
cases.
Truth tables can be used to evaluate complex propositions involving multiple logical connectives,
such as conjunction, disjunction, negation, implication, and bi-implication. They are also used
to test the validity of arguments, to determine the equivalence of propositions, and to simplify
complex expressions.
In computer science, truth tables are used in the design and analysis of digital circuits and
in the development of algorithms and computer programs. They can also be used to model
decision-making processes and to analyze the behavior of systems in artificial intelligence and
robotics. Here are the truth tables for the six logical connectives:

Negation (NOT) The truth table for the negation of a proposition “P” is given below:
P ¬P
T F
F F
The truth value of “¬𝑃” is “F” (false) if “P” is true, and “T” (true) if “P” is false. Conjunction
(AND) The truth table for the conjunction of two propositions “P” and “Q” is given below:
P Q P ∧𝑄
T T T
T F F
F T F
F F F
The truth value of “P ∧ Q” is “T” (true) if and only if both “P” and “Q” are true.
Disjunction (OR) The truth table for the disjunction of two propositions “P” and “Q” is given
below:
P Q P ∨𝑄
T T T
T F T
F T T
F F F
The truth value of “P ∨ Q” is “T” (true) if either “P” or “Q” or both are true.
Implication (IF-THEN) The truth table for the implication of two propositions “P” and “Q” is
given below:

11
2 Propositional Logic

P Q P→𝑄
T T T
T F F
F T T
F F T
The truth value of “P → Q” is “T” (true) if either “P” is false or “Q” is true, or if both “P” and “Q”
are true.
Bi-Implication (IF AND ONLY IF) The truth table for the bi-implication of two propositions
“P” and “Q” is given below:
P Q P↔𝑄
T T T
T F F
F T F
F F T
The truth value of “P ↔ Q” is “T” (true) if both “P” and “Q” have the same truth value, and “F”
(false) if “P” and “Q” have different truth values.
Exclusive or (XOR) logical connective is a binary operator that evaluates to true if exactly
one of its operands is true and false otherwise. The symbol for XOR is typically written as ⊕.
The truth table for XOR is as follows:
P Q P ⊕𝑄
T T F
T F T
F T T
F F F
In the truth table, the result of P ⊕ Q is true if either P is true and Q is false, or if P is false and
Q is true. If both P and Q are either true or false, the result of P ⊕ Q is false.
In some applications, XOR is used as a means of detecting errors in digital data transmission,
since a change in the value of just one of the input propositions will result in a change in the
truth value of the XOR output. XOR is also used in cryptography and data compression, as well
as in the design of digital circuits and computer algorithms.

2.3.1 Truth table construction


To construct a truth table, we first need to identify the propositions involved in the argument.
Each proposition is assigned a letter, such as “p” or “q”. The truth values of the propositions are
then listed in columns, with each row representing a different combination of truth values. The
truth values can be represented as either T (true) or F (false).
Here is an example of constructing a truth table for the argument “𝑝 ∧ 𝑞 → 𝑟 ”. The propositions
are “p”, “q”, and “r”, and the logical connectives are “and” (∧) and “implies” (→).

12
2 Propositional Logic

p q r p ∧𝑞 p ∧𝑞 → 𝑟
T T T T T
T T F T F
T F T F T
T F F F T
F T T F T
F T F F T
F F T F T
F F F F T

2.4 Examples of compound proposition


Implication using “whenever”:
1. “Whenever it rains, the streets get wet.” This can be translated into a logical implication
as: “If it rains, then the streets get wet.”
2. “Whenever John studies, he gets good grades.” This can be translated into a logical
implication as: “If John studies, then he gets good grades.”
3. “Whenever the sun rises, it’s a new day.” This can be translated into a logical implication
as: “If the sun rises, then it’s a new day.”
Implication using “sufficient”:
1. “Getting enough sleep is sufficient for feeling rested.” This can be translated into a logical
implication as: “If you get enough sleep, then you will feel rested.”
2. “Having a car is sufficient for being able to drive.” This can be translated into a logical
implication as: “If you have a car, then you can drive.”
3. “Having a degree is sufficient for finding a job.” This can be translated into a logical
implication as: “If you have a degree, then you can find a job.”
Implication using “unless”:
1. “You will fail the exam unless you study.” This can be translated into a logical implication
as: “If you don’t study, then you will fail the exam.”
2. “You will be late unless you leave now.” This can be translated into a logical implication
as: “If you don’t leave now, then you will be late.”
3. “The plant will die unless it gets watered.” This can be translated into a logical implication
as: “If the plant doesn’t get watered, then it will die.”
Implication using “provided that”:
1. “I’ll help you move provided that you help me paint my room.” This can be translated
into a logical implication as: “If you help me paint my room, then I’ll help you move.”

13
2 Propositional Logic

2. “You can borrow my car provided that you fill up the gas tank.” This can be translated
into a logical implication as: “If you fill up the gas tank, then you can borrow my car.”
3. “You can have the cake provided that you share with everyone else.” This can be translated
into a logical implication as: “If you share with everyone else, then you can have the
cake.”
Implication using the phrase “follows from”:
1. “The conclusion follows from the premises.” This can be translated into a logical implica-
tion as: “If the premises are true, then the conclusion is true.”
2. “It follows from the data that the hypothesis is correct.” This can be translated into a
logical implication as: “If the data is true, then the hypothesis is correct.”
3. “The result follows from the equation.” This can be translated into a logical implication
as: “If the equation is true, then the result is true.”
Here are examples of implication using the phrase “is necessary for”:
1. “Exercise is necessary for maintaining good health.” This can be translated into a logical
implication as: “If you want to maintain good health, then you must exercise.”
2. “Good sleep is necessary for being productive.” This can be translated into a logical
implication as: “If you want to be productive, then you must get good sleep.”
3. “Water is necessary for plants to grow.” This can be translated into a logical implication
as: “If you want the plants to grow, then you must provide water.”
Here are examples of implication using the phrase “a sufficient condition for”:
1. “A degree from a top university is a sufficient condition for getting a high-paying job.”
This can be translated into a logical implication as: “If you have a degree from a top
university, then you are guaranteed a high-paying job.”
2. “A good credit score is a sufficient condition for getting a loan.” This can be translated
into a logical implication as: “If you have a good credit score, then you are guaranteed a
loan.”
3. “A high IQ is a sufficient condition for being successful.” This can be translated into a
logical implication as: “If you have a high IQ, then you are guaranteed success.”
The phrase “a sufficient condition for Q is P” is commonly used in mathematical logic
and means that P (a certain condition or proposition) implies that Q (another condition or
proposition) is true. In other words, if P is true, then Q must also be true. This relationship can
be represented using the logical symbol “→”, where 𝑃 → 𝑄 means “if P, then Q”.
Here are some examples:
1. “A sufficient condition for winning the race is having the fastest time.” This means that if
a runner has the fastest time, then they must win the race.

14
2 Propositional Logic

2. “A sufficient condition for getting accepted into a college is having a high GPA.” This
means that if a student has a high GPA, then they will be accepted into the college.
3. “A sufficient condition for a circuit to work is having a complete circuit.” This means that
if a circuit is complete, then it must work.
Examples of bi-conditional statements:
1. If it rains, then the roads will be wet, and if the roads are wet, then it must have rained.
2. You can only enter the club if you are 21 years old or older, and if you are 21 years old or
older, then you can enter the club.
3. The game will start at 7 PM, and if the game starts at 7 PM, then it is 7 PM.
4. The lights will turn on if you switch the switch, and if the lights turn on, then you
switched the switch.
5. You pass the test if you score 80% or higher, and if you score 80% or higher, then you pass
the test.
6. 𝑥 is even ⇔ 𝑥 is divisible by 2
7. 𝑎 is a multiple of 𝑏 ⇔ 𝑏 is a factor of 𝑎
8. 𝑛 is prime ⇔ 𝑛 has exactly two distinct positive divisors
9. 𝑥 is positive ⇔ 𝑥 > 0
10. 𝑝 is a point on line 𝑙 ⇔ 𝑝 lies on 𝑙
11. If and only if it rains, the roads will be wet.
12. If and only if you are 21 years old or older, you can enter the club.
13. If and only if the game starts at 7 PM, it is 7 PM.
14. If and only if you switch the switch, the lights will turn on.
15. If and only if you score 80% or higher, you pass the test.
English examples of Exclusive OR (XOR) statements:
1. You can either take the train or the bus, but not both.
2. You are either a cat person or a dog person, but not both.
3. The game is either on Sunday or on Monday, but not both.
4. You can either have pizza or sushi for dinner, but not both.
5. You either have a red car or a blue car, but not both.
6. You can only play soccer or basketball, not both.
7. You must choose either apples or oranges, not both.

15
2 Propositional Logic

8. The concert is either on Saturday or on Sunday, but not both.


9. You can either have a sandwich or a salad for lunch, but not both.
10. You can either rent a car or take a taxi, but not both.

2.4.1 Truth value of compound proposition


The truth value of a compound proposition is determined by the truth values of the elementary
propositions and the logical connectives used to combine them. For example, consider the
following compound proposition:
“It is raining and I have an umbrella”
Let p be the proposition “It is raining” and q be the proposition “I have an umbrella.” The
compound proposition “p and q” can be represented as 𝑝 ∧ 𝑞. The truth value of 𝑝 ∧ 𝑞 is true if
both p and q are true, and false otherwise.
For another example, consider the following compound proposition:
“I will go to the party unless it is raining.”
Let p be the proposition “I will go to the party” and q be the proposition “It is raining.” The
compound proposition “p unless q” can be represented as 𝑝 → ¬𝑞. The truth value of 𝑝 → ¬𝑞
is true if either p is true and q is false, or p is false. If both p and q are true, the truth value is
false.

2.4.2 More Compound Proposition Examples with Truth Values


1. “If it is sunny, then I will go to the beach.” - Truth Value: True (Sunny → Beach)
2. “I will buy a new phone if and only if it has a good camera.” - Truth Value: Depends on
the camera quality
3. “Either I will study for the exam, or I will fail.” - Truth Value: True (Studying ∨ Failing)
4. “If it is not raining and I am not tired, I will go for a run.” - Truth Value: Depends on
weather and fatigue/tiredness
5. “I will go to the party, but only if my friends also go.” - Truth Value: Depends on friends’
attendance
6. “I will pass the course only if I score above 70 on the final exam.” - Truth Value: Depends
on exam score
7. “If I wake up early, then I will have time for breakfast.” - Truth Value: Depends on
waking up early
8. “Either I will watch a movie, or I will read a book this evening.” - Truth Value: Depends
on chosen activity

16
2 Propositional Logic

9. “If it is a weekday and I have work, then I will not attend the event.” - Truth Value:
Depends on weekday and work status
10. “I will go shopping if and only if there is a sale.” - Truth Value: Depends on sale
availability
11. “I will not go to the concert unless my favorite band is performing.” - Truth Value:
Depends on favorite band’s performance
12. “If the train is delayed, then I will miss my connecting flight.” - Truth Value: Depends
on train delay
13. “I will be happy only if it is a sunny day and I receive good news.” - Truth Value: Depends
on weather and news
14. “Either I will go for a hike, or I will stay at home and relax.” - Truth Value: Depends on
chosen activity
15. “If I finish my work early, then I will have time for a nap.” - Truth Value: Depends on
finishing work early
16. “I will join the gym, but only if they offer a student discount.” - Truth Value: Depends
on student discount
17. “I will not eat dessert unless it is chocolate.” - Truth Value: Depends on dessert type
18. “If I forget my umbrella, then I will get wet in the rain.” - Truth Value: Depends on
forgetting umbrella
19. “Either I will finish the project by tomorrow, or I will ask for an extension.” - Truth
Value: Depends on project completion
20. “I will attend the conference only if my colleague is also presenting.” - Truth Value:
Depends on colleague’s presentation
21. “If the traffic is heavy and I leave late, then I will be late for the meeting.” - Truth Value:
Depends on traffic and departure time
22. “I will take a vacation if and only if my boss approves the time off.” - Truth Value:
Depends on boss approval
23. “Either I will go to the museum, or I will visit the botanical garden.” - Truth Value:
Depends on chosen destination
24. “If I miss the bus, then I will take a taxi to reach the office on time.” - Truth Value:
Depends on missing the bus
25. “I will exercise regularly only if I see positive results.” - Truth Value: Depends on seeing
positive results
26. “If I forget to set an alarm, then I will oversleep.” - Truth Value: Depends on forgetting
to set an alarm

17
2 Propositional Logic

27. “Either I will buy a new car, or I will continue using public transportation.” - Truth
Value: Depends on car purchase decision
28. “I will not order dessert unless the restaurant has my favorite cheesecake.” - Truth Value:
Depends on cheesecake availability
29. “If I win the lottery, then I will travel around the world.” - Truth Value: Depends on
winning the lottery
30. “I will not attend the party unless my best friend is also invited.” - Truth Value: Depends
on best friend’s invitation
31. “If it snows heavily, then I will build a snowman.” - Truth Value: Depends on heavy
snowfall
32. “I will buy a house if and only if the interest rates are low.” - Truth Value: Depends on
interest rates
33. “Either I will go for a jog, or I will do yoga at home.” - Truth Value: Depends on chosen
activity
34. “I will not start a new project unless I finish my current tasks.” - Truth Value: Depends
on current task completion
35. “If it is a public holiday, then I will spend the day with family.” - Truth Value: Depends
on public holiday
36. “I will not eat fast food unless it is the only option available.” - Truth Value: Depends
on fast food availability
37. “If the concert tickets are sold out, then I will watch it online.” - Truth Value: Depends
on ticket availability
38. “Either I will cook dinner, or I will order takeout tonight.” - Truth Value: Depends on
chosen option
39. “I will buy a bicycle if and only if I move closer to my workplace.” - Truth Value: Depends
on moving closer
40. “If I miss the bus, then I will wait for the next one.” - Truth Value: Depends on missing
the bus
41. “I will not go to the party unless there is live music.” - Truth Value: Depends on live
music availability
42. “Either I will learn a new language, or I will take a photography course.” - Truth Value:
Depends on chosen learning path
43. “I will attend the workshop only if it covers advanced topics.” - Truth Value: Depends
on workshop content
44. “If it is a hot day, then I will go for a swim.” - Truth Value: Depends on hot weather

18
2 Propositional Logic

45. “I will not go on a road trip unless I have a reliable car.” - Truth Value: Depends on car
reliability
46. “If I forget my umbrella, then I will get wet in the rain.” - Truth Value: Depends on
forgetting the umbrella
47. “If it is a weekend, then I will go for a bike ride.” - Truth Value: Depends on whether
it’s a weekend
48. “I will only eat ice cream if it is a hot summer day.” - Truth Value: Depends on weather
conditions
49. “Either I will finish the novel, or I will start a new one.” - Truth Value: Depends on
reading choices
50. “If I miss the train, then I will take the bus to work.” - Truth Value: Depends on missing
the train
51. “I will attend the meeting only if it is necessary and beneficial.” - Truth Value: Depends
on necessity and benefits
52. “Either I will go to the theater, or I will watch a movie at home.” - Truth Value: Depends
on entertainment choice
53. “If it is a holiday and the weather is good, then I will have a barbecue.” - Truth Value:
Depends on holiday and weather
54. “I will buy a new phone if and only if it has both a good camera and ample storage.” -
Truth Value: Depends on camera quality and storage
55. “Either I will go on a road trip, or I will explore a new city.” - Truth Value: Depends on
travel preference
56. “If I receive a promotion, then I will celebrate with my colleagues.” - Truth Value:
Depends on receiving a promotion
57. “I will exercise regularly only if I can find a workout buddy.” - Truth Value: Depends on
finding a workout buddy
58. “Either I will take a nap, or I will drink a cup of coffee to stay awake.” - Truth Value:
Depends on energy level
59. “If I forget my umbrella, then I will borrow one from a friend.” - Truth Value: Depends
on forgetting the umbrella
60. “I will only go to the amusement park if the roller coaster is operational.” - Truth Value:
Depends on roller coaster status
61. “Either I will learn to play the guitar, or I will take piano lessons.” - Truth Value: Depends
on musical interest

19
2 Propositional Logic

62. “If it is a sale day and I have coupons, then I will go shopping.” - Truth Value: Depends
on sale and coupon availability
63. “I will not stay up late unless there is an important event.” - Truth Value: Depends on
the importance of the event
64. “If I forget to water the plants, then they will wither.” - Truth Value: Depends on
forgetting to water the plants
65. “I will buy a new laptop if and only if it meets both my performance and budget criteria.”
- Truth Value: Depends on laptop specifications and budget
66. “Either I will join a book club, or I will start my own reading group.” - Truth Value:
Depends on social preference

2.5 Contrapositive, Converse, and Inverse Examples


Consider the conditional statement: “If it is raining, then I will stay indoors.”

2.5.1 Original Statement:


𝑃 →𝑄

Truth Values:
• Scenario 1: It is raining (True), and I stay indoors (True) - Result: True
• Scenario 2: It is not raining (False), and I stay indoors (True) - Result: True
• Scenario 3: It is raining (True), but I do not stay indoors (False) - Result: False
• Scenario 4: It is not raining (False), and I do not stay indoors (False) - Result: True

2.5.2 Contrapositive:
¬𝑄 → ¬𝑃

Truth Values:
• Scenario 1: I don’t stay indoors (False), and it is not raining (False) - Result: True
• Scenario 2: I don’t stay indoors (False), and it is raining (True) - Result: False
• Scenario 3: I stay indoors (True), and it is not raining (False) - Result: True
• Scenario 4: I stay indoors (True), and it is raining (True) - Result: True

20
2 Propositional Logic

2.5.3 Converse:
𝑄 →𝑃

Truth Values:
• Scenario 1: I stay indoors (True), and it is raining (True) - Result: True
• Scenario 2: I stay indoors (True), and it is not raining (False) - Result: True
• Scenario 3: I don’t stay indoors (False), and it is raining (True) - Result: True
• Scenario 4: I don’t stay indoors (False), and it is not raining (False) - Result: True

2.5.4 Inverse:
¬𝑃 → ¬𝑄

Truth Values:
• Scenario 1: It is not raining (False), and I don’t stay indoors (False) - Result: True
• Scenario 2: It is raining (True), and I don’t stay indoors (False) - Result: False
• Scenario 3: It is not raining (False), and I stay indoors (True) - Result: True
• Scenario 4: It is raining (True), and I stay indoors (True) - Result: True

2.6 Some Mathematical Statements (examples)


2.6.1 Original Statement:
𝑃 →𝑄
“If 𝑥 is a positive number, then 𝑥 2 is positive.”
Contrapositive:
¬𝑄 → ¬𝑃
“If 𝑥 2 is not positive, then 𝑥 is not a positive number.”
Converse:
𝑄 →𝑃
“If 𝑥 2 is positive, then 𝑥 is a positive number.”
Inverse:
¬𝑃 → ¬𝑄
“If 𝑥 is not a positive number, then 𝑥 2 is not positive.”

21
2 Propositional Logic

2.6.2 Original Statement:


𝑅 →𝑆
“If 𝑦 is an even number, then 𝑦 + 2 is also an even number.”
Contrapositive:
¬𝑆 → ¬𝑅
“If 𝑦 + 2 is not an even number, then 𝑦 is not an even number.”
Converse:
𝑆 →𝑅
“If 𝑦 + 2 is an even number, then 𝑦 is also an even number.”
Inverse:
¬𝑅 → ¬𝑆
“If 𝑦 is not an even number, then 𝑦 + 2 is not an even number.”

2.6.3 Original Statement:


𝐴→𝐵
“If 𝑧 is a prime number, then 𝑧 2 is not divisible by 4.”
Contrapositive:
¬𝐵 → ¬𝐴
“If 𝑧 2 is divisible by 4, then 𝑧 is not a prime number.”
Converse:
𝐵 →𝐴
“If 𝑧 2 is not divisible by 4, then 𝑧 is a prime number.”
Inverse:
¬𝐴 → ¬𝐵
“If 𝑧 is not a prime number, then 𝑧 2 is divisible by 4.”

2.7 Bitwise Operation


In computer science, bitwise operations are operations that manipulate individual bits in a
binary representation of data. Bitwise operations are used to perform bit-level manipulations
of data, such as masking, shifting, and testing individual bits. Here are some common bitwise
operations, along with examples:

22
2 Propositional Logic

• Bitwise AND: The bitwise AND operation is represented by the symbol “&”. It takes
two binary numbers as operands and performs a logical AND operation on each pair of
corresponding bits. For example:
1010
&
0101
0000
• Bitwise OR: The bitwise OR operation is represented by the symbol “|”. It takes two binary
numbers as operands and performs a logical OR operation on each pair of corresponding
bits. For example:
1010 | 0101 = 1111
• Bitwise XOR: The bitwise XOR operation is represented by the symbol “∧ ”. It takes two
binary numbers as operands and performs a logical exclusive OR operation on each pair
of corresponding bits. For example:
1010 ∧ 0101 = 1111
• Bitwise NOT: The bitwise NOT operation is represented by the symbol “∼”. It takes a
single binary number as an operand and performs a logical NOT operation on each bit.
For example:
∼1010 = 0101
• Bitwise Left Shift: The bitwise left shift operation is represented by the symbol "«". It
takes a binary number and a shift count as operands and shifts the bits of the binary
number to the left by the specified number of positions. For example:
1010 « 2 = 101000
• Bitwise Right Shift: The bitwise right shift operation is represented by the symbol "»".
It takes a binary number and a shift count as operands and shifts the bits of the binary
number to the right by the specified number of positions. For example:
1010 » 2 = 0010
These bitwise operations are widely used in computer systems for various purposes, including
performing low-level operations on data, implementing efficient algorithms, and solving complex
problems in fields such as cryptography and data compression.

2.8 Translating English sentences


In propositional logic, the process of translating English sentences into symbolic representations
involves representing the meaning of the sentence as a proposition and using logical connectives,
such as “and” (∧), “or” (∨), “not” (¬), “implies” (→), and “if and only if” (↔), to join individual
propositions into more complex statements. For example, consider the following English
sentence:
“It is raining if and only if the ground is wet.”
This can be translated into propositional logic as: 𝑟 ↔ 𝑤

23
2 Propositional Logic

where r represents the proposition “it is raining” and w represents the proposition “the ground
is wet.” The biconditional symbol (↔) states that r and w are logically equivalent, meaning
they are both true or both false at the same time. Another example is: “If it is not raining, then
the ground is not wet.” This can be translated into propositional logic as:
¬𝑟 ↔ ¬𝑤
where ¬𝑟 represents the negation of the proposition “it is raining.” The implication symbol (↔)
states that if ¬𝑟 is true, then ¬𝑤 must also be true.

2.8.1 General rules for translation


1. Identify the proposition: Start by identifying the main proposition being made in the
sentence, which is usually a statement about the relationship between two or more objects
or events.
2. Assign a propositional variable: Assign a unique propositional variable to represent
each proposition. For example, 𝑝, 𝑞, 𝑟 , etc.
3. Identify logical connectives: Identify the logical connectives in the sentence, such as
“and”, “or”, “not”, “if-then”, “if and only if”.
4. Translate logical connectives: Replace the logical connectives with the appropriate
logical symbols. For example, “and” is translated as the symbol ∧, “or” is translated as the
symbol ∨, “not” is translated as the symbol ¬, “if-then” is translated as the symbol →,
and “if and only if” is translated as the symbol ↔.
5. Parentheses: Use parentheses to clarify the order of operations. For example, if there
are multiple negations, disjunctions, or conjunctions, use parentheses to indicate the
grouping of the sub-formulas.
6. Simplify: Finally, simplify the expression by using the rules of propositional logic, such
as the associative, commutative, and distributive laws.
Here’s an example of translating a natural language sentence into propositional logic with
details:
Sentence: “If it is raining, then I will bring an umbrella.”
1. Identify the proposition: The main propositions are “I will bring an umbrella.” and “It is
raining”.
2. Assign a propositional variable: Let’s assign the proposition “I will bring an umbrella”
the propositional variable 𝑝, so 𝑝 := “I will bring an umbrella.” and the proposition “It is
raining” the propositional variable 𝑞, so 𝑞 := “It is raining.”
3. Identify logical connectives: The sentence contains the logical connective “if-then”.
4. Translate logical connectives: Replace “if-then” with the symbol →. So the sentence
becomes: “It is raining → I will bring an umbrella.”

24
2 Propositional Logic

5. Replace propositions with propositional variables: Replace the propositions with the
assigned propositional variables. So the sentence becomes: 𝑞 → 𝑝
6. Simplify: No simplification is necessary in this case.
So the final translated propositional logic is: 𝑞 → 𝑝.

2.9 Tautology and contradiction


In propositional logic, a tautology is a formula that is always true regardless of the truth values
assigned to its propositions. A tautology can be thought of as a logically valid formula that can
p p→p
never be false. T T
F T
For example, the formula (𝑝 → 𝑝) is a tautology because it is true for any truth value assigned
to 𝑝. If 𝑝 is true, then 𝑝 → 𝑝 is true because the antecedent (the part before the → symbol) is
true and the consequent (the part after the → symbol) is also true. If 𝑝 is false, then 𝑝 → 𝑝 is
also true because the antecedent is false and the consequent is true.
On the other hand, a contradiction is a formula that is always false regardless of the truth values
assigned to its propositions. A contradiction can be thought of as a logically invalid formula
p p ∧ ¬p
that can never be true. T F
F F
For example, the formula (𝑝 ∧ ¬𝑝) is a contradiction because it is false for any truth value
assigned to 𝑝. If 𝑝 is true, then 𝑝 ∧ ¬𝑝 is false because the first part of the conjunction (the ∧
symbol) is true and the second part of the conjunction (the ¬ symbol) is false, making the whole
formula false. If 𝑝 is false, then 𝑝 ∧ ¬𝑝 is also false because the first part of the conjunction is
false and the second part of the conjunction is true, making the whole formula false.

2.10 Logical equivalences


Commutativity of ∧: 𝑝 ∧𝑞 ≡ 𝑞 ∧𝑝
Commutativity of ∨: 𝑝 ∨𝑞 ≡ 𝑞 ∨𝑝
Associativity of ∧: (𝑝 ∧ 𝑞) ∧ 𝑟 ≡ 𝑝 ∧ (𝑞 ∧ 𝑟 )
Associativity of ∨: (𝑝 ∨ 𝑞) ∨ 𝑟 ≡ 𝑝 ∨ (𝑞 ∨ 𝑟 )
Distributivity of ∧ over ∨: 𝑝 ∧ (𝑞 ∨ 𝑟 ) ≡ (𝑝 ∧ 𝑞) ∨ (𝑝 ∧ 𝑟 )
Distributivity of ∨ over ∧: 𝑝 ∨ (𝑞 ∧ 𝑟 ) ≡ (𝑝 ∨ 𝑞) ∧ (𝑝 ∨ 𝑟 )
Idempotence of ∧: 𝑝 ∧𝑝 ≡𝑝
Idempotence of ∨: 𝑝 ∨𝑝 ≡𝑝
Double negation: ¬(¬𝑝) ≡ 𝑝
De Morgan’s laws: ¬(𝑝 ∧ 𝑞) ≡ ¬𝑝 ∨ ¬𝑞
¬(𝑝 ∨ 𝑞) ≡ ¬𝑝 ∧ ¬𝑞

25
2 Propositional Logic

Logical equivalences, also known as logical identities or tautologies, are statements in propo-
sitional logic that are always true, regardless of the truth values of their constituent propositions.
In discrete mathematics, understanding these equivalences is essential for simplifying logical
expressions, making proofs, and solving problems. Here are some common logical equivalences
with explanations:
1. Double Negation:

¬(¬𝑃) ≡ 𝑃

This states that negating a proposition twice is equivalent to the original proposition.
2. Law of Contrapositive:

(𝑃 → 𝑄) ≡ (¬𝑄 → ¬𝑃)

If the implication "if P, then Q" is true, it is logically equivalent to its contrapositive.
3. De Morgan’s Laws:

¬(𝑃 ∧ 𝑄) ≡ (¬𝑃 ∨ ¬𝑄)


¬(𝑃 ∨ 𝑄) ≡ (¬𝑃 ∧ ¬𝑄)

These laws describe how negation distributes over conjunction (AND) and disjunction
(OR).
4. Idempotent Laws:

(𝑃 ∧ 𝑃) ≡ 𝑃
(𝑃 ∨ 𝑃) ≡ 𝑃

These laws state that repeating an operation on a proposition does not change its truth
value.
5. Commutative Laws:

(𝑃 ∧ 𝑄) ≡ (𝑄 ∧ 𝑃)
(𝑃 ∨ 𝑄) ≡ (𝑄 ∨ 𝑃)

These laws show that the order of conjunction and disjunction does not affect the result.
6. Associative Laws:

(𝑃 ∧ 𝑄) ∧ 𝑅 ≡ 𝑃 ∧ (𝑄 ∧ 𝑅)
(𝑃 ∨ 𝑄) ∨ 𝑅 ≡ 𝑃 ∨ (𝑄 ∨ 𝑅)

These laws indicate that grouping propositions with parentheses does not change the
outcome.

26
2 Propositional Logic

7. Distributive Laws:

𝑃 ∧ (𝑄 ∨ 𝑅) ≡ (𝑃 ∧ 𝑄) ∨ (𝑃 ∧ 𝑅)
𝑃 ∨ (𝑄 ∧ 𝑅) ≡ (𝑃 ∨ 𝑄) ∧ (𝑃 ∨ 𝑅)

These laws describe how conjunction and disjunction distribute over each other.
8. Absorption Laws:

𝑃 ∨ (𝑃 ∧ 𝑄) ≡ 𝑃
𝑃 ∧ (𝑃 ∨ 𝑄) ≡ 𝑃

These laws illustrate how a proposition combined with its own conjunction or disjunction
simplifies.
9. Identity Laws:

𝑃 ∧T≡𝑃
𝑃 ∨F≡𝑃

These laws show that combining a proposition with a tautology (T) or a contradiction (F)
does not change the proposition.
10. Implication Laws:

𝑃 → 𝑄 ≡ ¬𝑃 ∨ 𝑄
𝑃 → 𝑄 ≡ ¬(𝑃 ∧ ¬𝑄)

These laws provide alternative ways to express implications.


Kindly refer to the book for more details and examples.

Exercises
Exercise 1: Simplify the expression (𝑃 ∧ ¬𝑄) ∨ (¬𝑃 ∧ 𝑄).
Solution 1: Using the Commutative Law for Disjunction:

(𝑃 ∧ ¬𝑄) ∨ (¬𝑃 ∧ 𝑄) ≡ (¬𝑄 ∧ 𝑃) ∨ (𝑄 ∧ ¬𝑃)


≡ (𝑃 ∧ ¬𝑄) ∨ (¬𝑃 ∧ 𝑄)

So, the expression remains (𝑃 ∧ ¬𝑄) ∨ (¬𝑃 ∧ 𝑄).


Exercise 2: Simplify the expression ¬(𝑃 ∧ 𝑄) ∧ (𝑃 ∨ ¬𝑄).

27
2 Propositional Logic

Solution 2: Using De Morgan’s Laws:

¬(𝑃 ∧ 𝑄) ∧ (𝑃 ∨ ¬𝑄) ≡ (¬𝑃 ∨ ¬𝑄) ∧ (𝑃 ∨ ¬𝑄)


≡ (¬𝑃 ∧ 𝑃) ∨ (¬𝑃 ∧ ¬𝑄) ∨ (¬𝑄 ∧ 𝑃) ∨ (¬𝑄 ∧ ¬𝑄)
≡ ⊥ ∨ (¬𝑃 ∧ ¬𝑄) ∨ (⊥) ∨ (⊥)
≡ ⊥ ∨ (¬𝑃 ∧ ¬𝑄)

So, the simplified expression is ⊥ ∨ (¬𝑃 ∧ ¬𝑄).


Exercise 3: Simplify the expression ¬(𝑃 ∨ ¬𝑄) ∨ (𝑃 ∧ ¬𝑄).
Solution 3: Using De Morgan’s Laws:

¬(𝑃 ∨ ¬𝑄) ∨ (𝑃 ∧ ¬𝑄) ≡ (¬𝑃 ∧ 𝑄) ∨ (𝑃 ∧ ¬𝑄)

So, the simplified expression is (¬𝑃 ∧ 𝑄) ∨ (𝑃 ∧ ¬𝑄).


Exercise 4: Simplify the expression ¬(𝑃 ∧ 𝑄) ∨ (𝑃 ∧ ¬𝑄).
Solution 4: Using the Distributive Law:

¬(𝑃 ∧ 𝑄) ∨ (𝑃 ∧ ¬𝑄) ≡ (¬𝑃 ∨ ¬𝑄) ∨ (𝑃 ∧ ¬𝑄)

So, the simplified expression is (¬𝑃 ∨ ¬𝑄) ∨ (𝑃 ∧ ¬𝑄).


Exercise 5: Simplify the expression (𝑃 ∨ 𝑄) ∧ (¬𝑃 ∨ ¬𝑄).
Solution 5: Using the Distributive Law:

(𝑃 ∨ 𝑄) ∧ (¬𝑃 ∨ ¬𝑄) ≡ (𝑃 ∧ ¬𝑃) ∨ (𝑃 ∧ ¬𝑄) ∨ (𝑄 ∧ ¬𝑃) ∨ (𝑄 ∧ ¬𝑄)


≡ ⊥ ∨ (𝑃 ∧ ¬𝑄) ∨ (𝑄 ∧ ¬𝑃) ∨ ⊥
≡ (𝑃 ∧ ¬𝑄) ∨ (𝑄 ∧ ¬𝑃)

So, the simplified expression is (𝑃 ∧ ¬𝑄) ∨ (𝑄 ∧ ¬𝑃).


Exercise 6: Simplify the expression ¬(𝑃 ∨ ¬𝑄) ∨ (𝑃 ∧ ¬𝑄).
Solution 6: Using De Morgan’s Laws:

¬(𝑃 ∨ ¬𝑄) ∨ (𝑃 ∧ ¬𝑄) ≡ (¬𝑃 ∧ 𝑄) ∨ (𝑃 ∧ ¬𝑄)

So, the simplified expression is (¬𝑃 ∧ 𝑄) ∨ (𝑃 ∧ ¬𝑄).


Exercise 7: Simplify the expression (𝑃 → 𝑄) ∧ (¬𝑄 → ¬𝑃).
Solution 7: Using the Implication Law:

(𝑃 → 𝑄) ∧ (¬𝑄 → ¬𝑃) ≡ (¬𝑃 ∨ 𝑄) ∧ (𝑄 ∨ ¬𝑃)


≡ (¬𝑃 ∨ 𝑄) ∧ (¬𝑃 ∨ 𝑄)

28
2 Propositional Logic

So, the simplified expression is (¬𝑃 ∨ 𝑄) ∧ (¬𝑃 ∨ 𝑄).


Exercise 8: Simplify the expression (𝑃 ∧ 𝑄) ∨ (¬𝑃 ∧ 𝑄).
Solution 8: Using the Commutative Law for Disjunction:

(𝑃 ∧ 𝑄) ∨ (¬𝑃 ∧ 𝑄) ≡ (𝑄 ∧ 𝑃) ∨ (𝑄 ∧ ¬𝑃)
≡ (𝑃 ∧ 𝑄) ∨ (𝑄 ∧ ¬𝑃)

So, the expression remains (𝑃 ∧ 𝑄) ∨ (𝑄 ∧ ¬𝑃).


Exercise 9: Simplify the expression ¬(𝑃 ∧ 𝑄) ∨ (𝑃 ∧ ¬𝑄).
Solution 9: Using the De Morgan’s Laws:

¬(𝑃 ∧ 𝑄) ∨ (𝑃 ∧ ¬𝑄) ≡ (¬𝑃 ∨ ¬𝑄) ∨ (𝑃 ∧ ¬𝑄)

So, the simplified expression is (¬𝑃 ∨ ¬𝑄) ∨ (𝑃 ∧ ¬𝑄).


Exercise 10: Simplify the expression 𝑃 ∧ (𝑄 ∨ ¬𝑄).
Solution 10: In this expression, 𝑄 ∨ ¬𝑄 is always true (Tautology), so the entire expression
simplifies to just 𝑃.
Exercise 11: Simplify the expression 𝑃 ∧ (𝑃 ∨ 𝑄).
Solution 11: This expression represents the Distributive Law, so it remains as 𝑃 ∧ (𝑃 ∨ 𝑄).
Exercise 12: Simplify the expression ¬(𝑃 ∨ ¬𝑄) ∨ (𝑃 ∧ ¬𝑄).
Solution 12: Using De Morgan’s Laws:

¬(𝑃 ∨ ¬𝑄) ∨ (𝑃 ∧ ¬𝑄) ≡ (¬𝑃 ∧ 𝑄) ∨ (𝑃 ∧ ¬𝑄)

So, the simplified expression is (¬𝑃 ∧ 𝑄) ∨ (𝑃 ∧ ¬𝑄).

29

You might also like