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

Lecture01 (Unit1, Module1-MathLogic Proposition LogicalOps-AND, OR, NOT, XOR Imply BiImply)

Uploaded by

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

Lecture01 (Unit1, Module1-MathLogic Proposition LogicalOps-AND, OR, NOT, XOR Imply BiImply)

Uploaded by

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

8/18/2024

CS34110 Discrete Mathematics and Graph Theory

UNIT – I, Module – 1

Lecture 01: Logic

[ Mathematical logic; Proposition; Connectives;


Conjunction; Disjunction; Negation; Exclusive
disjunction; Implication; Bi-implication ]

Dr. Suddhasil De

Discrete mathematics

• Discrete mathematics: part of mathematics devoted to study


discrete objects.
• Discrete à study of distinct or non-connected elements/objects.
• Discrete structures: representations for discrete objects.
• Examples: sets, collections, combinations, relations, graphs etc.
• Importance of ‘discrete mathematics and graph theory’ study:
programming logic, software development, formal specification
and verification, networking, system development etc.
• Foundation of discrete mathematics: mathematical logic.

Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De


2

Mathematical logic

• Mathematical logic: (commonly) formal study of correct


reasoning;
(rigorously) mathematical properties (particularly, expressive and
deductive ability) of formal system of logic.
• Focus à how to deduce conclusion, starting from premise(s), by
solely following rules of proof system, with being affected by
topic/content of context.
• Categories of mathematical logic: propositional logic, first-order logic,
second-order logic, infinitary logic, intuitionistic logic etc.

Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De


3

1
8/18/2024

Propositional logic

• Propositional logic (also called propositional calculus): area of


mathematical logic dealing with propositions.
• Applications of propositional logic:
a. Translating imprecise/ambiguous English sentences into precise
propositions.
b. Specifying both hardware and software systems into precise and
unambiguous propositions.
c. Expressing custom and complicated search query in of large
collections of information by unambiguous propositions.
d. Designing logic circuits for computer hardware by propositions.
Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De
4

Proposition

• Proposition: declarative factual statement (formed following


syntactic rule, with meaning as per semantic interpretation)
having truth value of either TRUE or FALSE, but not both.
• Examples::
“Ice floats in water.” à Proposition, value = TRUE.
“2 + 2 = 4” à Proposition, value = TRUE.
“India is in Europe.” à Proposition, value = FALSE.
“2 + 2 = 5” à Proposition, value = FALSE.
“Do your homework.” à Not Proposition. “x + 1 = 2” à Not
“Where are you going?” à Not Proposition. Proposition
Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De
5

Proposition

• Two types: (i) primitive; (ii) compound (or composite).


A. Primitive (or atomic) proposition: proposition not able to break
down into simpler subpropositions of respective truth values.
• Examples:: 4 propositions in last slide.
B. Compound proposition: composite proposition, consisting of
subpropositions (with respective truth values) and connectives to
combine them.
• Examples::
“I am smart AND I revise before class.” à Compound proposition.
“I am smart OR I revise before class.” à Compound proposition.
Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De
6

2
8/18/2024

Proposition

B. Compound proposition:
• Truth value of compound proposition  completely determined by
truth values of subpropositions, and manner of connecting them.
• Connective (also called operator): representation of logical
operation, to be performed on truth value(s) of one or more
subpropositions.
Example:: AND ( ∧ ), OR ( ∨ ), NOT ( ¬ ), IMPLIES ( → ) etc.

Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De


7

Propositional variable & Truth function

• Propositional variables (also called sentential variables, or


statement variables): use of letters to denote variables for
representing propositions.
• Conventional letters as propositional variables: , , , , …
• Truth function: function in logic that accepting only truth values as
input and producing a unique truth value as output.

Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De


8

Logical operation

• Logical operation:
• 3 basic “truth-functional” logical operations:
conjunction (due to AND connective; operator notation: ∧);
disjunction (due to OR connective, operator notation: ∨);
negation (due to NOT connective; operator notation: ¬, ‾̄ , ~, ′, !).
• Additional logical operations:
exclusive disjunction (equivalent to XOR connective; operator
notations: ⨁, ∨, ∨̇);
• implication (equivalent to IF…THEN…; operator notation: →);
• bi-implication (equivalent to …IF AND ONLY IF…; operator: ).
Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De
9

3
8/18/2024

Logical operation: Conjunction

• Conjunction of given propositions: combining truth values of any


two or more given propositions (when connected by AND
connective in any compound proposition), using operator ∧.
• ∧ [read: “ and ”]: conjunction of and , to form compound
proposition “ AND ”, for given propositions , , having truth value
depending only on , . Truth ∧
• Definition of truth value of ∧ : table T T T
if both and to be TRUE, T F F
then ∧ to become TRUE; F T F
otherwise ∧ to become FALSE. F F F
Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De
10

Logical operation: Conjunction

• Conjunction:
• Example-1::
= “Ice floats in water.” à ’s value = TRUE.
= “2 + 2 = 4” à ’s value = TRUE.
∧ = “Ice floats in water AND 2 + 2 = 4.” à value of ∧ = TRUE.
• Example-2::
= “Ice floats in water.” à ’s value = TRUE.
= “2 + 2 = 5” à ’s value = FALSE.
∧ = “Ice floats in water AND 2 + 2 = 5.” à value of ∧ =
FALSE.
Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De
11

Logical operation: Conjunction

• Conjunction:
• Example-3::
= “India is in Europe.” à ’s value = FALSE.
= “2 + 2 = 4” à ’s value = TRUE.
∧ = “India is in Europe AND 2 + 2 = 4.” à value of ∧ = FALSE.
• Example-4::
= “India is in Europe.” à ’s value = FALSE.
= “2 + 2 = 5” à ’s value = FALSE.
∧ = “India is in Europe AND 2 + 2 = 5.” à value of ∧ = FALSE.

Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De


12

4
8/18/2024

Logical operation: Disjunction

• Disjunction of given propositions: combining truth values of any


two or more given propositions (when connected by inclusive-OR
connective in any compound proposition), using operator ∨.
• ∨ [read: “ or ”]: disjunction of and , to form compound
proposition “ OR ”, for given propositions , , having truth value
depending only on , . Truth ∨
• Definition of truth value of ∨ : table T T T
if both and to be FALSE, T F T
then ∨ to become FALSE; F T T
otherwise ∨ to become TRUE. F F F
Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De
13

Logical operation: Disjunction

• Disjunction:
• Example-1::
= “Ice floats in water.” à ’s value = TRUE.
= “2 + 2 = 4” à ’s value = TRUE.
∨ = “Ice floats in water OR 2 + 2 = 4.” à value of ∨ = TRUE.
• Example-2::
= “Ice floats in water.” à ’s value = TRUE.
= “2 + 2 = 5” à ’s value = FALSE.
∨ = “Ice floats in water OR 2 + 2 = 5.” à value of ∨ = TRUE.

Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De


14

Logical operation: Disjunction

• Disjunction:
• Example-3::
= “India is in Europe.” à ’s value = FALSE.
= “2 + 2 = 4” à ’s value = TRUE.
∨ = “India is in Europe OR 2 + 2 = 4.” à value of ∨ = TRUE.
• Example-4::
= “India is in Europe.” à ’s value = FALSE.
= “2 + 2 = 5” à ’s value = FALSE.
∨ = “India is in Europe OR 2 + 2 = 5.” à value of ∨ = FALSE.

Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De


15

5
8/18/2024

Logical operation: Negation

• Negation of given proposition: modifying truth value of any given


proposition (by ― (i) preceding with “It is not true that” or “It is
false that” or “It is not the case that” connectives, or (ii) possibly
inserting “negate” meaning inside given proposition, to form
compound proposition), using operators ‘¬’, ‘′’ or ‘ ’.
• ¬ [read: “not ”]: negation of , to form compound proposition “¬ ”,
for given proposition , having truth value depending only on .
• Definition of truth value of¬ (or ′ or ̅ ): Truth ¬
if to be TRUE, then ¬ to become FALSE; table T F
and, if to be FALSE, then ¬ to become TRUE. F T
Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De
16

Logical operation: Negation

• Negation:
• Example-1::
= “Ice floats in water.” à ’s value = TRUE.
¬ = “It is false that ice floats in water.” à value of ¬ = FALSE.
• Example-2::
= “Ice floats in water.” à ’s value = TRUE.
¬ = “Ice does not float in water.” à value of ¬ = FALSE.
• Example-3::
= “2 + 2 = 5” à ’s value = FALSE.
¬ = “2 + 2 ≠ 5.” à value of ¬ = TRUE.
Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De
17

Logical operation: Negation

• Negation:
• Other used notations (apart from ¬ ): , ~ , ′, ! , etc.

Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De


18

6
8/18/2024

Logical operation: Exclusive disjunction

• Exclusive disjunction of given propositions: combining truth


values of any two or more given propositions (when connected by
exclusive-OR connective in form (i) “Either…or…”, (ii) “Either…
or…, but not both” in any compound proposition), by operator ⨁.
• ⨁ [read: “ xor ”]: exclusive disjunction of and , for “EITHER
OR ”, of given propositions , . Truth ⨁
• Definition of truth value of ⨁ : table T T F
if exactly one of and to be TRUE, T F T
then ⨁ to become TRUE; F T T
otherwise ⨁ to become FALSE. F F F
Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De
19

Logical operation: Exclusive disjunction

• Exclusive disjunction:
• Example-1::
= “At 8:30AM on Monday, I attend lecture of CS34110.”
à ’s value = TRUE.
= “At 8:30AM on Monday, I attend lecture of CS34105.”
à ’s value = TRUE.
⨁ = “At 8:30AM on Monday, I attend lecture of EITHER
CS34110 OR CS34105, IS FALSE.”
à value of ⨁ = FALSE.

Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De


20

Logical operation: Exclusive disjunction

• Exclusive disjunction:
• Example-2::
= “At 8:30AM on Monday, I attend lecture of CS34110.”
à ’s value = TRUE.
= “It is not the case that at 8:30AM on Monday, I attend lecture of
CS34105.”
à ’s value = FALSE.
⨁ = “At 8:30AM on Monday, I attend lecture of EITHER
CS34110 OR CS34105.”
à value of ⨁ = TRUE.
Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De
21

7
8/18/2024

Logical operation: Exclusive disjunction

• Exclusive disjunction:
• Example-3::
= “At 8:30AM on Monday, I DO NOT attend lecture of CS34110.”
à ’s value = FALSE.
= “At 8:30AM on Monday, I attend lecture of CS34105.”
à ’s value = TRUE.
⨁ = “At 8:30AM on Monday, I attend lecture of EITHER
CS34110 OR CS34105.”
à value of ⨁ = TRUE.

Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De


22

Logical operation: Exclusive disjunction

• Exclusive disjunction:
• Example-4::
= “At 8:30AM on Monday, I DO NOT attend lecture of CS34110.”
à ’s value = FALSE.
= “At 8:30AM on Monday, I DO NOT attend lecture of
CS34105.”
à ’s value = FALSE.
⨁ = “At 8:30AM on Monday, I attend lecture of EITHER
CS34110 OR CS34105, IS FALSE.”
à value of ⨁ = FALSE.
Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De
23

Logical operation: Implication

• Implication of given propositions: conditionally combining truth


values of any two given propositions and (when connected by
condition in any compound proposition), by operator ‘→’.
• Other names given to implication:
“ implies ” “ whenever ” “ is sufficient for ”
“if , then ” “ follows from ” “a sufficient condition for is ”
“if , ” “ provided that ” “ only if ”
“ if ” “ unless ¬ ” “a necessary condition for is ”
“ when ” “ is necessary for ”
Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De
24

8
8/18/2024

Logical operation: Implication

• Implication:
• → [read: “ implies ”]: “IF THEN ”, of given propositions , .
• : hypothesis or antecedent or premise;
: conclusion or consequent.
Truth →
• Definition of truth value of → :
table T T T
if to be TRUE and to be FALSE,
T F F
then → to become FALSE;
F T T
otherwise → to become TRUE.
F F T
 Note: when to be FALSE, → to be TRUE
regardless of truth value of .
Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De
25

Logical operation: Implication

• Implication:
• Example-1:: <Politician’s pledge>
= “I win election.” à ’s value = TRUE.
= “I will lower taxes.” à ’s value = TRUE.
→ = “IF I win election, THEN I will lower taxes.”
à value of → = TRUE.
[think as obligation or contract fulfilled]
• Example-2::
’s value = TRUE; ’s value = FALSE.
Value of → = FALSE. [obligation not fulfilled]
Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De
26

Logical operation: Implication

• Implication:
• Example-3::
’s value = FALSE; ’s value = TRUE. [by some influence]
Value of → = TRUE.
• Example-4::
’s value = FALSE; ’s value = FALSE.
Value of → = TRUE. [no obligation]
• Difference from ‘if then ’ construct in programming languages:
: set of executable instructions/statements, instead of proposition;
If ’s value = FALSE, then not to be executed.
Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De
27

9
8/18/2024

Logical operation: Bi-implication

• Bi-implication of given propositions: biconditionally combining


truth values of any two given propositions and (when
connected by conditions in any compound proposition), using
operator ‘ ’.
• Other names given to bi-implication:
“ if and only if ” “ is necessary and sufficient for ”
“ iff ” “if then , and conversely”
“ exactly when ”

Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De


28

Logical operation: Bi-implication

• Bi-implication:
• [read: “ if and only if ”]: “ IF AND ONLY IF ”, of given
propositions , . Truth
• Definition of truth value of : table T T T
if and to have same truth values, T F F
then to become TRUE; F T F
otherwise to become FALSE. F F T
• Property: to become TRUE when both → and → to be
TRUE, and to become FALSE otherwise.
 Note: Truth table of opposite of ⨁ .
Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De
29

Logical operation: Bi-implication

• Bi-implication:
• Example-1::
= “I can board airplane.” à ’s value = TRUE.
= “I get boarding pass.” à ’s value = TRUE.
= “I can board airplane, IF AND ONLY IF I get boarding pass.”
à value of = TRUE. [think as both-way obligation fulfilled]
“IF I can board airplane, THEN I get boarding pass.”
à value of → = TRUE.
“IF I get boarding pass, THEN I can board airplane.”
àvalue of → = TRUE.
Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De
30

10
8/18/2024

Logical operation: Bi-implication

• Bi-implication:
• Example-2::
’s value = TRUE; ’s value = FALSE.
Value of = FALSE. [obligation not fulfilled]
“IF I can board airplane, THEN I do not get boarding pass.”
à value of → = FALSE.
“IF I do not get boarding pass, THEN I can board airplane.”
à value of → = TRUE.

Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De


31

Logical operation: Bi-implication

• Bi-implication:
• Example-3::
’s value = FALSE; ’s value = TRUE.
Value of = FALSE. [obligation not fulfilled]
“IF I can not board airplane, THEN I get boarding pass.”
à value of → = TRUE.
“IF I get boarding pass, THEN I can not board airplane.”
à value of → = FALSE.

Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De


32

Logical operation: Bi-implication

• Bi-implication:
• Example-4::
’s value = FALSE; ’s value = FALSE.
Value of = TRUE. [no obligation]
“IF I can not board airplane, THEN I do not get boarding pass.”
à value of → = TRUE.
“IF I do not get boarding pass, THEN I can not board airplane.”
à value of → = TRUE.

Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De


33

11
8/18/2024

Proposition and connectives: Nutshell

Sentence Variable, Operator Precedence


Simple proposition
Another simple proposition
Negation ¬ 
Conjunction ∧ 
Disjunction ∨ 
Implication → 
Bi-implication 
Exclusive disjunction ⨁
Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De
34

Summary

• Focus: Propositional logic.


• Discrete mathematics, discrete structures, and importance.
• Mathematical logic, propositional logic, and applicability.
• Proposition definition, with examples.
• Primitive and compound propositions.
• Propositional variables definitions.
• Connectives and logical operations of propositional variables.
• Conjunction, (inclusive) disjunction, negation, and exclusive
disjunction definitions, truth tables, with examples.
• Implication and bi-implication definitions and truth tables.

Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De


35

Summary

• Examples of implication and bi-implication.


• Precedence of connectives.

Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De


36

12
8/18/2024

References
1. [Ros19] Kenneth H. Rosen, Discrete Mathematics and its Applications, Eighth
edition, McGraw-Hill Education, 2019.
2. [Mot08] Joe L. Mott, Abraham Kandel, Theodore P. Baker, Discrete
Mathematics for Computer Scientists and Mathematicians, PHI, Second
edition, 2008.
3. [Lip07] Seymour Lipschutz and Marc Lars Lipson, Schaum's Outline of Theory
and Problems of Discrete Mathematics, Third edition, McGraw-Hill Education,
2007.

Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De


37

Further Reading

• Proposition:: [Ros19]:2-3.
• Logical operation:conjunction:: [Ros19]:4.
• Logical operation:disjunction:: [Ros19]:4-5.
• Logical operation:negation:: [Ros19]:3-4.
• Logical operation:exclusive disjunction:: [Ros19]:5-6.
• Logical operation:implication:: [Ros19]:6-9.
• Logical operation:bi-implication:: [Ros19]:10.

Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De


38

Lecture Exercises: Problem 1 [Ref: Gate 2017, Q.11, p.5 (Set2)]

Let , , denote the statements “It is raining”, “It is cold”, and “It is
pleasant”, respectively. Then the statement “It is not raining and it is
pleasant, and it is not pleasant only if it is raining and it is cold” is
represented by _____.

Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De


39

13
8/18/2024

Lecture Exercises: Problem 1 Ans

• = “It is raining”. = “It is cold”. = “It is pleasant”.


•  “It is NOT raining” = ¬ .
•  “It is NOT raining AND It is pleasant” = (¬ ∧ ).
• Again, “It is NOT pleasant” = ¬ .
• Also, “It is raining AND It is cold” = ( ∧ ).
•  “It is NOT pleasant ONLY IF It is raining AND It is cold” =
¬ → ( ∧ ).
•  Combining, “((It is NOT raining) AND It is pleasant), AND ((It is NOT
pleasant) ONLY IF (It is raining AND It is cold))” =
(¬ ∧ ) ∧ (¬ → ( ∧ )).

Discrete Mathematics Dept. of CSE, NITP Dr. Suddhasil De


40

14

You might also like