Lecture Week -1 -Propositional Logic
Lecture Week -1 -Propositional Logic
or
Change Profile to Silent Mode
Do you Know Bill Gates?
Logic and Problem Solving
(Module Code:-MA4001NP)
Lecture -1
Propositional Logic
• Introduction and Overview of Module
• Introduction to Propositional Logic
22 September, 2019
Google classroom code: ybghho
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 table
4
Module Leader/Tutor
Aananda Bhattarai
[email protected]
(B.E. Electronics and Communication, Pokhara
University)
5+ Years Teaching Experience
Working Under MOICT Nepal (Currently NTV
and Radio Nepal)
Working as a Data Analysist @CRWODS,Nepal
ED @Prabidhi IT Solution, Pokhara.
Introduction to the Module
• Overview of Module
– What can you expect?
• Learning Objectives
– How will you benefit?
• Learning Strategy
– How you will learn?
• Assessment Overview
– How you will be tested?
6
Overview of Module
• Logic and Problem solving
Aim:
• Consolidate and improve students’ mathematical
knowledge, skills and concepts.
7
Overview of Module
Syllabus :
Propositional logic
Linear Programming ,Math of finance and Break even analysis using excel as tool
8
Learning
Objectives
Computer
Hardware
Programming
Databases
Design Computer graphics
Logic and Problem solving
9
Learning Strategy
Logic and Problem solving
• Taught over 2 semester (30 weeks )
• Each week consists of 1 Lecture (1.5 Hours) and 2
tutorials (1.5 Hours each)
– Lecture: Learn how to acquire different
mathematical skills
– Tutorial: Review and practice mathematical
problems through in-class assignments to actually
acquire them
10
Module Assessment Summary
Assessments:
Two Class tests: (50% of total module marks)
Week 8(25%) and Week 22(25%)
1.15 hours closed book class test.
13
Text books
1. Maureen Sprankle(2008), Problem Solving and
Programming Concepts ,Prentice Hall.
17
Let’s get started with Lecture 1
19
Why Mathematics is Important ?
When not knowing math can cost you $15000
What can we learn from these 2
videos?
22
Agenda
Week 1 lecture coverage
• Logic and proposition
• Logical Connectives
• Truth tables
23
Logic:
- Study of principles of reasoning.
Example:
Ganesh is a human.
All humans have brain.
Therefore, Ganesh has a brain.
Hence, logical reasoning concludes based on certain
statements.
The fundamental objects in logic are propositions
Proposition:
Proposition is a statement that is either true or false.
It is a building block of logic.
For example:
1. Kathmandu is a city.(True)
2. Java is a programming language.(True)
3. Paper is made of glass.(False)
A proposition is either true or false but not both
True(T) or False(F) is called the truth value of the
proposition
Proposition (Contd.):
Sentences that are “Questions”, “Commands” and
“Opinions” are not valid propositions because they
will/may not have a true or false value.
Examples:
1. How old are you?
2. Go to School.
Proposition (Contd.):
Some examples of valid propositions:
1. Kathmandu is the capital of Nepal.
2. There are 7 days in a week.
3. Isaac Newton was born in 1642.
4. 6 is greater than 8.
Are they valid Propositions or Not?
• What time is it?
• Today is Friday.
• X-5=20.
Proposition Notation:
Proposition is represented by lower case letters for
example: p, q, r, ……, to denote propositional variables.
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.
Joined together by the word “or”
Primitive and Compound Propositions:
Propositions q and r cannot themselves be broken
down into simpler ones. Such propositions are called
primitive.
In the above example “p” is combination of two
propositions called compound proposition.
32
Operations on Propositions:
Main operations on propositions are:
1) Negation/ NOT/ Complement
2) Conjunction/ AND
3) Disjunction/ OR and
4) Conditional
5) Bi-conditional
Negation: (NOT)
Let p be any proposition.
The proposition “not p” or “it is not true that p” is called
the negation of p.
It is written ¬ p and read “not p”.
Example:
p: Kathmandu is the capital of Nepal.
¬ p: Kathmandu is not the capital of Nepal.
Here p is true but ¬ p is false
Negation: (NOT) Contd:
The Truth Table for Negation of a Proposition is as
Follows:
p ¬p Example:-Find the negation of the
proposition “Today is Friday.”
T F
“Today is not Friday.” or “It is not Friday
today.”
F T
Remember this!!
Disjunction: (OR)
Disjunction of two Propositions
Let p and q be given propositions.
The proposition “p or q” is called the disjunction of the
given propositions. It is written p ∨ q and read “p or q”.
Disjunction (Contd.):
Example:
p: Kathmandu is the capital of Nepal.
q: Delhi is the capital of China.
p or q: Kathmandu is the capital of Nepal or Delhi is
the capital of China.
p ∨ q is called the disjunction of the two propositions
p and q.
Disjunction (Contd.):
• The Truth Table for the Disjunction of Two
Propositions is as Follows:-
T F T
Example:- P =Today is Friday.
F T T q = It is raining today.
Then pVq = “Today is Friday or it is
F F F raining today.”
Remember this!!
Examples:
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 p∧q
T
q: Delhi is the capital of China. F
F
r: Tokyo is the capital of Pakistan. F F
F
Then (p ∨ q) ∧ r is false but p ∨ (q ∧ r) is true. pq
T
T
T
F
Use of Brackets Rules:
To minimize the number of brackets in expressions we
will adopt the following order of precedence in which
connectives are applied.
1. Apply connectives within brackets first.
2. The ¬ connective next.
3. “and” and “or”.
Using this convention ¬ p ∧ q will mean (¬ p) ∧ q rather
than ¬ (p ∧ q)
Any Questions?
46
Now Lets Remember the Truth Tables:-
p q p∧q p q pq
p ¬p
T T T T T T
T F T F T
T F F
F T T
F T F T F F F F
F F F
Negation Conjunction Disjunction
49
Exercises:
1. Which of the following are propositions?
a. How tall are you?
b. 2+8=11
c. X+3=4
d. Come here.
e. Mercury is the closest planet to earth.
f. x2 – 16 = 0 has two solutions.
Exercises:
2. Assume that p represents the statement “ Hari is
happy” and q represents the statement “Ram is in
pain”. Write natural language statements (English
sentences) for each of the following propositions:
a. ¬ p b. p ∧ q c. p ∨ ¬ q
d. p ∨ q e. q ∨ ¬ p
Exercises:
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?
53
Summary: Week 1 Lecture
• Logic and proposition
• Logical Connectives
• Truth tables
54
What to Expect: Week 1 Tutorials
55
Thank you