SE 212 Fall 2016
Assignment 1
Due: Tue 27 Sep 2016 at 8pm
50 marks
Assignments are to be submitted electronically on MarkUs. Submit each of the six questions
in a separate file. Begin with the provided .grg files on the course web page and do not
change t
SE 212 Fall 2016
Assignment 4
Due: Tue 1 Nov 2016 at 8pm
55 marks
Assignments are to be submitted electronically on MarkUs. Submit each question in a separate file. Begin with the provided .grg files on the course web page and do not change the
file names
SE 212 Fall 2016
Assignment 3
Due: Thu 13 Oct 2016 at 8pm
52 marks
Assignments are to be submitted electronically on MarkUs. Submit each question in a separate file. Begin with the provided .grg files on the course web page and do not change the
file name
SE 212 Fall 2016
Assignment 6
Due: Tue 15 Nov 2016 at 8pm
40 marks
Assignments are to be submitted electronically on MarkUs. Submit each question in a separate file. Begin with the provided .grg files on the course web page and do not change the
file name
SE 212 Fall 2016
Assignment 8
Due: Tue 29 Nov 2016 at 8pm
75 marks
Assignments are to be submitted electronically on MarkUs. Follow the instructions on
MarkUs to submit each of the three questions in a separate file. All completely correct
solutions must
SE 212 Fall 2016
Assignment 7
Due: Tue 22 Nov 2015 at 8pm
80 marks
Assignments are to be submitted electronically on MarkUs. Follow the instructions on
MarkUs to submit the question in one file.
Assignments are to be completed in groups of one or two stud
SE 212 Fall 2016
Assignment 2
Due: Tue 4 Oct 2016 at 8pm
45 marks
Assignments are to be submitted electronically on MarkUs. Submit each of the five questions in a separate file. Begin with the provided .grg files on the course web page and do not
change t
SE 212 Fall 2016
Summary of Set Theory
1
Axioms
Types as sets (if x x B)
x : B P (x) x x B P (x)
x : B P (x) x x B P (x)
Proper Subset D B D B (D = B)
Power Set
P(D) = cfw_B | B D
Set Comprehension
x cfw_y y : S | P (y) x S P (x)
x cfw_t(y) y : S | P
SE 212 Fall 2016
Summary of Natural Deduction for Propositional Logic
INTRODUCTION
ELIMINATION
P
Q and i
P Q
P
P Q
Q
P Q
or i
P Q
and e
P
or i
lem
P P
assume R cfw_
.
Q
imp i
RQ
Conditional Proof
Indirect Proof
disprove R cfw_
disprove R cfw_
.
.
false
f
SE 212 Fall 2016
Summary of Semantic Tableaux ( ` )
for Predicate Logic
All the rules for propositional logic can also be used.
POSITIVE
NEGATIVE
x P (x)
(x P (x)
forall nb
not forall nb
P (t)
x P (x)
where t is a term that is a legal
substitution.
x P (x
SE 212 Fall 2016
Summary of Natural Deduction ( ` )
for Predicate Logic
These rules are in addition to the rules already given for propositional logic.
INTRODUCTION
ELIMINATION
for every xg cfw_
.
.
x P
forall e
P [t/x]
P [xg /x]
forall i
x P
x P
for som
SE 212 Fall 2016
Assignment 5
Due: Tue 8 Nov 2016 at 8pm
50 marks
Assignments are to be submitted electronically on MarkUs. Submit each question in a separate file. Begin with the provided .grg files on the course web page and do not change the
file names
SE 212 Fall 2016
Predicate Logic
Summary of Logical Laws for Transformational Proof
forall over and
(x P (x) Q(x) (x P (x) (x Q(x)
exists over or
(x P (x) Q(x) (x P (x) (x Q(x)
dm
(x P (x) (x P (x)
(x P (x) (x P (x)
swap vars
(x, y p(x, y) (y, x p(x,
SE 212 Fall 2016
Summary of Program Correctness
Asn
assert( P [E/V ar] ); Var := E; assert( P );
P ` Q[E/V ar]
Derived Asn
assert( P ); Var := E; assert( Q );
Array Asn
assert( P [(B cfw_(i, e))/B] ); B[i] := e; assert( P );
P0 ` P
assert( P ); C; assert(
SE 212 Fall 2016
Propositional Logic
Summary of Logical Laws for Transformational Proof
P Q
comm
QP
P Q
QP
P Q
QP
P (Q R)
assoc
(P Q) R
P (Q R)
P P
contr
P P
lem
P P
P Q
P Q
P true
simp1
P true
P false
P false
false
impl
contrapos
(P R) (Q R)
P (Q R)
(P Q
SE 212 Fall 2016
Summary of Formalization
for Propositional Logic
Logical Connective
P
P Q
P Q
P Q
P Q
Possible Interpretations in English
not P
P does not hold
it is not the case that P
P is false
P and Q
P but Q
not only P but Q
P while Q
P despite Q
P
SE 212 Fall 2016
Summary of Semantic Tableaux
for Propositional Logic
POSITIVE
NEGATIVE
Rule 1
P Q
Rule 6
(P Q)
and nb
not and br
P
Q
Rule 7
(P Q)
Rule 2
P Q
not or nb
P
Q
or br
Q
P
Rule 8
(P Q)
Rule 3
P Q
Q
P
not imp nb
imp br
P
Q
Q
P
Rule 5
P
not not nb
SE 141 Midterm Examiniation
Winter 2007
1. [10 points] A circuit is required that will compute a parity bit to be added to a 7-bit
input word, so that the resulting 8bit word will in every instance have even parity (that is,
it will contain an even number
University of Waterloo
Department of Electrical and Computer Engineering
SE 240
Algorithms and Data Structures
Spring 2004
Midterm Examination
Instructor: Ladan Tahvildari
Date: Monday, June 21, 2004, 7:00 p.m.
Duration: 2 hours
Type: Closed Book
Instruct
University of Waterloo
Department of Electrical and Computer Engineering
SE 240
Algorithms and Data Structures
Spring 2005
Final Examination
Instructor: Ladan Tahvildari
Date: August 4, 2005
Time: 4:00 p.m. to 6:30 p.m.
Duration: 2.5 hours
Type: Closed Bo
University of Waterloo
Department of Electrical and Computer Engineering
SE 240
Algorithms and Data Structures
Spring 2005
Midterm Examination
Instructor: Ladan Tahvildari
Date: Monday, June 13, 2005, 4:30 p.m.
Duration: 2 hours
Type: Closed Book
Instruct
University of Waterloo
Department of Electrical and Computer Engineering
SE 240
Algorithms and Data Structures
Spring 2004
Final Examination
Instructor: Ladan Tahvildari
Date: Monday, August 9, 2004, 9:00 a.m. to 12:00 noon.
Duration: 3 hours
Type: Specia
University of Waterloo
Department of Electrical and Computer Engineering
SE 240
Algorithms and Data Structures
Spring 2006
Midterm Examination
Instructor: Ladan Tahvildari
Date: Monday, June 12, 2006, 4:30 p.m.
Duration: 1.5 hours
Type: Closed Book
Instru
University of Waterloo
Department of Electrical and Computer Engineering
SE 240
Algorithms and Data Structures
Spring 2007
Midterm Examination
Instructor: Ladan Tahvildari
Date: Monday, June 11, 2007, 6:30 p.m.
Duration: 1.5 hours
Type: Closed Book
Instru