Discrete Structures (w3)

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 36

Discrete Structures

Week 03
BSCS 3rd Semester (7A + 7B + 7C)
 Text Book:
Discrete Mathematics and its Applications by KENNET
H.ROSEN , 7th Edition.

 Reference Material
Applied Discrete Structures by Alan Doerr and Kenneth
Levasseur , 2.0 Edition, Published by University of
Massachusetts Lowell (Year: 2013)
Week 03 Contents
 Conditional Statements and its negation.
 Converse, inverse and contrapositive
 Translation from and to informal language.
 Checking system specification statements
 Solving riddles and statement analysis
problems
Negation of Conditional Statements ~(P→Q)

p q p→q ~(p → q)

T T T F

T F F T

F T T F

F F T F
Converse, inverse and
contrapositive
Hypothesis and Conclusion
 A conditional statement consists of two parts,

 A Hypothesis in the “if” clause

 A Conclusion in the “then” clause.

 For instance, “If it rains, then they cancel school.”

 Example
1. "It rains" is the hypothesis.
"They cancel school" is the conclusion.

2. “If it is raining” is the hypothesis

“then the grass is wet” is the conclusion


Identify Hypothesis and Conclusion
 If you pay your power bill, then you will have electricity.

Hypothes Conclusio
is n

 If you do not buy firewood, then you will be cold.

Hypothes Conclusio
is n

 If it is cold, then it might be snowing.

Hypothes Conclusio
is n
Converse
 To form the converse of the conditional statement, interchange
the hypothesis and the conclusion.

 for p  q, converse will be q  p

p q p→q (q → p)

T T T T

T F F T

F T T F

F F T T
Inverse
 To form the inverse of the conditional statement, take the
negation of both the hypothesis and the conclusion..

 for p  q, inverse will be ~p  ~q

~p 
p q p→q ~p ~q
~q
T T T F F T

T F F F T T

F T T T F F

F F T T T T
Contrapositive
 To form the contrapositive of the conditional statement,
interchange the hypothesis and the conclusion of the inverse
statement.

 for p  q, contrapositive will be ~q  ~p


p q p→q ~p ~q ~q  ~p

T T T F F T

T F F F T F

F T T T F T

F F T T T T
Converse, Inverse and
Contrapositive
Statement If p , then q . pq

Converse If q , then p . qp

Inverse If not p , then not q . ~p  ~q

Contrapositive If not q , then not p . ~q  ~p


Converse, Inverse and
Contrapositive
Conditional
If it is Raining
Statement Then field is wet
(if p then q)

Inverse If it is not raining,


(if not p, then not q) Then the field is not wet

Converse If the field is wet,


(if q, then p) Then it is raining

Contrapositive If the field is not wet,


(if not q, then not q) Then it is not raining
Converse, Inverse and
Contrapositive
Conditional
If you do your homework,
Statement then you will pass in Math 8
(if p then q)

If you do not do your


Inverse homework,
(if not p, then not q) then you will not pass in Math 8

Converse If you passed in Math 8,


(if q, then p) then you did your homework

If you do not pass in Math 8,


Contrapositive then you do not do your
(if not q, then not q) homework.
Class Practice
Conditional
If an Object is a Triangle,
Statement Then it is a Polygon
(if p then q)

Inverse
(if not p, then not q)

Converse
(if q, then p)

Contrapositive
(if not q, then not p)
Class Practice
Conditional
If a Polygon is a Rectangle,
Statement Then it has four sides
(if p then q)

Inverse
(if not p, then not q)

Converse
(if q, then p)

Contrapositive
(if not q, then not p)
SOLUTION..!
Class Practice (Solution)
Conditional
If an Object is a Triangle,
Statement Then it is a Polygon
(if p then q)

Inverse If an Object is not a Triangle,


(if not p, then not q) Then it is not a Polygon

Converse If an object is a Polygon,


(if q, then p) Then it is a triangle

If an object is not a Polygon,


Contrapositive Then it is not a triangle
(if not q, then not p)
Class Practice (Solution)
Conditional
If a Polygon is a Rectangle,
Statement Then it has four sides
(if p then q)

Inverse If a Polygon is not a Rectangle,


(if not p, then not q) Then it does not have four sides

Converse If a polygon has four sides,


(if q, then p) Then it is a Rectangle

If a polygon does not have four


Contrapositive sides,
(if not q, then not p) Then it is not a Rectangle
Translation From and
To Informal Language.
Translation from and to informal language.

 Translation from and to Informal Language


is an important concept in Discrete Mathematics.
It involves converting formal logic statements
(using propositional logic symbols) into natural
language (informal language) and vice versa.
This helps bridge the gap between mathematical
reasoning and real-world communication
Translation from and to informal language.

 This process involves identifying the logical


structure in natural language statements and
expressing it using symbols of propositional logic.

 Key Logical Connectors:


 Negation (¬): "not," "it is false that"
 Conjunction (∧): "and," "both"
 Disjunction (∨): "or," "either"
 Conditional (→): "if...then," "implies"
 Biconditional (↔): "if and only if"
Translation from Informal to Formal Language

Example 1:
 Informal: "If it rains, then the ground will be wet."
 Formal: P→Q where
 P: "It rains," and Q: "The ground will be wet."

Example 2:
 Informal: "I will go to the party if and only if my
friend goes."
 Formal: P↔Q where
 P: "I will go to the party," and Q: "My friend goes."
Translation from Informal to Formal Language

Informal Statement Formal Statement

"It is raining and cold." P∧Q

"If the light is on, then the room


P→Q
is bright."

"I will eat pizza or pasta." P∨Q

"I will go to the gym if and only if


P↔Q
I feel energetic."
Translation from Formal to Informal Language

Example 1:
Formal: P∧Q
Informal: “I will study and complete my homework.”
Here, P: “I will study," and Q: "I will complete my
homework.”

Example 2:
Formal: P∨¬Q
Informal: "I will go to the park or I will not stay home."
Here, P: "I will go to the park," and Q: "I will stay
home."
Translation from Formal to Informal Language

Formal Statement Informal Statement

P∨Q "Either I will read a book or watch TV."

¬P→Q "If I do not study, then I will fail."

P∧¬Q "I will exercise and not eat junk food."


Steps for Translation
From Informal to From Formal to
Formal Informal:
 Identify the components:  Interpret the symbols:
Break the statement into Recognize what each symbol
smaller parts (propositions). (¬,∧,∨,→,↔) represents.
 Determine the  Rephrase naturally:
connectors: Look for words
like "and," "or," "if...then," Convert the logical
and translate them into relationship into a natural
logical symbols. language statement.
  Maintain logical accuracy:
Combine logically:
Use parentheses for Ensure the informal
clarity and ensure proper statement reflects the same truth
logical structure conditions.
Informal to Formal (Examples)
1. "If I go to the park or I go to the movie, then I will not pass
the exam."
Formal:(P∨Q)→¬R
Where:
 P: “I go to the park”
 Q: "I go to the movie”
 R: "I pass the exam"
2. "If I study and I attend the lecture, then I will pass the test.“
Formal: (P∧Q)→R
Where:
 P: "I study”
 Q: "I attend the lecture”
 R: "I pass the test”
Formal to Informal (Examples)
P: "I pass the course”

Q: "I submit all assignments”

R: "I perform well in exams”

 P↔(Q∧R)

 I will pass the course if and only if I submit all


assignments and perform well in exams
System Specifications
Translating sentences in natural language (such as
English) into logical expressions is an essential part of
specifying both hardware and software systems. System
and software engineers take requirements in natural
language and produce precise and unambiguous
specifications that can be used as the basis for system
development.
Determine whether these system
specifications are consistent:
1. “The diagnostic message is stored in the buffer or it is
retransmitted.”

2. “The diagnostic message is not stored in the buffer.”

3. “If the diagnostic message is stored in the buffer, then it is


retransmitted.”

 Let p: “The diagnostic message is stored in the buffer”

 Let q :“The diagnostic message is retransmitted.”

The specifications can then be written as

 1. p ∨ q, 2. ¬p, 3. p → q
Determine whether these system
specifications are consistent (Cont..)

p q ~p pVq pq

F T T T T

 we conclude that these specifications are consistent,


because they are all true when p is false and q is
true.
Determine whether these system
specifications are consistent:
1. “The diagnostic message is stored in the buffer or it is retransmitted.”

2. “The diagnostic message is not stored in the buffer.”

3. “If the diagnostic message is stored in the buffer, then it is


retransmitted.”

4. The diagnostic message is not retransmitted

 Let p: “The diagnostic message is stored in the buffer”

 Let q :“The diagnostic message is retransmitted.”

The specifications can then be written as

 1. p ∨ q, 2. ¬p, 3. p → q 4. ~q
Determine whether these system
specifications are consistent:
1. “The diagnostic message is stored in the buffer or it is
retransmitted.”

2. “The diagnostic message is not stored in the buffer.”

3. “If the diagnostic message is stored in the buffer, then it is


retransmitted.”

4. The diagnostic message is not retransmitted

 This new specification is ¬q, which is false


when q is true. Consequently, these four
specifications are inconsistent.
Are these system specifications consistent?

1. “Whenever the system software is being upgraded, users


cannot access the file system.”

2. “If users can access the file system, then they can save new
files.”

3. “If users cannot save new files, then the system software is not
being upgraded.”
System specifications consistent (Solution)

1. “Whenever the system software is being upgraded, users cannot


access the file system.”

2. “If users can access the file system, then they can save new files.”

3. “If users cannot save new files, then the system software is not
being upgraded.”

 P: The system software is being upgraded.

 Q: Users can access the file system.

 R: Users can save new files.

The specifications can then be written as

 1. P  ~Q, 2. Q  R, 3. ~R → ~P
System specifications Consistent (Solution)

~R 
P Q R P  ~Q QR
~P

F T T T T T

 We conclude that these specifications are


consistent, because they are all true when P =
FALSE, Q = TRUE, and R = TRUE

You might also like