Discr
e
te S
tructur
es
Pr
opo
sitional Logic
1
Dr
. Muham
mad
Huma
y
oun
Assis
tan
t
Pr
of
ess
or
C
OMS
A
T
S
Ins
ti
tut
e
of C
omput
er
Sci
e
nce
,
Lahor
e.
mhuma
youn@ci
itl
ahor
e.e
du.pk
h
ttps://
si
te
s.
g
oo
gl
e.c
om
/a/
ci
it
lah
or
e.ed
u.pk
/d
struc
t/
1
Ins
truct
or
MS in Comput
er
Sci
ence
and En
gineering
•
Chal
mer
s
Uni
ver
si
ty of
T
echnol
ogy
,
S
w
eden.
PhD
in Comput
er
Sci
ence
•
Uni
ver
si
ty of
Gr
enobl
e,
Fr
ance.
P
os
t-doc
R
esear
ch
Fell
ow
•
P
ohang U
ni
ver
si
ty of
Sci
ence
and
Technol
ogy
,
South
K
or
ea.
Speci
ali
za
tion:
•
Human Langu
ag
e
Pr
ocessing
,
Logic
,
Pr
oof Theory
,
Da
ta
mining
2
Logi
stics
•
T
w
o lectur
es
per w
eek
–
E
ac
h l
ectur
e
requi
res
readi
n
g
cour
se
book
(a
nd a
n
op
ti
on
al
r
eadi
n
g o
f r
e
fer
ence book
s)
•
3
Qui
zz
es
(15%
mark
s)
•
3
As
si
gnmen
ts
(10
% mark
s)
•
Thr
ee e
xams
–
Sessi
onal
Ex
am 1
(10%
mark
s)
–
Sessi
onal
Ex
am
2
(15%
mark
s)
–
Termi
nal
Ex
am
(50%
mark
s)
•
Co
ver
s al
l
cour
se
3
Logi
stics
Con
t.
•
Cour
se
ma
teri
al
wi
ll
be
pos
ted
on
the c
our
se
w
eb
si
te:
h
ttp
s://
si
tes.
g
oogl
e.c
om/
a/
ci
itl
a
hor
e.edu
.pk/d
struct
/
•
Cour
se r
epr
esen
ta
ti
ve
(CR)
can al
so
col
lect
c
our
se
ma
teri
al
fr
om me a
ft
er ev
ery l
ectu
re
•
Other s
tuden
ts
ma
y g
e
t i
t fr
om hi
m
•
DON’
T ind
ividual
ly
appr
oac
h
me f
or the ma
terial
•
CR:
Ge
t c
our
se
handbook
and
thi
s
lectu
re fr
om
me
a
ft
er
this class
4
Logi
stics
Con
t.
•
Wha
t
is on
the w
eb
sit
e:
–
Cour
se Handbook
–
Lectur
es
–
As
si
gnmen
ts
–
P
as
t qui
zz
es
and
the
ir sol
uti
ons
–
Ex
ams pa
tt
ern
–
Ne
w
s
•
Visit the
w
eb
sit
e
fr
eque
n
tly
5
Plagiari
sm
•
Cop
ying
someone
el
se’
s
w
ork
(parti
al
or
compl
e
te) and
sub
mi
tti
ng
it
as
if
i
t w
er
e
one’
s
own
•
Z
er
o
toler
ance
for
plagia
rism
•
R
ead
cour
se
hand
book
t
o
kno
w mor
e
about
pl
agi
ari
sm
6
A
tt
endance
P
olicy
•
80% a
tt
end
anc
e
is mand
a
tor
y
•
The
stud
en
ts
fal
li
ng
shor
t
wi
ll
not b
e allo
w
ed
to
appear i
n the T
ermi
n
al
Ex
am
•
To
g
e
t
g
ood
gr
ade y
ou mus
t
a
tt
end
al
l
the
lectu
res and
r
ead
sug
g
es
ted
ma
teri
al
7
Cour
se Objectiv
es
•
Deep u
nder
st
andi
n
g
of
discr
e
te
struct
ur
es
used
in
Comp
ut
er S
cience
•
De
vel
opi
n
g
pr
oblem
so
lving
and
analyt
ic
al
skil
ls
•
De
vel
opi
n
g
alg
ori
thmic
and
compu
ta
tiona
l
skil
ls
–
Abi
li
ty
to under
st
and
ma
thema
tical
ar
gumen
ts
and
thei
r
desi
gn
–
Under
st
andin
g
of log
ic
–
Pr
oo
fing
techniques
8
Cour
se Objectiv
es
Think
Ma
thema
tic
ally
The v
er
y
founda
tio
n
of
Comput
er
Science
Discr
e
te
Str
uctur
es/Ma
thema
ti
cs
• Disc re te ma thema tics deal s wi th objects tha t come in di scr e te bun dl e s, e. g ., 1 or 2 babi es . • Con tinuous ma thema tics deal s wi th objects tha t var y con ti nuousl y, e. g., 3.4 2 inches fr om a w al l. • Thi n k of digit al wat ches vers us analo g wat ches (ones wher e the sec ond h and loop s ar ound con ti nuousl y wi th out st oppi ng). 1 0Dis
cr
e
te
vs
. Con
tinu
ous
Con tinu o u s Discre te 1 1Wh
y Study Dis
cr
e
te
Str
uctur
es
It is the ma thema tics und erlyi ng al mos t all of compu ter sc ience : • Pr ogr am veri fi ca ti on – Anal yzi n g al g ori thms for co rr ectness and e ff iciency • Fi ndi n g e fficien t alg ori thm s – (f or sorti n g , sear chi n g , e tc. ) • Formal izing securi ty requi remen ts • Desi gni ng cr yp togr aph ic pr ot oc ols f or enhanced securi ty • Gr aph The or y (Ne tw ork s – both ph ysi cal & s oci al ) 1 2Cour
se
Topics
• Founda ti ons : Logi c • Me thod s of Pr oof • Set Theory • Indu cti on and R ecur si on • Coun ti ng • R el a ti ons • Gr aphs • Tr ees • In tr oducti on of A lg ori th ms 1 3Cour
se r
equir
es
origi
nal
thinki
ng
• Man y s tuden ts fi nd thi s cour se to be signifi ca n tly mo re c ha ll enging than other c our ses • Bec ause (amo ng other t hi ngs), it teaches ma thema tic al r eason in g an d pr ob lem sol vin g – R equi res origin al a n d de ep th in kin g • Book e xer ci ses – A w a y t o l e t you succes sfu ll y appl y concep ts usi ng your o wn cr ea ti vi ty One of the prim ary g oa ls of this co ur se: • To l earn how to a tt ack pr obl e ms tha t ma y be som e wha t di ff er en t fr om an y y ou ma y ha ve pr e vi ousl y seen 1 4Lectur
e
Schedule
W eek s T o pic of Lectur e Rea ding Ass ig nm ent W eek 1 Fo u n d atio n s: Log ic Ch ap ter 1 ( sectio n 1 .1 an d 1.2 ), Ro sen . W eek 2 Predicate Alg eb ra Ch ap ter 1 (s ect io n 3 , 4 an d 5 ), Ro sen . W eek 3 Metho d s o f Proo f: Ch ap ter 1 (s ect io n 6 an d 7 ), Ro sen . W eek 4 Set Theo ry Ch ap ter 2 , Ro sen . W eek 5 SESS IONAL I Ex a m · Pap er w il l b e co n d u cted i n th e first lectu re o f th e w ee k · Ma rked p ap er s wil l b e sh o wn t o stu d en ts an d th e so lu tio n o f p ap er w il l b e d iscu ss ed i n th e seco n d lectu re o f th e w ee k 1 5Lectur
e
Schedule
W ee k 6 Induc ti on and Rec ursion Chapt er 4 , Rosen . W ee k 7 Counti ng Chapt er 5 and 7, Rosen W ee k 8 Rel at ions Chapt er 8 , Rosen . W ee k 9 Revi sion wea k W ee k 1 0 S ES S ION AL I I Exam · Paper will be conduc te d i n the first le ct ure · Marke d pape rs will be show n t o student s in th e sec ond le ct ure 1 6Lectur
e
Schedule
W ee k 1 1 Graphs Chapt er 9 , Rosen W ee k 12 Graphs Algorit hm s · Eule r and Ham il ton pat hs · Shortest pat hs proble m s · Plana r gra phs · Graph col ouring Chapt er 9 , Rosen W ee k 13 T re es · Introduc ti on · Applic at ions Chapt er 10 , Rosen W ee k 14 T re e Algorit hm s · T ra ver sal · Spanning tre es · Minim um Spanning tre es Chapt er 10 , Rosen W ee k 1 5 Introducti on o f Algorithm s · Algorit hm s · Grow th func ti on · Com ple xit y of al gorit hm s Chapte r 3 , Ros en W ee k 16 Revi sion W ee k 1 7 F ina l exa m 1 7R
ec
omm
ended
Boo
k
s
Cour
se
Book
• Disc re te Ma thema tics an d Its Ap pli ca tio ns, 6th E
d. b y K en ne th H. R osen
R
e
fer
ence
Boo
k
s:
• Discr e te Ma thema tics , 6th E d. Ri char d Johnsonb augh • Ap pli ed Disc re te Struct ur es for Comp ut er Science . P ear son E duc a ti on, Inc. Al an Doerr and K en ne th Le vasseur . • Discr e te Ma thema tics Using a Com
put er . John O ’Donne ll , Cor de li a Hal
l and R
e x P ag e. 2 n
d E
LE
C
TURE 1
Founda
tions:
Logic
Chap
ter 1 Sections 1.1 and 1.2
1
9
In
tr
od
ucti
on
Logi
c
is the
study
of the
pr
inci
p
les
an
d
me
thod
s
tha
t
di
sti
ngui
sh
es
be
tw
een
a
v
alid
an
d
an
in
v
alid
ar
gumen
t
Logi
c
dea
ls
wi
th
g
ener
al
r
easoni
n
g
la
w
s,
whi
ch y
ou
can
trus
t
2
0
Appl
ic
a
ti
ons
•
App
li
ed
in pr
ovi
ng
pr
ogr
am
corr
ectness
and
v
erific
a
tion
•
Da
tabases
(R
el
a
ti
onal
Al
g
ebr
a and
cal
cul
us)
•
Art
if
ici
al
In
tel
li
g
ence
2
1
Pr
opos
itio
nal
Logic
2
2
Pr
oposi
tio
n
•
A s
ta
teme
n
t
is
a
de
cl
ar
a
ti
ve
sen
ten
ce
–
It i
s
Sunda
y
toda
y (OK)
–
The
sun
ri
ses
fr
om
eas
t
(OK
)
–
Open
the
door (
an
or
der; not a s
ta
temen
t)
–
Ar
e
you hungr
y?
(In
terr
og
a
ti
ve;
not a s
ta
tem
en
t)
•
A
pr
oposi
ti
on
is a s
ta
teme
n
t
whi
ch
is ei
ther
true
or
fal
se
but
not both
–
ʹ
ʹ
ൌ
Ͷ
–
It
i
s
Sunda
y
toda
y
–
The
sun
ri
ses
fr
om
eas
t
2
3
Truth V
alues
•
If a pr
oposi
ti
on
is
true, w
e
sa
y th
a
t
it
has
a
truth
v
alue
of
“
true
”
•
If a pr
oposi
ti
on
is
f
al
se, i
ts
tru
th
val
ue i
s
“
fals
e
”
•
The truth
v
al
ues
“true”
and
“f
als
e”
ar
e,
respect
iv
el
y,
denot
ed by the l
e
tt
er
s
T
and
F
2
4
Ex
amples
Pr
opo
sitio
ns
•
Gr
ass
is
gr
een
•
Ͷ
ʹ
ൌ
•
Ͷ
ʹ
ൌ
•
Ther
e
ar
e f
our
fi
n
g
er
s
in
a
hand
No
t
Pr
opo
sitio
ns
•
Wh
a
t
ti
me i
s
it
?
•
R
ead thi
s
car
e
ful
ly
Not
decl
arati
ve
sen
tenc
es
•
ݔ
ͳ
ൌ
ʹ
•
ݔ
ݕ
ൌ
ݖ
•
He
is
v
ery
ri
ch
Nei
ther
true
nor
false
2
5
Con
te
xt
•
If the sen
tence i
s pr
eceded
b
y other sen
tences
tha
t
mak
e the p
ronoun
or v
ari
ab
le r
e
fer
e
nce
cl
ear
,
then
the sen
tence
is
a
st
a
temen
t /
pr
oposi
ti
on
Ex
ample
:
ݔ
ൌ
ͳ
ݔ
ʹ
•
No
w
ݔ
ʹ
i
s a
pr
opo
si
ti
o
n
wi
th
truth
-v
al
ue
FALSE
Bi
ll
Ga
tes
is an
Ame
ri
can.
He
i
s
ver
y
ri
ch.
•
“H
e
is v
er
y
ri
ch”
is
no
w a pr
opo
si
ti
o
n
wi
th
truth
-v
al
ue
TRU
E
ݔ
ʹ
ݔ
ൌ
ͳ
2
6
Quiz
•
Ar
e
thes
e pr
oposi
ti
ons?
–
Ar
e y
ou
hu
ngry
?
–
ݔ
ݕ
ൌ
͵
–
I am happ
y
–
It i
s r
ai
ni
ng
2
Qui
z
•
Ar
e
thes
e pr
oposi
ti
ons?
–
Ar
e y
ou
hu
ngry
?
N
O
–
ݔ
ݕ
ൌ
͵
–
I am happ
y
YE
S
–
It i
s r
ai
ni
ng
YE
S
2
8
•
The ar
ea
of l
ogi
c
tha
t deal
s wi
th
pr
oposi
ti
ons
is
c
al
led the
pr
oposit
ion
a
l
calculus
or
pr
oposi
tiona
l
log
ic
•
It
w
as f
ir
st
de
vel
oped s
ys
tema
ti
cal
ly
b
y the
Gr
eek
phi
losopher
Ari
st
otl
e
mor
e
than
2
3
0
0
year
s
ag
o
2
9
Compound
Pr
oposi
tio
ns
•
Compound
pr
oposi
tio
n
s
,
ar
e
formed
fr
om
e
xi
sti
ng
pr
oposi
ti
ons
usi
ng
logi
cal
oper
a
tor
s
(al
so c
al
led
as
conn
ectiv
es
)
•
The me
thod
s t
o pr
oduce
ne
w pr
oposi
ti
ons
(fr
om
those
tha
t
w
e
al
ready
ha
ve) w
er
e
di
scuss
ed
b
y the Engl
ish
ma
thema
ti
ci
an
Geor
g
e
Bool
e
in
18
54
i
n
hi
s book
The Laws of
Though
t
3
0
S
ymbols
f
or Connectiv
es
S
ymbol
Mean
ing
Neg
a
ti
on
ש
Or
, di
sjun
cti
on
ר
And
,
conjuncti
on
֜
Impl
ic
a
ti
on
֞
B
i-imp
li
ca
ti
on
3
1
Neg
a
tio
n
De
finitio
n
1
Le
t
p
be a pr
oposi
ti
on.
The
negati
on
of p
, denot
ed
b
y
㻀
p
(al
so denot
ed by
), i
s the
st
a
temen
t
“
It i
s not
the c
ase t
ha
t
p
.”
The
pr
oposi
ti
on
㻀
p
is
r
ead “not
p
.”
The
tru
th
val
ue of th
e neg
a
ti
on
of
p
,
㻀
p
, i
s the
opposi
te
of
the
trut
h
val
ue of
p
.
3
2
Ex
amples
•
“M
y
PC runs Li
n
ux
”
“It
is not the
c
ase
tha
t
m
y
PC ru
ns Li
nu
x
”
“
My
P
C
does not run
Li
nu
x
”
•
ʹ
ʹ
ൌ
Ͷ
“
It
is not the
case
tha
t
ʹ
ʹ
ൌ
Ͷ
”
ʹ
ʹ
്
Ͷ
•
ݔ
͵
ൌ
͵
?
?
?
3
3
Truth
Table
for t
he Ne
g
a
tio
n
•
Ot
her
Not
a
tio
n
for neg
a
tio
n:
̱
p
•
Wha
t i
s the neg
a
ti
on o
f “It
is
not
the c
ase
tha
t
ʹ
ʹ
ൌ
Ͷ
”
3
4
The
Conjuncti
on
De
finitio
n
2
Le
t
p
and
q
be p
roposi
ti
ons.
The
conjun
cti
on
of
p
and
q
, denot
ed
b
y
p
ר
q
, i
s the
pr
oposi
ti
on
“
p
and
q
.”
The
conjuncti
on
p
ר
q
is
true when both
p
and
q
ar
e
tru
e and
is
f
al
se
otherwi
se.
3
5
Ex
amples
p
:
It
is r
ai
ni
ng
q
:
It
is wi
nd
y
ר
ݍ
?
I am thi
rs
ty
I am hungry Conjuncti
on?
“R
ebec
ca’
s
PC
has
mor
e
than
16
GB
fr
ee
har
d
di
sk sp
ace,
and
the
pr
ocesso
r
in R
ebecc
a’
s
PC ru
ns
fas
ter
than
1 GHz.
”
It
is c
ol
d but
sunn
y.
3
Truth T
able
•
Can y
ou do
it
for thr
ee
pr
oposi
ti
ons?
•
How man
y poss
ibl
e
ans
w
er
s?
3
7
The Di
sjunctio
n
De
finitio
n
3
Le
t
p
and
q
be p
roposi
ti
ons.
The
di
sju
nct
ion
of
p
and
q
, denot
ed
b
y
p
ש
q
, i
s the pr
oposi
ti
on
“
p
or
q
.”
The
di
sjuncti
on
p
ש
q
is
fals
e
when both
p
and
q
ar
e
fals
e
and
is
true o
therwi
se.
3
8
Truth T
able
3
9
Inclusiv
e
vs. Ex
clusiv
e
“S
tuden
ts
who
ha
v
e
tak
en
c
al
cul
u
s
or
comput
er
sci
e
nce
c
an
tak
e
thi
s
cl
ass
.”
(Inclusiv
e or)
“St
ude
n
ts
who ha
v
e
tak
en
c
al
cul
us
or
comput
er
sci
ence
,
but
no
t bo
th,
c
an
en
rol
l
in
thi
s
cl
ass.
”
Stude
n
ts
who ha
ve
tak
en
either
c
al
cul
us
o
r
c
omput
er
sci
ence
,
can
en
rol
l
in thi
s
cl
ass.
(e
xclusiv
e or)
4
0
Ex
clusiv
e Di
sjunct
ion
De
finitio
n
4:
Le
t
p
and
q
be p
roposi
ti
ons.
The
e
xcl
u
si
ve
or
of
p
and
q
, denot
ed
b
y
p
ْ
q
,
is
the pr
oposi
ti
on
tha
t
is
true
when e
xactl
y
one
of
p
and
q
is
true
and
is
fals
e
otherwi
se
.
•
Ei
the
r
p
or
q
.
•
p
or
q
but
not both
.
4
1
Truth T
able
•
Ei
ther
p
or
q
.
•
p
or
q
but
not both.
4
2
“Inclusiv
e
or
”
or “Ex
clusiv
e
or
”
“
Toni
gh
t
I wi
ll
s
ta
y ho
me o
r
g
o
out t
o
a mo
vi
e
.”
?
?
?
Hu
man
languag
es
can
be
amb
iguous
So be
c
ar
e
ful
4
3
Conditio
nal
St
a
temen
ts/
Implic
a
tion
p:
Pr
emi
se,
Hypothes
is
,
an
teceden
t
q:
Concl
us
ion,
Consequ
ence
•
The s
ta
temen
t
p
→
q
is
true
when
–
both
p
a
n
d
q
ar
e
true
–
p
is f
alse
(no
ma
tt
er
wha
t
trut
h
val
ue
q
has
)
4
4
Cond
itio
nal
St
a
temen
ts
De
finitio
n
5:
Le
t
p
and
q
be p
roposi
ti
ons.
The
condi
ti
onal
st
at
emen
t
p
→
q
is
the pr
oposi
ti
on
“i
f
p
, then
q
.”
The c
ondi
ti
onal
s
ta
temen
t
p
→
q
is
fals
e
when
p
is
true
and
q
is
fals
e
,
and
true
otherwi
se.
In
the
c
ondi
ti
onal
s
ta
temen
t
p
→
q
,
p
is
c
al
led the
h
ypot
hesi
s
(or
an
tec
eden
t
or
premi
se
)
and
q
is
c
al
led
th
e
concl
u
si
on
(or
consequenc
e
). 4
•
The
st
a
teme
n
t
p
→
q
is c
al
led
a
condi
ti
onal
st
a
teme
n
t
be
cause
p
→
q
asserts
tha
t
q
is
true
on
the
condi
ti
on tha
t
p
hol
ds.
•
A
c
ondi
ti
onal
s
ta
teme
n
t
is
al
so
cal
led
an
im
pl
ic
a
tio
n
.
Other
Not
a
tio
ns
•
֜
ݍ
•
ـ
ݍ
4
6
Other f
orms
•
Condi
ti
onal
s
ta
temen
ts
pl
a
y
an
essen
tial
r
ole
in ma
the
ma
ti
cal
r
easoni
ng
•
Man
y w
a
ys t
o
e
xpr
ess
an i
mpl
ic
a
ti
on
(p
-> q)
: 47
ื
Ex
ample
p:
you
g
e
t 1
00% on the
fi
nal
q:
you wi
ll
g
e
t
an
A
p imp
lies
tha
t
q.
you
g
e
t 1
00% on the
fi
nal
imp
li
es
tha
t
you wi
ll
g
e
t
an A
.
If p,
then
q.
If
y
ou
g
e
t
10
0%
on t
he
fi
nal
,
the
n
tha
t
you wi
ll
g
e
t
an
A
.
4
8
ื
Ex
ample
Con
t.
If
p,
q
.
If
you g
e
t
10
0%
on t
he fi
n
al
,
tha
t
you wi
ll
g
e
t
an
A
.
p is
sufficien
t
for q.
Ge
t
10
0% on the
fi
nal
is
suf
fi
ci
en
t
for
g
e
tti
ng an
A
.
q only
if p
.
you wi
ll
g
e
t an
A
onl
y i
f
y
ou g
e
t
100
%
on th
e fi
nal
.
q u
nless
㻀
p
.
you wi
ll
g
e
t an
A
unl
es
s
y
ou
don’t
g
e
t 1
00% on fi
nal
.
4
9
Ex
ampl
es
•
If I f
al
l
in a
lak
e, then
I’l
l
g
e
t
w
e
t.
•
If gr
a
vi
ty
does not e
xi
st t
hen
I c
an fl
y.
•
If sun
ri
ses f
rom the w
es
t
then
it
’l
l
be
the
end
of our pl
ane
t.
•
If the moon i
s made
of chees
e,
then the earth
is
r
ect
angul
ar
.
5
0
Ex
ample
Con
t.
•
If
you manag
e t
o
g
e
t
a 100% on
the fi
n
al
,
then
you w
oul
d e
xpect t
o
recei
ve
an A
.
–
ܶ
ื
ݍ
ൌ
ݍ
(Fi
rs
t
2
cases i
n
the tru
th
tabl
e)
•
If
you do
not
g
e
t
100
%
you ma
y o
r m
a
y no
t
recei
ve
an A depen
di
ng
on o
ther
fact
or
s.
–
ܨ
՜
ݍ
ൌ
ܶ
ሺ
ʹ
ሻ
•
Ho
w
e
ver
,
if
y
ou do
g
e
t 1
00
%,
but
the pr
of
essor
does not
g
iv
e y
ou an A
,
you wi
ll
f
eel
chea
ted.
If
you g
e
t
100
%
on th
e fi
nal
,
then
you wi
ll
g
e
t an
A
.
5
1
Ex
er
cise
•
Tr
ansl
a
te the pr
oposi
ti
ons
in
to
respect
iv
e
formu
lae
–
It i
s r
ai
ni
ng
and
wi
nd
y.
–
It i
s sunn
y
but
fr
ee
zi
n
g.
–
Gi
ve me t
ea or c
of
fee.
–
If th
er
e
ar
e D
DP
s
tud
en
ts
and
enr
ol
led
in
BS,
then
I
wi
ll
t
eac
h DS.
5
2
Truth t
ables
p
q
ר
ש
0
0
0
0
1
0
1
0
1
1
1
0
0
1
0
1
1
1
1
0
5
3
Ex
er
cise
•
Can
you c
ompl
e
te th
e f
ol
lo
wi
ng
tru
th
tabl
e
wi
thout
ask
ing me an
y
ques
ti
on
in cl
as
s?
5
4
p
q
r
ሺ
ר
ሻ
ש
࢘
p,
q
and r
ar
e pa
rame
ter
s
in thi
s
e
xer
ci
Do
e
xer
cises
fr
om the
cour
se
book
5