0% found this document useful (0 votes)
11 views11 pages

Practice Problems 2 - Sol

The document contains practice problems covering topics in probability, relations, and combinatorial distributions. It includes problems on random relations, dividing identical coins among persons, properties of trees, weather and animal appearances, and random walks with traps. Each section provides logical statements, calculations, and expected values related to the respective topics.

Uploaded by

kkw91228
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views11 pages

Practice Problems 2 - Sol

The document contains practice problems covering topics in probability, relations, and combinatorial distributions. It includes problems on random relations, dividing identical coins among persons, properties of trees, weather and animal appearances, and random walks with traps. Each section provides logical statements, calculations, and expected values related to the respective topics.

Uploaded by

kkw91228
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Practice Problems 2

1 Random Relation (20 points)


Suppose A is a set of size n, where n is a positive integer. Recall that a relation R on A is a subset
of A × A. If an element x is related to an element y by R, we write (x, y) ∈ R.
We now form a random relation R in the following way. Suppose p is a real number in [0, 1].
Independently for each (x, y) ∈ A × A, the event “(x, y) ∈ R” occurs with probability p.
For each of the following statements, do the following.
(1) Translate into an equivalent logical statement with quantifiers.
(2) Calculate the probability with which the statement holds. If your answer is wrong, partial
credit is given only if you show your working.
Example Statement. The relation R is empty.
(1) ∀x ∈ A, ∀y ∈ A, (x, y) ∈
/ R.
(2) Since each pair (x, y) is not included in R with probability 1 − p independently, the probability
2
that the statement holds is (1 − p)n .

(a) (5 pt) The relation R is reflexive.


Solution:
(1) ∀x ∈ A, (x, x) ∈ R.
(2) pn

(b) (5 pt) The relation R is symmetric.


Solution:
(1) ∀x ∈ A, ∀y ∈ A, (x, y) ∈ R ⇒ (y, x) ∈ R.
n
(2) (p2 + (1 − p)2 )( 2 )

1
(c) (5 pt) The relation R corresponds to a function from A to itself. For instance, if (x, y) ∈ R,
this means that when the input is x, the output is y.
Solution:
(1) Let E := ∀x ∈ A, ∃y ∈ A, (x, y) ∈ R ∧ (∀z ∈ A, (x, z) ∈ R ⇒ y = z).
(2) nn pn (1 − p)n(n−1) .

(d) (5 pt) The relation R corresponds to an injective function from A to itself.


Solution:
(1) E ∧ (∀x1 , ∀x2 , ∀y, (x1 , y) ∈ R ∧ (x2 , y) ∈ R ⇒ x1 = x2 ).
(2) n!pn (1 − p)n(n−1) .

(e) (5 pt) The relation R corresponds to a bijective function from A to itself such that given any
input, the output is not the same as the input.

2
2 Dividing m Identical Coins Among n Persons (20 points)
Suppose n ≥ 2 and m are positive integers. There are m identical coins to be distributed among n
persons.

(a) We describe a procedure called Unfair to divide the coins. The first person comes along and
an integer x is picked uniformly at random from {0, 1, 2, . . . , m}. Then, the first person takes
x coins and goes home. In general, when the ith person comes along (where i < n), and there
are r coins left, an integer y is picked uniformly at random from {0, 1, 2, . . . , r} and the ith
person goes home with y coins. The nth (last) person just takes whatever that is left.
Define Xi to be the number of coins the ith person takes.

(i) (4 pt) Compute E[X1 ], the expected number of coins the first person receives.
Solution:
1
E[X1 ] = m+1 (0 + 1 + 2 + · · · + m) = m
2.

(ii) (2 pt) Suppose n ≥ 3. Given that the first person receives x coins, what is the expected
number of coins the second person receives? (Compute E[X2 |X1 = x].)
Solution:
E[X2 |X1 = x] = m−x
2 .

(iii) (2 pt) Assume n ≥ 3. Compute E[X2 ].


Solution:
E[X2 ] = m
4.

(iv) (4 pt) For general i ≤ n, compute E[Xi ].


Solution:
For i < n, E[Xi ] = m2i
.
m
For i = n, E[Xn ] = 2n−1 .

3
(b) We next consider another procedure called Fair. First, compute the set S of all integer solutions
to the equation x1 + x2 + x3 + . . . + xn = m, where each xi ≥ 0. A solution (x1 , x2 , . . . , xn ) is
picked uniformly at random from S, and for each 1 ≤ i ≤ n, the ith person receives xi coins.

(i) (2 pt) What is the size of S?


Solution:
|S| = m+n−1 = m+n−1
 
m n−1

(ii) (4 pt) Suppose X1 is the number of coins received by the first person. What is the
probability that X1 = k, where 0 ≤ k ≤ m? Express your answer in terms of n, m and k.
Solution:
Number of integer solutions with x1 being k = m+n−k−2 = m+n−k−2
 
m−k n−2 .
m+n−k−2
( n−2 )
P r[X1 = k] = m+n−1 .
( m )

(iii) (2 pt) Prove that for all positive integers n ≥ 2 and m ≥ 1,


m    
X m+n−k−2 m m+n−1
k· = · .
n−2 n m
k=0

Solution:
Since ni=1 E[Xi ] = m and by symmetry, E[X1 ] = m
P
Pm n.
Using the equation k=0 k · P r[X1 = k] = E[X1 ], and the expression for P r[X1 = k] in
the previous part, we have the result.

4
3 Trees and Sinks (10 points)
Recall that a tree is a connected simple graph with no cycle.

n
(a) (5 pt) Prove that any tree with n nodes has at least 2 nodes with degree 1 or 2.
Hint: Using induction naively might be complicated. The following counting argument might
be helpful. Given any tree T , build it node by node. Whenever a new node is inserted, place a
marble at the new node, and possibly redistribute the marbles in existing nodes. Think about
what properties should be maintained to complete the argument.
Solution:
A node with degree at least 3 has no marble; a node with degree 2 has exactly one marble; a
node with degree 1 has one or two marbles; the initial node with degree 0 has one marble. Use
induction to show this property can be maintained.

(b) (2 pt) Given a simple undirected graph G = (V, E), a random direction is assigned to each edge
uniformly at random independently. A node v is a sink if all the edges incident on v receive
direction pointing towards v. Suppose node v has degree d. What is the probability that v is
a sink?
Solution:
1
2d

(c) (3 pt) Suppose T is a tree with n nodes. Prove that after assignment of random directions to
the edges in T , the expected number of sinks is Ω(n).
Solution:
From previous parts.

5
4 Weather and Animals (20 points)
Suppose the weather and the animals obey the following rules.
ˆ The weather of each day is independent of previous days.
ˆ Each day is either sunny or cloudy (but not both); the probability of a day being sunny is 23 .
ˆ The temperature of a day is exactly one of hot, warm or cold. A sunny day is either hot or
warm, where the probability that a sunny day is hot is 14 . A cloudy day is either warm or
cold, where the probability that a cloudy day is cold is 15 .
ˆ Whether an animal appears in a day depends only on the temperature of that day.
A tortoise appears only on a hot or warm day. The probability that a tortoise appears on a
hot day is 54 , and the probability that it appears on a warm day is 12 .
A hare appears only on a warm or cold day. The probability that a hare appears on a warm
day is 43 , and the probability that it appears on a cold day is 14 .

(a) Consider the following scenarios on some given day.

(i) (3 pt) What is the probability that a tortoise appears?


Solution:
phot = 16 , pwarm = 23 1
30 , pcold = 15
2 1 4 2 3 1 4 1 31
3 × 4 × 5 + ( 3 × 4 + 3 × 5 ) × 2 = 60

(ii) (3 pt) Is the event that “a tortoise appears” independent of the event that “a hare ap-
pears”? Prove your answer.
Solution:
23
The probability that a hare appears is: 30 × 34 + 15
1
× 14 = 120
71
.
23 1 3 23
The probability that both animals appear is: 30 × 2 × 4 = 80 .
31 71 23
60 × 120 ̸= 80 . Hence, not independent.

(iii) (3 pt) Suppose a given day is cold. Are the events “a tortoise appears” and “a hare
appears” independent? Prove your answer.
Solution:
Yes, because on a cold day, a tortoise appears with 0 probability.

6
(iv) (3 pt) Suppose on a given day, a tortoise appears and a hare does not appear. What is
the probability that the day is sunny?
Solution:
The probability that a tortoise appears and a hare does not appear is:
1 4 23 1 1 11
6 × 5 × 1 + 30 × 2 × 4 + 0 = 48 .
The probability that it is sunny and a tortoise appears and a hare does not appear:
2 1 4 3 1 47
3 × ( 4 × 5 + 4 × 8 ) = 240 .
The conditional probability is: 47
55 .

(v) (3 pt) Suppose on a given day, both tortoise appears and hare appear. What is the
probability that the day is sunny?
Solution:
Observe that both animals appear only on a warm day.
pwarm = 23
30
The probability of sunny and warm is: 12 .
Hence, the required conditional probability is: 15
23 .

(b) (5 pt) Suppose that among 100 days, there are exactly 40 days on which both tortoise and hare
appear. Among those 100 days, what is the expected number of sunny days?
Solution:
23 57
Probability that not both animals appear = 1 − 80 = 80 .
2 1 3
Probability that sunny and not both animals appear: 3 × (4 + 4 × (1 − 38 )) = 23
48 .
115
Hence, probability of sunny given not both animals appear is: 171 .
The expected number of sunny days:
15 115
40 × 23 + 60 × 171 = 66.4378337147.

7
5 Escaping Probability (20 points)
An agent starts at the origin (0, 0), and performs a random walk in the following manner. If the
current position is (a, b), then it increases exactly one of its coordinates by 1; specifically, its next
position is (a + 1, b) or (a, b + 1), each with probability 21 . The randomness used in each step is
independent of that used in all previous steps.

(a) (3 pt) Suppose a, b are non-negative integers. What is the probability that the agent will pass
through (a, b)?
Compute the numerical solution for the special case (2, 3).
Solution:
a+b
 1
a · 2a+b
Special case: 0.3125

(b) (3 pt) Given non-negative integers a1 ≤ a2 ≤ · · · ≤ an and b1 ≤ b2 ≤ · · · ≤ bn , what is the


probability that the agent will pass through all the points (a1 , b1 ), (a2 , b2 ), . . . , (an , bn )?
Compute the numerical solution for the points: (1, 2), (2, 4), (4, 5).
Solution:
Denote (a0 , b0 ) = (0, 0).
1 Qn (ai −ai−1 +bi −bi−1 )!
Required probability = 2an +bn i=1 (ai −ai−1 )!(bi −bi−1 )!
1 3 3 3 27
  
Numerical solution = 29
· 1 · 1 · 1 = 512 = 0.052734375.

(c) Consider a set V = {(1, 2), (2, 1), (2, 4), (4, 2), (3, 6), (6, 3)} of traps. The final goal of this part
is to compute the probability that the agent can escape without passing through any trap.

(i) (2 pt) Define a binary relation ∼ on V such that u ∼ v iff the probability that the agent
passes through both points u and v is zero. Give a necessary and sufficient condition for
(x1 , y1 ) ∼ (x2 , y2 ).
Solution:
(x1 − x2 )(y1 − y2 ) < 0

8
(ii) (3 pt) Prove whether the relation ∼ is reflexive, symmetric, transitive.
Solution:
Symmetric: yes; Reflexive, transitive: no.

(iii) (2 pt) For a subset S ⊆ V , we use AS to denote the event that the agent passes through
all the points in S. We use the convention that A∅ denotes the sample space Ω of the
experiment.
Give a definition for the sample space Ω associated with the agent’s random walk. (There
can be more than one way to define Ω.)
Solution:
Ω := {→, ↑}N : infinite random walk
Ω := {→, ↑}9 : 9 steps is sufficient to determine whether the agent has escaped from V

(iv) (2 pt) Suppose we use a graph G = (V, E) to represent the relation ∼, i.e., we use an edge
to connect two points that are related by ∼. If S ⊆ V is not an independent set in G,
what is the probability of the event AS ?
Solution:
0

9
(v) (5 pt) Compute the probability that the agent will escape all the traps in V .
(It might be helpful if you draw the graph G.)

Solution:
By the inclusion-exclusion principle, the answer is:
|S| Pr[A ].
P
S⊆V (−1) S

It suffices to consider |S| ≤ 3.


Define v1 = (1, 2), v2 = (2, 4) and v3 = (3, 6); and u1 , u2 and u3 be the mirror images along
the line x = y.
We employ symmetry to reduce calculation for |S| ≥ 1, and multiply the answer by 2.
Case |S| = 1.
1
v1 : 23
·3
1
v2 : 26
· 15
1
v3 : 29
· 84
Case |S| = 2.
(a) on the same side:
1
v1 v2 : 26
·3·3
1
v1 v3 : 29
· 3 · 15
1
v2 v3 : 29
· 15 · 3
(b) on both sides:
1
v1 u2 : 26
·3
1
v1 u3 : 29
·3·6
|S| = 3:
1
(a) same side v1 , v2 , v3 : 29
·3·3·3
1
(b) both sides v1 , u2 , u3 : 29
·3·1·3
Final answer =
1 − ( 83 + 15
64 + 84
512 )
9
× 2 + ( 64 + 45
512 + 45
512 + 3
64 + 18
512 )
27
× 2 − ( 512 + 9
512 ) × 2 = 0.109375

10
6 Extremal Graph with No Hamiltonian Cycle (10 points)
Suppose G = (V, E) is a simple undirected graph, where n = |V | ≥ 3 and m = |E|. The purpose
of this question is to find the maximum possible value of m (in terms of n) such that G has no
Hamiltonian cycle.

(a) (2 pt) For some value of m that will be decided later, suppose a graph G contains m + 1
edges. The goal is to show that G must contain a Hamiltonian cycle. We shall prove this by
contradiction. Suppose there exists two vertices u and v in V such that there is no edge in G
between u and v.
Based on Dirac’s and Ore’s Theorems on Hamiltonian cycles, what assumption should be made
regarding u and v to set up the contradiction proof?
Solution:
The sum of degrees of u and v is at most n − 1.

(b) (3 pt) Suppose that in the graph G in part (a), vertices u and v (together with their incident
edges) are removed. Give a lower bound on the number of remaining edges in terms of n and m.
Solution:
m + 1 − (n − 1) = m − n + 2.

(c) (3 pt) Determine a value of m (in terms of n) to reach a contradiction.


Solution:
n−2

m−n+2≥ 2 +1
n−1

Choose m = 2 + 1.

(d) (2 pt) Prove that the value of m you choose in the previous part is optimal. In other words,
construct a graph G with n vertices and m edges such that G has no Hamiltonian cycle.
Solution:
Clique on n − 1 vertices plus one more edge.

11

You might also like