Selecting the the k-th smallest element in a set.

Slides:



Advertisements
Similar presentations
Piyush Kumar (Lecture 3: Stable Marriage) Welcome to COT5405.
Advertisements

Marriage, Honesty, & Stability N ICOLE I MMORLICA, N ORTHWESTERN U NIVERSITY.
“Students” t-test.
Matching Theory.
1 Stable Marriage Problem. 2 Consider a society with n men (denoted by capital letters) and n women (denoted by lower case letters). A marriage M is a.
T(n) = 4 T(n/3) +  (n). T(n) = 2 T(n/2) +  (n)
Randomized Algorithms Kyomin Jung KAIST Applied Algorithm Lab Jan 12, WSAC
CSL758 Instructors: Naveen Garg Kavitha Telikepalli Scribe: Manish Singh Vaibhav Rastogi February 7 & 11, 2008.
1 Discrete Structures & Algorithms Graphs and Trees: IV EECE 320.
Lecture 6 CSE 331 Sep 14. A run of the GS algorithm Mal Wash Simon Inara Zoe Kaylee.
Lecture 4 CSE 331 Sep 9, Blog posts for lectures Starts from today See Sep 8 post on the blog.
1 Bipartite Matching Polytope, Stable Matching Polytope x1 x2 x3 Lecture 10: Feb 15.
Randomized algorithm Tutorial 1 Hint for homework 1.
Lecture 9 CSE 331 Sep 21, Gale-Shapley Algorithm Intially all men and women are free While there exists a free woman who can propose Let w be such.
Lecture 8 CSE 331 Sep 17, HW 1 due today Place Q1 and Q2 in separate piles I will not accept HWs after 1:15pm.
Week 11 - Friday.  What did we talk about last time?  Exam 2 post mortem  Cycle detection  Connectivity.
Chapter 10: Iterative Improvement Simplex Method The Design and Analysis of Algorithms.
The Stable Marriage Problem
A Randomized Algorithm for Minimum Cuts Andreas Klappenecker.
Section 15.8 The Binomial Distribution. A binomial distribution is a discrete distribution defined by two parameters: The number of trials, n The probability.
Lecture 4 1 Discrete distributions Four important discrete distributions: 1.The Uniform distribution (discrete) 2.The Binomial distribution 3.The Hyper-geometric.
Ragesh Jaiswal Indian Institute of Technology Delhi Threshold Direct Product Theorems: a survey.
1 Two-point Sampling. 2 X,Y: discrete random variables defined over the same probability sample space. p(x,y)=Pr[{X=x}  {Y=y}]: the joint density function.
The Mathematics Of 1950’s Dating: Who wins the battle of the sexes? Adapted from a presentation by Stephen Rudich.
The Mathematics Of 1950’s Dating: Who wins the battle of the sexes? Presentation by Shuchi Chawla with some modifications.
Lecture 3 CSE 331. Stable Matching Problem Problem Statement Algorithm Problem Definition Implementation Analysis.
COMP 170 L2 L17: Random Variables and Expectation Page 1.
Stable Matchings a.k.a. the Stable Marriage Problem
Stable Marriage Problem Introductory talk Yosuke KIKUCHI Dept Comp. and Info. Eng. Tsuyama College of Tech OKAYAMA, JAPAN.
CSE 331: Review. Main Steps in Algorithm Design Problem Statement Algorithm Real world problem Problem Definition Precise mathematical def “Implementation”
Great Theoretical Ideas in Computer Science.
1 The Stable Marriage Problem Algorithms and Networks 2014/2015 Hans L. Bodlaender Johan M. M. van Rooij.
All Pair Shortest Path IOI/ACM ICPC Training June 2004.
Stable Matching Lecture 7: Oct 3. Matching A B C DE Boys Girls Today’s goal: to “match” the boys and the girls in a “good” way.
Stable Marriages (Lecture modified from Carnegie Mellon University course Great Theoretical Ideas in Computer Science)
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 7.
Design & Co-design of Embedded Systems Final Project: “The Match Maker” Second Phase Oral Presentation Safa S. Mahmoodian.
Bipartite Matching. Unweighted Bipartite Matching.
The Stable Marriage Problem
Great Theoretical Ideas in Computer Science for Some.
Incentive compatibility in 2-sided matching markets
Network Flows Chun-Ta, Yu Graduate Institute Information Management Dept. National Taiwan University.
Fair Shares.
Graph Algorithms Maximum Flow - Best algorithms [Adapted from R.Solis-Oba]
CSCI 256 Data Structures and Algorithm Analysis Lecture 2 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
18.1 CompSci 102 Today’s topics 1950s TV Dating1950s TV Dating.
1 Distributed Vertex Coloring. 2 Vertex Coloring: each vertex is assigned a color.
The Stable Marriage Problem Original author: S. C. Tsai ( 交大蔡錫鈞教授 ) Revised by Chuang-Chieh Lin and Chih-Chieh Hung.
Algorithms used by CDNs Stable Marriage Algorithm Consistent Hashing.
Matching Boys Girls A B C D E
Cybernetica AS & Tartu University
Stable Matching.
Information Complexity Lower Bounds
Stable Marriage Problem
Introduction to the Design and Analysis of Algorithms
Chapter 10 Iterative Improvement
The Stable Marriage Problem
Apollo Weize Sun, Mar.10th, 2017.
Lecture 18: Uniformity Testing Monotonicity Testing
The Mathematics Of 1950’s Dating: Who wins The Battle of The Sexes?
Lecture 5 CSE 331 Sep 10, 2010.
S. Raskhodnikova; based on slides by K. Wayne
Lecture 8 CSE 331 Sep 16, 2016.
Lecture 8 CSE 331 Sep 15, 2017.
Lecture 10 CSE 331 Sep 21, 2012.
Lecture 9 CSE 331 Sep 15, 2014.
Stable Matchings.
Piyush Kumar (Lecture 3: Stable Marriage)
Lecture 7 CSE 331 Sep 11, 2013.
Random Variables Binomial and Hypergeometric Probabilities
Presentation transcript:

Selecting the the k-th smallest element in a set. Lazy Select Selecting the the k-th smallest element in a set.

Lazy Select Algorithm. Input: A set S of n elements from a totally ordered universe, k-integer in [1,n]. Output: The k th smallest element of S, S(k). at 1. Pick elements of S, chosen independently and uniformly random , with replacement; call this multiset R. log n ) steps using any optimal sorting algorithm. * 2. Sort R in O ( and 3. Let . and b=R(h) Let a=R(l) Determine and

4. If k< then P={y  S | y  b}; else if k > , let P={y  S | y  a}; else if k  , let P={y  S | a  y  b}; Check whether S(k)  P and |P|  . If not, repeat Steps 1-3 until such a set P found. 5. By sorting P in steps, identify which is S(k).

The idea to identify a an b in S such that: 1.The element S(k) , that we seek, is in P. 2.The set P of elements is not very large, so that we can sort inexpensively In Step5. Theorem : With probability , LazySelect finds S(k) on the first pass through Steps 1-5 , and thus performs only 2n+o(n) comparisons.

The probability to fail: We fail if 1 The probability to fail: We fail if 1. either element a>S(k) or b<S(k).( In such a situation P does not contain S(k) ). 2.P is too big. When a > S(k) ? When fewer than l of the samples in R are less than or equal to S(k). Let 1i Thus Pr[ ]=k/n Pr[ ]=1-k/n

Let X indicates the number of samples in R that are at most S(k) Let X indicates the number of samples in R that are at most S(k). What is the expected number of such a samples in R? Recall that If X has an expected value then a and b are chosen good! So what is the probability to fail? Pr[|X- | n ]. Chebyshev: Pr[|X-|t*] 

is a Bernoulli variable, with probability k/n for successes Lemma: is a Bernoulli variable, with probability k/n for successes and (1-k/n) for fail. So , the probability that the element S(k) ,that we seek ,is in P is Note : the analysis of the second mode of failure we leave to diligent student.

The Stable Marriage Problem.

A monogamous, heterosexual society: A : a,b,c,d a: A,B,C,D B : b,a,c,d b: D,C,B,A C : a,d,c,b c: A,B,C,D D : d,c,a,b d: C,D,A,B M: A-a, B-b, C-c, D-d. C-d dissatisfied couple.

Unstable marriage: y X X x Y y X –y dissatisfied pair.

The proposal Algorithm: “man proposes, women disposes”. For each currently unattached men X: X proposes to the most desirable women on his list , who has not already rejected him. For each women y: upon receiving a proposal , decide to accept or to reject. * If man X proposed to women y, she will accept the proposal if she is currently unmarried, or if her current mate Y is less desirable to her than X.(poor Y reverts to the unmarried state). * The algorithm repeats this process, terminating when every person has been married. Algorithm always terminates with a stable marriage. The algorithm uses O(n^2) proposes.

A probabilistic analysis of a deterministic algorithm. What is the number of the proposes in average case? Tp -the number of proposals made during the execution. Assumption: input chosen independently random and uniformly. The principle of Deferred Decisions. We do not assume that the men have chosen their random preference list in advance. Each time a man has to make a proposal , he picks a random woman from the set of women not already propositioned by him. This is equivalent to choosing the random preference list prior to the execution. !!!**In this approach we remove the dependence on the history of proposal.