Thisyear PDF
Thisyear PDF
DAY 1
Syllabus
Unit-1 Logic: Propositional logic and its applications; Propositional equivalences;
Predicates and Quantifiers; Rules of inference; Introduction to Proofs; Proof Methods;
Proof by Mathematical Induction (Weak and Strong).
Unit-2 Set theory: Sets, operations on sets, cardinality, inductive definition of sets and proof
by induction; Relations, representation of relations, properties of relations,
equivalence relations and partitions; Partial orderings; Posets; Well-ordered sets.
Unit-3 Functions: Mappings; Injection and Surjection; Composition of functions; Inverse
functions; Special functions; recursive function theory.
Unit-4 Algebraic Structures: Definition and elementary properties of groups; semigroups;
monoids; rings; fields, vector spaces; lattices and Boolean Algebra.
Unit-5 Elementary combinatorics: Basic Counting Principles; Permutations and
Combinations; Binomial Coefficients and Identities; Generalized Permutations and
Combinations; Sterling’s number of the second kind; Pigeon-hole Principle and its
application; Inclusion-Exclusion Principle and its application; Recurrence Relations;
Solving Linear Recurrence Relations; Generating Functions; Catalan Numbers;
Fibonacci numbers.
Unit-6 Number Theory: Divisibility and Modular Arithmetic; Integer Representations and
Algorithms; Prime numbers and related Theorems; Greatest Common Divisors;
Euclid’s Algorithm; Solving Congruence; Applications of Congruence, Fermat’s Little
Theorem,
1. K. H.The Chinese
Rosen Remainder
, Discrete Theorem;and
Mathematics Applications in Cryptography.
Applications, TMH
Goals of this Course
Students should learn a particular set of mathematical facts and how to apply
them; more importantly, how to think logically and mathematically.
1. Mathematical Reasoning: understand mathematical reasoning in order to read,
comprehend, and construct mathematical arguments. Mathematical logic,
discussions of methods of proof.
2. Discrete Structures: Abstract mathematical structures used to represent discrete
objects and relationships between these objects. These discrete structures include
sets, permutations, relations, graphs, trees.
3. Combinatorial Analysis: Basic techniques of counting. Combinatorial analysis to solve
counting problems.
4. Number Theory and Applications:
Number Theory
Division
If a and b are integers with a ≠ 0, we say that a divides b if there is an integer c
such that b = ac. When a divides b we say that a is a factor or divisor of b, and that
b is a multiple of a. The notation a | b denotes that a divides b. We write a ∤ b when
a does not divide b.
THEOREM 1
Let a, b, and c be integers, where a = 0. Then
(i ) if a | b and a | c, then a | (b + c);
(ii ) if a | b, then a | bc for all integers c;
(iii ) if a | b and b | c, then a | c.
THEOREM 2
THE DIVISION ALGORITHM Let a be an integer and d a positive integer. Then there are
unique integers q and r, with 0 ≤ r < d, such that a = dq + r.
What are the quotient and remainder when −11 is divided by 3. Which one is correct?
−11 = 3(−3) − 2
−11 = 3(−4) + 1.
Modular Arithmetic
In some situations we care only about the remainder of an integer when it is divided by some
specified positive integer.
Q. what time it will be (on a 12-hour clock) 50 hours from now (Assume 3:30 pm)
If ‘a’ and ‘b’ are integers and ‘m’ is a positive integer, then ‘a’ is congruent to ‘b’ modulo ‘m’ if m
divides a − b. We use the notation a ≡ b (mod m) to indicate that a is congruent to b modulo m.
If a and b are not congruent modulo m, we write a ≢ b (mod m).
THEOREM 3: Let ‘a’ and ‘b’ be integers, and let m be a positive integer.
Then a ≡ b (mod m) if and only if a mod m = b mod m.
THEOREM 4: Let m be a positive integer. The integers ‘a’ and ‘b’ are congruent modulo
‘m’ if and only if there is an integer ‘k’ such that a = b + km.
Eg: 13 ≡ 3 (mod 5) 13 = 3 + 2 × 5, k = 2
2 ≡ 9 (mod 7) k=?
PROPERTIES
1. 𝑎 + 𝑏 𝑚𝑜𝑑 𝑛 = 𝑎 𝑚𝑜𝑑 𝑛 + 𝑏 𝑚𝑜𝑑 𝑛 𝑚𝑜𝑑 𝑛
2. 𝑎 − 𝑏 𝑚𝑜𝑑 𝑛 = 𝑎 𝑚𝑜𝑑 𝑛 − 𝑏 𝑚𝑜𝑑 𝑛 𝑚𝑜𝑑 𝑛
3. 𝑎 × 𝑏 𝑚𝑜𝑑 𝑛 = 𝑎 𝑚𝑜𝑑 𝑛 × 𝑏 𝑚𝑜𝑑 𝑛 𝑚𝑜𝑑 𝑛
43 𝑚𝑜𝑑 11 : easy to compute as the values are small
Modular Exponentiation
Find 𝑎𝑛 𝑚𝑜𝑑 𝑚 efficiently, where a, n, and m are large integers.
ALGORITHM (Modular Exponentiation)
a: integer, 𝑛 = (𝑏𝑘−1 𝑏𝑘−2 …𝑏1 𝑏0 )2 (binary representation), m: positive integers
x := 1
power := a mod m
for i := 0 to k − 1
if 𝑏𝑖 = 1
then x := (x ・ power) mod m
power := (power ・ power) mod m
2335 𝑚𝑜𝑑 19
2335 𝑚𝑜𝑑 19
35 = (100011)2
𝒙 =1; power = 𝟐𝟑 𝒎𝒐𝒅 𝟏𝟗 = 𝟒
𝒊=𝟓 𝑏5 = 1 𝒙 = 𝟕. 𝟏𝟕 𝐦𝐨𝐝 𝟏𝟗 = 𝟓
Representations of Integers
BINARY EXPANSIONS:
Q. What is the decimal expansion of the integer that has (10101110)2 as its binary
expansion?
Q. What is the decimal expansion of the number with hexadecimal expansion
(2𝐴𝐸0𝐶)16
Binary addition
1110 1011
+ 1011 +1101
11001 1111
0101
?
Binary multiplication
110
101
110
000x
110xx
11110
• Multiplicative inverse
In 𝑍𝑛 , two numbers ‘a’ and ‘b’ are multiplicative inverse of each other if
𝑎 × 𝑏 ≡ 1 𝑚𝑜𝑑 𝑛.
Eg If the modulus is 10, the multiplicative inverse of 3 is 7.
3 × 7 ≡ 1 𝑚𝑜𝑑 10.
LEMMA: Let a = bq + r, where a, b, q, and r are integers. Then gcd(a, b) = gcd(b, r).
Q. Given 𝑎 = 252, 𝑏 = 198. Find ‘s’ and ‘t’ such that gcd 𝑎, 𝑏 = 𝑠 × 𝑎 + 𝑡 × 𝑏
using Euclidean Algorithm
252 = 1 × 198 + 54
198 = 3 × 54 + 36
54 = 1 × 36 + 18
36 = 2 × 18 + 0
18 = 54 − 1 × 198 − 3 × 54 = 4 × 54 − 1 × 198
= 4 × 252 − 1 × 198 −1 × 198 = 4 × 252 − 5 × 198
18 = 4 × 252 + (−5) × 198
Q. Given 𝑎 = 252, 𝑏 = 198. Find ‘s’ and ‘t’ such that gcd 𝑎, 𝑏 = 𝑠 ×
𝑎 + 𝑡 × 𝑏 using extended Euclidean Algorithm
Q. Given a=161 and b=28, find gcd(𝑎, 𝑏) and the value of s and t such
that gcd 𝑎, 𝑏 = 𝑠 × 𝑎 + 𝑡 × 𝑏
Linear Diophantine Equations
• Find integer values of 𝑥 and 𝑦 that satisfy 𝑎𝑥 + 𝑏𝑦 = 𝑐.
• This type of equation has either no solution or an infinite number of
solutions.
• Let 𝑑 = gcd(𝑎, 𝑏).
• If 𝑑 ∤ 𝑐, then the equations has no solution.
• If 𝑑|𝑐, then the equations have an infinite number of solutions. One of them is called
particular solutions and the rest general.
• Particular Solution
• If 𝑑|𝑐:
• Reduce the equations to 𝑎1 𝑥 + 𝑏1 𝑦 = 𝑐1 by dividing both sides by d.
• Solve for s and t in the relations 𝑎1 𝑠 + 𝑏1 𝑡 = 1 using extended Euclidian algorithm.
• Particular solutions: 𝑥0 = 𝑐1 𝑠 and 𝑦0 = 𝑐1 𝑡
• General solutions: 𝑥 = 𝑥0 + 𝑘𝑏1 and y = 𝑦0 − 𝑘𝑎1 , where k is an integer
Q. Find the particular and general solutions to the equations 21𝑥 + 14𝑦 = 35
𝑑 = gcd 21, 4 = 7.
• Euler’s Phi function finds the number of integers that are both smaller than
‘n’ and relatively prime to ‘n’.
Some rules to find ∅(𝑛)
1. ∅ 1 = 0
2. ∅ 𝑝 = 𝑝 − 1 if p is a prime
3. ∅ 𝑚 × 𝑛 = ∅(𝑚) × ∅(𝑛), if m and n are relatively prime
4. ∅ 𝑝𝑒 = 𝑝𝑒 -𝑝𝑒−1 , if p is prime.
𝑒 𝑒 𝑒
If n can be factored as 𝑛 = 𝑝11 × 𝑝22 × ⋯ × 𝑝𝑘𝑘 ,combine third and forth rule
to find
𝑒1 𝑒1 −1 𝑒2 𝑒2 −1 𝑒𝑘 𝑒𝑘 −1
∅ 𝑛 =(𝑝1 − 𝑝1 ) × (𝑝2 − 𝑝2 ) × ⋯ × (𝑝𝑘 −𝑝𝑘 )
Q. What is the value of
i. ∅ 13 = 13 − 1 = 12
ii. ∅ 10 = ∅ 2 × ∅ 5 = 1 × 4 = 4
iii. ∅ 240 =?
Q. Find
i. 624 𝑚𝑜𝑑 35
= 6𝜙(35) 𝑚𝑜𝑑 35 = 1
ii. 2062 𝑚𝑜𝑑 77
Some multiplicative inverse can be solved using Euler’s Theorem. If n
and a are coprime, then 𝑎−1 𝑚𝑜𝑑 𝑛 = 𝑎𝜙(𝑛)−1 𝑚𝑜𝑑 𝑝
Q. Find 7−1 𝑚𝑜𝑑 15 without using extended Euclidean algorithm.
Cryptography
Cryptography is the art or science of converting information or data
into an unintelligible data.
• Transforming information so that it cannot be easily recovered
without special knowledge (key).
• Encryption is the process of converting information or data into an
unintelligible data, especially to prevent unauthorized access.
• Decryption is generally the reverse process of encryption. It is the process of
decoding the data which has been encrypted into a unintelligible data.
• Cipher is the unintelligible data obtained after encryption using a key.
Encryption Decryption
• The nine most common letters in English text and their approximate
relative frequencies are E 13%, T 9%, A 8%, O 8%, I 7%, N 7%, S 7%, H
6%, and R 6%
• Suppose that we intercepted the ciphertext message ZNK KGXRE
HOXJ MKZY ZNK CUXS that we know was produced by a shift cipher.
What was the original plaintext message?
• The most common letter in the ciphertext is K.
• Hypothesize that the shift cipher sent the plaintext letter E to the
ciphertext letter K (6 shift, key=6)
A B C D E F G H I J K . . . . Z
0 1 2 3 4 5 6 7 8 9 10 . . . . 25
• Shift the letters of the message by −6, obtaining THE EARLY BIRD GETS
THE WORM
Modern day cryptosystem are
divided into two: Asymmetric key cryptography:
Symmetric key cryptography: Two keys for each communicating entity.
A private key and a public key. If A and B
The sender and receiver uses the
are the communicating entity.
same key (private key).
A’s key are (private_A and public_A).
Similarly, B’s key are (private_B and
public_B).
RSA
(Rivest Shamir Adleman) cryptosystem
RSA is one of the first public-key cryptosystems and is widely used for
secure data transmission. In such a cryptosystem, the encryption key is
public and distinct from the decryption key which is kept secret.
Invented by Rivest, Shamir and Adleman.
Key generation, encryption and decryption algorithm
• Example
• Bob chooses 7 and 11 as p and q and calculates n = 7*11=77.
• The value of 𝜑 𝑛 = 7 − 1 11 − 1 = 60.
• Bob choses e=13 and computes d :
• 𝑑 ≡ 𝑒 −1 mod𝜑 𝑛
i.e. 𝑑 ≡ 13−1 mod 60 (apply Extended Euclidean algorithm to
find the inverse.
On computation you will get d=37.
Bob announces ‘e’ and ‘n’ as public and keeps ‘d’ as secret key.
• Imagine Alice wants to send the plaintext (M) 5 to Bob. She use the public
key𝑒 of Bob to generate the cipher text ‘C’ given by the formula 𝐶 =
𝑀 𝑚𝑜𝑑 𝑛.
• Signing:
Alice creates a signature out of the message
Using her private exponent, 𝑆 = 𝑀𝑑 𝑚𝑜𝑑 𝑛
And sends the message and the signature to
Bob.
Fig. 2. RSA digital signature scheme
• Verifying:
Bob receives M and S. Bob applies Alice’s public exponent to signature to create a copy of the
message 𝑀′ = 𝑆 𝑒 𝑚𝑜𝑑 𝑛. Bob compares the value of 𝑀′ with the value of 𝑀. If the two values are
congruent, Bob accepts the message.
𝑀′ ≡ 𝑀 𝑚𝑜𝑑 𝑛
→ 𝑆 𝑒 ≡ 𝑀 𝑚𝑜𝑑 𝑛
→ 𝑀𝑑×𝑒 ≡ 𝑀 𝑚𝑜𝑑 𝑛
1. 𝑀 = 3 × 5 × 7 = 105.
105 105 105
2. 𝑀1 =
3
= 35, 𝑀2 =
5
= 21, 𝑀3 =
7
= 15.
1 1 1
3. 𝑀1 = 𝑚𝑜𝑑3 = 2, 𝑀2 = 𝑚𝑜𝑑5 = 1, 𝑀3−1
−1 −1
= 𝑚𝑜𝑑7 =1
35 21 15
4. 𝑥 = 2 × 35 × 2 + 3 × 21 × 1 + 2 × 15 × 1 𝑚𝑜𝑑 105 = 23
Applications of Congruence's
• Hashing Functions
One of the most commonly used hashing functions
h(k) = k mod m
• A hashing function h assigns memory location h(k) to the record that has k as its key.
• Eg: Assigning a memory locations in a central computer so that customer records can be
retrieved quickly. Customer records are often identified using the Social Security number
of the customer as the key (k) where m is the number of available memory locations.
• Hashing functions should be easily evaluated so that files can be quickly located.
• Q. Find the memory locations assigned by the hashing function h(k) = k mod 111 to the
records of customers with Social Security numbers 064212848 and 037149212.
h(064212848) = 064212848 mod 111 = 14.
h(037149212) = 037149212 mod 111 = 65,
• Pseudorandom Numbers: Numbers generated by systematic methods that are not truly random.
• The most commonly used procedure for generating pseudorandom numbers is the linear congruential
method. We choose four integers: the modulus m, multiplier a, increment c, and seed x0, with 2 ≤ a < m, 0
≤ c < m, and 0 ≤ x0 < m.
• recursively defined function 𝑥𝑛+1 = 𝑎𝑥𝑛 + 𝑐 𝑚𝑜𝑑 𝑚
• Eg: Find the sequence of pseudorandom numbers generated by the linear congruential method with modulus
m = 9, multiplier a = 7, increment c = 4, and seed x0 = 3.
x1 = 7x0 + 4 mod 9 = 7 ・ 3 + 4 mod 9 = 25 mod 9 = 7,
x2 = 7x1 + 4 mod 9 = 7 ・ 7 + 4 mod 9 = 53 mod 9 = 8,
x3 = 7x2 + 4 mod 9 = 7 ・ 8 + 4 mod 9 = 60 mod 9 = 6,
x4 = 7x3 + 4 mod 9 = 7 ・ 6 + 4 mod 9 = 46 mod 9 = 1,
x5 = 7x4 + 4 mod 9 = 7 ・ 1 + 4 mod 9 = 11 mod 9 = 2,
x6 = 7x5 + 4 mod 9 = 7 ・ 2 + 4 mod 9 = 18 mod 9 = 0,
x7 = 7x6 + 4 mod 9 = 7 ・ 0 + 4 mod 9 = 4 mod 9 = 4,
x8 = 7x7 + 4 mod 9 = 7 ・ 4 + 4 mod 9 = 32 mod 9 = 5,
x9 = 7x8 + 4 mod 9 = 7 ・ 5 + 4 mod 9 = 39 mod 9 = 3.
The sequence :3, 7, 8, 6, 1, 2, 0, 4, 5, 3, 7, 8, 6, 1, 2, 0, 4, 5, 3, . . .
Check Digits
• Congruences are used to check for errors in digit strings. A common technique for detecting errors in such strings is to add
an extra digit at the end of the string. This final digit, or check digit, is calculated using a particular function. Then, to
determine whether a digit string is correct, a check is made to see whether this final digit has the correct value.
• Eg: ISBNs All books are identified by an International Standard Book Number (ISBN-10), a 10-digit code x1x2 . . . x10,
assigned by the publisher.
• The check digit is calculated as:
𝑥10 ≡ σ9𝑖=1 𝑖𝑥𝑖 𝑚𝑜𝑑 11 (either a digit or the letter X (used to represent 10)).
10
• Message to be transmitted
• Eg: 1011011
• Generator known to both sender and receiver. Let ‘n’ be the length of
the generator.
• Eg: 1101 here n = 4
• Pad n-1 bits as 0’s to the message to be transmitted
• Padded message: 1011011000
• Finding the CRC: Divide the padded message by generator. Reminder
is obtained by performing XOR operation
1101 1011011000 (Padded message) 1101 1011011001 (Without error) 1101 1010011001 (With error)
1101 1101 1101
1100 1100 1110
1101 1101 1101
1110 1110 1111
1101 1101 1101
1100 1101 1000
1101 1101 1101
001 (CRC) 000 (CRC) 1011
1101
110(CRC)
Sender: Receiver:
Message is sent as: 1011011001 CRC=000 No error in received data
Receiver:
CRC≠000 Error in received data
Single bit error detection and correction using Hamming code
𝒅𝟕 𝒅𝟔 𝒅𝟓 𝒑𝟒 𝒅𝟑 𝒑𝟐 𝒑𝟏
Check: Check:
𝒄𝟏 = 0, 1,0,1 = 0 𝒄𝟏 = 0, 1,0,1 = 0
𝒄𝟐 = 1, 1,1,1 = 0 𝒄𝟐 = 1, 1,1,1 = 0
𝒄𝟒 = 0, 0,1,1 = 0 𝒄𝟒 = 1, 0,1,1 = 1
• 𝒄𝟒 𝒄𝟐 𝒄𝟏 :000 (no error) • 𝒄𝟒 𝒄𝟐 𝒄𝟏 :100 (Error at position
(100)2 = 410 )
• The corrected code will be:
𝒑𝟏 → 𝟏, 𝟑, 𝟓, 𝟕
𝒑𝟐 → 𝟐, 𝟑, 𝟔, 𝟕 1 1 0 0 1 1 0
𝒑𝟒 → 𝟒, 𝟓, 𝟔, 𝟕
Propositional Logic
• Logic is the basis of all mathematical reasoning and of all automated
reasoning.
• Propositions: A proposition is a declarative sentence (that is, a sentence
that declares a fact) that is either true or false, but not both. A proposition
ia a basic building blocks of logic.
• Eg:
• 1 + 1 = 2.
• Toronto is the capital of Canada.
• What time is it?
• x + 1 = 2.
• Propositional variables (or statement variables): Variables that
represent propositions. The conventional letters used for
propositional variables are p, q, r, s, . . . .
• If the proposition is true, it is denoted by T. If the proposition is false,
it is denoted by F.
• The area of logic that deals with propositions is called the
propositional calculus or propositional logic.
T T T F
T F T T
F T T T
F F F F
Only the contrapositive always has the same truth value as p → q. When two
compound propositions always have the same truth value we call them
equivalent. A conditional statement and its contrapositive are equivalent.
Q. What are the contrapositive, the converse, and the inverse of the
conditional statement
“The home team wins whenever it is raining?”
“q whenever p”
q: The home team wins
p: It is raining.
“The home team wins whenever it is raining?”
“q whenever p”
q: The home team wins
p: It is raining.
Q. Let p be the statement “You can take the flight,” and let q be the statement
“You buy a ticket.”
Then p ↔ q is the statement?
Q. Construct the truth table of the compound proposition
(p ∨¬q) → (p ∧ q).
𝑝∧𝑞
Q. Let p, q, and r be the propositions
p : Grizzly bears have been seen in the area.
q : Hiking is safe on the trail.
r : Berries are ripe along the trail.
Write these propositions using p, q, and r and logical connectives (including
negations).
a) Berries are ripe along the trail, but grizzly bears have not been seen in the
area.
b) Grizzly bears have not been seen in the area and hiking on the trail is safe,
but berries are ripe along the trail.
c) If berries are ripe along the trail, hiking is safe if and only if grizzly bears
have not been seen in the area.
d) It is not safe to hike on the trail, but grizzly bears have not been seen in
the area and the berries along the trail are ripe.
e ) Hiking is not safe on the trail whenever grizzly bears have been seen in
the area and berries are ripe along the trail.
p : Grizzly bears have been seen in the area.
q : Hiking is safe on the trail.
r : Berries are ripe along the trail.
Write these propositions using p, q, and r and logical connectives (including negations).
a) Berries are ripe along the trail, but grizzly bears have not been seen in the area.
𝑟 ∧ ¬𝑝
b) Grizzly bears have not been seen in the area and hiking on the trail is safe, but berries are ripe along the
trail.
¬𝑝 ∧ 𝑞 ∧ 𝑟
c) If berries are ripe along the trail, hiking is safe if and only if grizzly bears have not been seen in the area.
𝑟 → (𝑞 ↔ ¬𝑝)
d) It is not safe to hike on the trail, but grizzly bears have not been seen in the area and the berries along the
trail are ripe.
¬ 𝑞 ∧ ¬𝑝 ∧ 𝑟
e ) Hiking is not safe on the trail whenever grizzly bears have been seen in the area and berries are ripe along
the trail.
𝑝 ∧ 𝑟 → ¬𝑞
Q. Let p, q, and r be the propositions and:
but/nevertheless/however/even
p :You get an A on the final exam. so/inspite/yet/though/still/nonetheless/anyhow/an
q :You do every exercise in this book. yway
Q. The automated reply cannot be sent when the file system is full
a: The automated reply can be sent.
f: The file system is full.
𝑓 → ¬𝑎
System specifications should be consistent, that is, they should not contain
conflicting requirements that could be used to derive a contradiction.
Q. Determine whether these system specifications are consistent:
“The diagnostic message is stored in the buffer or it is retransmitted.”
“The diagnostic message is not stored in the buffer.”
“If the diagnostic message is stored in the buffer, then it is retransmitted.”
p: The diagnostic message is stored in the buffer .
q: The diagnostic message is retransmitted.
𝑝∨𝑞
¬𝑝 p q 𝑝∨𝑞 ¬𝑝 𝑝→𝑞
𝑝→𝑞 T T T F T
T F T F F
F T T T T
F F F T T
Logic Puzzles: Puzzles that can be solved using logical reasoning are known as logic puzzles.
• An island that has two kinds of inhabitants, knights, who always tell the truth, and their opposites,
knaves, who always lie. You encounter two people A and B. What are A and B if A says “B is a
knight” and B says “The two of us are opposite types?”
• Let
• 𝑝 : A is a knight. and ¬𝑝: A is knave
• 𝑞: B is a knight. and¬𝑞: B is knave
Assume A is a knight.
If A is a knight, then he is telling the truth when he says that B is a knight.
However, if B is a knight, then B’s statement that A and B are of opposite types contradicts. We can
conclude that A is not a knight, that is, that p is false.
Assume A is a knave.
If A is a knave, then everything A says is false. A’s statement that B is a knight is a lie. Means that q is
false and B is also a knave. If B is a knave, then B’s statement that A and B are opposite types is a lie
which is consistent with both A and B being knaves.
• We can conclude that both A and B are knaves.
Logic Circuits
• De Morgan laws:
1. ¬(p ∧ q) ≡ ¬p ∨¬q
2. ¬(p ∨ q) ≡ ¬p ∧¬q
Q. Show that ¬(p ∨ q) and ¬p ∧¬q are logically equivalent.
Q. Show that p ∨ (q ∧ r) and (p ∨ q) ∧ (p ∨ r) are logically equivalent.
Equivalence Name
p∧T≡p Identity laws
Logical Equivalences. p∨F≡p
p∨T≡T Domination laws
p∧F≡F
p∨p≡p Idempotent laws
p∧p≡p
¬(¬p) ≡ p Double negation law
p∨q≡q∨p Commutative laws
p∧q≡q∧p
(p ∨ q) ∨ r ≡ p ∨ (q ∨ r) Associative laws
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)
p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r) Distributive laws
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)
¬(p ∧ q) ≡ ¬p ∨¬q De Morgan’s laws
¬(p ∨ q) ≡ ¬p ∧¬q
p ∨ (p ∧ q) ≡ p Absorption laws
p ∧ (p ∨ q) ≡ p
p ∨¬p ≡ T Negation laws
p ∧¬p ≡ F
Logical Equivalences
Involving Conditional Statements.
• p → q ≡ ¬p ∨ q
• p → q ≡ ¬q →¬p
• p ∨ q ≡ ¬p → q
• p ∧ q ≡ ¬(p →¬q)
• ¬(p → q) ≡ p ∧¬q
• (p → q) ∧ (p → r) ≡ p → (q ∧ r)
• (p → r) ∧ (q → r) ≡ (p ∨ q) → r
• (p → q) ∨ (p → r) ≡ p → (q ∨ r)
• (p → r) ∨ (q → r) ≡ (p ∧ q) → r
Logical Equivalences Involving
Biconditional Statements.
• p ↔ q ≡ (p → q) ∧ (q → p)
• p ↔ q ≡ ¬p ↔¬q
• p ↔ q ≡ (p ∧ q) ∨ (¬p ∧¬q)
• ¬(p ↔ q) ≡ p ↔¬q
Q. Show that ¬(p → q) and p ∧¬q are logically equivalent.
(p ∧ q) → (p ∨ q) ≡ ¬(p ∧ q) ∨ (p ∨ q)
≡ (¬p ∨¬q) ∨ (p ∨ q) by the first De Morgan law
≡ (¬p ∨ p) ∨ (¬q ∨ q) by the associative and commutative
laws for disjunction
≡T∨T
≡ T by the domination law
Propositional Satisfiability
A compound proposition is satisfiable if there is an assignment of truth
values to its variables that makes it true. When no such assignments exists,
that is, when the compound proposition is false for all assignments of truth
values to its variables, the compound proposition is unsatisfiable.
Q. Determine whether each of the compound propositions
i. (p ∨¬q) ∧ (q ∨¬r) ∧ (r ∨¬p)
ii. (p ∨ q ∨ r) ∧ (¬p ∨¬q ∨¬r), is satisfiable.
i, When p=T; q=T; r=T; (p ∨¬q) ∧ (q ∨¬r) ∧ (r ∨¬p) will be T, hence it
satisfiable
Q. Show that each of these conditional statements is a tautology
a) (p ∧ q) → p b) p → (p ∨ q)
c) ¬p → (p → q) d) (p ∧ q) → (p → q)
e) ¬(p → q) → p f ) ¬(p → q)→¬q
a) (p ∧ q) → p ≡ ¬ 𝑝 ∧ 𝑞 ∨ 𝑝 ≡ ¬𝑝 ∨ ¬𝑞 ∨ 𝑝 ≡ ¬𝑝 ∨ 𝑝 ∨ ¬𝑞 ≡ 𝑇 ∨ ¬𝑞 ≡ 𝑇
f) ¬(p → q)→¬q ≡ ¬(¬𝑝 ∨ 𝑞) → ¬𝑞 ≡ (𝑝 ∧ ¬𝑞) → ¬𝑞
≡ ¬(𝑝 ∧ ¬𝑞) ∨ ¬𝑞 ≡ ¬𝑝 ∨ 𝑞 ∨ ¬𝑞 ≡ ¬𝑝 ∨ 𝑇 ≡ 𝑇
L.H.S
¬(p ↔ q) ≡ ¬ 𝑝 → 𝑞 ∧ 𝑞 → 𝑝
≡ ¬ ¬𝑝 ∨ 𝑞 ∧ ¬𝑞 ∨ 𝑝
≡ ¬ ¬𝑝 ∧ ¬𝑞 ∨ (¬𝑝 ∧ 𝑝) ∨ (𝑞 ∧ ¬𝑞) ∨ 𝑞 ∧ 𝑝
≡ ¬ ¬𝑝 ∧ ¬𝑞 ∨ 𝐹 ∨ 𝐹 ∨ 𝑞 ∧ 𝑝
≡ ¬ ¬𝑝 ∧ ¬𝑞 ∧ 𝑇 ∧ 𝑇 ∧ ¬ 𝑞 ∧ 𝑝
≡ 𝑝 ∨ 𝑞 ∧ ¬𝑞 ∨ ¬𝑝
≡ ¬𝑝 → 𝑞 ∧ 𝑞 → ¬𝑝
≡ ¬𝑝 ↔ 𝑞
Q. Show that ¬(p ↔ q) and p ↔ ¬ q are logically equivalent.
L.H.S.
p → q ≡ ¬𝑝 ∨ 𝑞
≡ 𝑞 ∨ ¬𝑝
≡ ¬(¬𝑞) ∨ ¬𝑝
≡ ¬q →¬p
Q. Show using truth table, ¬(p ⊕ q) and p ↔ q are logically
equivalent.
Q. Show that ¬(p ⊕ q) and p ↔ q are logically equivalent without
using truth table.
Hint: A ⊕ B=A𝐵+ത 𝐴ҧ B
Q. Determine whether [(p ∨ q) ∧ (¬p ∨ r)] → (q ∨ r) is a tautology or
not.
Q. Show that (p → q) → r and p → (q → r) are not logically equivalent.
Q. 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)?
Eg: Let P(x) be the statement “x + 1 > x.” What is the truth value of the quantification
∀xP(x), where the domain consists of all real numbers?
• Because P(x) is true for all real numbers x, the quantification ∀xP(x) is true.
Eg: Let Q(x) be the statement “x < 2.” What is the truth value of the quantification
∀xQ(x), where the domain consists of all real numbers?
• 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 ∀xQ(x). Thus ∀xQ(x) is false.
• The existential quantification of P(x) is the proposition
“There exists an element x in the domain such that P(x).”
We use the notation ∃xP(x) for the existential quantification of P(x).
Here ∃ is called the existential quantifier.
• Besides the phrase “there exists” we can also express existential
quantification in many other ways, such as by using the words “for
some,” “for at least one,” or “there is.”
• Eg: Let P(x) denote the statement “x > 3.” What is the truth value of
the quantification ∃xP(x), where the domain consists of all real
numbers?
• Because “x > 3” is sometimes true—for instance, when x = 4 the
existential quantification of P(x), which is ∃xP(x), is true.
Statement When True? When False?
∀xP(x) P(x) is true for every x. There is an x for which P(x) is false
∃xP(x) There is an x for which P(x) is true. P(x) is false for every x.
¬∃xP(x) ∀x¬P(x)
¬∀xP(x) ∃x¬P(x)
Q. What are the negations of the statements “There is an honest politician” and “All Americans eat
cheeseburgers”?
Let H(x) denote “x is honest.”
“There is an honest politician” is represented by ∃xH(x), where the domain consists of all politicians.
The negation of this statement is ¬∃xH(x), which is equivalent to ∀x¬H(x).
“Every politician is dishonest.”
In English, the statement “All politicians are not honest” is ambiguous, this statement often means “Not all
politicians are honest.”
• “All Americans eat cheeseburgers”
“There is a person x having the properties that x is a student in this class and x
has visited Mexico.”
S(x): x is a student in this class.
M(x): x has visited Mexico.
∃𝑥(𝑆(𝑥) ∧ 𝑀 𝑥 ), where the domain consist of all people.
Q. “For every student x in this class, x has the property that x has visited Mexico or x has visited
Canada.”
M(x): x has visited Mexico.
C(x): x has visited Canada.
∀𝑥(𝐶(𝑥) ∨ 𝑀 𝑥 ), where domain consist of student in the class.
Q. “For every person x, if x is a student in this class, then x has visited Mexico or x has visited Canada.”
S(x): x is a student in this class.
M(x): x has visited Mexico.
C(x): x has visited Canada.