=========================preview======================
(COMP170)Midterm_1_2005_sol.pdf
Back to COMP170 Login to download
======================================================
HKUST C Department of Computer Science
COMP170: Discrete Math Tools for CS C FALL 2005
Midterm Examination 1 C Solution-Key
Date: Tue, October 04, 2005 Time: 19:00C20:30 Venues: LTD, LTC, LTB



Instructions
.
This is a closed book exam. It consists of 15 pages and 9 questions.

.
Please write your name, student ID, Email, lecture section and tutorial on this page.

.
For each subsequent page, please write your student ID at the top of the page in the space provided.

.
Please sign the honor code statement on page 2.

.
Answer all the questions within the space provided on the examination paper. You may use the back of the pages for your rough work. The last three pages are scrap paper and may also be used for rough work. Each question is on a separate page. This is for clarityand is not meant to imply that each question requiresa full page answer. Many canbe answered using only a few lines.

.
Unless otherwise speci.ed you must always explain how you derived your answer. A number without an explanation will be considered an incorrect answer.

.
Solutions canbe written in terms of binomial coe.cients and falling facto-

rials. For example, 35 + 24 may be written instead of 16, and 53 instead of 60. Calculators may be used for the exam (but are not necessary).

.
Please do not use the nPk and nCk notation. Use nk and nk instead.


Questions 1 2 3 4 5 6 7 8 9 Total
Points 7 7 7 10 15 14 14 12 14 100
Score

As part of HKUSTs introduction of an honor code, the HKUST senate has recommended that all students be asked to sign a brief declaration printed on examination answer books that their answers are their own work, and that they are aware of the regulations relating to academic integrity. Following this, please read and sign the declaration below.
I declare that the answers submitted for this examination are my own work.
I understand that sanctions will be imposed, if I am found to have violated the University regulations governing academic integrity.
Students Name:

Students Signature:
Problem 1: [7 pts] For the multiple choice problems below, circle the correct answer. For this question, no work needs to be shown. In what follows Sn isa set containing n items
(a) Assume n>m. The number of one-to-one functions from Sn to Sm is
n
m nm
(i) 0 (ii) n(iii) m(iv) n(v) m
(b) Assume m>n. The number of one-to-one functions from Sn to Sm is
m nm
(i) 0 (ii) n(iii) m(iv) n(v) n
m
(c) Assume m>n. The number of onto functions from Sn to Sm is
m
m nm
(i) 0 (ii) n(iii) m(iv) n(v) n
(d) Assume m n. You are given n distinct chairs. How many di.erent ways are there to color m chairs red and n .m chairs blue.
m nm
(i) 2n (ii) n(iii) m(iv) n(v) n
m
(e)
You are given n distinct chairs. Each chair is colored either red or blue. How many di.erent ways are there to color the chairs?

(i) 2n (ii) 3n (iii) n! (iv) n2 (v) 2nn