Propositional Logic: Logic and Problem Solving
Propositional Logic: Logic and Problem Solving
Welcome
to Islington
College !!!
Congratulations for choosing the best IT college in
Nepal !!!
Agenda
• Module Introduction
Your Module Leader
Module Objective
Module Assessments and Syllabus Summary
Recommended booklist
• Week 1 Lecture Coverage
– Introduction to logic
– Proposition and compound Proposition
– Truth tables
Module Leader
Ashok Dhungana,
MSc. IT, TU, Nepal
Sr. Lecturer , Islington College.
ashok.dhungana@islingtoncollege.edu.np
Islington.ashok@gmail.com
01- 4412929
Your Lecturer
Mr. Ashok Dhungana Mr. Prakash Adhikari
Masters in Computer Science (Nepal) Masters in Computer Science (France)
ashok.dhungana@islingtoncollege.edu.np prakash.adhikari@islingtoncollege.edu.np
Your Tutor
Mr. Indra Dhakal
Masters in Applied Mathematics (Germany)
indra.dhakal@islingtoncollege.edu.np
•
•
•
Your Tutor
Mr. Nadil Paudel
M.A (Mathematics)
Tribhuvan University Nepal
nadil.paudel@islingtoncollege.edu.np
Introduction to the Module
• Overview of Module
- What can you expect?
• Learning Objectives
- How will you benefit?
• Learning Strategy
- How will you learn?
• Assessment Overview
- How you will be tested?
Overview of Module
• Logic and Problem solving
Aim:
This module seeks to consolidate and improve student's
Puzzles: developing logical reasoning ,introducing systematic approach to solving puzzles, developing
appropriate strategies to solve puzzles.
Algorithms : Understanding how problems can be solved systematically, plan their solutions and write
them in the form of algorithms.
Linear Programming :Math of finance and Break-even analysis using excel as tool.
Learning Objectives
Computer
Programming
Hardware
Computer graphics
Databases
Design Logic and Problem solving
Learning Strategy
• Taught over 2 semester (30 weeks )
60 - 69 B Very Good: above the average standard but with some errors
l336nkz
Please feel free to visit IT Department if you have any problems
with Google classroom.
Any Questions?
Let’s get started with Lecture 1
Example ->
p = Java is an object-oriented language.
Meaning,
p represents the proposition “Java is an object-oriented language”
Primitive and Compound
Propositions:
p: Kathmandu is in either Nepal or UK.
This proposition is made up of two simpler propositions.
q: Kathmandu is in Nepal.
r: Kathmandu is in UK.
In the above example “p” is combination of two propositions called
compound proposition.
In the above example, compound proposition is connected by “or” which
is called connective.
Compound Propositions:
A compound proposition is an expression
P(p, q, r, ...), which consists of propositional variables p, q, r, ... joined
together by the logical connectives ∧, V and ¬.
Example ->
p: Kathmandu is the capital of Nepal.
¬ p: Kathmandu is not the capital of Nepal.
Here p is true but ¬ p is false
Examples: Its your turn..
Consider the propositions : p, q ,r and s
p is F, q is T, r is T and s is F. Using the definitions of ∧, ∨ and ¬. Find the truth
value for the following:
1. p ∧ ¬q is ?
2. q V ¬r is ?
3. ¬s V q is ?
Answers:
1.F
2.T
3.T
Use of Brackets:
When there are more than one logical connectives, their operation can
be determined by using braces.
For example:
(p ∨ q) ∧ r means first evaluate w = (p ∨ q) and then evaluate w ∧
r.
Use of Brackets Example:
Let ,
p: Kathmandu is the capital of Nepal. T
q: Delhi is the capital of China. F
r: Tokyo is the capital of Pakistan. F
p ¬p
T F
F T
The above is the truth table for negation.
Truth Tables (Continued):
Similarly,
-conjunction:(p
Truth table for ∧ q)
p q p∧q
T T T
T F F
F T F
F F F
Truth Tables (Contd.):
Similarly,
-disjunction:
Truth table for
(p q)
p q pq
T T T
T F T
F T T
F F F
Truth Tables (Contd.):
Note:
1. Truth table provides an equivalent definition for the propositions ¬p, p ∧ q,
and p ∨ q.
2. The truth table for a proposition with n atomic propositions will have 2n
rows.
Example ->
If we have two propositions, p and q, then there are 22 = 4 number of rows.
Truth Tables (Contd.):Try it…
Example: Draw the truth table for p ∧ (q ∨ r)
p q r q∨r p ∧ (q ∨ r)
T T T T T
T T F T T
T F T T T
T F F F F
F T T T F
F T F T F
F F T T F
F F F F F
Any Questions?
Exercises: Its your Turn….
d. p ∨ q e. q ∨ ¬ p
Exercises: Its Your Turn…
3. Write down the truth table for
a. p ∧ (¬q)
b. (¬p) ∧ (¬q)
c. ¬ (p ∧ q)
d. p ∧ (q ∨ r)
e. (p ∧ q) ∨ r
f. ¬ p ∧ q
g. p ∧ (false ∧ q)
Any Questions?
Summary: Week 1 Lecture