Problem set 0 my solution
Theodore S. Norvell
6892
October 7, 2013
Q1 (a) Substitutions. For each of the following expressions, underline the bound occurrences
in the following
f (i)
(0)
icfw_j,.k
cfw_i cfw_j, .k | P (i)
i cfw_j, .k i < m2
(b) Perform the
Assignment 3
Algorithms: Correctness and Complexity
Due Nov 7 in class.
Q0 [10]. We can model a data network as directed graph where switches, routers, computers
etc. are nodes and data links are edges. Each edge is associated with a currently available
b
Assignment 0
Theodore S. Norvell
6892 Due Sept 12.
September 10, 2013
The post-oce needs your help. They have two problems. Lets call them the Household
Delivery problem (HD) and the Mailbox Pickup problem (MP).
MP is as follows. The input is again a set
ENGI 6892
Algorithms: Complexity and Correctness
Assignment 2
Due Thursday, 08 October 2015, 10:30 AM
NOTE: Be sure to read all the parts of each question before starting.
1
Contracts and Proof Outlines [60]
Suppose a is an array of numbers of length n, a
ENGI 6892
Algorithms: Complexity and Correctness
Assignment 3
Due Thursday, 29 October 2015, 10:30 AM
1
Object Invariants and Renement [30]
Consider the following abstract denition of DynamicArrayI:
class DynamicArrayI T
public readonly ghost var s : Seq
ENGI 6892
Algorithms: Complexity and Correctness
Assignment 4
Due Friday, 13 November 2015, 3:30 PM
1
Grammars and Parsing [15]
In the Double-Double language, a name consists of one or more identiers separated by one
fewer signs. Consider the following co
ENGI 6892
Algorithms: Complexity and Correctness
Assignment 4 Solution
Submitted Friday, 13 November 2015, 3:30 PM
1
Grammars and Parsing [15]
In the Double-Double language, a name consists of one or more identiers separated by one
fewer signs. Consider t
ENGI 6892
Algorithms: Complexity and Correctness
Assignment 1
Due Thursday, 26 September 2015, 10:30 AM
1
GCD [50]
(a) List all the boolean expressions that need to be shown to be universally true in order
to check that the proof outline below is correct.
ENGI 6892
Algorithms: Complexity and Correctness
Assignment 2 Solution
Submitted Thursday, 08 October 2015, 10:30 AM
NOTE: Be sure to read all the parts of each question before starting.
1
Contracts and Proof Outlines [60]
Suppose a is an array of numbers
ENGI 6892
Algorithms: Complexity and Correctness
Assignment 3 Solution
Submitted Thursday, 29 October 2015, 10:30 AM
1
Object Invariants and Renement [30]
Consider the following abstract denition of DynamicArrayI:
class DynamicArrayI T
public readonly gho
Assignment 3 solution
Algorithms: Correctness and Complexity
Due Nov 7 in class.
Q0 [10]. We can model a data network as directed graph where switches, routers, computers
etc. are nodes and data links are edges. Each edge is associated with a currently av
Assignment 2
Algorithms: Correctness and Complexity
Due Oct 24 at 11pm by D2L drobbox.
The work that you turn in for this assignment must represent the eort of each group of one or
two students. You are welcome to help your fellow students understand the
Assignment 1 my solution
Theodore S. Norvell
6892 2013
Q0 [20] For this question consider the following facts
gcd(x, 0)
gcd(0, y )
gcd(x, y )
x
=
=
=
=
x, for all x 0
y , for all y 0
gcd(x, y + kx) = gcd(x + ky, y), for all x, y, k 0
y (x div y ) + x mod
Problem set 0
Theodore S. Norvell
6892
October 7, 2013
Q0 Take the binary search challenge.
Solve the following problem in the language of your choice (e.g. Java, C, or pseudo-code).
Dont test your code. Email me your solution.
Input: An array (possibly e
Problem set 1
Theodore S. Norvell
6892
For both questions, follow the example in the notes.
Q0
(a) Design a syntactic and semantic interface for an unbounded queue. Include an abstract
state, an abstract invariant (if needed), signatures for all methods,
Problem set 1 solution
Theodore S. Norvell
6892
For both questions, follow the example in the notes.
Q0
(a) Design a syntactic and semantic interface for an unbounded queue. Include an abstract
state, an abstract invariant (if needed), signatures for all
Problem set 2 solution
Theodore S. Norvell
6892
2013
Important: For all these problems, do not worry about eciency. We will explore ecient
approaches later. For now I want to focus on looking at problems as instances of more general
sub problems that can
Problem set 2
Theodore S. Norvell
6892
2013
Important: For all these problems, do not worry about eciency. We will explore ecient
approaches later. For now I want to focus on looking at problems as instances of more general
sub problems that can be broken
Assignment 4 solution
Algorithms: Correctness and Complexity
Due Nov 29th at 5:00pm.
Q0 [20] Scheduling
(a) [10] Design a greedy algorithm for the following problem. There is a set of tasks T to be
done and only one machine that can do them. Each task is
Assignment 4
Algorithms: Correctness and Complexity
Due Nov 29th at 5:00pm.
Q0 [20] Scheduling
(a) [10] Design a greedy algorithm for the following problem. There is a set of tasks T to be
done and only one machine that can do them. Each task is associate
Assignment 1
Theodore S. Norvell
6892 Due Sept 26
Q0 [20] For this question consider the following facts
gcd(x, 0)
gcd(0, y )
gcd(x, y )
x
=
=
=
=
x, for all x 0
y , for all y 0
gcd(x, y + kx) = gcd(x + ky, y), for all x, y, k 0
x(x div y ) + x mod y, for
Assignment 0 solution
Theodore S. Norvell
6892 Due Sept 14.
September 17, 2013
The post-oce needs your help. They have two problems. Lets call them the Household
Delivery problem (HD) and the Mailbox Pickup problem (MP).
HD is as follows. The input is a s
ENGI 6892
Algorithms: Complexity and Correctness
Assignment 1 Solution
Due Thursday, 26 September 2015, 10:30 AM
1
GCD [50]
(a) List all the boolean expressions that need to be shown to be universally true in order
to check that the proof outline below is