

















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
Material Type: Notes; Class: Introduction to Image Processing and Analysis; Subject: Computer Science and Engineering; University: Arizona State University - Tempe; Term: Fall 2008;
Typology: Study notes
1 / 25
This page cannot be seen from the preview
Don't miss anything!


















Goran Konjevod
Department of Computer Science and Engineering Arizona State University
ASU, Fall 2008
Instructor: Goran Konjevod, BY450, [email protected] Office Hours: TTh 13:30–15: TA: Melih Onus, [email protected] Office Hours: TBA
Leaving decisions to chance. Randomized algorithm: allowed to invoke a random event and use the outcome to determine the next step. Basic random events: (^1) Basic: generate a random bit (^2) Complex: generate a random number (int/float) (^3) Complex: generate a random object of some general type
Randomization may make complicated algorithms simpler make inefficient computations efficient (quicksort, mincut) make possible things we don’t know how to do deterministically (primality testing in P, matching in parallel) make possible things that are provably impossible to do deterministically (volume computation, distributed protocols)
Let s 1 ≤ s 2 ≤... ≤ sn be the set S in order. Let Xij =
1 si is compared to sj 0 si is not compared to sj Number of comparisons made is Tn =
∑n i=
j>i Xij^.
Sample space: set Ω of all possible outcomes (quicksort: the set of all possible runs of the algorithm on input S) Events: subsets of Ω (example: let x be an element of S. The set Ax of all possible runs where the first element selected is x) Probability of an event (Pr[Ax ] = 1/n). Random variable: mapping from Ω to real numbers (Xij ). Expectation of a random variable: its “average value”,
E[X ] =
ω∈Ω
Pr[ω] · X (ω)
(E[Xij ] = Pr[Xij = 1] · 1 + Pr[Xij = 0] · 0 = Pr[Xij = 1]).
Xij = 1 if and only if si and sj are compared. When are si and sj compared? Exactly if either si or sj is selected before any of the elements si , si+1,... , sj− 1 , sj. The probability of this happening is 2/(j − i + 1).
E[Tn] =
∑^ n
i=
j>i
Pr[Xij = 1] =
∑^ n
i=
j>i
j − i + 1
∑^ n
i=
n−∑i+
k=
k
∑^ n
i=
∑^ n
k=
k
≤ 2 nHn = O(n ln n).
Input: (multi)graph G = (V , E ). Output: a cut of minimum cardinality in G. Polynomially solvable, O(n^3 ) time (but not simple). Need n minimum st-cuts or the Stoer-Wagner algorithm.
(^1) Pick an edge e uniformly at random. (^2) Contract e. (^3) Repeat until there are only two vertices left.
Let k be the minimum cut cardinality. Let C be a minimum cut. G has at least kn/2 edges. For i = 1,... , n − 2, let Ai be the event that no edge of C was contracted in the i-th step. If all of the events A 1 ,... An− 2 happen, then the algorithm finds the minimum cut C.
Pr[A 1 ] ≥ 1 −
n
n − 2 n
If A 1 happens, then before the second step of the algorithm there are at least k(n − 1)/2 edges in the graph.
Pr[A 2 | A 1 ] ≥ 1 −
n − 1
n − 3 n − 1
In general, if A 1 ,... , Ai− 1 happen, then before the i-th step there are at least k(n − i + 1)/2 edges in the graph and so
Pr[Ai | A 1 , A 2 ,... Ai− 1 ] ≥ 1 −
n − i + 1
n − i − 1 n − i + 1
Two events A and B are independent, if
Pr[A ∩ B] = Pr[A] Pr[B].
The conditional probability of A given B is defined by
Pr[A | B] =
Pr[A ∩ B] Pr[B]
For any two events A, B, we have
Pr[A ∩ B] = Pr[A | B] · Pr[B].
In general,
Pr[A 1 ∩A 2 ∩· · ·∩Ak ] = Pr[Ak | A 1 ∩· · ·∩Ak− 1 ] · · · Pr[A 2 | A 1 ]·Pr[A 1 ].
The probability that no edge of C is contracted is
Pr[A 1 ∩ A 2 ∩ · · · ∩ An− 2 ] ≥ n − 2 n
n − 3 n − 1
n − 4 n − 2
n(n − 1)