Midterm - Discrete Mathematics

Midterm - Discrete Mathematics
Class:
Student Number:
Name:
Total Scores: 100%
1. (a) The MASSASAUGA is a brown and white venomous snake indigenous
to North America. How many possible arrangements are there when all four
A’s are together? (5%)
(b) Determine the coefficient of x9 y 3 in the expansions of (2x − 3y)12 . (5%)
2. (a) Give a truth table to consider the statement (p ∨ q) ∧ ¬(p ∧ q). (8%)
(b) Show that a simpler way to express the compound statements (p ∨ q) ∧
¬(¬p ∧ q). (7%)
3. Prove the following equation by the Principle of Mathematical Induction.
(10%)
n
X
n
1
=
.
n+1
i=1 i(i + 1)
4. Find the greatest common divisor of a = 1369 and b = 2597, and express
the result as a linear combination of a and b. (10%)
5. Let A = {1, 2, 3, 4} and B = {x, y, z}. (a) How many functions f : A → B
are there? (5%) (b) How many functions f : A → B are one-to-one? (5%) (c)
How many functions f : A → B are onto? (5%)
6. Angelica is selling boxes of candy for her choir’s Christmas fund raiser.
The pieces of candy are packed into each box so that the mean number of
pieces is 125 with a standard deviation of 5 pieces. To find a lower bound on
the probability that a box of Angelica’s candy contains between 118 and 132
pieces. (5%)
7. The time-complexity function f (n) is defined to be the number of times for
the statement sum := sum + 1 is executed. Determine the best big-O form
for f .
(a) (7%)
begin
sum := 0
for i := 1 to n do
for j := 1 to n do
sum := sum + 1
end
1
(b) (8%)
begin
sum := 0
i := n
while i > 0 do
begin
sum := sum + 1
i := bi/2c
end
end
8. A finite state machine M = (S, F, O, v, w) has F = O = {0, 1} and is
determined by the state diagram shown in Fig. 6.5. (a) Determine the output
string for the input string 110111 with starting at s0 . (5%) (b) Find the state
table for this machine. (10%) (c) Determine an input string x of minimal
length such that v(s4 , x) = s1 . (5%)
2