




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Discrete Structures, Randomized Algorithm, Exercises, Exam Paper
Typology: Exercises
1 / 8
This page cannot be seen from the preview
Don't miss anything!





Problem 1.
(a) Instead, let’s consider a sequence of k coin flips. We look at the probability of getting at least n heads in that sequence. That is, let
Yi =
1 : if the i-th coin flip is heads 0 : otherwise
be an indicator random variable. Then we let Y =
∑k i=1 Yi. There is a direct mapping between the problem if you assume the same random flips. That is, consider getting a value of X 1 = x 1. We have the same chance of getting Y 1 =... = Yx 1 − 1 = 0 and Yx 1 = 1. Similarly, consider Xi = xi. Then we have YPi j−=1 (^1) xi+1 =... = YPij=1 xi− 1 = 0 and YPij=1 xi = 1 with probability P r[Xi = xi]. Basically, if some Xi = xi, then we have a mapping to xi − 1 values of j such that Yj = 0 and 1 value of j such that Yj = 1. We claim that P r[X = k] = P r[Y = n in k flips]. This fact should be somewhat obvious given the mapping. Each Xi = xi corresponds to xi total flips in the sequence of coin flips. Moreover, each Xi corresponds to exactly one head in the sequence. Thus, if X = k, then we have a correspondence to a sequence of k flips with n heads, so Y = n with equal probability. We can generalize to P r[X ≥ k] = P r[Y ≤ n in k flips]. If we increase the value of X on the LHS, then there are fewer heads in the first k flips. Thus, P r[Y ≤ n] decreases commensurately. Once we have this reduction, we can use a Chernoff bound, because we have Yi are indicator random variables. We note that E[Yi] = 1/2 (it’s just a coin flip), giving us μY = E[Y ] =
∑k i=1 E[Yi] =^ k/2. P r[Y ≤ (1 − δ)μY in k flips] ≤ e−δ (^2) μY / 2
= e−δ
(^2) k/ 4
. (1)
If we set k = (1 + ε)2n, and (1 − δ)μY = n, we get
P r[X ≥ (1 + ε)μX ] = P r[Y ≤ (1 − δ)μY in (1 + ε)μX flips] = P r[Y ≤ n in (1 + ε)μX flips] ≤ e−δ (^2) (1+ε)n/ 2
. (2)
Then we just need to substitute in for δ. We have (1−δ)μY = n, so (1−δ)(1+ε)n = n, or δ = ε/(1 + ε), which gives us
P r[X ≥ (1 + ε)2n] ≤ e−ε
(^2) n/(2+2ε) .
(b) As expected, this derivation is very similar to what we did in class.
We start by exponentiating things and applying Markov’s inequality to get
P r[X > (1 + ε)μ] = P r
etX^ > et(1+ε)μ
etX^
et(1+ε)μ^
We take advantage of the independence of our variables to get
E
etX^
e
P (^) tX i ]
= E
etXi
etXi^
Now, we look at the geometric distribution to solve for E[etXi^ ]:
E
etXi^
et^ +
e^2 t^ +
e^4 t^ +...
k=
et 2
)k
et/ 2 1 − et/ 2
, if et^ < 2
et 2 − et^
Substituting back in our formula for E[etX^ ], we get
E
etX^
etXi^
et 2 − et
)n
et 2 − et
)μ/ 2
. (6)
ends up in such a subproblem the problem size reduces by a factor of 4/3, so x can be in at most log 4 / 3 n such problems. We can think of x as belonging to at most log 4 / 3 n segments, where a segment is some number of bad rounds followed by a good round. We let Xi be the value of the i-th segment for x. That is, if Xi = k, then after the (i − 1)-st good round for x, we have k − 1 bad rounds followed by the i-th good round. Wow, would you look at that? The Xi follow a geometric distribution as in Problem 1.^1 Naturally we let X =
i=≤lg n Xi. So now we just apply the bound from Problem 1. We can use the part a bound, because I’m more confident about that one, and it doesn’t really matter. So we have
P r[X ≥ (1 + ε)2 log 4 / 3 n] ≤ e−ε
(^2) log 4 / 3 n/(2+2ε) .
For our purposes, we can set ε = 5 to get
P r[X ≥ 12 log 4 / 3 n] ≤ e−25 log^4 /^3 n/^12 ≤ e−2 log^4 /^3 n^ ≤ e−2 lg^ n^ = 1/n^2.
Notice that increasing ε increases the power of n, so this is really a high probability bound. Alright, so we have a high probability bound that it takes O(lg n) rounds before x is in a subproblem of size 1. But there are n different elements x that we can be talking about, so we take the union bound, giving us probability at most 1/n (or 1/nc−^1 if we adjust the constant) that any element has not been reduced to a subproblem of size 1. Thus, with high probability, all elements are completed by O(lg n) steps (i.e., this many levels of recursion). At each level of recursion, we do at most n comparisons (counting all the subproblems), so with high probability, the total number of comparisons (or work) is O(n lg n).
Problem 3.
(a) Let’s consider just the node with an address of all 0s, denoted by 0(n). We argue that there are Ω(
N ) packets routed through this node, so the total routing must take Ω(
N ) steps. Consider all packets coming from ai 0 (n/2), where 0(n/2)^ is n/2 0s. There are 2n/^2 such packets, because ai is n/2 bits long. The bit fixing strategy corrects each bit in order. Thus, ai is corrected to 0(n/2)^ before the second half of the string is touched. Therefore, each of these packets goes through O(n). Again, there are 2n/^2 = 2lg^ N/^2 = N 1 /^2 such packets, so we’re done.
(b) Again, we argue that a lot of packets will go through 0(n)^ with high probability. Specif- ically, we argue that there are at least 2Ωn^ such packets with high probability.. (^1) The mean is at most 2. Having a smaller mean only helps (stochastic domination), so let’s just argue that the mean is at most 2. i.e., with probability at least 1/2, a round is good. Let xi be the element of rank i. Well, with probability 1/2, we pick a pivot between xn/ 4 and x 3 n/ 4. For any pivot within this range, both subproblems are smaller than 3n/4. Thus, x is in a subproblem of size at most 3n/4, and x has a good round. We can also have a good round for x for some other partition choices, but it doesn’t matter, we just need to show that the probability is at least 1/2.
We again consider a subset of packets starting from ai 0 (n/2). We let S =
ai 0 (n/2)|ai contains k 1s
For every si ∈ S, we have an indicator random variable Xi, with
Xi =
1 : if si goes through 0(n) 0 : otherwise
Similarly, X =
Xi.
We note that |S| =
(n/ 2 k
, because we are just choosing k of n/2 locations to be 1s.
Okay, so now let’s look at E[Xi] = P r[si goes through 0(n)]. The packet from si goes through 0(n)^ if we choose to fix the k bits in the first half of the string to 0s before fixing the corresponding k bits in the second half to 1s. Since there are 2k bits to choose from, and we need to choose k of them first, we have
E[Xi] =
( 2 k k
k 2 ek
2 e
)k .
Thus, we have
(∑n/ k^2 )
i=
Xi
(∑n/ k^2 )
i=
E[Xi]
n/ 2 k
E[Xi]
n/ 2 k
2 e
)k
( (^) n 2 k
)k (^1 2 e
)k
( (^) n
4 ek
)k
. (9)
So now we just choose k = n/(8e). Then we have E[X] ≥ 2 n/(8e). Next, we apply the Chernoff bound to get
P r[X < (1 − ε)E[X]] ≤ e−ε
(^2) E[X]/ 2
≤ e−ε
22 n/(8e)/ 2
= e−ε 22 n/(8e)− 1
. (10)
Now, we just set k = c lg n/ lg lg n, giving us
P r[c lg n/ lg lg n balls in bin 1] ≥
2 e
c lg n/ lg lg n
)c lg n/ lg lg n
2 e
lg lg n c lg n
)c lg n/ lg lg n
c lg n
)c lg n/ lg lg n , for n ≥ 4
c 2 lg lg^ n
)c lg n/ lg lg n
cnc = Ω(n−c). (12)
Setting c = 1/2, we get P r[lg n/2 lg lg n balls in bin 1] ≥ Ω(1/
n).
(b) Okay, first let us argue that conditioning on a bin not having k balls only increases the probability that the next bin does have k balls. We use induction on number of bins we are conditioning on. Let Bi be the event that bin i has at least k balls. The base case is as follows, for i > 1:
P r[Bi] = P r[Bi|B 1 ] · P r[B 1 ] + P r[Bi|¬B 1 ] · P r[¬B 1 ] ≤ P r[Bi|¬B 1 ] · P r[B 1 ] + P r[Bi|¬B 1 ] · P r[¬B 1 ] (13) = P r[Bi|¬B 1 ](P r[B 1 ] + P r[¬B 1 ]) = P r[Bi|¬B 1 ]. (14)
In line 13, we notice that Bi is more likely if B 1 does not have k balls, because then there are more balls that can be in Bi. Okay, so now we assume that it works condition on up to k events, and we condition on the next one. Note that we are solving for every event Bi, with i > k + 1. We have
P r[Bi] ≤ P r[Bi|¬B 1 ∧ ¬B 2 ∧... ∧ ¬Bk] = P r[Bi|B 1 ∧... ∧ ¬Bk ∧ Bk+1] · P r[Bk+1] +P r[Bi|B 1 ∧... ∧ ¬Bk ∧ ¬Bk+1] · P r[¬Bk+1] ≤ P r[Bi|B 1 ∧... ∧ ¬Bk ∧ ¬Bk+1] (15)
The argument is the same as in the base case.
Thus, we have concluded that conditioning on bins not having k balls increases the chances that the next bin does. Specifically, the induction ends at proving
P r[Bi] ≤ P r[Bi|¬B 1 ∧... ∧ ¬Bi− 1 ].
Conversely, we have
P r[¬Bi] ≥ P r[¬Bi|¬B 1 ∧... ∧ ¬Bi− 1 ] ,
because this is exactly 1 − P r[Bi].
So now let’s solve the real problem, with k = lg n/2 lg lg n. From part (a), we have
P r[Bi] = P r[Bin i has at least lg n/2 lg lg n balls] ≥
n
Thus, we have
P r[¬Bi] = P r[Bin i has at most lg n/2 lg lg n balls] ≤ 1 −
n
So now we just solve for all bins having at most this many balls:
P r[all bins have ≤ lg n/2 lg lg n balls] = P r[¬B 1 ] · P r[¬B 2 |¬B 1 ] · · · P r[¬Bn|¬B 1 ∧... ∧ ¬Bn− 1 ]
≤ P r[¬B 1 ] · P r[¬B 2 ] · · · P r[¬Bn]
≤
n
)n
≤ e −
“ (^1) 2 √n
” n
= e−
√n/ 2
. (16)
So the probability is exponentially small that all bins have have fewer than lg n/2 lg lg n balls. Therefore, we conclude that with high probability, some bin has Ω(lg n/ lg lg n) balls.