Computer Science 236

CS 236 Homework Assignments


Homework assignments are due by 11:00 pm on the due date.

Please upload a PDF file containing your solutions to Learning Suite.

Late submissions are not accepted.

Email submissions are not accepted.


Assignment Assigned Problems Due Date
Homework 1 only problems 3, 4 26 Jun 2026
Homework 2 only problems 2, 5
(for problem 5, you don't need to use BNF notation)
26 Jun 2026
Homework 3 only problems 2, 3, 4, 5
(for problem 4, the start symbol is <expression>)
29 Jun 2026
Homework 4 only problems 6, 7
(you don't need to give "output" for problem 7)
1 Jul 2026
Homework 5 only problems 4, 5, 7
(for problem 5, only do parts a,b,c (not part d))
6 Jul 2026
Homework 6 only problems 1, 5, 6 6 Jul 2026
Homework 7 only problems 1, 2, 5, 6
(for problem 1, assume 'sound' means 'valid')
8 Jul 2026
Homework 8 Problem 1.

Use mathematical induction to prove
(for all integers n > 0):
P(n): 1 + 3 + 6 + ... + n(n+1)/2 = n(n+1)(n+2)/6

Problem 2.

Use mathematical induction to prove
(for all integers n > 0):
P(n): 1*1! + 2*2! + ... + n*n! = (n+1)! - 1

8 Jul 2026
Homework 9 only problems 1, 2, 6 10 Jul 2026
Homework 10 only problems 6, 7 13 Jul 2026
Homework 11 Problem 1.

Consider the following facts, rules, and queries.

Facts:
  child('Jill','Zed').
  child('Ned','Bea').
  child('Tim','Jack').
  child('Sue','Jack').
  child('Anne','Jill').
  child('Lou','Jane').
  child('Mary','Tim').
  child('Ron','Dan').
  child('Anna','Kim').
  child('Tim','Jill').
  child('Mary','Jane').
  child('Jill','Bea').

Rules:
  ancestor(X,Y) :- child(Y,X).
  ancestor(X,Y) :- child(Y,Z), ancestor(X,Z).

Queries:
  ancestor('Zed','Mary')?

a. Write the rules as clauses (disjunctions of literals).

b. Write one formal proof of the query using proof-by-contradiction, instantiation, and resolution. Give a justification for each line in your proof. Each step must be a premise or the result of instantiation or resolution.

13 Jul 2026
Homework 12 only problems 1, 7 17 Jul 2026
Homework 13a only problem 1 17 Jul 2026
Homework 13b only problems 2, 3i
(For problem 3,
only complete part i: give a
relational algebra expression)
20 Jul 2026
Homework 14a only problems 1, 2
(for problem 2, only do parts a-e)
22 Jul 2026
Homework 14b only problem 6
(For problem 6,
ignore the Irreflexive
and Asymmetric properties.)
22 Jul 2026
Homework 15a only problems 1, 2 27 Jul 2026
Homework 15b only problems 5, 7 29 Jul 2026
Homework 16a only problems 2gklm, 5
(For problem 2,
only complete parts
g, k, l, and m)
(For problem 5b,
ignore the edge weights)
29 Jul 2026
Homework 16b only problems 7a
(For problem 7,
only complete part a)
31 Jul 2026
Homework 17a only problems 2, 4a
(For problem 4,
only complete part a)
31 Jul 2026
Homework 17b Problem 1.

Consider the directed graph with nodes V and edges E. A diagram of the graph is provided at this link: Graph

V = { a, b, c, d, e, f }
E = { (a,b), (b,d), (c,b), (d,a), (e,d), (e,f), (f,e) }

Follow parts a-d below to show the steps of finding the strongly connected components in the graph.

a. Draw the diagram for the reverse-edge graph.

b. Draw the DFS-forest for the reverse-edge graph. (When there is a choice of nodes to visit, choose the one that is first in alphabetic order.)

c. Give the postorder numbers for the nodes in the reverse-edge graph. Assign numbers starting with the number 1.

d. Draw the DFS-tree for each strong component in the order it is found. (When there is a choice of nodes to visit, choose the one that is first in alphabetic order.)

3 Aug 2026
Homework 18a only problem 3 5 Aug 2026
Homework 18b only problem 4 7 Aug 2026
Homework 18c only problem 6a 7 Aug 2026
Homework 18d only problem 7a 10 Aug 2026
Homework 18e only problem 7c 10 Aug 2026