Lecture 7: The Principle of Deferred Decisions

Similar documents
SF2972: Game theory. Introduction to matching

SF2972: Game theory. Plan. The top trading cycle (TTC) algorithm: reference

Mechanism Design without Money II: House Allocation, Kidney Exchange, Stable Matching

CS 787: Advanced Algorithms Homework 1

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 13

Lecture 2. 1 Nondeterministic Communication Complexity

Game Theory and Randomized Algorithms

The next several lectures will be concerned with probability theory. We will aim to make sense of statements such as the following:

Stanford University CS261: Optimization Handout 9 Luca Trevisan February 1, 2011

ON SPLITTING UP PILES OF STONES

1. The chance of getting a flush in a 5-card poker hand is about 2 in 1000.

5.4 Imperfect, Real-Time Decisions

Tiling Problems. This document supersedes the earlier notes posted about the tiling problem. 1 An Undecidable Problem about Tilings of the Plane

NON-OVERLAPPING PERMUTATION PATTERNS. To Doron Zeilberger, for his Sixtieth Birthday

12. 6 jokes are minimal.

Card-Based Protocols for Securely Computing the Conjunction of Multiple Variables

Yale University Department of Computer Science

Lecture 18 - Counting

Non-overlapping permutation patterns

Finite Math Section 6_4 Solutions and Hints

Senior Math Circles February 10, 2010 Game Theory II

Two-Sided Matchings: An Algorithm for Ensuring They Are Minimax and Pareto-Optimal

The tenure game. The tenure game. Winning strategies for the tenure game. Winning condition for the tenure game

Advanced Automata Theory 4 Games

Fermat s little theorem. RSA.

Fast Sorting and Pattern-Avoiding Permutations

Q1) 6 boys and 6 girls are seated in a row. What is the probability that all the 6 gurls are together.

The topic for the third and final major portion of the course is Probability. We will aim to make sense of statements such as the following:

COMP Online Algorithms. Paging and k-server Problem. Shahin Kamali. Lecture 9 - Oct. 4, 2018 University of Manitoba

Computational aspects of two-player zero-sum games Course notes for Computational Game Theory Section 3 Fall 2010

Game Theory and Algorithms Lecture 3: Weak Dominance and Truthfulness

1. An office building contains 27 floors and has 37 offices on each floor. How many offices are in the building?

Today s Topics. Sometimes when counting a set, we count the same item more than once

CS100: DISCRETE STRUCTURES. Lecture 8 Counting - CH6

A Lower Bound for Comparison Sort

MATH 215 DISCRETE MATHEMATICS INSTRUCTOR: P. WENG

28,800 Extremely Magic 5 5 Squares Arthur Holshouser. Harold Reiter.

NIM Games: Handout 1

SMT 2014 Advanced Topics Test Solutions February 15, 2014

Online Computation and Competitive Analysis

Extending the Sierpinski Property to all Cases in the Cups and Stones Counting Problem by Numbering the Stones

Weighted Polya Theorem. Solitaire

18.204: CHIP FIRING GAMES

Game Theory and Algorithms Lecture 19: Nim & Impartial Combinatorial Games

depth parallel time width hardware number of gates computational work sequential time Theorem: For all, CRAM AC AC ThC NC L NL sac AC ThC NC sac

Randomly Permuting Arrays, More Fun with Indicator Random Variables. CS255 Chris Pollett Feb. 1, 2006.

STAT 430/510 Probability Lecture 3: Space and Event; Sample Spaces with Equally Likely Outcomes

REU 2006 Discrete Math Lecture 3

How to Make the Perfect Fireworks Display: Two Strategies for Hanabi

CS 3233 Discrete Mathematical Structure Midterm 2 Exam Solution Tuesday, April 17, :30 1:45 pm. Last Name: First Name: Student ID:

DISCRETE STRUCTURES COUNTING

Week 1. 1 What Is Combinatorics?

Discrete Structures for Computer Science

CSE 312: Foundations of Computing II Quiz Section #2: Inclusion-Exclusion, Pigeonhole, Introduction to Probability (solutions)

SOLITAIRE CLOBBER AS AN OPTIMIZATION PROBLEM ON WORDS

Hanabi is NP-complete, Even for Cheaters who Look at Their Cards,,

n! = n(n 1)(n 2) 3 2 1

Math 152: Applicable Mathematics and Computing

Foundations of Computing Discrete Mathematics Solutions to exercises for week 12

Permutations and Combinations

November 8, Chapter 8: Probability: The Mathematics of Chance

Sec 5.1 The Basics of Counting

CSE 312 Midterm Exam May 7, 2014

Pin-Permutations and Structure in Permutation Classes

CIS 2033 Lecture 6, Spring 2017

Discrete Structures Lecture Permutations and Combinations

BMT 2018 Combinatorics Test Solutions March 18, 2018

Greedy Flipping of Pancakes and Burnt Pancakes

Topics to be covered

Pattern Avoidance in Poset Permutations

Instability of Scoring Heuristic In games with value exchange, the heuristics are very bumpy Make smoothing assumptions search for "quiesence"

Notes for Recitation 3

Randomized Algorithms

Optimal Results in Staged Self-Assembly of Wang Tiles

Cutting a Pie Is Not a Piece of Cake

Enumeration of Two Particular Sets of Minimal Permutations

The Hex game and its mathematical side

IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 55, NO. 6, JUNE

Section Summary. Finite Probability Probabilities of Complements and Unions of Events Probabilistic Reasoning

Lecture Notes 3: Paging, K-Server and Metric Spaces

The Classification of Quadratic Rook Polynomials of a Generalized Three Dimensional Board

Lecture 20: Combinatorial Search (1997) Steven Skiena. skiena

STRATEGY AND COMPLEXITY OF THE GAME OF SQUARES

Tile Number and Space-Efficient Knot Mosaics

Stupid Columnsort Tricks Dartmouth College Department of Computer Science, Technical Report TR

More Great Ideas in Theoretical Computer Science. Lecture 1: Sorting Pancakes

MATH 351 Fall 2009 Homework 1 Due: Wednesday, September 30

3-2 Lecture 3: January Repeated Games A repeated game is a standard game which isplayed repeatedly. The utility of each player is the sum of

Tutorial 1. (ii) There are finite many possible positions. (iii) The players take turns to make moves.

From a Ball Game to Incompleteness

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 11

Near-Optimal Radio Use For Wireless Network Synch. Synchronization

Algorithms. Abstract. We describe a simple construction of a family of permutations with a certain pseudo-random

G R AD E 4 UNIT 3: FRACTIONS - LESSONS 1-3

Two-person symmetric whist

Module 3 Greedy Strategy

CSE465, Spring 2009 March 16 1

Olympiad Combinatorics. Pranav A. Sriram

Spring 2015 Math227 Test #2 (Chapter 4 and Chapter 5) Name


Transcription:

Randomized Algorithms Lecture 7: The Principle of Deferred Decisions Sotiris Nikoletseas Professor CEID - ETY Course 2017-2018 Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 7 1 / 20

Overview A1. The Principle of Deferred Decisions A2. The Proposal Algorithm for the Stable Marriage Problem Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 7 2 / 20

A1. The Principle of Deferred Decisions The Clock Solitaire game: randomly shuffle a standard pack of 52 cards split the cards into 13 piles of 4 cards each; label piles as A, 2,..., 10, J, Q, K take first card from K pile take next card from pile X, where X is the value of the previous card taken repeat until: - either all cards removed ( win ) - or you get stuck ( lose ) We want to evaluate the probability of win. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 7 3 / 20

Key features - game termination Remark 1. The last card we take before the game ends (either winning or loosing) is a K. Proof: Let us assume that at iteration j we draw card X but pile X is empty (thus the game terminates). Let X K (i.e. we lose). Because pile X is empty and X K, we must have already drawn (prior to draw j) 4 X cards. But then we can not draw an X card at the jth iteration, a contradiction. Note: There is no contradiction if the last card is a K and all other cards have been already removed (in that case the game terminates with win). Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 7 4 / 20

Key features - win Remark 2. We win if the fourth K card is drawn at the 52 iteration. Proof: whenever we draw for the 1st, 2nd or 3rd time a K card, the game does not terminate because the K pile is not empty so we can continue (see remark 1). when the fourth K is drawn at the 52nd iteration then all cards are removed and the game s result is win. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 7 5 / 20

The probability of win Because of remark 2, it is: Pr{win} = Pr{4th K at the 52nd iteration} = = #game evolutions: 52nd card = 4th K #all game evolutions Note: Considering all possible game evolutions is a rather naive approach since we have to count all ways to partition the 52 cards into 13 distinct piles, with an ordering on the 4 cards in each pile. This complicates the probability evaluation because of the dependence introduced by each random draw of a card. we define another probability space that better captures the random dynamics of the game evolution. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 7 6 / 20

The principle of deferred decisions Basic idea: rather than fix (end enumerate) the entire set of potential random choices in advance, instead let the random choices unfold with the progress of the random experiment. In this particular game at each draw any card not drawn yet is equally likely to be drawn. A winning game corresponds to a dynamics where the first 51 random draws include 3 K cards exactly. This is equivalent to draw the 4th K at the 52nd iteration. So we forget how the first 51 draws came out and focus on the 52nd draw, which must be a K. But the latter probability is 1 13 because of symmetry (e.g. the type of the 52nd card is random uniform among all 13 types). Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 7 7 / 20

The probability of win Thus we have proved the following: Theorem: The probability of win at the clock solitaire is 1 13. An alternative approach: - we actually have 13x4=52 distinct positions (13 piles, 4 positions each) where 52 distinct cards are placed. This gives a total of 52! different placements. - each game evolution actually corresponds to an ordered permutation of the 52 cards. - The winning permutations are those where the 52nd card is a K (4 ways) and the 51 preceding cards are arbitrarily chosen (51!). Thus: Pr{win} = 4 51! 52! = 4 52 = 1 13 (the idea was to defer, i.e. first consider the last choice and then conditionally the previous ones!) In other words, the principle does not assume that the entire set of random choices is made in advance. Rather, at each step of the process we fix only the random choices that must be revealed. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 7 8 / 20

A2. The Proposal Algorithm for the Stable Matching Problem The Stable Matching Problem. Consider n women (w 1,..., w n ) and n men (m 1,..., m n ). A matching is a 1-1 correspondence between the men and the women (i.e. we assume monogamous, heterosexual matchings) Each person has a strict preference list of the members of the other sex. A matching is unstable iff there exist w i and m j such that: - w i and m j are not matched together - w i prefers m j to her match - m j prefers w i to his match a matching which is not unstable is stable Many applications (e.g. assigning teachers to schools they want to serve at, doctors to hospitals, etc.) Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 7 9 / 20

Questions does a stable matching always exists? (i.e. for all choices of preference lists?) can we find one efficiently? Answers: yes, there is at least one stable matching for every choice of preference lists we will prove this by providing an algorithm that finds a stable matching this algorithm is randomized (Las Vegas) and needs O(n ln n) time w.h.p. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 7 10 / 20

The Gale-Shapley Proposal Algorithm (I) Basic idea: man proposes, woman disposes. Each currently unattached man proposes to the woman he most desires and has not rejected him already. The woman accepts him if she is currently unattached or she prefers him to her current match. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 7 11 / 20

The Gale-Shapley Proposal Algorithm (II) Features: - Once a woman gets matched, she remains matched forever (though her mates may change) - The desirability of her mates (from her perspective) can only increase with time, i.e. at each step either a woman matches for the first time, or she matches to a more desired (to her) mate - Unmatched men always have (at least one) an unmatched woman to make proposals to. - Unmatched men can propose to currently matched women - Men can change status from unmatched to matched and then to unmatched (rejected) and so on, based on the proposals of other men and the womens choice. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 7 12 / 20

A more formal description let us assume some arbitrary ordering of the men let i the smallest value such that man m i is unmatched m i proposes to the most desirable woman (according to his own preference list) that has not already rejected him. she accepts him if either a) she is currently unmatched or b) she prefers him to her current match (in that case, her current match becomes unmatched). this is repeated until there are no unmatched men left. Questions: does the algorithm terminate? is the resulting matching stable? how much time it takes? Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 7 13 / 20

Is the algorithm well-defined? Lemma. Whenever there is an unmatched man m i, there is some woman he has not proposed to (so she cannot have rejected him in the past). Proof: Once a woman becomes matched, she never becomes unmatched in the future Since m i is unmatched currently, all women he has proposed to (if any) so far are matched. Thus, if m i has proposed to all women, then all women are matched, hence all men are matched too - a contradiction. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 7 14 / 20

Worst case time complexity Theorem. The algorithm terminates after O(n 2 ) iterations (proposals). Proof: For man m i, let t i the number of women m i could still potentially propose. n At each step (proposal), the sum t i decreases by 1 (three cases actually: a) get accepted by a matched woman so her current mate gets rejected and cannot propose her again b) get accepted by an unmatched woman so he cannot propose her again c) get rejected) n Initially t i = n 2, so the number of proposals is at most n 2. i=1 Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 7 15 / 20 i=1

Correctness Theorem: The matching found by the algorithm is stable. Proof: Let us assume the matching is unstable, so there is at least two pairs m i w j and m k w l, however with m i and w l preferring to be matched together. Since m i prefers w l to w j, he must have proposed to w l before he proposed to w j. But she rejected him, so she must prefer her current match m k to m i : a) either she already had a better match at the time m i proposed to her or b) she matched m i initially and then got a more desirable proposal. A contradiction. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 7 16 / 20

Average case analysis of the Proposal Algorithm Note: In randomized algorithms random choices are made when processing a fixed input. In average case analysis, the input is random and we analyze the time complexity (a random variable) of a deterministic algorithm In the matching problem, the input s randomness is introduced by assuming that the preference lists are random uniform. Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 7 17 / 20

The Amnesiac version of the Proposal algorithm Note: A simplified modification of the Gale-Shapley algorithm: - At each step, m i proposes to a woman chosen uniformly at a random among all n women (including those he has been rejected by) This does not affect the output of the algorithm, since if m i was rejected by a woman, he will be rejected again if he proposes her again The Amnesiac algorithm thus performs more proposals since it includes some wasted rejects, so his expected running time is an upper bound on the time of the original algorithm Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 7 18 / 20

The expected time complexity Theorem If the preference lists are chosen in a uniform random manner, the expected number of proposals in the Gale-Shapley algorithm is at most O(n log n). Proof: Clearly the algorithm terminates once all women have received at least one proposal. So the matching random process is actually a coupon collectors problem, for which we have proved the following bound: Coupon Collectors: If m = n ln n + cn (for any constant c R) then the time T for collecting all n coupons obeys the following: Pr{T > m} = 1 e e c Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 7 19 / 20

The use of the principle of deferred decisions We have actually used the principle in the sense that we do not assume that the (random) preference lists are chosen in advance. In fact we somehow (in the average case analysis of the Gale-Shapley algorithm) assume that men do not know their preference lists and each time a man makes a proposal he picks a random woman. The only dependency (from the past proposals) left is eliminated in the Amnesiac algorithm by the wasted proposals to women having already rejected a man (i.e. we forget the past) Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 7 20 / 20