CS336F101 - 8/24/10 What
we’ll
cover 
 CS 336...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 8/24/10 What
we’ll
cover 
 CS 336 Lecture
1
 
 •  The
operation
 •  Review
of
predicates
 The
People
   Instructor: Dr. Maggie Myers myers@cs.utexas.edu   Office hours: TTH, and extra hours as announced   Office: Aces 2.112   Phone: 471-9533   TA’s:
 The
People
 Reza Mahjourian Gabriel Elizondo The
Materials
 Text: Discrete Mathematics and its Applications, Kenneth H. Rosen. (6th edition) The text is a reference and will be supplemented. See Blackboard Grading
 Three
100
pt
exams
(Sept.
21,
Oct.
14,
and
 Nov.
4)
 
 a
comprehensive
final
worth
180
pts

 
 120
pt.
Quiz/homework
grade

 
 combine
for
a
possible
600
pts.
No
curve!

 1 8/24/10 Why
are
you
here?
 •  Homework
 •  Study
groups
 •  Attendance
 Top
10
Reasons
for
Taking
CS
336.
 10  Bowling
class
was
full
and
I
got
kicked
out
of
the
class
across
 the
hall.
 9.  To
get
one
step
closer
to
2
milli
($)
(Yeah!)
or
becoming
1337
 h4<>0r2
to
take
over
the
world.

 8.
 Something
to
do
after
an
all‐nighter.

 7.
 We
thought
there
would
be
free
pizza.
 6.
 Why
take
the
path
of
least
resistance
and
learn
a
real
 programming
language?
 5.
 To
meet
other
“bright
eyed”
people
studying
CS.
 4.
 To
look
smart.
 3.
 The
counselor
made
me
do
it;
It ’s
required.

 2.
 To
experience
the
thrill
of
learning
how
to
analyze
programs
or
 at
least
we
thought
we
would
be
learning
to
analyze
programs.
 Top
Reason
for
Taking
CS
336.
 1
 To
learn
how
to
write
love
notes
to
math
majors
 (who
insist
we
prove
our
love).
 Topics
 •  Basic
Ammunition
 •  What
did
you
Learn
in
CS313?
 •  What
do
you
expect
to
learn
here?
 •  Predicate
calculus
with
an
emphasis
on
manipulation
 •  How
to
write
proofs
 •  Prove
it

 •  Assertions
and
Hoare
triples
 •  Weakest
Preconditions
 •  Axioms
for
sequential
composition,
assignment,
and
 branching
 •  Verification
of
loop‐free
programs
 •  Loops
and
invariants
 •  Total
correctness
 •  Developing
loops
from
invariants
and
bounds
 •  Developing
invariants
 2 8/24/10 Topics
 Tools
for
the
analysis
of
programs
 •  Weapons
of
Mathematical
Inductions
 –  Recursive
Definitions
 –  Mathematical
induction
 –  Well‐ordering
principle
 –  Recurrence
relations
 A
Review:

Translating
 Predicates,Quantifiers,
and
Proofs
 Write the following in predicate form. (Formalize the program specification) •  All elements in a subarray b[j..k] are zero. (∀i|j≤i≤k:b[i]=0)
 •  X is the minimum value in the array b[0,n-1]. •  Combinatorics
 –  
 –  
 –  
 –  
 Pigeon
Hole
principle
 Permutations
and
combinations
 Inclusion‐exclusion
principle
 Big‐Oh
 •  Graph
Theory
 Translating
Predicates,Quantifiers,
 and
Proofs
 Write the following in predicate form. (Formalize the program specification) •  All elements in a subarray b[j..k] are zero. (∀i|j≤i≤k:b[i]=0) •  X is the minimum value in the array b[0,n-1]. (∀i|0≤i<n:X≤b[i]) ∧(∃i|0≤i<n:X=b[i])
 The
Basic
Equivalences
 •  These laws will be our principal tools for manipulating propositions, so you should know them —and their names— well. •  Let E1, E2, and E3 be any propositions whatsoever The
Basic
Equivalences
 1.  Commutativity: (E1 ∧ E2) ↔ (E2 ∧ E1) (E1 ∨ E2) ↔ (E2 ∨ E1) (E1 ↔ E2) ↔ (E2 ↔ E1) The
Basic
Equivalences
 2.  Associativity: E1 ∧ (E2 ∧ E3) ↔ (E1 ∧ E2) ∧ E3 E1 ∨ (E2 ∨ E3) ↔ (E1 ∨ E2) ∨ E3 3 8/24/10 The
Basic
Equivalences
 3.  Distributivity: E1 ∧ (E2 ∨ E3) ↔ (E1 ∧ E2) ∨ (E1 ∧ E3) E1 ∨ (E2 ∧ E3) ↔ (E1 ∨ E2) ∧ (E1 ∨ E3) The
Basic
Equivalences
 4.  De Morgan: ¬(E1 ∧ E2) ↔ (¬E1 ∨ ¬E2) ¬(E1 ∨ E2) ↔ (¬E1 ∧ ¬E2) 5.  Negation: ¬ (¬E1) ↔ E1 6.  Excluded Middle: E1 ∨ ¬E1 ↔ T 7.  Contradiction: E1 ∧ ¬E1 ↔ F The
Basic
Equivalences
 8.  Implication: E1 → E2 ↔ ¬E1 ∨ E2 9.  Equality: (E1 ↔ E2) ↔ (E1 → E2) ∧ (E2 → E1) The
Basic
Equivalences
 10.  ∨-simplification: E1 ∨ E1 ↔ E1 E1 ∨ T ↔ T E1 ∨ F ↔ E1 E1 ∨ (E1 ∧ E2) ↔ E1 11.  ∧-simplification: E1 ∧ E1 ↔ E1 E1 ∧ T ↔ E1 E1 ∧ F ↔ F E1 ∧ (E1 ∨ E2) ↔ E1 The
Basic
Equivalences
 12.  Identity: E1 ↔ E1 These 12 together with substitution and transitivity will be the bases of our proofs. Example…Prove that ¬T ↔ F is an equivalence, using the rules of Substitution and Transitivity and the Laws 1-12. Proof: ¬T ↔ <excluded middle> ¬ (E1 ∨ ¬E1) ↔ <deMorgan> ¬ E1 ∧ ¬(¬E1) ↔ <contradiction> F 4 8/24/10 Prove Contrapositive, (p →q) ↔ (¬q → ¬˛p) Proof: ¬q → ¬˛p ↔ < implication> ¬(¬q) ∨ ¬˛p ↔ < negation> q ∨ ¬˛p ↔ < commutative> ¬p ∨ q ↔< implication> p→ q Hence by transitivity (p →q) ↔ (¬q → ¬˛p) Prove p → (q → p). Proof: p → (q → p) ↔ < implication×2> ¬p ∨ (¬q ∨ p) ↔ < commutative> ¬p ∨ (p∨¬q) ↔ < associativity> (¬p ∨ p)∨¬q ↔ < commutative> (p ∨ ¬p)∨¬q ↔ < exclusive middle> T∨¬q ↔ < commutative> ¬q∨T ↔ < ∨-simp. > T
 5 ...
View Full Document

Ask a homework question - tutors are online