COMP9020 16s1 Problem Set 1 4 March 2016
Numbers, Sets, Functions
Exercise 1. How many numbers divisible by 3, 5, or 7 are there between 100 and 1000?
Exercise 2. Recall the algorithm for computing the gcd of two positive numbers1 :
if m = n
m
gcd(m, n) =

COMP9020 17s1 Problem Set 1 3 March 2017
Numbers, Sets, Words
Exercise 1. How many numbers are there between 100 and 1000 that are
(a) divisible by 3?
(b) divisible by 5?
(c) divisible by 15?
Exercise 2. Prove that (A \ B) (B \ A) = (A B) \ (A B)
(a) usin

COMP9020 17s1 Problem Set 2 10 March 2017
Logic
Before you start.
Download and read a short essay on
Good Mathematical Writing
and write up your solutions to the following exercises with these guidelines in mind.
Hint: If the link above does not work, you

GUIDELINES FOR GOOD MATHEMATICAL WRITING
FRANCIS EDWARD SU
Communicating mathematics well is an important part of doing mathematics. Whether you are speaking or writing, learning to communicate effectively is not just a service to your audience; it is als

Overview
COMP9020 Lecture 23
Session 1, 2017
Logic
whats a proof?
from English to propositional logic
truth tables, validity, satisfiability and entailment
applications: program logic, constraint satisfaction problems,
reasoning about specifications, digi

COMP9020 Lecture 23
Session 1, 2017
Logic
Textbook (R & W) Ch. 2, Sec. 2.1-2.5;
Ch. 10, Sec. 10.1-10.3
Problem sets 2 and 3
Supplementary Exercises Ch. 2 and 10 (R & W)
Guidelines for good mathematical writing
1
Overview
whats a proof?
from English to pro

COMP9020 Lecture 7
Session 2, 2016
Graphs
Revision: 1.1
1
From Relations to Graphs and Digraphs
Binary relations on sets correspond to directed graphs. Symmetric
relations correspond to undirected graphs.
Terminology (the most common; there are many varia

State Machines
Transition Diagrams
COMP9020 Lecture 8a
Session 2, 2016
State Machines vs Transition Diagrams
Revision: 1.2 of Date: 2016/11/08 04:23:55 UTC
1
State Machines
Transition Diagrams
State Machines
Section 5.4 of the textbook introduces a state

COMP9020 Lecture 8
Session 2, 2016
Order of Growth
Revision: 1.2
1
Problem vs. Algorithm
Intuitively, a problem is a question and an algorithm provides
answers.
In (language) theory wed call a pair P = (I , L) where I for
some alphabet is a set of instanc

COMP9020 Lecture 12
Session 2, 2016
On the Final Exam
Revision: 1.1
1
What could be in it?
Material from assigned reading, slides, and problems.
We covered topics covered in parts of the textbook chapters 1, 2,
3\cfw_3.4, 4.14.4, 5, 6.1, 6.2, 9.1, 9.2, 9.

COMP9020 Lecture 12
Session 2, 2016
Expectation
Revision: 1.2
1
Random Variables
Random variables (abbr. rv) generalise the notion of a random
event. First of all, they permit separation of the sample spacethe
carrier of probability, and the space of valu

COMP9020 Lecture 9b
Session 2, 2015
Counting and Likelihood
Revision: 1.2
1
Counting Techniques
General idea: find methods, algorithms, and occasional precise
formulae to count the number of elements in various sets or
collections derived, in a structured

COMP9020 Lecture 11
Session 2, 2016
Conditional Probability
Revision: 1.3
1
Conditional Probability
Definition
The conditional probability of an event E given an event S (of
non-zero probability) is
def
Pr(E |S) =
Pr(E S)
Pr(S)
It defines a probability di

COMP9020 Lecture 9
Session 2, 2015
Time Complexity
Revision: 1.3
1
Order of growth of recurrences for algorithms
We want to know what to expect of running time of an algorithm
as the input size goes up. To avoid vagaries of the specific
computational plat

COMP9020 Lecture 3
Session 2, 2016
Sets, Functions, and Sequences
Revision: 1.3
1
Divisibility
Let m, n Z.
m|n means m is a divisor of n, defined by n = km for some k Z
(Also stated as: n is divisible by m, m is a divisor of n.)
m - n - negation of m|n
No

COMP9020 Lecture 5
Session 2, 2016
Relations
Revision: 1.2
1
Relations and their representation
Relations are an abstraction used to capture the idea that the
objects from certain domains (often the same domain for several
objects) are related. These obje

COMP9020 Lecture 4-5
Session 1, 2016
Relations
Textbook - Ch. 3, Sec. 3.13.2, 3.4; Ch. 11, Sec. 11.111.2
Problem sets 4 and 5
Supplementary Exercises Ch. 3 and 11 (R & W)
NB
Mid-term test: 22 April
1
Relations and their Representation
Relations are an abs

The University of New South Wales
Would-Be Mid-Session Test
2016/09/08
COMP9020
Foundations of Computer Science
(token instructions)
Time allowed: 1 hour + 5 minutes reading time
Total number of questions: 5
Maximum number of marks: 25
All questions are w

The University of New South Wales
Would-Be Mid-Session Test
2016/09/08
COMP9020
Foundations of Computer Science
(token instructions)
Time allowed: 1 hour + 5 minutes reading time
Total number of questions: 5
Maximum number of marks: 25
All questions are w

COMP9020 15s1 Problem Set 3 20 March 15
Boolean Expressions
Exercise 1. Let 1 = (p (q r), 2 = (s (q p), and = 1 2 .
(a) Draw Karnaugh maps for the three formulae, 1 , 2 , and .
(b) Find a minimal DNF for .
(c) Find a minimal CNF for 1 .
Exercise 2. Portia

COMP9020 15s1 Problem Set 4 27 March 15
Solutions
Exercise 1.
(a) Yes, since a + 0.5 a a 0.5 for all a R
(b) No; see (a)
(c) Yes, since (b + 0.5 a) (a b 0.5) implies (b a 0.5) (a 0.5 b).
(d) No; e.g. (0, 0.1) R
(e) No; e.g. (1.1, 1.5) R and (1.5, 1.9) R b

COMP9020 15s1 Problem Set 5 17 April 15
Relations
Exercise 1. Let P be a partial order on the domain of n elements, and Q its associated quasi-order.
Describe the difference P \ Q (as a subset of S S).
Exercise 2. Define a relation R R R where (a, b) R if

COMP9020 15s1 Problem Set 1 6 March 15
Numbers, Sets, Functions
Exercise 1. How many numbers divisible by 3, 5, or 7 are there between 100 and 1000?
Exercise 2. Recall Euclids algorithm for the gcd of two positive numbers1 :
if m = n
m
gcd(m, n) = gcd(m n

COMP9020 15s1 Problem Set 2 13 March 15
Solutions
Exercise 1.
First question: Yes. In fact, the conclusion follows directly from just the first requirement.
Second question: No. The third requirement states that the alarm should sound whenever there
is