COMP2121 / CSIS1118
Foundations of Computer Science / Discrete Mathematics
Tutorial 3
Date: Nov. 06, 2014 (Thu.)
1. How many permutations of the 26 letters of the English alphabet do not contain
any of the strings oil, bird or lemon?
Let A be any permutat

THE UNIVERSITY OF HONG KONG
DEPARTMENT OF COMPUTER SCIENCE
COMP2121/CSIS1118
Foundations of Computer Science/Discrete Mathematics
QUIZ 1
Date: September 29, 2014
Time: 1 hour and 45 minutes
Q1. [15%] Determine whether the following argument is valid or no

THE UNIVERSITY OF HONG KONG
DEPARTMENT OF COMPUTER SCIENCE
COMP2121 / CSIS1118
Foundations of Computer Science/Discrete Mathematics
Assignment 1
Due Date : September 27, 2013
Question 1 [10 pt] (refer to P.13, Q.8)
Let p, q, and r be the propositions
p :

COMP2121 / CSIS1118
Foundations of Computer Science / Discrete Mathematics
Tutorial 4
Date: Nov. 20, 2014 (Thu.)
1. Suppose we know that 4% of the patients tested in a clinic are infected with avian
inuenza. Furthermore, suppose that when a blood test for

COMP2121/CSIS1118
Discrete Mathematics
Graphs
Revision
Francis Chin
Nov 14, 2013
1
Equivalence relation
Let a, b be any two integers.
(a, b) R if and only if a-b is a multiple of 3.
(a) Show that R is an equivalence relation.
(b) Find all the equivalence

COMP2121/CSIS1118
Discrete Mathematics
Probability
Professor Francis Chin
October 31, 2013
([O1, O3]) Text book - Chapter 7
1
1.
2.
MC then opens one
of the other two
doors which does
not have the car
behind
3.
An expensive
sport car is hiding
behind one

COMP2121/CSIS1118
Discrete Mathematics
Inclusion and Exclusion
Pigeon-Hole Principle
Prof. Francis Chin
October 28, 2013
([O3], Chapter 6.2, 8.5, 8.6)
1
Security Problem Locks and Keys
Design a safe with locks and keys system that can only be
opened by an

COMP2121/CSIS1118
Discrete Mathematics
Hamiltonian Graphs
Graphs
Francis Chin
Nov 25, 2013
[O1, O2] Chapter 10.5
1
Euler and Hamiltonian Circuit/Path
An Euler circuit (or cycle) is a simple circuit
containing every edge in the graph.
A connected graph has

COMP2121/CSIS1118
Discrete Mathematics
Hamiltonian Graphs
Graphs
Francis Chin
November 21, 2013
[O1, O2] Chapter 10.5
1
Euler and Hamiltonian Circuit/Path
An Euler circuit (or cycle) is a simple circuit
containing every edge in the graph.
A connected grap

COMP2121/CSIS1118
Discrete Mathematics
Graphs
Francis Chin
November 7, 2013
([O1, O2]; Chapter 10)
1
What is a Graph?
A simple graph G = (V, E) consists of
V, the set of vertices (nodes, points), and
E, the set of edges (lines)
Undirected graphs are gra

COMP2121/CSIS1118
Discrete Mathematics
Propositional Logic
Professor Francis Chin
Sept 9, 2013
([O1, O2]; chapters 1.1, 1.2, 1.3)
1
Propositional Satisfiability (Ch1.3, p28)
A proposition is a statement that can either be true (T) or
false (F), but a comp

COMP2121/CSIS1118
Discrete Mathematics
Conditional Probability
Bayes Theorem
Professor Francis Chin
November 4, 2013
([O1, O3]) Text book - Chapter 7
1
Probability
Sample space (S) a set of possible outcomes;
Event (E) a subset of sample space;
If all out

COMP2121/CSIS1118
Discrete Mathematics
Counting
Francis Chin
([O3]; Chapter 6)
October 10, 2013
1
Counting
Counting is for finding the number of possible arrangements
or configurations of a certain pattern.
Examples:
Assume the length of a password is bet

COMP2121/CSIS1118
Discrete Mathematics
Methods of Proof
Professor Francis Chin
Sept 16, 2013
([O1,O2]; Chapters 1.6, 1.8, 1.9, 5.1, 5.2)
1
Logical Inference
Example: If Peter did it, he will be nervous when he is questioned.
Peter was very nervous when he

COMP2121/CSIS1118
Discrete Mathematics
Sets
Francis Chin
Sept 30, 2013
([O1]; Chapter 2.1, 2.2, 9)
1
Sets Definition & Notation
A set is a collection of objects.
Example:
A = cfw_apple, orange, mango, pear
B = cfw_policeman, fireman, manager, doctor, lawy

COMP2121/CSIS1118
Discrete Mathematics
Relations and Functions
Francis Chin
([O1]; Chapters 2.3, 9)
October 3, 2013
1
Properties of Relations
Relation is a set of ordered pairs.
A relation R on a set A is called
reflexive : (a,a) R for all a A. i.e., a A

COMP2121/CSIS1118
Discrete Mathematics
Graphs
Revision
Francis Chin
Dec 2, 2013
1
Logical Equivalence
Show that p(qr) and (pq)(pr) are
logically equivalent.
using truth table
using logical equivalences
p(qr) p(qr)
(pq)(pr)
(pq)(pr)
(pq)(pr)
(pq)(pr)

COMP2121/CSIS1118
Discrete Mathematics
Combinations
Francis Chin
October 21, 2013
([O3], Chapter 6 except 6.2)
1
Counting Review
Rule of Sum
Rule of Product
Given a set S of n distinct objects.
A permutation is an ordered arrangement of these objects.

Department of Computer Science
Second Term Timetable 2014-2015
Updated on Aug 05, 2014 (subject to change)
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
08:30AM - 09:20AM
09:30AM - 10:20AM
COMP2123B (LE2) Chui C K
COMP3271 (CBC) Wang Jack
CSIS1123B (L

Department of Computer Science
First Term Timetable 2014-2015
Updated on Jul 17, 2014 (subject to change)
Monday
Tuesday
Wednesday
Thursday
Friday
08:30AM - 09:20AM
09:30AM - 10:20AM
COMP2121B (CBA) Chin Francis,
COMP3297 (CBC) Mitcheson
Yiu S M
George
CS

ENGG1007
Foundations of Computer Science
Tutorial 1
Li Ning & Xiaowei Wu
Sep 20, 2012
1
Basic Concepts
Proposition: is a statement that is either true (T) or
false (F), but not both.
A proposition (compound proposition) can be formed
by combining severa

COMP2121/CSIS1118
Discrete Mathematics
Planar Graphs
and Graph Coloring
Francis Chin
November 28, 2013
([O1,O2]) Chapter 10.7, 10.8
1
Motivation: Planar
Layouts
Puzzle:
Three houses have to connect
to three utilities: Electricity,
Water and Gas. For safet

THE UNIVERSITY OF HONG KONG
DEPARTMENT OF COMPUTER SCIENCE
COMP2121 / CSIS1118
Foundations of Computer Science/Discrete Mathematics
Prof. Francis Chin
QUIZ
November 18, 2013 (Mon)
Question 1
Let a, b be any two integers.
(a, b) R if and only if 3a + b is

COMP2121/CSIS1118
Discrete Mathematics
Euler Path/Circuit
Prof. Francis Chin
November 11, 2013
([O1, O2] Chapter 10.4, 10.5)
1
Revision
Graph G(V, E)
Directed and undirected graph
Model of application
Complete graph, cycle, mesh, torus, hypercube
Number o

THE UNIVERSITY OF HONG KONG
FACULTY OF ENGINEERING
DEPARTMENT OF COMPUTER SCIENCE
CSISIllS/COMP2121 Foundations of Computer Science and Discrete Mathematics: Final Exam
Date: 27 May, 2013 Time: 9:30am 12:30pm
Write Your University Number here and also on

COMP2121 Discrete Mathematics
Prof. Francis Chin
QUIZ
October 7, 2013 (Mon)
Question 1 [10 pt]
Show that p (q r) and q (p r) are logically equivalent by means of
a. truth table;
b. by applying the logical known equivalences.
Ans:
a.
p
q
r
p
qr
p (q r)
pr

THE UNIVERSITY OF HONG KONG
DEPARTMENT OF COMPUTER SCIENCE
COMP2121 / CSIS1118
Discrete Mathematics / Foundations of Computer Science
Assignment 3
Due Date: December 10, 2013
Question 1:[10]
(a) How many paths of length 5 are there in the complete biparti

THE UNIVERSITY OF HONG KONG
DEPARTMENT OF COMPUTER SCIENCE
COMP2121 / CSIS1118
Foundations of Computer Science/Discrete Mathematics
Assignment 2
Due Date: Oct 31, 2013 (Thursday)
Question 1:
A binary sequence is a sequence of 0s and 1s. What is the number