You are on page 1of 7

2nd partial exam of Combinatorics & Probability Univ.

Rovira i Virgili
December 14, 2022 Version B

You have 2 hours for completing the exam.


No electronic devices are allowed (i.e. calculators, mobile phones, etc.).
All answers must include the supporting deductions and calculations (if the calculations
are too heavy then they can be left implied in the final answer).
If some answer does not include all the necessary information, it will be deemed
invalid.

Name and surname:

1. (2 points) Solve the following recurrence equation by means of generating


functions 
0 if n = 0,

an = 1 if n = 1,

3an−1 − 2an−2 for n ≥ 2.

Solució

The recurrence can be reformulated as

an+2 = 3an+1 − 2an .

We multiply both sides of the equation by z n and sum over n ≥ 0:



X ∞
X ∞
X
an+2 z n = 3 an+1 z n − 2 an z n
n=0 n=0 n=0
A(z) − a0 − a1 z A(z) − a0
=3 − 2A(z)
z2 z
A(z) − z 3A(z)
2
= − 2A(z)
z z
By solving for A(z) we get
z z
A(z) = 2
= .
1 − 3z + 2z (1 − 2z)(1 − z)

Now we decompose A(z) as a sum of partial fractions:


c1 c2
A(z) = +
1 − 2z 1−z
1 1
= − .
1 − 2z 1−z
Finally, with the aid of the table at the back of the exam we get

X ∞
X
n n
A(z) = 2 z − zn,
n=0 n=0
n
an = 2 − 1.

2. Let Ω = {a, b, c, d} and F = {∅, {a}, {b, c}, {d}, {a, b, c}, {b, c, d}, {a, d}, Ω}.
(a) (1 point) Prove that (Ω, F) is a measurable space.
2
(b) (1 point) Let P : F −→ [0; 1] be defined as follows: P({a}) = ,
5
1
P({b, c}) = and P({d}) = α. Determine the value of α so that P is
3
a probability measure over (Ω, F).
(c) (1 point) Calculate P({b, c, d}) and P({a, d}).

Solució

(a) In order to prove that (Ω, F) is a measurable space we just have to


show that F is a σ-algebra over Ω:
i. Ω ∈ F ✓
ii. For all A ∈ F we have A ∈ F:
• Ω=∅∈F ✓
• {a} = {b, c, d} ∈ F ✓
• {b, c} = {a, d} ∈ F ✓
• {d} = {a, b, c} ∈ F ✓

[
iii. If A1 , A2 , . . . ∈ F then Ai ∈ F. Obviously, we don’t have
i=1
to check all the finite or infinite unions that can be constructed
with the elements of F. The following two-set combinations will
suffice:
• {a} ∪ {b, c} = {a, b, c} ∈ F ✓
• {a} ∪ {d} = {a, d} ∈ F ✓
• {b, c} ∪ {d} = {b, c, d} ∈ F ✓
• {a} ∪ {b, c, d} = {a, b, c, d} ∈ F ✓
• {a, b, c} ∪ {d} = {a, b, c, d} ∈ F ✓
• {a, d} ∪ {b, c} = {a, b, c, d} ∈ F ✓
• {a, d} ∪ {a, b, c} = {a, b, c, d} ∈ F ✓
• {a, d} ∪ {b, c, d} = {a, b, c, d} ∈ F ✓
• {a, b, c} ∪ {b, c, d} = {a, b, c, d} ∈ F ✓
Note that we have omitted the combinations where one set is a
subset of the other.
(b) For P to be a probability measure over (Ω, F) we must have

P(Ω) = P({a} ∪ {b, c} ∪ {d}) = P({a}) + P({b, c}) + P({d})


2 1 11
= + +α= + α = 1,
5 3 15
hence
11 4
α=1− = .
15 15
However, we’re not done yet, since we still have to verify that P is
indeed a probability measure over (Ω, F), or in other words, that
(Ω, F, P) is a probability space. In order to do that we have to check
that
i. P(Ω) = 1 ✓
ii. For all A ∈ F we have P(A) ≥ 0 ✓
∞ ∞
!
[ X
iii. If A1 , A2 , . . . are disjoint subsets ∈ F then P Ai = P(Ai ).
i=0 i=0
So we have to verify the following combinations:
     
2 1 11
• P {a} ∪ {b, c} = P {a} + P {b, c} = + = =
  5 3 15
P {a, b, c} ✓
     
2 4 2
• P {a} ∪ {d} = P {a} + P {d} = + = =
  5 15 3
P {a, d} ✓
     
1 4 3
• P {b, c} ∪ {d} = P {b, c} + P {d} = + = =
  3 15 5
P {b, c, d} ✓
     
11 4
• P {a, b, c} ∪ {d} = P {a, b, c} + P {d} = + =
  15 15
1 = P {a, b, c, d} ✓
     
2 3
• P {a} ∪ {b, c, d} = P {a} + P {b, c, d} = + = 1 =
  5 5
P {a, b, c, d} ✓
     
2 1
• P {a, d} ∪ {b, c} = P {a, d} + P {b, c} = + = 1 =
  3 3
P {a, b, c, d} ✓
       
• P {a} ∪ {b, c} ∪ {d} = P {a} + P {b, c} + P {d} =
 
2 1 4
+ + = 1 = P {a, b, c, d} ✓
5 3 15
Note: In principle the last line was not necessary because it was
already verified when we calculated P ({d}).
   
(c) Both P {a, d} and P {b, c, d} were calculated above. Their re-
2 3
spective values are and .
3 5

3. (2 points) Suppose that the floor of our house is covered with rectangular
tiles of size a × 3a, as in Figure 1. If we flip a coin of radius 1 on the floor,
there is a probability p that the coin does not intersect any of the lines.
1
What should be the value of a so that p > ?
2

3a

a
Figure 1: Tiled floor and coin of radius 1

Solució

For the coin not to touch any of the lines, its center must fall inside the
inner (dashed) rectangle, which we will call the admissible region (see
Figure 2). Then, the probability that the center of the coin falls within the
admissible region is the area of the admissible region divided by the area
of the outer rectangle, i.e.

(a − 2)(3a − 2) 3a2 − 8a + 4
p= = .
3a2 3a2
So we have to solve the inequality
3a2 − 8a + 4 1
p= >
3a2 2
3a2
3a2 − 8a + 4 >
2
3 2
a − 8a + 4 > 0
2
3a2 − 16a + 8 > 0
1 √ 1
The solutions to the latter inequality are a < (8 − 2 10) or a > (8 +
3 3
√ 1 √
2 10), but the only one that makes sense is a > (8 + 2 10), since
3
1 √
(8 − 2 10) < 1 (the radius of the coin).
3

3a

a
Figure 2: Admissible region for the center of the coin

4. We have two urns, the first one containing 4 black balls and 2 white balls,
while the second box contains 3 white balls and 2 black balls. An experi-
ment consists of selecting a box at random, and then extracting two balls
at once from the chosen box, also at random.
(a) (1 point) Calculate the probability that at least one of the extracted
balls is black.
(b) (2 points) Suppose that we don’t know which box was chosen. If
the two balls turn out to be white, calculate the probability that the
second box was chosen.

Solució

(a) Let Ui denote the event that the urn Ui is chosen (where i ∈ {1, 2}).
Additionally, let B1 be the event that at least one of the balls is black,
and let W denote the event that both balls are white. If we want
to calculate P(B1 ) directly, we have to use the formula for the total
probability, i.e.

P(B1 ) = P(B1 |U1 ) P(U1 ) + P(B1 |U2 ) P(U2 )

Now, the easiest way to calculate P(B1 ) is indirectly, by noting that


P(B1 ) = 1 − P(W ). Then

P(W ) = P(W |U1 ) P(U1 ) + P(W |U2 ) P(U2 )


2 3
 
1 1 1 1 3 1 11
= 62 + 25 = + =
2
2 2
2 15 2 10 2 60

11 49
Hence P(B1 ) = 1 − P(W ) = 1 − = .
60 60
(b) We now want to calculate P(U2 |W ). Since we have already calcu-
lated P(W ) in the previous problem, we just have to apply Bayes’
rule:
3
P(W |U2 ) P(U2 ) 9
P(U2 |W ) = = 20
11 = .
P(W ) 60
11
SOME USEFUL TABLES AND FORMULAS

Shifting of ordinary generating functions:



X A(z) − A(0) A(z) − a0
If A(z) = an z n , then = is the OGF of the se-
n=0
z z
quence ⟨an+1 ⟩∞
n=0 .
A(z) − a0 − a1 z
is the OGF of the sequence ⟨an+2 ⟩∞n=0 .
z2
Table of ordinary generating functions:

Function Sequence Series



1 X
⟨1, 1, 1, . . .⟩ zn
1−z n=0

1 X
⟨1, −1, 1, −1, . . .⟩ (−1)n z n
1+z n=0

1 X
⟨1, a, a2 , a3 , . . .⟩ an z n
1 − az n=0

1 X
⟨1, 0, 1, 0, 1, . . .⟩ z 2n
1 − z2 n=0

1 X
⟨1, 2, 3, 4, 5, . . .⟩ (n + 1)z n
(1 − z)2 n=0

X X
Total probability: P(B) = P(B ∩ Ai ) = P(B|Ai ) P(Ai )
i≥1 i≥1

P(B|Ak ) P(Ak )
Bayes’ formula: P(Ak |B) = P
i≥1 P(B|Ai ) P(Ai )

You might also like