Docsity

Lecture Notes on Discrete Mathematics: Logic, Lecture notes of Discrete Mathematics

Partial preview of the text

Download Lecture Notes on Discrete Mathematics: Logic and more Lecture notes Discrete Mathematics in PDF only on Docsity!

LECTURE NOTES

on

DISCRETE MATHEMATICS

Eusebius Doedel

LOGIC

Introduction.

First we introduce some basic concepts needed in our

A discussion of logic. These will be covered in more detail later.

set

is a collection of “objects” (or “elements”).

EXAMPLES

the infinite set of

all integers

Z

the infinite set of

all positive integers

Z

≡ {

the infinite set

R

of

all real numbers

the finite set

T

F

, where

T

denotes “

True

” and

F

False

the finite set of alphabetic characters :

a, b, c,

(^) , z

EXAMPLE

Let

P

n

denoet the infinite set of all polynomial functions

p ( x ) of degree

n

or less with integer coefficients.

The derivative operator

D

restricted to elements of

P

n

can be

viewed as a function from

P

n

to

P

n − 1 ,

D

P

n

P n − 1 , D : p 7

dx dp

For example, if

p ( x ) = x 3

x (^) + 1, then

D

x 3

  • 2

x (^) + 1

x 2

  • 2

i.e.

D

x 3

  • 2

x (^) + 1)

x 2

  • 2

EXAMPLE

We can also define functions of

several variables

e.g.

f (^) ( x, y

x (^) +

(^) y ,

can be viewed as a function “from

Z

cross

Z

into

Z

”.

We write

f

Z

×

(^) Z

Z

.

Let

B

T

F

. Then we can view

, and

, as functions

B

B

B

×

B

B

B

×

B

B

We can also view the arithmetic operators

, +, and

×

, as functions

Z

Z

Z

×

Z

Z

Z

×

Z

Z

defined by value tables, for example,

x

x

A Logical expressions.

logical expression

(or “

proposition

P

p, q,

is a function

P

B

×

B

× · · · ×

B

B

For example,

P

1 ( p, q

p (^) ∨ ¬

q

and

P

2 ( p, q, r

p (^) ∧

(^) ( q ∨ (^) r )

Here are logical expressions.

P

1

:

B (^) ×

B

B

and

P

2

B

×

B

×

B

B

Analogously,

arithmetic expressions

such as

A

1 ( x, y

x (^) + (

y )

and

A

2 ( x, y, z

x (^) ×

y (^) +

(^) z )

can be considered as functions

A

1

R

×

R

R

and

A

2

R

×

R

×

R

R

or, equivalently,

A

1

R

2

R

and

A

2

R

3

R

Two propositions are

equivalent

if they always have the same values.

EXAMPLE

p (^) ∨

(^) q )

is equivalent to

p (^) ∧ ¬

q ,

(one of

de Morgan’s laws

), as can be seen in the table below :

p

q

p (^) ∨

(^) q

p (^) ∨

(^) q ) ¬ p ¬ q ¬ p

q

T T T F F F F

T F T F F T F

F T T F T F F

F F F T T T T

The three basic logical operators

and

are all we need.

However, it is very convenient to introduce some

additional operators

much like in arithmetic, where we write

x 3 to denote

x (^) ×

x (^) ×

(^) x

).

Three such additional operators are

exclusive or

“conditional”

if then

“biconditional”

if and only if

“iff”

defined as :

p

q

p (^) ⊕

(^) q

p → q p ↔ q

T

T

F

T

T

T

F

T

F

F

F

T

T

T

F

F

F

F

T

T

EXAMPLE

Suppose two persons, P and Q, are suspected of committing a crime.

Let

P

denote the statement by P that

“Q did it, or we did it together”.

Let

Q

denote the statement by Q that

“P did it, or if I did it then we did it together”.

Suppose we know P always tells the truth and Q always lies.

NOTEWho committed the crime?

By “did it” we mean “was involved”.

of As an analogy from arithmetic, consider the problem of finding the values

x

and

y

in

Z

so that

the value of the arithmetic expression

x 2

(^) y

is 5 ,

and such that

the value of

x (^) +

(^) y

is 3 ,

i.e.

, we want to find all solutions of the the simultaneous equations

x 2

(^) y

x (^) +

(^) y

(How many solutions are there ?)

For the “crime problem” we have the truth table

p q ¬ ( p ∨ ( q → ( p ∧ q )

∧ ( q ∨ ( p

(^) q ) )

T T F T T T F T T

T F F T T F F F F

F T T F F F T T F

F F F T T F F F F

We observe that the expression isThe values of the entire expression are in column (9). The order of evaluation has been indicated at the bottom of the table.

True

only if

p

=

F

and

q

=

T

Therefore Q was involved in the crime, but P was not.

EXERCISE

Suppose three persons, P, Q, and R, are suspects in a crime.

P states that “Q or R, or both, were involved”.

Q states that “P or R, or both, were involved”.

R states that “P or Q, but not both, were involved”.

Suppose P and Q always tell the truth, while R always lies.

NOTEWho were involved in the crime?

there may be more than one solution

EXERCISE

Construct a truth table for the logical expression

p (^) ∧

(^) ( ¬ ( ¬ p (^) ∨

(^) q )))

p (^) ∧

(^) q ) .

Based on the truth table find a simpler,

equivalent

logical expression.