The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2015
COMP 2711 Discrete Mathematical Tools for CS
Fall 2015 Written Assignment # 4
Distributed: October 8, 2015 Due: October 15, 2015
Solutions
Your solutions should contain (i) your name, (ii) your student ID #, (ii) your
email address, (iv) your lecture sect
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Spring 2013
Problem Set 3: Discrete Probability
COMP 2711, Spring 2014
Due: 2/4/2014, Wednesday, in class
Please read the Problem Sets webpage carefully for instructions on proper submission of your
work as well as proper academic conduct.
1. Twelve people are random
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2014
COMP 2711 Discrete Mathematical Tools for CS
Written Assignment # 4
Distributed: 8 October 2014 Due: 14 October 2014
At the top of your solution, please write your (i) name, (ii) student ID #,
(iii) email address and (iv) tutorial section.
Some Notes:
Pl
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Spring 2014
L02: More Counting
Use of Sum/Product Principle
Counting lists and functions
The Bijection Principle
Functions concepts: Injection, surjection, and
bijection
The Bijection Principle
# Increasing triples = # 3elements subsets
Counting permutations
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2014
Problem 2: Use induction to prove that
n(n + 1)(n + 2)
1 2 + 2 3 + + n(n + 1) =
3
for all integers n 1.
Problem 2: Use induction to prove that
n(n + 1)(n + 2)
1 2 + 2 3 + + n(n + 1) =
3
for all integers n 1.
Solution: Denote the statement to proven by p(n
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2014
Problem 1: Use contradiction to prove that
n(n + 1)(n + 2)
1 2 + 2 3 + + n(n + 1) =
3
for all integers n 1.
Problem 1: Use contradiction to prove that
n(n + 1)(n + 2)
1 2 + 2 3 + + n(n + 1) =
3
for all integers n 1.
Solution: Start by denoting the problem
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2014
Problem 5
Suppose that boys and girls are equally likely to be born.
(a) In a family consisting of a mother, father, and two children
of dierent ages, what is the probability that the family has
two girls, given that one of the children is a girl?
(b) Wha
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2014
The Tennis Club Problem
A tennis club has 2n members.
We want to pair up the members (by twos) to play
singles matches.
21
The Tennis Club Problem
A tennis club has 2n members.
We want to pair up the members (by twos) to play
singles matches.
(a) In how
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2014
Problem 3 Throwing Balls into boxes
When we say throw m balls into n boxes we mean that each
of the nm possible outcomes is uniformly likely.
(a) Throw 6 balls into 5 boxes.
What is the probability that every box contains at least one ball?
Problem 3 Thro
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2014
The problem
Consider the identity:
n
2
21
n2
4
=
n
4
n4
2
The problem
Consider the identity:
n2
4
n
2
=
n
4
n4
2
Example:
10
2
8
4
= 45 70
= 3150
= 210 15
10 6
=
4
2
22
The problem
Consider the identity:
n
2
n2
4
=
n
4
n4
2
In the next slide we will see
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2014
Problem 1
What is the probability that a hand of 5 cards chosen from
an ordinary deck of 52 cards, will consist of cards of the same
suit?
Problem 1
What is the probability that a hand of 5 cards chosen from
an ordinary deck of 52 cards, will consist of c
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2014
COMP 2711 Discrete Mathematical Tools for CS
2014 Fall Semester Written Assignment # 9
For selfpractice. No need to hand in.
Solution Keys
At the top of your solution, please write your (i) name, (ii) student ID #,
(iii) email address and (iv) tutorial s
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2014
COMP 2711 Discrete Mathematical Tools for CS
2014 Fall Semester Written Assignment # 9
For selfpractice. No need to hand in.
At the top of your solution, please write your (i) name, (ii) student ID #,
(iii) email address and (iv) tutorial section.
Some N
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2014
COMP 2711 Discrete Mathematical Tools for CS
2014 Fall Semester Solution to Written Assignment # 8
Distributed: 20 Nov 2014 Due: 28 Nov 2014
At the top of your solution, please write your (i) name, (ii) student ID #, (iii)
email address and (iv) tutorial
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2014
COMP2711: Tutorial 12
Solution to recurrences
HKUST
Solution to recurrences
COMP2711: Tutorial 12
Question 1
Give asymptotic upper bounds for T (n) by recursion tree
approach. Make your bounds as tight as possible.
(a)
T (1) = T (2) = 1
T (n) = T (n 2) +
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2014
Consider the statement:
For all primes p, either p is odd or p is 2.
(a) Use symbolic statements and a universal quantier to express the above statement.
(b) Express the negation of the statement in (a) using an existential quantier.
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Spring 2014
Part I of Course
Part I: Counting
L01: Basic Counting
L02: More Counting
L03: Binomial Coefficients
Page 1
L01: Basic Counting
Objectives
Counting: What and Why?
Two basic principles of counting
Reading
Textbook, pp. 3138
Page 2
Outline
Introdu
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2015
Midterm Exam
COMP 2711, Spring 2015
1. [10 points]
Let p q and r denote the two given propositions which are both true.
(a) This conditional statement is q p which is the converse of p q. Its truth value
cannot be deduced from that of p q.
(b) Let s denot
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2015
Logic Examples I
Problem 1. Is the following reasoning for nding the solutions of the equation
x correct?
(1) 2x2 1 = x: Given
2x2 1 =
(2) 2x2 1 = x2 : Square both sides
(3) X 2 = 1
(4) So, x = 1 or x = 1.
Problem 2.
a spy.
A, B, C are three persons, one
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2015
Page 1
L09: Probability of Unions of Events
Objective:
The inclusionexclusion principle for probability
Reading
Stein et al. 292300
Outline
The inclusionexclusion principle
An example
Proof of the principle
Page 3
Recall:
Page 5
Example: Roll Tw
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2015
L05: Pigeonhole Principle
Outline
Pigeonhole Principle
Generalized Pigeonhole Principle
Reading: Rosen 6.2
Pigeonhole Principle
Pigeonhole principle
If k + 1 or more objects (pigeons) are placed into k
boxes (pigeonholes) where k is a positive integer
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2015
L03: Rules of Inference
& Basic Proof Technique
Objectives
Rules of Inference
Rules of Inference for Propositional Logic
Rules of Inference for Predicate Logic
Basic Proof Technique
Some Terminology
Direct Proof
Proof by Contraposition
Proof by Contr
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2015
L04: Basics of Counting
Objectives
Product Rule
Sum Rule
Using Both Product and Sum
Rules
Tree Diagrams
Appendix (sets and functions)
Reading: Rosen 2.12.3, 6.1
Page 1
Outline
Introduction
Product Rule
Sum Rule
Using Both Product and Sum Rules
Tre
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2015
COMP 2711 Discrete Mathematical Tools for Computer Science
2015 Fall Semester Assignment # 3
Distributed: 29 September 2015 Due: 7pm, 08 October 2015
Your solutions should contain (i) your name, (ii) your student ID #, (ii) your
email address, (iv) your l
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Fall 2014
COMP 2711 Discrete Mathematical Tools for CS
2014 Fall Semester Solution to Written Assignment # 6
Distributed: Nov 5, 2014 Due: Nov 12, 2014
At the top of your solution, please write your (i) name, (ii) student ID #, (iii)
email address and (iv) tutorial
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Spring 2013
COMP 2711
Page 2
L12: Intro to Logic
Objective
Why should we care about logic?
Introduce basic ingredients of the language of logic.
Reading
Textbook: 147159
COMP 2711
Page 3
Outline
Example: Logic in programs
Logic statements, truth table, and equivalen
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Spring 2013
COMP 2711
Page 1
Overview of Part 5
Theme:
Relating
Small problems
Proof techniques using
Big problems
Small Big relationships
+ proof by smallest counter example
+ proof by induction
Problem solving techniques using
+ recursion
+ divide & conquer
Running
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Spring 2013
COMP 2711
Page 1
L11: The RSA Algorithm
Objective:
Present the RSA Cryptosystem
Prove its correctness
Discuss related issues
Reading
Textbook, pp. 123143
COMP 2711
Page 2
The RSA Algorithm
Exponentiation mod n
The RSA Cryptosystem
Correctness
Fermats Lit
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Spring 2013
COMP 2711
Page 1
Part I of Course
COMP 2711
Page 2
L01: Basic Counting
Objectives
Counting: What and Why?
Basic principles of counting
Reading
Textbook, pp. 3138
COMP 2711
Page 3
Outline
Introduction to Counting
The Sum Principle
Principle through an exa
The Hong Kong University of Science and Technology
Discrete Mathematical Tools for Computer Science
COMP 2711

Spring 2013
COMP 2711 Discrete Mathematical Tools for Computer Science
2017 Spring Semester Pool Questions for Quiz 2
Question 1: Let
P (x) be the statements x is a duck;
Q(x) be the statements x is one of my poultry;
R(x) be the statement x is an officer;
S(x) be th