100% found this document useful (1 vote)
58 views

Discrete Mathematics: R. Johnsonbaugh

This document summarizes key concepts from Chapter 1 of the textbook "Discrete Mathematics" by R. Johnsonbaugh. It introduces logic and proofs, including propositions, connectives like conjunction and disjunction, truth tables, conditional and biconditional statements, predicates, quantifiers, and predicate logic. Concepts like necessary and sufficient conditions, converse, contrapositive and logical equivalence are defined. The document provides many examples to illustrate these logical terms and concepts.

Uploaded by

theresa.painter
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
58 views

Discrete Mathematics: R. Johnsonbaugh

This document summarizes key concepts from Chapter 1 of the textbook "Discrete Mathematics" by R. Johnsonbaugh. It introduces logic and proofs, including propositions, connectives like conjunction and disjunction, truth tables, conditional and biconditional statements, predicates, quantifiers, and predicate logic. Concepts like necessary and sufficient conditions, converse, contrapositive and logical equivalence are defined. The document provides many examples to illustrate these logical terms and concepts.

Uploaded by

theresa.painter
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 34

R.

Johnsonbaugh,
Discrete Mathematics
5
th
edition, 2001
Chapter 1
Logic and proofs
Logic
Logic = the study of correct reasoning
Use of logic
In mathematics:
to prove theorems
In computer science:
to prove that programs do what they are
supposed to do
Section 1.1 Propositions


A proposition is a statement or sentence
that can be determined to be either true or
false.
Examples:
John is a programmer" is a proposition
I wish I were wise is not a proposition


Which of the following are
propositions?
The number 4 is positive and the number
3 is negative
2 + 3 = 5
Why is induction important?
x y = y x
All students study hard.
2
n
+ n is a prime number for infinitely
many n
Go directly to jail.
\
\
\
\
X
X
X
Connectives
If p and q are propositions, new compound
propositions can be formed by using
connectives
Most common connectives:
Conjunction AND. Symbol ^
Inclusive disjunction OR Symbol v
Exclusive disjunction OR Symbol v
Negation Symbol ~
Implication Symbol
Double implication Symbol
Truth table of conjunction



The truth values of compound propositions
can be described by truth tables.
Truth table of conjunction






p ^ q is true only when both p and q are true.
p q p ^ q
T T T
T F F
F T F
F F F
Example
Let p = Tigers are wild animals
Let q = Chicago is the capital of Illinois
p ^ q = "Tigers are wild animals and
Chicago is the capital of Illinois"
p ^ q is false. Why?

Truth table of disjunction
The truth table of (inclusive) disjunction is




p v q is false only when both p and q are false
Example: p = "John is a programmer", q = "Mary is a lawyer"
p v q = "John is a programmer or Mary is a lawyer"
p q p v q
T T T
T F T
F T T
F F F
Exclusive disjunction
Either p or q (but not both), in symbols p v q






p v q is true only when p is true and q is false,
or p is false and q is true.
Example: p = "John is programmer, q = "Mary is a lawyer"
p v q = "Either John is a programmer or Mary is a lawyer"
p q p v q
T T F
T F T
F T T
F F F
Exclusive OR or Inclusive OR?
Choice of soup or salad.

No fishing or hunting allowed

The task will be completed on Thursday or
Friday

Discounts are available to persons under
20 or over 60
Exclusive
Inclusive
Exclusive
Inclusive
Negation
Negation of p: in symbols ~p





~p is false when p is true, ~p is true when p is
false
Example: p = "John is a programmer"
~p = "It is not true that John is a programmer"

p ~p
T F
F T
More compound statements

Let p, q, r be simple statements
We can form other compound statements,
such as
(pvq)^r
pv(q^r)
(~p)v(~q)
(pvq)^(~r)
and many others
Example: truth table of (pvq)^r
p q r (p v q) ^ r
T T T T
T T F F
T F T T
T F F F
F T T T
F T F F
F F T F
F F F F
T ^
T ^
T ^
T ^
T ^
T ^
F ^
F ^
1.2 Conditional propositions
and logical equivalence

A conditional proposition is of the form
If p then q
In symbols: p q
Example:
p = " John is a programmer"
q = " Mary is a lawyer "
p q = If John is a programmer then Mary is
a lawyer"

Truth table of p q






p q is true when both p and q are true
or when p is false
p q p q
T T T
T F F
F T T
F F T
Hypothesis and conclusion

In a conditional proposition p q,
p is called the antecedent or hypothesis
q is called the consequent or conclusion
If "p then q" is considered logically the
same as "p only if q"
Necessary and sufficient

A necessary condition is expressed by the
conclusion.
A sufficient condition is expressed by the
hypothesis.
Example:
If John is a programmer then Mary is a lawyer"
Necessary condition: Mary is a lawyer
Sufficient condition: John is a programmer

Practice
You do not learn the
simple things well.
If you learn the simple
things well then the
difficult things become
easy.
If you do not learn the
simple things well, then
the difficult things will
not become easy.

The difficult things become
easy but you did not learn
the simple things well.

You learn the simple things
well but the difficult things
did not become easy.

p: You learn the simple things well.
q: The difficult things become easy.

~p
pq
~p q
q . ~p
p . ~q
Logical equivalence
Two propositions are said to be logically
equivalent if their truth tables are identical.






Example: ~p v q is logically equivalent to p q
p q ~p v q p q
T T T T
T F F F
F T T T
F F T T
Converse
The converse of p q is q p






These two propositions
are not logically equivalent
p q p q q p
T T T T
T F F T
F T T F
F F T T
Contrapositive
The contrapositive of the proposition p q is
~q ~p.






They are logically equivalent.

p q p q ~q ~p
T T T T
T F F F
F T T T
F F T T
Double implication
The double implication p if and only if q is
defined in symbols as p q






p q is logically equivalent to (p q)^(q p)


p q p q (p q) ^ (q p)
T T T T
T F F F
F T F F
F F T T
Tautology
A proposition is a tautology if its truth table
contains only true values for every case
Example: p p v q
p q p p v q
T T T
T F T
F T T
F F T
Contradiction
A proposition is a contradiction if its truth table
contains only false values for every case
Example: p ^ ~p

p p ^ (~p)
T F
F F
De Morgans laws for logic

The following pairs of propositions are
logically equivalent:

~ (p v q) and (~p)^(~q)
~ (p ^ q) and (~p) v (~q)

Introduction to Predicate logic
Predicate logic involves the use of
Quantifiers to allow for general statements
which propositional logic does not allow
E.g. p(n) is true for all n means p(0) is true,
p(1) is true, p(2) is true etc.
Alternative using quantifiers n p(n) is true.
Domain of a propositional function
A propositional function P(x) is a statement
involving a variable x
For example:
P(x): 2x is an even integer
x is an element of a set D
For example, x is an element of the set of integers
D is called the domain of P(x)
In the propositional function
P(x): 2x is an even integer,
the domain D of P(x) must be defined, for
instance D = {integers}.
D is the set where the x's come from.
For every and for some
Most statements in mathematics and
computer science use terms such as for
every and for some.
For example:
For every triangle T, the sum of the angles of T
is 180 degrees.
For every integer n, n is less than p, for some
prime number p.

Universal quantifier

One can write P(x) for every x in a domain D
In symbols: x P(x)
is called the universal quantifier
Truth of as propositional function

The statement x P(x) is
True if P(x) is true for every x e D
False if P(x) is not true for some x e D
Example: Let P(n) be the propositional
function n
2
+ 2n is an odd integer
n e D = {all integers}
P(n) is true only when n is an odd integer,
false if n is an even integer.

Existential quantifier

For some x e D, P(x) is true if there exists
an element x in the domain D for which P(x) is
true. In symbols: -x, P(x)

The symbol - is called the existential
quantifier.
Counterexample
The universal statement x P(x) is false if
-x e D such that P(x) is false.

The value x that makes P(x) false is called a
counterexample to the statement x P(x).
Example: P(x) = "every x is a prime number", for
every integer x.
But if x = 4 (an integer) this x is not a primer
number. Then 4 is a counterexample to P(x)
being true.
Generalized De Morgans
laws for Logic
If P(x) is a propositional function, then each
pair of propositions in a) and b) below have
the same truth values:
a) ~(x P(x)) and -x: ~P(x)
"It is not true that for every x, P(x) holds" is equivalent
to "There exists an x for which P(x) is not true"
b) ~(-x P(x)) and x: ~P(x)
"It is not true that there exists an x for which P(x) is
true" is equivalent to "For all x, P(x) is not true"
Summary of Predicate logic
In order to prove the
universally quantified
statement x P(x) is
true
It is not enough to
show P(x) true for
some x e D
You must show P(x) is
true for every x e D

In order to prove the
universally quantified
statement x P(x) is
false
It is enough to exhibit
some x e D for which
P(x) is false
This x is called the
counterexample to
the statement x P(x)
is true

You might also like