=========================preview======================
(COMP2711)[2011](f)midterm~=cy3j8^_28872.pdf
Back to COMP2711 Login to download
======================================================
HKUST C Department of Computer Science and Engineering
COMP2711: Discrete Math Tools for CS C Fall 2011
Midterm Examination 1

Date: Tuesday, Oct 4, 2011 Time: 19:00C21:00

Name: Student ID:
Email: Lecture and Tutorial:

Instructions
.
This is a closed book exam. It consists of 14 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 clarity and is not meant to imply that each question requires a full page answer. Many can be answered using only a few lines.

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

.
Solutions can be 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 8 10 12 8 10 15 12 15 10 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:
Solution: Since no red balls are adjacent, all red balls must be separated by a blue ball. We can solve this problem by placing red balls between blue balls. There are b + 1 position to place those red balls. Therefore, the
b+1
answer is .
r
(a)
Consider the following equations: x + y + z = n where x, y, z are integers 0. How many solutions are there?

(b)
Now, consider x1 + x2 + ... + xr = n where x1,x2, ..., xr are integers 0. How many solutions are there?


Solution:
(a) Consider a list of n balls and two walls. These two walls will separate the n balls into three partitions, including partitions of zero balls, and
these partitions correspond to our variables x, y and z. There are n+2
ways of placing these walls.
n+r.1
(b)
In general, we need r . 1 walls. So, there are r.1 ways.

(a