PPT

HEINZ NIXDORF INSTITUTE
University of Paderborn
Algorithms and Complexity
Algorithms for Radio Networks
Exercise 12
Stefan Rührup
[email protected]
HEINZ NIXDORF INSTITUTE
Exercise 24
University of Paderborn
Algorithms and Complexity
• Assume that a start node s in the center (0, 0) of a square
[−1, 1] × [−1, 1] of edge length 2 chooses uniformly at
random a target node t in this square
1. What is the cumulative probability function P[R ≤ r] for
the distance R = |s-t|2 between the start node and target
node if r ≤ 1?
2. What is the cumulative probability function P[R ≤ r]
if 1 ≤ r ≤ √2?
3. Compute the corresponding probability density function
and draw the graph of the function.
4. What is the expected value of R?
2
HEINZ NIXDORF INSTITUTE
University of Paderborn
Algorithms and Complexity
Exercise 24
1.) r ≤ 1
2.) 1 ≤ r ≤ √2
t
t
A2
A1
s
P[R ≤ r] =
/
=  r2 / 4
s
P[R ≤ r] = (8 A1 + 4 A2) / 4
3
HEINZ NIXDORF INSTITUTE
University of Paderborn
Algorithms and Complexity
Exercise 24
√r2-1
t
A2
r

A1
1
A1
s
A1 = √r2-1
 = /2 - 2
cos  = 1/r
A2

A2 =  r2 · /(2)
P[R ≤ r] = (8 A1 + 4 A2) / 4
=
4
HEINZ NIXDORF INSTITUTE
University of Paderborn
Algorithms and Complexity
Exercise 24
• r ≤ 1: P[R ≤ r] =  r2 / 4
=: F1(r)
P[R = r] =  r / 2
• 1 ≤ r ≤ √2: P[R ≤ r] =
=: F2(r)
P[R = r] =
E[R] ≈ 0.765
Numerical integration of
where fR is the probability density function (PDF),
which is piecewise defined by the two functions above
5
HEINZ NIXDORF INSTITUTE
University of Paderborn
Algorithms and Complexity
Exercise 24
• Distribution function (cumulative probability)
P[R ≤ r]
r
0
F1(r)
F2(r)
1
6
HEINZ NIXDORF INSTITUTE
Exercise 24
University of Paderborn
Algorithms and Complexity
• Probability Density Function (PDF) for 0 ≤ r ≤ √2
P[R = r]
r
7
HEINZ NIXDORF INSTITUTE
University of Paderborn
Algorithms and Complexity
Exercise 25
• Find a counter-example that disproves
for independent random variables X and Y.
• Chose X = {1,2} and Y={1,2} with
P[X=1] = P[X=2] = 1/2 and P[Y=1] = P[Y=1] = 1/2
• E[X] =  k · P[X=k] = 3/2
E[Y] =  k · P[Y=k] = 3/2
• E[X/Y] =  k · P[X/Y=k] = 9/8
X/Y X=1 X=2
P[X/Y] X=1
X=2
Y=1 1
2
Y=1
1/4
1/4
Y=2 1/2
1
Y=2
1/4
1/4
8
HEINZ NIXDORF INSTITUTE
Exercise 26 (additional exercise)
University of Paderborn
Algorithms and Complexity
• An object moves with a constant speed for a fixed distance
d. The speed V is chosen uniformly at random between
either vmin or vmax, i.e. the speed is vmin with probability 1/2
and vmax with probability 1/2.
– What is the average speed v?
– What is the expected speed E[V]?
– Show that v ≤ E[V]
If the speed is constant, one needs a time of t = d/v to cover
a fixed distance d.
The average speed is given by
9
HEINZ NIXDORF INSTITUTE
Exercise 26
University of Paderborn
Algorithms and Complexity
• P[V = vmin] = 1/2 and P[V = vmax] = 1/2.
• The average speed is given by
E[D] = d is fixed. But what is the expected time E[T]?
If the speed is constant, one needs a time of t = d/v to cover
a fixed distance d.
10
HEINZ NIXDORF INSTITUTE
Exercise 26
University of Paderborn
Algorithms and Complexity
• P[V = vmin] = 1/2 and P[V = vmax] = 1/2.
• The expected speed is
The expected speed is also given by
So, this is another example, where
(see Exercise 25)
11
HEINZ NIXDORF INSTITUTE
Exercise 26
University of Paderborn
Algorithms and Complexity
• Show that
12
HEINZ NIXDORF INSTITUTE
Exercise 26
University of Paderborn
Algorithms and Complexity
• What is the minimum of the function x+1/x for x > 0?
(this is a relative minimum,
because the second derivative
is greater than 0)
• x+1/x = 2 for x=1
Therefore,
13
HEINZ NIXDORF INSTITUTE
University of Paderborn
Algorithms and Complexity
Thanks for your attention!
End of the lecture
Mini-Exam No. 4 on Monday 13
Feb 2006, 2pm, FU.511 (Mozart)
Good Luck!
Stefan Rührup
[email protected]
F2.313