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

DS Lecture01

The document provides an introduction to discrete mathematics. It defines discrete mathematics as concerning processes consisting of individual steps, distinguishing it from calculus which studies continuously changing processes. The document then discusses some key concepts in discrete mathematics including logic, statements, compound statements, and truth tables. Logic is defined as studying the principles that distinguish valid from invalid arguments. Statements are sentences that can be either true or false. Compound statements combine simple statements using logical connectives like "and" and "or". Truth tables specify the truth value of compound statements based on the truth values of their constituent statements.

Uploaded by

Madiha Hena
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

DS Lecture01

The document provides an introduction to discrete mathematics. It defines discrete mathematics as concerning processes consisting of individual steps, distinguishing it from calculus which studies continuously changing processes. The document then discusses some key concepts in discrete mathematics including logic, statements, compound statements, and truth tables. Logic is defined as studying the principles that distinguish valid from invalid arguments. Statements are sentences that can be either true or false. Compound statements combine simple statements using logical connectives like "and" and "or". Truth tables specify the truth value of compound statements based on the truth values of their constituent statements.

Uploaded by

Madiha Hena
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 24

LECTURE # 1

RECOMMENDED BOOKS

1. Discrete Mathematics and Its Applications (eight edition) by


Kenneth H. Rosen
2. Discrete Mathematics with Applications (second edition) by
Susanna S. Epp
3. Discrete Mathematics by Ross and Wright

1
INTRODUCTION
What is Discrete Mathematics?

Discrete Mathematics concerns processes that consist of a sequence of


individual steps.
This distinguishes it from calculus, which studies continuously changing
processes. While the ideas of calculus were fundamental to the science and
technology of the industrial revolution, the ideas of discrete mathematics
underline the science and technology specific to the computer age.

LOGIC

Logic is the study of the principles and methods that distinguishes between
a valid and an invalid argument.
Now what do we mean by the valid and invalid argument, we will study in
our next Lectures.

SIMPLE STATEMENT

A statement is a declarative sentence that is either true or false but not both.
A statement is also referred to as a proposition. So when we say a
statement or Proposition this must be clear to you that these are the same.
2
If a proposition is true, we say that it has a truth value of "true”.
If a proposition is false, its truth value is "false".
The truth values “true” and “false” are, respectively, denoted by the
letters T and F.
EXAMPLES OF STATEMENTS OR PROPOSITIONS:

1. Grass is green.
Grass is green is a statement (or proposition) because the sentence is
true and its truth value is T.( Because everyone knows that grass is
green)
2. 4+2=6
4 + 2 = 6 is also a statement and its truth value is T.(Because 4+2 is 6)
3. 4+2=7
4 + 2 = 7 is also a statement and its truth value is F. ( Because we
know that 4+2 is 6 not 7).Here you should note that both 2 and 3 are
statements although 4+2=7 is mathematically wrong.
4. There are four fingers in a hand.
There are four fingers in a hand is also a statement and its truth value
is false.
5. Washington, D.C, is the capital of the United States of America.
The above statement is also a proposition and its truth value is T.
6. Karachi is the capital of Pakistan. Karachi is the capital of Pakistan is
also a statement and its truth value is F.
7. Pervaiz Musharaf is the president of America.
The above sentence is a statement and its Truth value is false.
3
REMARK: Every sentence is not a statement.
EXAMPLES OF SENTENCES WHICH ARE NOT PROPOSITIONS:

Consider the following sentences


• Close the door.
• x is greater than 2.
• He is very rich
• What time is it ?
• Read this carefully.
• x + z = 10
are not propositions.
REMARK:
If sentence is a question or command , or it is vague or nonsensical,
then it cannot be classified as true or false then the sentence cannot
be a statement or proposition, as easily seen in the above sentences.
The statements which involve variable or pronoun and there are some
information about the variable or pronoun which make the role of
variable clear then the sentence becomes statement.
For example in the last sentence if we say that x=3 and z=7 then this
become a statement and its truth value is T and if we say x=8 and z=4
then the sentence has its truth value as F.
Here is the rule given below

RULE
If the sentence is preceded by other sentences that make the pronoun or
variable reference clear, then the sentence is a statement.

4
EXAMPLES
x=1 is a sentence which gives us the information about the variable
which is in the below sentence. .
x > 2 now using the value above we can see that our sentence takes the
form 1 > 2 now we can talk about its truth value . So
x > 2 is a statement with truth-value FALSE.
Similarly in the next example
Bill Gates is an American
He is very rich.
He is very rich is a statement with truth-value TRUE.

UNDERSTANDING STATEMENTS
1. x + 2 is positive.
The above sentence is not a statement because it is true for some
value of x and false for some values of x. We can say that the
truth value of the statement is vague
2. May I come in?
The above sentence is permission and hence we can't talk about its
truth values so it is also not a statement.
3. Logic is interesting.
Logic is interesting is a statement because logic is interesting and
its truth value is T.
4. It is hot today.
It is hot today is also a statement because whenever we say this
sentence then that day either hot or not so we can assign a truth
value to this sentence.
5. -1 > 0 is also a statement with truth value F
5
• x + y = 12 is not a statement.
COMPOUND STATEMENT
Simple statements could be used to build a compound statement.

EXAMPLES
1. “3 + 2 = 5” and “Lahore is a city in Pakistan”
Here 3 + 2 = 5 is a statement and Lahore is a city in Pakistan is
another statement we combine these two statements by using
and to form another statement and you can talk about its truth
value. Similarly in the next example we combine two statements
by using or to form another statement.
2. “The grass is green” or “ It is hot today”

3. “Discrete Mathematics is not difficult to me”


Here the original statement is Discrete Mathematics is
difficult to me and we form the new statement by using
not.

AND, OR, NOT are called LOGICAL CONNECTIVES.

SYMBOLIC REPRESENTATION

Statements are symbolically represented by letters such as p, q, r,...

EXAMPLES
p = “Islamabad is the capital of Pakistan”
q = “17 is divisible by 3”

6
LOGICAL CONNECTIVES

CONNECTIVE MEANINGS SYMBOL CALLED

Negation not ~ Tilde

Conjunction and  Hat

Disjunction or  Vel

Conditional if…then…  Arrow

Biconditional if and only if  Double arrow

EXAMPLES
p = “Islamabad is the capital of Pakistan”
q = “17 is divisible by 3”
p  q = “Islamabad is the capital of Pakistan and 17 is divisible by 3”
p  q = “Islamabad is the capital of Pakistan or 17 is divisible by 3”
~p = “It is not the case that Islamabad is the capital of Pakistan” or simply
“Islamabad is not the capital of Pakistan”
TRANSLATING FROM ENGLISH TO SYMBOLS
Let p = “It is hot”, and q = “ It is sunny”
SENTENCE SYMBOLIC FORM
1. It is not hot. ~p
2. It is hot and sunny. p q
3. It is hot or sunny. pq
4. It is not hot but sunny. ~ p q
7
5. It is neither hot nor sunny. ~p~q
EXAMPLE

Let h = “Zia is healthy”


w = “Zia is wealthy”
s = “Zia is wise”
Translate the compound statements to symbolic form:

STATEMENTS SYMBOLIC FORM

1. Zia is healthy and wealthy but not wise. (h  w)  (~s)


2. Zia is not wealthy but he is healthy and wise. ~w  (h  s)
3. Zia is neither healthy, wealthy nor wise. ~h  ~w  ~s

TRANSLATING FROM SYMBOLS TO ENGLISH

Let m = “Ali is good in Mathematics”


c = “Ali is a Computer Science student”
Translate the following statement forms into plain English:

STATEMENT FORM STATEMENT

1. ~c Ali is not a Computer Science


student.
2. c m Ali is a Computer Science student or
good in Maths.
3. m~c Ali is good in Maths but not a
Computer Science student.
8
TRUTH TABLE
A convenient method for analyzing a compound statement is to make a truth
table for it.
A truth table specifies the truth value of a compound proposition for all
possible truth values of its constituent propositions.
The truth values “true” and “false” are respectively denoted by the letters
T and F.
NEGATION (~)

If p is a statement variable, then negation of p, “not p”, is denoted as “~p”


It has opposite truth value from p i.e., if p is true, ~p is false; if p is false,
~p is true.
EXAMPLES
1. “Ali is not a Computer Science student” then its negation is “Ali is a
computer Science student”
2. “I like my course of Discrete mathematics ”then its negation is “I don't
like my Discrete mathematics course”
3. “2 + 3 is equal to 5” then its negation is “2 + 3 is not equal to 5”

TRUTH TABLE FOR


~p

p ~p

T F

F T 9
CONJUNCTION ()
If p and q are statements, then the conjunction of p and q is “p and q”,
denoted as “p  q”.
It is true when, and only when, both p and q are true. If either p or q is false,
or if both are false, pq is false.

p q pq
T T T
T F F
F T F
F F F

Note that in the table T is only in that row where both p and q have T
and all other values are F. Thus for finding out the truth values for the
conjunction of two statements we will only first search out where the
both statements are true and write down the T in the corresponding row
in the column of p  q and in all other rows we will write F in the
column of p  q.
DISJUNCTION () or INCLUSIVE OR

If p and q are statements, then the disjunction of p and q is “p or q”,


denoted as “p  q”
It is true when at least one of p or q is true and is false only when both p and
q are false.
10
Note that in the table F is only in that row where both p and q have F
and all other values are T. Thus for finding out the truth values for the
disjunction of two statements we will only first search out where the
both statements are false and write down the F in the corresponding row
in the column of p  q and in all other rows we will write T in the
column of p  q.
Remark:
Note that for Conjunction of two statements we find the T
in both the statements, But in disjunction we find F in both the
statements. In other words we will fill T first in the column of
conjunction and F in the column of disjunction.

SUMMARY

1. What is a statement?
2. How a compound statement is formed.
3. Logical connectives (negation, conjunction, disjunction).
4. How to construct a truth table for a statement form.

11
LECTURE # 1B

STATEMENT FORM

A statement form or propositional form is an expression made up of


statement variables (such as p, q, and r) and logical connectives (such as ~,
,and ) that becomes a statement when actual statements are substituted
for the component statement variable.

TRUTH TABLE FOR A STATEMENT FORM

1. Note the distinct statement variables (such as p, q, r, …) in the


statement form.
2. Write all possible combinations of truth values for the statement
variables. Remember that for n statements variables there are 2n
possible combinations of truth values.
3. Write the truth values for the expression within the innermost
parentheses (expression evaluated left to right), and then within the
next innermost parentheses and so forth, until the complete
expression is evaluated.
Let p and q are the statements then
Negation ~p
is negation of the statement p.
Conjunction pq
is the “and “of the two statements p and q
Disjunction pq
is the “or” of the two statements p and q.
Now we will made some truth tables for practice

12
EXAMPLE
Write truth table for the statement form ~ p  q

p q ~p ~pq
T T F F
T F F F
F T T T
F F T F

Here in order to complete this table we first fill the column for ~p
and from the definition of negation you know that it is false where p is true
and false where p is true.
Then we fill the column for ~ p  q and you know that conjunction of two
statements is true omly when both the statements are true. So ~ p  q is true
only where ~ p and q both have truth values T,which is third row . Hence we
have T in the column of ~ p  q in the third row and write down F in all other
entries.
EXAMPLE
Construct truth table for ~ p  (q  ~ r)

p q r ~r q~r ~p ~ p  (q  ~ r)
T T T F T F F
T T F T T F F
T F T F F F F
T F F T T F F
F T T F T T T
F T F T T T T
F F T F F T F 13
F F F T T T T
EXAMPLE

Truth table for (pq)  ~ (pq)

p q pq pq ~ (pq) (pq)  ~ (pq)


T T T T F F
T F T F T T
F T T F T T
F F F F T F

LOGICAL EQUIVALENCE

Two statement forms are called logically equivalent if, and only if, they
have identical truth values for all possible truth values for their statement
variables.
The logical equivalence of statement forms P and Q is denoted by writing
P  Q.

EXAMPLE
Double Negative Property ~(~p)  p

p ~p ~(~p)
T F T
F T F

Same Truth Values


14
So by the logical equivalence we have ~(~p)  p
EXERCISE

Rewrite in a simpler form:


“It is not true that I am not happy”
Solution:
Let p = “I am happy”
then ~ p = “I am not happy”
and ~(~ p) = “It is not true that I am not happy”
Since ~(~p)  p
Hence the given statement is equivalent to: “I am happy”
The above example shows that using logic we can show that complicated
statements are simple

EXAMPLE

~(pq) and ~p  ~q are not logically equivalent

p q ~p ~q pq ~(pq) ~p  ~q

T T F F T F F
T F F T F T F
F T T F F T F
F F T T F T T

Note that the entries in the last two columns are the same . Hence
the statements forms are logically equivalent that is
~(pq) and ~p  ~q are not logically equivalent
15
DE MORGAN’S LAWS

1) The negation of an and statement is logically equivalent to the or


statement in which each component is negated.
Symbolically ~(p  q)  ~p  ~q.
2) The negation of an or statement is logically equivalent to the and
statement in which each component is negated.
Symbolically: ~(p  q)  ~p  ~q.
Now we will prove the part one of the Demorgan`s Law by using truth
table, you should remember whenever two expressions are logically
equivalent. The first part of the Law is

~(p  q)  ~p  ~q

p q ~p ~q pq ~(p  q) ~p  ~q

T T F F T F F
T F F T T F F
F T T F T F F
F F T T F T T

APPLYING
DE MORGAN’S LAWS

Give negations for each of the following statements:


a. The fan is slow or it is very hot.
b. Akram is unfit and Saleem is injured.
Solution
a. The fan is not slow and it is not very hot.
b. Akram is not unfit or Saleem is not injured.
16
INEQUALITIES AND DEMORGAN’S LAWS

Use DeMorgan’s Laws to write the negation of


-1 < x  4
For some particular real number x
-1 < x  4 means x > –1 and x  4
By DeMorgan’s Law, the negation is:
x > –1 or x  4
Which is equivalent to: x  –1 or x > 4
EXERCISE

Are the statements (p  q)  r and p  ( q  r ) logically equivalent?

p q r pq qr (p  q)  r p  (q  r)
T T T T T T T
T T F T F F F
T F T F F F F
T F F F F F F
F T T F T F F
F T F F F F F
F F T F F F F
F F F F F F F

Since the last two column have the same entries in the columns so we have
their corresponding statement forms are equivalent. That is

(p  q)  r  p  (q  r )
Which is known as the Associative Law for Conjunction.
17
EXERCISE

Are the statements (pq)r and p (q  r) logically equivalent?


In order to prove or disprove the logical equivalence we will make
truth table and if the columns for the given statement forms are not
identical then they are not logical equivalent.

p q r pq (p  q)  r (q  r) p (q  r)

T T T T T T T
T T F T T T T
T F T F T T T
T F F F F F F
F T T F T T F
F T F F F T F
F F T F T T F
F F F F F F F

Now it is clear from above table that the entries of the given
statement forms are not identical so the statement forms are not
logically equivalent.
TAUTOLOGY
A tautology is a statement form that is always true regardless of the truth
values of the statement variables.
A tautology is represented by the symbol “t”.
So if we have to prove that a given statement form is TAUTOLOGY we
will make the truth table for the statement from and if in the column of the
given statement form all the entries are T ,then we say that statement form is
18
tautology.
EXAMPLE: The statement form p  ~ p is tautology.

p ~p p~p
T F T
F T T

Since we have T in the last column so we have p  ~p  t

CONTRADICTION

A contradiction is a statement form that is always false regardless of the


truth values of the statement variables.
A contradiction is represented by the symbol “c”.
So if we have to prove that a given statement form is CONTRADICTION
we will make the truth table for the statement form and if in the column of
the given statement form all the entries are F ,then we say that statement
form is contradiction.
EXAMPLE:
The statement form p  ~ p is a contradiction.

p ~p p~p

T F F
F T F

Since in the last column in the truth table we have F in all the entries
so is a contradiction p  ~p c
19
REMARKS

– Most statements are neither tautologies nor contradictions.


– The negation of a tautology is a contradiction and vice versa.
– In common usage we sometimes say that two statement are
contradictory.
By this we mean that their conjunction is a contradiction: they cannot
both be true.

LOGICAL EQUIVALENCE INVOLVING TAUTOLOGY

1. Show that p  t  p

p t pt

T T T

F T F

Since in the above table the entries in the first and last columns are
identical so we have the corresponding statement forms are Logically
equivalent that is
ptp

20
LOGICAL EQUIVALENCE INVOLVING CONTRADICTION

Show that pc  c

p c pc

T F F
F F F

Same truth values in the indicated columns so pc  c


EXERCISE
Use truth table to show that (p  q) (~p (p  ~q)) is a tautology.
SOLUTION
Since we have to show that the given statement form is
Tautology so the column of the above proposition in the truth table will
have all entries as T.
As clear from the table below

p q pq ~p ~q p~q ~ p (p  ~q) (p  q) 


(~p  (p  ~q))
T T T F F F F T
T F F F T T T T
F T F T F F T T

F F F T T F T T

21
Hence (p  q) (~p (p  ~q))  t
EXERCISE

Use truth table to show that (p  ~q) (~pq) is a contradiction.


SOLUTION
Since we have to show that the given statement form is
Contradiction so its column in the truth table will have all entries
as F. As clear from the table below
p q ~q p~q ~p ~pq (p  ~q) (~pq)
T T F F F T F
T F T T F F F
F T F F T T F
F F T F T T F

USAGE OF “OR” IN ENGLISH

In English language the word or is sometimes used in an inclusive sense (p


or q or both).
Example I shall buy a pen or a book.
In the above statement, if you buy a pen or a book in both cases the
statement is true and if you buy both pen and book then statement is again
true. Thus we say in the above statement we use or in inclusive sense.
The word or is sometimes used in an exclusive sense (p or q but not both).
As in the below statement
Example Tomorrow at 9, I’ll be in Lahore or Islamabad.
Now in above statement we are using or in exclusive sense because both the
statements are true then we have F for the statement.
While defining a disjunction the word or is used in its inclusive sense. Thus
the symbol  means the “inclusive or” 22
EXCLUSIVE OR

When or is used in its exclusive sense, The statement “p or q” means “p or q


but not both” or “p or q and not p and q” which translates into symbols as:
(p q)  ~(p  q)
Which is abbreviated as:
pq
or p XOR q

TRUTH TABLE FOR EXCLUSIVE OR

p q pq pq ~ (pq) (pq)  ~ (pq)

T T T T F F
T F T F T T
F T T F T T
F F F F T F

Note:
Basically
p  q ≡ (p q)~p  q)
≡ [p  ~q) ~p] [(p  ~q)  q]
≡ (p q) p q)
≡ (p q) p ~q)
23
REASONING EXERCISES

1. If two propositions are logically equivalent, what can be said about


their truth tables?
2. If a proposition is neither a tautology nor a contradiction, what can
be said about its truth table?
3. Can a statement with a single variable p be a tautology or a
contradiction? Explain.
4. If A and B are two (possibly compound statements) such that A B
is a contradiction, what can you say about A and B?
5. If A and B are two (possibly compound statements) such that AB
is a tautology, what can you say about A and B?
6. If two statements are logically equivalent to each other, then they
must either be tautologies or contradictions. Is it correct?

24

You might also like