=========================preview======================
(COMP170)Midterm_1_2006_sol.pdf
Back to COMP170 Login to download
======================================================
HKUST C Department of Computer Science and Engineering
COMP170: Discrete Math Tools for CS C FALL 2006
Midterm Examination 1 C Sketch Solution Key
Date: Th, October 05, 2006 Time: 19:00C20:30 Venues: LTB, LTC, LTD
Instructions
.
This is a closed book exam. It consists of 17 pages and 8 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 Total
Points 10 20 10 15 10 10 11 14 100
Score
As part of HKUSTs introduction of an honor code, the HKUST Senatehas 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: [10pts]Supposethatwehavea studenthallwith9 roomslabelled A, B, . . . , I. How many ways are there to assign 10 students to the 9 hall rooms so that every student is assigned and no hall room is empty?
An assignment is a mapping which states, for each student, which room he/she will live in. Here are three di.erent example assignments.
Assignment Student
1 2 3 4 5 6 7 8 9 10
Assigned to Room
(1) A B C D E F G H I I
(2) A A B C D E F G H I
(3) A A C B D E F G H I
This is exactly the number of onto functions from S10 to S9 (Si, being a set with i elements).
As seen in the homeworks, we can solve this by .rst noticing that exactly one pair of students get assigned to the same room, while all the others get
assigned an individual room. There are 10 ways of choosing that pair