CMPSCI 190DM: A Mathematical Foundation for Informatics
Final Exam
David Mix Barrington
10 December 2013
Directions:
- Answer the problems on the exam pages.
- There are seven problems
for 125 total points.
Actual scale is A = 105,
C = 75.
- If you need extra space use the back of a page.
- No books, notes, calculators, or collaboration.
Q1: 20 points
Q2: 15 points
Q3: 15 points
Q4: 20 points
Q5: 15 points
Q6: 20 points
Q7: 20 points
Total: 125 points
- Question 1 (20):
Briefly identify the following terms or concepts (4 points each):
- (a) a function from a set A to a set B
- (b) the inductive hypothesis of an induction proof
- (c) the rule for counting the union of two finite
sets A and B
- (d) a connected component in an undirected graph
- (e) the identity matrix
- Question 2 (15):
Let p, q, r and s be four boolean variables.
I am going to choose values for these variables, but all sets
of values will not be equally likely. Instead I will
choose one of the four variables to be true, with each of the
four equally likely to be chosen, and set the other three
variables to false.
- (a, 5) What is the probability that the statement
"p ∨ q ∨ (¬r)" will be true, given my values for
the four variables?
- (b, 10) What is the probability that the
statement
"(q ∨ r) → ¬(p → (r ∨ s))" will be true, given
my values for the four variables?
- Question 3 (15):
Let g(n) be the number of binary sequences of length n where the first
three digits are all alike. (For example, g(0) = g(1) = g(2) = 0,
and g(3) = 2 because the only possible sequences are 000 and 111.)
Prove
by induction on n, starting with either n = 3, that
g(n) = 2n-2.
- Question 4 (20):
Suppose I throw a six-sided die three times, to get a sequence of
three numbers each chosen from the set {1, 2, 3, 4, 5, 6}, with
each such sequence being equally likely.
- (a, 5) How many different three-number sequences are
there? (Remember that you do not have to evaluate an arithmetic
expression.)
- (b, 5) How many of these sequences have all three
numbers the same?
- (c, 5) How many of these sequences have all three
numbers different?
- (d, 5) What is the probability that two of the
three numbers are the same, and the third is different?
- Question 5 (15):
Let f(n) be the probability that in n independent tosses of
a fair coin, I get heads exactly once. So f(0) = 0
and f(1) = 1/2. We are going to derive a general formula for
f(n). The probability that we get the first heads on
the n+1'st toss is exactly 1/2n+1. If we have one
heads in the first n tosses, the probability that we do not
get another on the n+1'st toss is 1/2.
So we know that f(n+1) = (1/2)f(n) + 1/2n+1.
Using this fact, prove by induction on all positive
integers n that f(n) = n/2n. (Use a base case of n = 1.)
- Question 6 (20): Let B be the following integer matrix:
1 2
2 0
- (a, 5) Draw the directed multigraph whose matrix is B.
Name
the vertices x and y, where the rows and columns correspond to
the two vertices in that order.
- (b, 5) Compute the matrix B2.
- (c, 10) In the directed multigraph of part (a), how many
three-step paths are there from vertex x to itself? Explain your
answer.
- Question 7 (20):
Caroline is a trombonist with the UMass Marching Band, who has
been assigned extra marching practice. On the command "left
face", she is supposed to turn 90 degrees to her left. She does
this correctly 90% of the time, but the other 10% of the time
she
turns 90 degrees to the right instead. Her choice of turn on
each
command is independent of the others. She begins facing north,
and gets a series of "left face" commands, so that at any later
time she is facing either north, east, south, or west.
- (a, 5) Write down the transition matrix T for the Markov
process that describes Caroline's direction change after one
command. Use the row order north-east-south-west.
- (b, 5) Compute the matrix T2. Note
that
many calculations are repeated.
- (c, 5) If she begins facing north, what is the
probability that she is facing south after two commands?
- (d, 5) If she begins facing north, what is the
probability that she is again facing north after four
commands? Remember that you do not have to evaluate an
arithmetic expression.
Last modified 12 December 2013