

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Math 213 Exam 2 (Solutions)
Prof. I.Kapovich April 10, 2007
Problem 1 A binary string x of length 20 is chosen at random. Let X be the random variable where X(x) is the number of 0s in x plus twice the number of 1s in x. Find E(X) and V (X). Solution. For i = 1, 2 ,... , 20 let
Xi =
1 , if the i-th bit is 0 2 , if the i-bit is 1
Then X = X 1 + · · · + X 20. Clearly, the random variables X 1 ,... , X 20 are independent. Therefore EX =
i=1 EXi^ = 20EX^1 and^ V X^ =^
i=1 V Xi^ = 20V X^1. We have
EX 1 = 1 ·
and
E(X 12 ) = 1^2 ·
Therefore
EX =
i=
EXi = 20EX 1 = 20 ·
and
V (X) = 20V X 1 = 20
Problem 2 Find the general solution of the recurrence relation
(†) an = 4an− 1 − 4 an− 2 + n.
Solution. The associated homogeneous relation is an = 4an− 1 − 4 an− 2. It has characteristic equation r^2 = 4r − 4, that is
r^2 − 4 r + 4 = (r − 2)^2.
Hence the homogenehous relation an = 4an− 1 − 4 an− 2 has the general solu-
tion a( nh )= (c 1 + c 2 n)2n, where c 1 , c 2 ∈ R. We can look for a particular solution of the relation (†) of the form an = α + βn. Substitution this expression in (†) we get 1
2
α + βn = 4(α + β(n − 1)) − 4(α + β(n − 2)) + n (β − 1)n + α − 4 β = 0, and hence β − 1 = 0, α − 4 β = 0 β = 1, α = 4.
Thus an = 4 + n is a particular solution of (†). Therefore (†) has general solution an = (c 1 + c 2 n)2n^ + 4 + n,
where c 1 , c 2 ∈ R are arbitrary constants.
Problem 3 Find the number of onto functions from a 5-element set to a 3-element set. Solution. The number of onto functions from a 5-element set to a 3-element set is:
Problem 4 Let A be the set of all nonempty strings of uppercase and lowercase Eng- lish letters. Let R be the set of all pairs (x, y) where x, y ∈ A are strings of the same length such that for every position n the n-th characters of x and y are the same English letter, either uppercase or lowercase. (a) Show that R is an equivalence relation on A. (b) Find the equivalence class of the string Y es. Solution. (a) It is clear that for every x ∈ A we have xRx and that R is symmetric. Let x, y, z ∈ A be such that xRy and yRz. Since xRy and yRz, the string y has the same length as x and also y has the same length as z. Hence x and z have the same length. Moreover, for every position i the i-th letter of y is the same (with a possible difference in case) as the i-th letter of x and as the the i-th letter of z. Hence the i-th characters of x and z are the same, with a possible difference in case. Thus xRz and R is transitive. Therefore R is an equivalence relation. (b) The equivalence class of Y es is:
{yes, Y es, yEs, yeS, Y Es, Y eS, yES, Y ES}.
Problem 5 Find the conditional probability that exactly four heads appear when a fair coin is tossed 5 times, given that the first flip came up heads.