Online Budgeted Matching in Random Input Models with applications to Adwords



Similar documents
Partial optimal labeling search for a NP-hard subclass of (max,+) problems

The main objective is to maximize the throughput of the traffic.

Online Adwords Allocation

A note on profit maximization and monotonicity for inbound call centers

Regulated Maximal Matching: A Distributed Scheduling Algorithm for Multi-Hop Wireless Networks With Node-Exclusive Spectrum Sharing

Bidding for Representative Allocations for Display Advertising

A Note on Profit Maximization and Monotonicity for Inbound Call Centers

! Search engines are highly profitable. n 99% of Google s revenue from ads. n Yahoo, bing also uses similar model

Control of Wireless Networks with Flow Level Dynamics under Constant Time Scheduling

Unit 11 Using Linear Regression to Describe Relationships

The Online Freeze-tag Problem

Online story scheduling in web advertising

Queueing systems with scheduled arrivals, i.e., appointment systems, are typical for frontal service systems,

Scheduling of Jobs and Maintenance Activities on Parallel Machines

Bidding for Representative Allocations for Display Advertising

Numerical Simulation and Experimental Verification of Air Flow through a Heated Pipe

Optical Illusion. Sara Bolouki, Roger Grosse, Honglak Lee, Andrew Ng

A technical guide to 2014 key stage 2 to key stage 4 value added measures

Point Location. Preprocess a planar, polygonal subdivision for point location queries. p = (18, 11)

MSc Financial Economics: International Finance. Bubbles in the Foreign Exchange Market. Anne Sibert. Revised Spring Contents

CSC2420 Fall 2012: Algorithm Design, Analysis and Theory

Assessing the Discriminatory Power of Credit Scores

v = x t = x 2 x 1 t 2 t 1 The average speed of the particle is absolute value of the average velocity and is given Distance travelled t

DISTRIBUTED DATA PARALLEL TECHNIQUES FOR CONTENT-MATCHING INTRUSION DETECTION SYSTEMS. G. Chapman J. Cleese E. Idle

1) Assume that the sample is an SRS. The problem state that the subjects were randomly selected.

Chapter 10 Stocks and Their Valuation ANSWERS TO END-OF-CHAPTER QUESTIONS

A Spam Message Filtering Method: focus on run time

DISTRIBUTED DATA PARALLEL TECHNIQUES FOR CONTENT-MATCHING INTRUSION DETECTION SYSTEMS

Support Vector Machine Based Electricity Price Forecasting For Electricity Markets utilising Projected Assessment of System Adequacy Data.

Senior Thesis. Horse Play. Optimal Wagers and the Kelly Criterion. Author: Courtney Kempton. Supervisor: Professor Jim Morrow

MBA 570x Homework 1 Due 9/24/2014 Solution

Adwords Auctions with Decreasing Valuation Bids

Polarization resolved measurement of Rayleigh backscatter in fiber-optic components

Group Mutual Exclusion Based on Priorities

Name: SID: Instructions

Congestion and price competition in the cloud

NETWORK TRAFFIC ENGINEERING WITH VARIED LEVELS OF PROTECTION IN THE NEXT GENERATION INTERNET

Advertisement Allocation for Generalized Second Pricing Schemes

TRADING rules are widely used in financial market as

Risk Management for a Global Supply Chain Planning under Uncertainty: Models and Algorithms

6.042/18.062J Mathematics for Computer Science December 12, 2006 Tom Leighton and Ronitt Rubinfeld. Random Walks

Auction-Based Resource Allocation for Sharing Cloudlets in Mobile Cloud Computing

2. METHOD DATA COLLECTION

Project Management Basics

TIME SERIES ANALYSIS AND TRENDS BY USING SPSS PROGRAMME

1 Introduction. Reza Shokri* Privacy Games: Optimal User-Centric Data Obfuscation

MECH Statics & Dynamics

Performance of a Browser-Based JavaScript Bandwidth Test

Redesigning Ratings: Assessing the Discriminatory Power of Credit Scores under Censoring

A Resolution Approach to a Hierarchical Multiobjective Routing Model for MPLS Networks

Auction Mechanisms Toward Efficient Resource Sharing for Cloudlets in Mobile Cloud Computing

Queueing Models for Multiclass Call Centers with Real-Time Anticipated Delays

Performance of Multiple TFRC in Heterogeneous Wireless Networks

6. Friction, Experiment and Theory

Profitability of Loyalty Programs in the Presence of Uncertainty in Customers Valuations

LECTURE 2. TURÁN S THEOREM : BIPARTITE GRAPHS

FEDERATION OF ARAB SCIENTIFIC RESEARCH COUNCILS

CHARACTERISTICS OF WAITING LINE MODELS THE INDICATORS OF THE CUSTOMER FLOW MANAGEMENT SYSTEMS EFFICIENCY

A Simple Model of Pricing, Markups and Market. Power Under Demand Fluctuations

AdWords and Generalized On-line Matching

Mobile Network Configuration for Large-scale Multimedia Delivery on a Single WLAN

CASE STUDY BRIDGE.

A GUIDE TO VALUE ADDED KEY STAGE 2 TO 4 IN 2011 SCHOOL & COLLEGE PERFORMANCE TABLES & RAISE ONLINE

How To Write A Powerline

A Duality Model of TCP and Queue Management Algorithms

A New Optimum Jitter Protection for Conversational VoIP

Report b Measurement report. Sylomer - field test

Review of Multiple Regression Richard Williams, University of Notre Dame, Last revised January 13, 2015

DECISION SUPPORT SYSTEM IMPROVES SUPPLY CHAIN OPERATIONS

Maximizing Acceptance Probability for Active Friending in Online Social Networks

Health Insurance and Social Welfare. Run Liang. China Center for Economic Research, Peking University, Beijing , China,

Growth and Sustainability of Managed Security Services Networks: An Economic Perspective

X How to Schedule a Cascade in an Arbitrary Graph

INFORMATION Technology (IT) infrastructure management

Utility-Based Flow Control for Sequential Imagery over Wireless Networks

Allocating online advertisement space with unreliable estimates

1 Gambler s Ruin Problem

Cluster-Aware Cache for Network Attached Storage *

Apigee Edge: Apigee Cloud vs. Private Cloud. Evaluating deployment models for API management

A GUIDE TO VALUE ADDED KEY STAGE 2 TO 4 IN 2013 SCHOOL PERFORMANCE TABLES & RAISEonline

Progress 8 measure in 2016, 2017, and Guide for maintained secondary schools, academies and free schools

The Cash Flow Statement: Problems with the Current Rules

OPINION PIECE. It s up to the customer to ensure security of the Cloud

T-test for dependent Samples. Difference Scores. The t Test for Dependent Samples. The t Test for Dependent Samples. s D

Global Imbalances or Bad Accounting? The Missing Dark Matter in the Wealth of Nations. Ricardo Hausmann and Federico Sturzenegger

Assigning Tasks for Efficiency in Hadoop

Mixed Method of Model Reduction for Uncertain Systems

Increasing the Operating Safety of the Machine-Tools by Using Hydro-pneumatic Accumulators. Modeling - Simulation

Two Dimensional FEM Simulation of Ultrasonic Wave Propagation in Isotropic Solid Media using COMSOL

Algorithms for Advance Bandwidth Reservation in Media Production Networks

HUMAN CAPITAL AND THE FUTURE OF TRANSITION ECONOMIES * Michael Spagat Royal Holloway, University of London, CEPR and Davidson Institute.

Lecture 15: Transformer Shunt Inductance. Tuned Transformers.

Linear energy-preserving integrators for Poisson systems

Socially Optimal Pricing of Cloud Computing Resources

DUE to the small size and low cost of a sensor node, a

Online Matching and Ad Allocation. Contents

Bi-Objective Optimization for the Clinical Trial Supply Chain Management

Please read the information that follows before beginning. Incomplete applications will delay the review and approval process.


Turbulent Mixing and Chemical Reaction in Stirred Tanks

Transcription:

Online Budgeted Matching in Random Inut Model with alication to Adword Gagan Goel Aranyak Mehta Abtract We tudy an online aignment roblem, motivated by Adword Allocation, in which querie are to be aigned to bidder with budget contraint. We analyze the erformance of the Greedy algorithm (which aign each query to the highet bidder) in a randomized inut model with querie arriving in a random ermutation. Our main reult i a tight analyi of Greedy in thi model howing that it ha a cometitive ratio of 1 1/e for maximizing the value of the aignment. We alo conider the more tandard i.i.d. model of inut, and how that our analyi hold there a well. Thi i to be contrated with the wort cae analyi of [MSVV05] which how that Greedy ha a ratio of 1/2, and that the otimal algorithm reented there ha a ratio of 1 1/e. The analyi of Greedy i imortant in the Adword etting becaue it i the natural allocation algorithm for an auction-tyle roce. From a theoretical erective, our reult imlifie and generalize the claic algorithm of Kar, Vazirani and Vazirani for online biartite matching. Our reult include a new roof to how that the Ranking algorithm of [KVV90] ha a ratio of 1 1/e in the wort cae. It ha been recently dicovered [KV07] (indeendent of our reult) that one of the crucial lemma in [KVV90], related to a certain reduction, i incorrect. Our roof i direct, in that it doe not go via uch a reduction, which alo enable u to generalize the analyi to our online aignment roblem. 1 Introduction In thi aer we tudy an online aignment roblem in which there i a random tream of item (or querie) arriving online, and each item, a it arrive, ha to be allocated to one of everal bin (or bidder). Each bin ha a different value for the item, and alo ha a caacity (or budget). The goal i to maximize the total value of the allocation. The motivation for thi roblem i keyword baed ad auction. In uch an auction, advertier reort to the earch engine their bid for different keyword (how much they are willing to ay for each click on their ad if it i laced next to the earch reult for that keyword). Beide ubmitting bid for different keyword, an advertier alo reort a global daily budget, over all keyword. When a uer ubmit a query (coniting of keyword), he i returned, next to the earch reult, a mall lit of advertiement relevant to the keyword. The earch engine job i to decide which ad to return with each query in the query equence. The Adword auction, being crucial for the multi-billion dollar market they uort, call for theoretical invetigation and there are everal different iue that have been tudied (e.g., the tudy of game theoretic aect of ingle query auction [AGM06, EOS07, Var06] and otimization from advertier erective [RW06, FMPS07]). Arguably, one major iue i that of deigning allocation algorithm to maximize revenue (ee [MSVV05, LPSV07]). An allocation algorithm ha to determine for each query, a it arrive, which bidder win the query, i.e., whoe ad hould be dilayed. A natural algorithm for uch an auction tyle roce i Greedy : Select the highet bidder for each query. It can be hown that the Greedy algorithm ha a cometitive ratio of 1/2 in the tandard online wort-cae cometitive analyi model. In [MSVV05] a determinitic algorithm with a cometitive ratio of 1 1/e 0.63 wa reented, which wa roved to be otimal, even over randomized algorithm 1. College of Comuting, Georgia Intitute of Technology, Atlanta GA, gagang@cc.gatech.edu Google, Inc., Mountain View, CA, aranyak@google.com (Work done while the author wa at the IBM Almaden Reearch Center, San Joe, CA.) 1 In earch auction, winner are uually charged the next highet bid. Furthermore, each bid can be normalized by quality factor.

In ite of the elegance and otimal cometitive ratio of thi algorithm, there remain ome diatifaction with the ue of wort cae analyi in that we are unlikely to ee a wort-cae equence of querie a inut. In thi aer we make a more ditributional aumtion about the query equence: the querie arrive in a random ermutation, i.e. the et of querie i till arbitrary, but the order of querie i random. Thi lead u to formulate the following combinatorial roblem (we aume, for imlicity, that there i exactly one ad returned er query): There are m bidder. Bidder i ha a budget of B i. There i a (unknown) et Q of n querie. For q Q, and i [m], bid iq i the bid of bidder i for query q. The querie arrive online one at a time, in a random ermutation of Q. The algorithm ha to allocate each query, a it arrive, to a bidder. Let Q i be the et of querie allocated to bidder i at the end of the inut equence. The revenue of the algorithm i defined a m i=1 min{b i, q Q i bid iq }. The goal of the algorithm i to maximize it revenue. We alo tudy thi aignment roblem in the more tandard i.i.d. inut model, in which there i an unknown ditribution on querie, and the next query in the equence i icked indeendently from thi ditribution. Undertanding the Adword allocation roblem in ditributional model i imortant, and wa an oen quetion in [MSVV05] and in [LPSV07] (ee alo a different aroach in [MNS07]). The random ermutation model ha been tudied, e.g., in the claic ecretary roblem [Dyn63], recent work in auction [BIK07] and in data tream [GM06] with the motivation that an adverary may have control over the et of inut, but not have control over the order of the inut, which may follow ome random roce. In the roblem above, we will aume that for each bidder i m: max q Q bid iq i very mall comared to B i. Thi i a reaonable aumtion for the Adword motivation, alo made in [MSVV05]. But in fact, our algorithm and analyi work for a larger cla, encomaing thi aumtion. We define thi cla formally in Section 3, but mention here that thi cla alo contain the roblem of biartite matching (all bid 0 or 1, all budget 1) and b-matching, for any oitive integer b (all bid 0 or 1, all budget b). The offline verion of thi roblem i NP-hard, with the bet known algorithm [AM04] (ee alo [FGMS06]) giving a factor of 1 1/e, even if the bid are not retricted to be mall comared to budget (when the bid are very mall comared to budget then LP rounding give a factor very cloe to 1). Finally, we note that indeendent of the Adword motivation, the roblem defined above i a general combinatorial allocation roblem, cloely related to claic matching roblem, and with oible alication beyond the current motivation. 1.1 Main Reult Our main reult i an analyi to how that Greedy ha cometitive ratio 1 1/e in the random ermutation inut model, a well a in the i.i.d. model. Thi i to be comared with the ratio in the wort cae inut model: 1/2 for Greedy and the otimal 1 1/e for the algorithm in [MSVV05]. We alo how that our analyi i tight by roviding examle in the two model for which Greedy ha ratio exactly 1 1/e. We alo how a lower bound that no determinitic algorithm can have a ratio better than 3/4 and no randomized algorithm can have a ratio better than 5/6 for the cae of biartite matching in the random ermutation model. Along the way, we rovide a direct roof for the RANKING algorithm of [KVV90] for the online biartite matching roblem (ee below for detail). 1.2 Technique From a technical erective our work can be een a imlifying and generalizing the claic work of Kar, Vazirani and Vazirani on online biartite matching (matching boy to girl) in the wort cae inut model [KVV90]. Their RANKING algorithm fixe beforehand a random ermutation of the boy, and matche each arriving girl to the highet available neighbor in the ermutation. They how a duality reult that the erformance of RANKING in the wort cae i the ame a the erformance of Greedy in the random ermutation model (boy arrive in a random ermutation). They how that thi cometitive ratio i 1 1/e, by analyzing a virtual algorithm called EARLY, which work identical to RANKING, but additionally, refue to match a boy if the correct girl ha already been matched off. They how that RANKING i trictly better than EARLY, and that EARLY ha a cometitive ratio of 1 1/e. For imlicity of reentation, we aume in our analyi that the bid are already normalized if neceary, and that we dilay only one ad er query and hence need to determine a ingle winner er query. We do not conider the iue of econd rice in our etting, and aume that a winning bidder ay hi own bid. We alo make a natural modeling aumtion (alo made in [MSVV05]) that all the bid of a bidder are very mall comared to hi budget.

On the way to roving our main reult on the general Adword roblem, we rovide a different roof for biartite matching. Thi roof ha the advantage that it i imler and direct, in that we do not conider any Refual algorithm (like EARLY) at all, but rove the factor of Greedy via direct argument. Thi imler analyi enable u to extend the coe of the algorithm and the analyi to our general aignment roblem in the randomized inut model. In fact, indeendent of our reult, it ha been dicovered [KV07] that the roof in [KVV90] ha a hole, in articular that one of the lemma (Lemma 6) related to the EARLY algorithm i incorrect. Thu, while RANKING indeed ha a ratio of 1 1/e (by our roof), the ratio of EARLY i unknown at thi oint. Our direct roof for the cae of matching follow the main idea from [KVV90], but alo introduce ome new idea. To rovide a direct roof for Greedy we ue a different claification of ermutation: For each boy, we claify the et of all ermutation into thoe in which remain unmatched and thoe in which get matched. We further claify the latter cla into two ubclae good and bad deending on the tructure of the match. We then bound the number of unmatched boy by howing that for every unmatched boy there i a certain fraction of bad matche, and for every bad match there i a certain fraction of good matche. Thi give u the factor of Greedy. The Tagging Procedure: In going from the cae of matching to the more general cae of Adword, we need to develo ome new technique to take care of the comlexity introduced in having different bid for the ame query. The main reaon i that in matching, ince all the bid are 0 or 1 (with a budget of 1), any match i a good a another, while thi i not the cae with different bid. Thi create everal different (but related) iue: In matching, if a boy get matched to a wrong girl then it can affect at mot one other boy, in the ene that at mot one other boy might not get matched. In the general roblem, if a query goe to a wrong bidder then it can affect everal other querie in many different way. To cature thi interaction we introduce a tagging rocedure which find an aroriate ma from a query to other querie. Thi i required in order to define notion of good and bad event. Another difference from matching i that a query may be tagged imultaneouly by any number of good and bad tag, while in matching the maing i alway either good or bad, from exactly one boy to another. On Monotonicity: One imortant roerty that we need in our analyi i that of monotonicity of the allocation algorithm: If you move a query to the front of the ermutation, then each bidder end at leat a much money now a before (ee Lemma 2.5 and 3.1 for detail). Thi roerty eem very ueful to get a handle on the analyi: Our roof in the matching cae exloit the fact that Greedy i monotonic, while the roof in [KVV90] ha a hole reciely becaue their EARLY algorithm i not monotonic. However, uon moving to the general Adword roblem, it turn out that Greedy i not monotonic a uch. Thi create an obtacle in the roof. We get around it by analyzing a variant of Greedy: In the cae that a bidder ha not yet exhauted hi budget, but hi bid for a query i larger than hi remaining budget, we do not truncate hi bid, but intead over-end hi budget. Each bidder will overend at mot once, and we will not count the overending a art of the revenue. Thi variant of Greedy can be hown to be monotonic, and therefore eaier to analyze. We then how that the revenue of Greedy i almot the ame a that of the variant, thu roving a bound for Greedy. Regarding our random ermutation model of inut, we note that it i not new, ued mot notably in the claic ecretary-tyle roblem [Dyn63] (ee alo [BIK07]), in which a random ermutation of a et of number arrive online and we have to ick the larget number when it arrive. Our roblem i concetually different, ince it involve artitioning the entire random equence into m art to maximize the um of the value of the art, rather than icking one element or tructure in the equence which i the larget. Likewie, the technique from ecretary-tyle roblem do not eem to aly here. The random ermutation model ha alo been ued recently in the data-tream literature [GM06]. We tructure the ret of thi aer a follow: We firt tudy the imler cae of biartite matching in Section 2, before analyzing the general roblem in Section 3 (the roof in the cae of matching i imler and hel undertand the general cae). We analyze the i.i.d. model in Section 4.2, and rovide the lower bound in the ermutation model in Section 4.3. We conclude with a general dicuion of thi and related roblem in Section 5.

2 The Cae of Online Biartite Matching In thi ection we conider the ecial cae of biartite matching (bid all 0 or 1, budget all 1). In thi roblem, there i a biartite grah (boy and girl). In the random ermutation model, only the girl are known to the algorithm in advance, while the boy arrive in a random ermutation. A a boy arrive, hi incident edge are revealed, and he can be matched off to ome girl. The Greedy algorithm matche each arriving boy to the firt neighboring girl who i till available (firt in ome re-determined arbitrary order). We roceed to analyze the erformance of Greedy in thi model. By a duality rincile hown in [KVV90], thi alo give a roof for RANKING in the online wort cae model. We label the boy and girl with number from 1 to n. We will ue, q [n] to denote boy and girl, and ue, t [n] to denote the oition in the ermutation. We alo ue the notion of time: time t will denote the event when Greedy trie to allocate the boy at oition t. We aume that there i an otimal matching of ize n, and that [n] it matche boy with the girl (thi aumtion i for imlicity of reentation, and can be removed later). Let Ω be the et of all ermutation of [n]. For a ermutation σ Ω, σ() will rereent the boy at oition, and σ 1 (), the oition of boy. 2.1 Intuition: Whether a boy get matched or not clearly deend on hi oition in the random ermutation. If he i high enough in the ermutation, then he will get matched, but if he come in low in the ermutation, then by the time he arrive, hi deirable girl may all have been matched off to other boy. Let u ay that boy remained unmatched in a articular ermutation σ. Note that thi could only have haened if girl wa already matched (ay, to boy ) when boy arrived. So we can aociate the mi of boy to the match of boy. Likewie, we can aociate every mi to a unique match. But notice that all thee matche that we conidered are of ecial kind: girl got matched to boy and boy arrived after boy. We will later define thee kind matche to be bad matche. Now let u conider the econd kind of match: i.e. girl got matched to boy and boy arrived before boy. We hall later define uch a match of boy to be a good match. Note that in a good match we are guaranteed that both boy and girl got matched (a well a boy ). Our goal i to rove that, on the average over all ermutation, there are many matche, in articular, many good matche. Clearly, every mi for boy i caued by a bad match for ome other boy q (who tole hi girl ). Thi immediately how a factor of 1/2 for Greedy (in fact for every ermutation). We will how omething tronger: On average over all ermutation, the mie reult in an even larger fraction of bad and good matche. 2.2 Proof Outline: For each σ Ω, [n] and [n], define: 1 if σ() = and boy remain mi σ (, ) = unmatched at the end of Greedy. 0 otherwie. 1 if girl q i matched to boy σ(), good σ (, q) = and σ 1 (boy q). 0 otherwie. 1 if girl q i matched to boy σ(), bad σ (, q) = and σ 1 (boy q) >, 0 otherwie. Define alo the following artition for every boy. Partition the et Ω into grou of ermutation.t. in each grou the relative order of all but boy i fixed. Let Ω be one uch grou. Let σ k Ω be the ermutation in which boy occur at oition k. We will rove three main relationhi between aggregate of thee variable. The firt inequality follow immediately from the definition (either the boy in oition t remain unmatched, or ome girl get matched to him). The other two require a detailed look at the relationhi between different ermutation, and their roof

are rovided immediately below in Section 2.3. Lemma 2.2 and 2.3 hold for every [n] and every grou Ω. Lemma 2.1. σ Ω, t [n] : good σ (t, ) + bad σ (t, ) + mi σ (t, ) = 1 Lemma 2.2. t [n] : mi σt (t, ) σ Ω :<t bad σ (, ) n Lemma 2.3. t [n 1] : bad σ (, ) n σ Ω t σ Ω : t+1 good σ (, ) The three lemma above contrain the variable mi, bad and good at the end of Greedy, for every inut. Note how Lemma 2.2 and 2.3 how that if there are many mie then there are many bad matche and therefore many good matche. Alo notice that the revenue of Greedy i given by: [ ] E [ σ Ω bad σ (, )] + E σ Ω [ good σ (, )] We minimize the revenue over the contrained region given by the inequalitie to get the wort erformance of the algorithm (on a random ermutation of the wort et Q). Thi rogram turn out to be linear, and we can olve the LP to how a factor of 1 1/e. Thi technique i known a a factor revealing LP and the detail are given in the Aendix A. Theorem 2.1. The cometitive ratio of Greedy in the random ermutation inut model (and hence of RANK- ING in the online model) i 1 1/e. 2.3 Some Baic Proertie of Greedy and Proof of the Inequalitie: We tart by decribing three baic roertie (Lemma 2.4, 2.5 and 2.6) of the Greedy algorithm and the variable defined above. Thee will hel u work toward our main lemma (Lemma 2.2 and 2.3). The firt lemma follow eaily from the definition. Lemma 2.4. [Prefix Proerty] For any two ermutation σ 1 and σ 2, and any t [n], if we have t : σ1 1 () = σ 1 2 (), then the run of Greedy on σ 1 and σ 2 are identical from time 1 to time t. The econd lemma decribe a crucial monotonicity roerty of the Greedy algorithm. Informally, it ay that if you move a boy u front in the ermutation, then the et of girl who ued to be matched by time t are now all matched by time t + 1. Formally, for [n], define G (t) to be the et of the girl matched during the time 1 to t by Greedy in the run on ermutation σ. Lemma 2.5. [Monotonicity], m [n], < m : (1) t [1, 1] : G m (t) = G (t) (2) t [ 1, m 1] : G m (t) G (t + 1) Proof. The firt art follow directly from Lemma 2.4. We will ue induction on t to rove the econd art. The bae cae i when t = 1, and follow eaily from the firt art itelf. Suoe the lemma hold for all t k,

where 1 k < m 1. We will how that the lemma hold for t = k + 1. By hyothei, G m (k) G (k + 1). Notice that the boy at oition k + 1 in σ m i ame a boy at oition k + 2 in σ. Let u denote thi boy by b. If b i unmatched in the run of Greedy on σ m, then the induction te hold trivially. So, intead, aume that b i matched to girl g in the run of Greedy on σ m. We hall how that g G (k + 2). Suoe not. Thi mean that girl g wa available when Greedy wa matching b in σ, but the boy b got matched to ome other girl g / G (k + 1). By the induction hyothei we have g / G m (k). Therefore both g and g were available at time k + 1 in the run on σ m, and Greedy hould have referred g over g in that run a well, a contradiction. Hence g G (k + 2) and the lemma hold by induction. From the definition, we know that for any ermutation σ, at mot one out of the 2n variable, {good σ (, ), bad σ (, )} [n] can be 1: (2.1) σ : (good σ (t, ) + bad σ (t, )) 1 t The third roerty tell u which variable i 1, for each ermutation σ x Ω : Lemma 2.6. [Partition] Fix, and a artition Ω. Conider the run of Greedy on the ermutation σ n. If girl get matched to the boy at oition t, for ome t [n], then: (1) x [1, t] : good σx (, ) = 1 : t+1 (2) x [t + 1, n] : bad σx (t, ) = 1 Proof. (2): By Lemma 2.4 (Prefix Proerty), we know that x [t + 1, n], in the run on σ x, girl i matched to the boy at oition t, and therefore bad σx (t, ) = 1. (1): By Lemma 2.5 (Monotonicity), we know that x [1, t], in the run on σ x, girl i matched to ome boy whoe oition lie in the range [x, t + 1], and therefore [x,t+1] good σ x (, ) = 1. Now we are ready to rove the main inequalitie (Lemma 2.2 and 2.3): Proof of Lemma 2.2 : If mi σt (t, ) equal 0, then lemma hold trivially. So aume that mi σt (t, ) = 1. Thi mean that in σ t, boy (who i in oition t) remain unmatched. Thi i oible only if girl i matched to ome boy whoe oition i ome t < t. Now by Lemma 2.6, [t + 1, n], bad σ (t, ) = 1. Thi give the following equence: (2.2) bad σ (, )/(n ) σ Ω :<t bad σ (t, )/(n t ) (t < t) σ Ω n bad σ (t, )/(n t ) =t +1 = 1 (Lemma 2.6) = mi σt (t, ) Proof of Lemma 2.3 : the run on σ n. We conider two different cae: whether girl get matched or remain unmatched in

Cae 1: Girl remain unmatched in σ n. Take any ermutation σ x Ω, x [n]. If girl i matched in σ x then, by Lemma 2.4 (Prefix Proerty), it could only be to a boy in ome oition greater than or equal to x. Hence, t : bad σx (t, ) = 0, and the lemma hold trivially. Cae 2: Girl i matched in σ n. Suoe he i matched to the boy in oition t. There are two ubcae: Cae 2.1: t < t. Lemma 2.6 and Lemma 2.1 tell u which of the variable are 1. We ee that for every σ Ω, and every < t, bad σ (, ) = 0. Hence in thi cae, the left hand ide i 0, and the lemma follow trivially. Cae 2.2: t t. Again uing Lemma 2.6 and Lemma 2.1 we get the following: σ Ω t bad σ (, ) n = bad σ (t t, ) n t σ Ω = t = σ Ω : t +1 = σ Ω : t+1 good σ (, ) good σ (, ) All the equalitie follow from Lemma 2.6 and Equation (2.1). The firt equality hold becaue t, σ Ω, bad σ (, ) = 0. The econd equality hold becaue bad σ (t, ) = 1 for reciely the lat n t of the σ Ω. Similarly, the lat two equalitie hold becaue : t +1 good σ(, ) = 1 for reciely the firt t of the σ in Ω, and the ret of the variable are 0. Thi rove the lemma in thi cae a well. 3 The General Problem In thi ection we tudy the general aignment roblem a defined in Section 1. A mentioned there, our analyi hold for a larger cla of inut which include biartite matching and the cae of mall bid. We decribe thi cla below: For each bidder i, conider an allocation of ome ubet of the querie to bidder i, ay (q 1, q 2,..., q k ), which k 1 traddle the budget in the following ene: j=1 bid ij < B i k j=1 bid ij. For every uch allocation we are guaranteed that the overending i mall comared to the budget, i.e., k j=1 bid ij B i B i. We will how that Greedy, which aign every query that arrive to the highet bidder with a non zero remaining budget, ha a cometitive ratio of (1 1/e) when the inut arrive in a random ermutation of the (unknown) query et (the cae of i.i.d. inut i conidered in Section 4.2). Note that OPT i an offline otimum algorithm and will have ame allocation for any uch inut ermutation. Our analyi of Greedy in the matching cae involved a maing between a boy and the boy to whom girl got matched. In the more general cae of Adword allocation with different bid thi kind of aociation become non trivial. For every query there i a correonding bidder i to whom OPT allocated query. But now Greedy could aign everal querie with different bid value to thi bidder and the maing between query and thee querie i not traightforward. Our tagging rocedure take care of thi difficulty: For a ermutation σ Ω, σ() will rereent the query at oition, and σ 1 (), the oition of query. The Tagging Procedure: Fix an otimal allocation OP T and alo fix, for each bidder, an arbitrary ordering of the querie aigned to it in OPT. Now conider any query q and the bidder i to whom OPT aigned q. In the fixed ordering, when OPT aigned q to i, uoe that the money ent by i increaed from x to y. Then we will call [x, y] i, the Ot-Interval of the query q: i.e., define Ot-Interval(q) = [x, y] i. Greedy, run on ome ermutation σ, make it own allocation, leading to a imilar Alg-Interval σ (q) for each query q. For a query q, the money in Ot-Interval(q) i ent by Greedy on ome other querie, ay, e.g., q 1, q 2, q 3. We ay that q 1, q 2 and q 3 tag the Ot-Interval of q. We define taget σ (q 1, q) a the et Ot-Interval(q) Alg-Interval σ (q 1 ). The ame et i alo called goodet σ (q 1, q) or badet σ (q 1, q), deending on whether σ 1 (q) σ 1 (q 1 ) or σ 1 (q) > σ 1 (q 1 ).

q5=5 q4=5 OPT q3=2 q2=4 q1=2 Greedy Figure 1: How bidder i money i ent in OPT and in the run of Greedy on the ermutation (q 1, q 2, q 4, q 5, q 3). The dotted line highlight goodet σ(q 3, q 5) = taget σ(q 3, q 5) Examle: For illutration uroe, conider the following cenario. Focu on five ecial querie q 1, q 2, q 3, q 4, q 5, and a bidder i who ha a budget of 10. Fix an OPT which aign q 4 and q 5 to bidder i in that order (ee Fig 1). Conider a ermutation σ in which the relative oition of thee querie i (q 1, q 2, q 4, q 5, q 3 ), and uoe that Greedy aign q 1, q 2, q 3 to bidder i (in that order). The bid of the different querie are hown in the figure. Then we have the following taget: taget σ (q 1, q 4 ) = [0, 2] i, taget σ (q 2, q 4 ) = [2, 5] i, taget σ (q 1, q 5 ) =, taget σ (q 2, q 5 ) = [5, 6] i, taget σ (q 3, q 4 ) =, taget σ (q 3, q 5 ) = [6, 8] i. The firt four are badet and the lat two are goodet (ince q 3 i after q 4 and q 5 in the ermutation). Note alo that the ubinterval [8, 10] i of Ot-Interval(q 5 ) i not tagged. Thi contribute toward the lo of Greedy, and we will define it later a a mi of q 5. Note how a query Ot-Interval can be tagged imultaneouly by any number of other querie, and imultaneouly with good and bad tag (unlike in the cae of matching, in which the tag were one-to-one). Alo, if a bidder end more money in Greedy comared to in OPT then ome art of Alg-Interval σ (q) may not even be ued to tag any Ot-Interval. Define extra σ (q) = Alg-Interval σ (q) \ Ot-Interval(). Define [x, y] i = y x. Alo, for any query q, we define ot(q) = Ot Interval(q) and alg σ (q) = Alg Interval σ (q). By convention, = 0. 3.1 The Main Proertie of Greedy and the Analyi Recall from Section 2 that in the cae of matching, Greedy ha three roertie (namely Prefix, Monotonicity and Partition) which we exloited in roving the relationhi between the variable mi, bad and good. In the general cae, a we aw above, Greedy behave in a much le controlled manner becaue of the different bid. However, we manage to rove that the correonding roertie till hold, in ite of thi different behavior 2. Thi i ufficient to rove our main lemma (Lemma 3.4, 3.5 and 3.6), and rove a factor of 1 1/e. We rove the three roertie in thi Section, and defer the roof of Lemma 3.4, 3.5 and 3.6 to the aendix B. Let u firt exlicitly ell out a very baic roerty of Greedy (which we took for granted in matching): Conitent Tie-Breaking: Conider a query q, and any two ermutation σ, σ. Define highet σ (q) a the et of bidder who have the highet bid for q among all bidder with non-zero remaining budget, when q arrive during the run on σ. Define highet σ (q) imilarly. Suoe that highet σ (q) highet σ (q), and uoe that in the run on σ, q i allocated to bidder i highet σ (q). Then it ha to be true that q i allocated to i, even in the run on σ. We now roceed to rove the monotonicity roerty. Fix a query Q. Partition the et of all ermutation Ω into ubet uch that for each ubet, all the ermutation within the ubet have the ame order on all querie, excet for query. For any ubet Ω of thi artition, let the ermutation be called σ 1,.., σ n, according to the oition of. Define alg σ (i, t) to be the amount of money that bidder i ha ent in the run of Greedy on the ermutation σ 3 u to (jut after) time t. We have the following verion of the monotonicity lemma: Lemma 3.1. [Monotonicity] For every, [1, n], <, for every t 1, and for every bidder i [1, n], we have one of the two condition: Either: alg σ (i, t + 1) alg σ (i, t) 2 A tated in the Introduction, Greedy a uch i not monotonic, but we modify Greedy o that it doe not truncate the bid by the remaining budget. Thi variant i the one we analyze here, and i monotonic. 3 Note that ince the algorithm may overend budget, alg σ(i, t) could be greater than B i (however it i at mot B i + ɛ i ).

Or: alg σ (i, t + 1) B i Proof. Fix < n and a bidder i. We will rove the lemma by induction on t going from 1 to 1. We are comaring the run of ALG on σ and on σ u to time t. Note, firtly, that the two ermutation are identical until oition 1, hence o are the two run (by the Prefix Proerty). So, in fact, t <, alg σ (i, t) = alg σ (i, t) and o alg σ (i, t+1) alg σ (i, t). Hence we may aume that the bae cae of the induction i t = 1. Suoe the tatement i true for ome t [ 1, 2]. We will how it i true for t + 1 a well. Thi would rove the lemma. Let q be the query σ (t + 1). Since t [ 1, 2], we know that σ (t + 2) = q a well. Suoe that in the run on σ, ALG allocate q to bidder j. We ak: where doe ALG allocate q in the run on σ? Define, for a ermutation π and a time τ, avail π (τ) a the et of bidder available with non-zero remaining budget in the run of ALG on π at (jut before) time τ. By the induction hyothei, avail σ (t + 2) avail σ (t + 1). Alo, we know that j avail σ (t + 1) and that j i the highet bidder among bidder in avail σ (t + 1). Now conider two cae: If j avail σ (t + 2) then, by the argument above, j i the highet bidder in avail σ (t + 2) a well, and (by the Conitent Tie-breaking Proerty), ALG will allocate q to j in σ. In the econd cae, when j avail σ (t + 2), then alg σ (j, t + 1) B j anyway. Hence, both action kee the induction tatement true for t + 1. The refix roerty hold a before, by the definition of Greedy: Lemma 3.2. [Prefix Proerty] For any two ermutation σ 1 and σ 2, and any t [n], if we have t : σ1 1 () = σ 1 2 (), then the run of Greedy on σ 1 and σ 2 are identical from time 1 to time t. For any oition, we will ue taget σ (, ) to mean taget σ (σ(), ). Similarly we define goodet σ (, ) and badet σ (, ). Alo define extra σ () = extra σ (σ()). We get the following verion of the artition lemma: Lemma 3.3. [Partition] Fix, and a artition Ω. (1) x [1, t] : :x t+1 goodet σx (, ) taget σn (t, ) (2) x [t + 1, n] : badet σx (t, ) = taget σn (t, ) Proof. (2): Follow directly from Lemma 3.2. (1): Suoe i be the bidder to which OPT allocated query. By the Prefix Proerty, alg σk (i, k 1) = alg σn (i, k 1), and by the monotonicity lemma either alg σk (i, +1) B i or alg σk (i, +1) alg σn (i, ). So either alg σk (i, + 1) alg σk (i, k 1) alg σn (i, ) alg σn (i, k 1), or alg σk (i, + 1) B i. In either cae, taget σn (, ) k +1 taget σ k (, ). But recall that taget σk (, ) contribute toward goodet σk (, ) for all.t. k. Thi rove the lemma. Define good σ (, ) = goodet σ (, ) and bad σ (, ) = badet σ (, ). Alo define: { max(0, ot() alg σ ()) if σ() = mi σ (, ) = 0 otherwie. Thee three baic roertie hown above (Lemma 3.1, 3.2 and 3.3) uffice to rove the required relationhi between good, bad and mi, and to rove the main theorem. We tate thee inequalitie below (Lemma 3.5 and 3.6 hold for every Q and every grou Ω ). Their roof are more involved than the correonding roof in the cae of matching, and are rovided in the Aendix B. Lemma 3.4. [n], σ Ω : bad σ (, ) + good σ (, ) + extra σ () + mi σ (, ) ot(σ())

Lemma 3.5. t [n] : mi σt (t, ) σ Ω <t bad(, ) n Lemma 3.6. t [n 1] : bad(, ) n σ Ω t good(, ) σ Ω t+1 Theorem 3.1. The factor of Greedy in the random-ermutation inut model i at leat (1 1/e). Sketch of Proof: Lemma 3.4, 3.5 and 3.6, rovide inequalitie bounding the variable mi, bad, good and extra. We ue the ame idea of factor revealing LP (a we ued in Section 2) by maximizing the lo of revenue over thee inequalitie. It turn out that after ome rearrangement, we get the ame LP (but with our new variable). The detail of thi roof are rovided in Aendix C. Recall, however, that we had modified Greedy to allow overending of budget. We can how (e.g., by induction) that the revenue of thi variant of Greedy i almot the ame a that of the ure Greedy, which truncate the bid by the remaining budget, when the bid are mall (each bidder ending may be different by at mot nɛ, where eilon i the larget bid). Thu we have roved the factor for both verion of Greedy. 4 Additional Reult 4.1 Tightne of the analyi We rove that our analyi i tight, by giving an examle in which Greedy doe no better that 1 1/e (detail are given in Aendix D): Theorem 4.1. The factor of Greedy in the random-ermutation inut model i no more than (1 1/e). 4.2 The i.i.d. randomized inut model In thi model there i a fixed (but unknown) ditribution on Q, and the next query in the equence i icked indeendently from thi ditribution. A imle reduction to our random ermutation etting how that: Theorem 4.2. The factor of Greedy in the indeendent ditribution inut model i at leat (1 1/e). Alo, there i an examle ditribution over which Greedy doe no better than 1 1/e. Proof. (Sketch) In thi model we have a amle ace coniting of the different query equence obtained by drawing n time from the given ditribution. We have to comare the exected erformance of Greedy with the exected erformance of OPT over thi amle ace 4. Divide the amle ace into clae.t. the et of querie i the ame for every equence in a cla. Clearly, each cla conit of all the ermutation of ome et, and furthermore, the robability of occurrence of each equence in a cla i the ame. Suoe Ω i one uch cla. Then, by Theorem 3.1 we get that E[GREEDY Ω ] (1 1/e)E[OPT Ω ]. Taking exectation over the different clae, we get the firt art of the theorem. For the econd art, a tight examle i rovided in Aendix D.1. 4.3 Lower Bound The roof of the following theorem ue a uniform ditribution on a et of imle 3 3 ize biartite matching examle, and can be found in Aendix E. Theorem 4.3. No determinitic algorithm can have a cometitive ratio better than 3/4, and no randomized algorithm can have a cometitive ratio better than 5/6, for the cae of biartite matching in the random ermutation model. 4 The reult alo hold for the average of the ratio of Greedy and OPT, and not only for the ratio of their average.

5 Further Dicuion Our motivation for tudying Greedy wa that it i a natural algorithm in an auction tyle roce. However, the quetion naturally arie: I Greedy otimal in our ditributional model? If we make the aumtion that there are n tye of keyword, and many querie of each tye, and that we know the length of the query equence, then there i an allocation algorithm with a ratio very cloe to 1: Samle the equence for an ɛ fraction of it length and learn the ditribution of querie. Now olve and round a revenue maximization Linear Program to get 1 ɛ ratio allocation. However, thi amling method will not work if all the querie are ditinct, and of coure, thi method could be arbitrarily bad in the wort cae. We do not know of any algorithm rovably better than Greedy in the random ermutation model, but we believe that the algorithm from [MSVV05] erform trictly better. Currently we can how that it cannot do better than a factor α 0.81. Recall that in the cae of matching, it wa roved in [KVV90] that RANKING in the wort cae and Greedy in the random ermutation cae are dual of each other. The quetion naturally arie for the general aignment roblem: What i the dual algorithm to Greedy? It turn out that no uch duality reult eem to hold in the general cae. Furthermore any uch dual would have the bidder arriving in online, and hence would not aly to online aignment. Finally, it i imortant to invetigate the extent to which the RANKING algorithm of [KVV90] and it idea can be generalized, maybe even to offline algorithm. Our roblem can be conidered to be a ecial cae of the roblem of combinatorial auction with ubmodular utility bidder. In thi etting an imortant roblem i to find offline algorithm uing only value querie [LLN01]. There exit algorithm with factor 1 1/e [DS06, Fei06] (and even lightly better [FV06]) but uing the tronger demand querie, and there i a ga between the factor and the hardne in the value query model. Can the idea in our algorithm hel cloe thi ga? Even the cae of Adword with large bid i oen (recall that the bet known offline algorithm give factor 1 1/e [AM04]). The ame quetion can be aked for the 0-1-XOS utility model (alo known a the MCG roblem [CK04]). We believe that our technique may be ueful for ome of thee roblem. Reference [AGM06] Gagan Aggarwal, Ahih Goel, and Rajeev Motwani. Truthful auction for ricing earch keyword. In ACM Conference on Electronic Commerce, age 1 7, 2006. [AM04] N. Andelman and Y. Manour. Auction with budget contraint. In 9th Scandinavian Workho on Algorithm Theory (SWAT), age 26 38, 2004. [BIK07] M. Babaioff, N. Immorlica, and R. Kleinberg. Matroid, ecretary roblem, and online mechanim. In SODA, 2007. [CK04] C. Chekuri and A. Kumar. Maximum coverage roblem with grou budget contraint and alication. In APPROX, 2004. [DS06] Shahar Dobzinki and Michael Schaira. An imroved aroximation algorithm for combinatorial auction with ubmodular bidder. In SODA, 2006. [Dyn63] E. B. Dynkin. The otimum choice of the intant for toing a markov roce. Sov. Math. Dokl., 4, 1963. [EOS07] B. Edelman, M. Otrovky, and M. Schwarz. Internet advertiing and the generalized econd rice auction: Selling billion of dollar worth of keyword. American Economic Review, 97(1):242 259, 2007. [Fei06] Uriel Feige. On maximizing welfare when utility function are ubadditive. In STOC, 2006. [FGMS06] Lia Fleicher, Michel X. Goeman, Vahab S. Mirrokni, and Maxim Sviridenko. Tight aroximation algorithm for maximum general aignment roblem. In SODA, age 611 620, 2006. [FMPS07] J. Feldman, S. Muthukrihnan, M. Pal, and C. Stein. Budget otimization in earch-baed advertiing auction. In ACM Conference on Electronic Commerce, 2007. [FV06] Uriel Feige and Jan Vondrak. Aroximation algorithm for allocation roblem: Imroving the factor of 1-1/e. In FOCS, 2006. [GM06] Sudito Guha and Andrew McGregor. Aroximate quantile and the order of the tream. In PODS, age 273 279, 2006. [KV07] Erik Krohn and Katuri Varadarajan. Private Communication, 2007. [KVV90] R.M. Kar, U.V. Vazirani, and V.V. Vazirani. An otimal algorithm for online biartite matching. In Proceeding of the 22nd Annual ACM Symoium on Theory of Comuting, 1990. [LLN01] B. Lehman, D. Lehman, and N. Nian. Combinatorial auction with decreaing marginal utilitie. In Proceeding of the 3rd ACM conference on Electronic Commerce, age 18 28, 2001.

[LPSV07] S. Lahaie, D. Pennock, A. Saberi, and R. Vohra. Algorithmic Game Theory (Nian et al. editor), chater Sonored Search. 2007. [MNS07] M. Mahdian, H. Nazerzadeh, and A. Saberi. Allocating online advertiement ace with unreliable etimate. In ACM Conference on Electronic Commerce, 2007. [MSVV05] Aranyak Mehta, Amin Saberi, Umeh Vazirani, and Vijay Vazirani. Adword and generalized online matching. In FOCS, 2005. [RW06] P. Rumevichientong and D. P. Williamon. An adative algorithm for electing rofitable keyword for earchbaed advertiing ervice. In Seventh ACM Conference on Electronic Commerce, 2006. [Var06] H. Varian. Poition auction. International Journal of Indutrial Organization (To aear), 2006. [Yao77] A. C. Yao. Probabilitic comutation: toward a unified meaure of comlexity. FOCS, age 222 227, 1977. A Aggregating the inequalitie: A Factor Revealing LP Now we will aggregate the contraint in Lemma 2.2 and 2.3 over all the ermutation and girl. For that, we need to firt define the following: mi() = E σ Ω [ bad() = E σ Ω [ good() = E σ Ω [ mi σ (, )], bad σ (, )], good σ (, )] By umming the contraint in Lemma 2.2 over all ermutation clae Ω and all, we get t : bad σ (, )/(n ) σ Ω mi σ (t, ) σ Ω :<t Changing the order of ummation and dividing by Ω, we get, Corollary A.1. Similarly we can get, Corollary A.2. t : t : mi(t) bad()/(n ) :<t bad() n t good() : t+1 Proof of Theorem 2.1 : (1.3) From Lemma 2.1 and Corollarie A.1 and A.2 we have:.t.: t < n : t n : Min: [bad(t) + good(t)] t t+1 good() t good(t) + bad(t) + <t bad() n 0 bad() n 1 good(t), bad(t), mi(t) 0 Now change variable a follow: m t = good(t) + bad(t), v t = bad(t)/(n t) Min: t m t

.t.: m n v 0 t+1 t m t + v 1 <t m t, v t 0 It can be hown that droing the term m t+1 from the firt et of equation doe not affect the LP olution by much. A roof of a imilar tatement i in KVV, and o are the calculation. We rovide an LP baed calculation here, for comletene. We get the following rimal-dual air: Min: Max: α t.t.: t m n t t m t v 0.t.: t >t α n t β 0 m t + <t v 1 α t + t β 1 m t, v t 0 α t, β t 0 Both LP have the roerty that if we et all inequalitie tight, we get a feaible olution. Thi mean that thee olution are otimal. m t = α n+1 t = (1 1/n) i 1, v t = β n+1 t = 1 n (1 1/n)i 1 The otimal objective function um u to n(1 1/e) roving the theorem 5. B Proof of the Main Lemma from Section 3 Proof of Lemma 3.4 : (2.4) For every σ, and every [1, n], [bad σ (, ) + good σ (, )] = taget σ (σ(), ) = alg σ (σ()) extra σ () The firt equality i becaue of the fact that i either above or below in σ. The econd equality follow from the definition of extra σ (). Now, by definition, mi σ (, ) i oibly non-zero only for = σ(), in which cae it i equal to max{0, ot() alg σ ()}. Hence, mi σ (, ) = max{0, ot(σ()) alg σ (σ())} From (2.4), we get that { mi σ (, ) = max 0, ot(σ()) thu roving the lemma. bad σ (, ) good σ (, ) extra σ () } Proof of Lemma 3.5 : Define the quantity x := <t bad σ n (, ). By the definition of bad σn (, ), x ot(). In fact, we hall how the following inequality: 5 We aumed that the otimal matching i erfect, i.e. OPT = n. The cae of OPT < n can be taken care of with minor change in the roof.

(2.5) mi σt (t, ) x = We rove Equation (2.5) in a equence of two claim: Claim 1. mi σt (t, ) x σ Ω <t bad σ (, ) n Proof: Let i be the bidder to whom OPT allocated the query. We how the following ubclaim: Subclaim: Conider the run on the ermutation σ t. At time t (when ALG conider aigning query ), the remaining budget of i i at leat ot() x 0. Proof: Firt note that, by the Prefix Proerty, <t bad σ t (, ) = <t bad σ n (, ) =: x. Since in σ t, < t, bad σt (, ) = taget σt (σ t (), ), therefore <t taget σ t (σ t (), ) = x. But thi mean that at leat ot() x length of Ot-Interval() i untagged after time t 1 in the run on σ t. Of coure, thi mean that at leat ot() x amount of budget of i i till unent at thi time. Thi rove the ubclaim. If x < ot(), then uing the fact that the algorithm i greedy (and that we do not truncate the bid of bidder by their remaining non-zero budget), we ee that alg() ot(). If x = ot(), then alg() ot() x, trivially. Thi rove the claim. Claim 2. σ Ω <t bad σ(,) n = x Proof: Fix an < t, and conider the value of bad σ(,) σ Ω n. Note that, by the definition of bad σ (, ) and by the Prefix Proerty: { bad σn (, ) for k [ + 1, n] bad σk (, ) = 0 for k [1, ] σ Ω Hence badσ(,) n = bad σn (, ). Hence, bad σ(,) σ Ω <t n = <t bad σ n (, ) = x. Thi conclude the roof of Equation (2.5), and hence of the lemma. Proof of Lemma 3.6 : To do a tight counting for the roof of the lemma, we need to define a notion of weighted et. Given a univere U of element, a weighted et S w ha weight on all it element. In articular, an unweighted et S can be viewed a a weighted et with weight one on element which are reent in the et, and zero otherwie. We hall alo define two new oeration and on thee weighted et. Given a weighted et S, and a number x, we define new weighted et S = S x to mean that weight S (e) = weight S (e) x, e U. Alo given weighted et S 1 and S 2, we define S = S 1 S 2 to mean that weight S (e) = weight S1 (e) + weight S2 (e). S 1 w S 2 mean that weight S1 (e) weight S2 (e), e U. Define the meaure of weighted et S, µ(s) = U weight S(u)du. For the ret of the roof, the term et will mean a weighted et. We will conider et on the univere Ot Interval(), which, recall, i a interval of ize ot(), correonding to a query. Fix an t. Conider a ubet Ω.t. badet σn (, ). By the Prefix Proerty, badet σi (, ) = badet σn (, ), i [ + 1, n]. By Partition lemma, Lemma 3.3, we ee that for every k, l [ + 1, n]: badet σl (, ) +1 =kgoodet σk (, ), where the union i a dijoint union. Since the union i dijoint, thi i the ame a By averaging, we ee that: +1 k [1, ], l [ + 1, n] : badet σl (, ) w =k goodet σk (, ) : 1 n n l=+1 badet σl (, ) w 1 +1 k=1 =k goodet σk (, )

or, : n l=+1 badet σl (, ) n w +1 k=1 =k goodet σk (, ) But ince badet σi (, ) = φ, i [1, ] and < k : goodet σk (, ) = φ, we get: : n badet σl (, ) n w l=1 +1 goodet σk (, ) k=1 =1 And again, ince k >, : goodet σi (, ) = φ, we get : : n badet σl (, ) n w l=1 n +1 goodet σk (, ) k=1 =1 or, : badet σ (, ) n w σ Ω +1 goodet σ (, ) σ Ω =1 Alo, by definition, u, u, t: badet σn (, ) badet σn (u, ) =. Hence: badet σ (, ) n w t σ Ω goodet σ (, ) σ Ω t+1 Therefore, µ badet σ (, ) µ goodet σ (, ) n t σ Ω t+1 σ Ω µ(badet σ (, )) n t σ Ω bad σ (, ) n t σ Ω t+1 t+1 σ Ω µ(goodet σ (, )) σ Ω good σ (, ) C Proof of the Main Theorem - Theorem 3.1 We hall ue the ame definition of mi(), bad() and good() a defined in Aendix A. Let extra() = E σ Ω extra σ (). Uing the imilar aroach in Aendix A, we will get the following three corollarie from Lemma 3.4, 3.5 and 3.6. Corollary C.1. t : bad(t) + good(t) + extra(t) + mi(t) OPT/n Corollary C.2. Corollary C.3. t : t : mi(t) bad()/(n ) :<t bad() n t good() : t+1

Uing the above corollarie, we get the following LP: Min: [bad(t) + good(t) + extra(t)].t.: t < n : t n : t t+1 good() t good(t) + bad(t) + extra(t) + <t bad() n 0 bad() n good(t), bad(t), extra(t) 0 OPT/n Firt inequality can in fact be relaxed to t < n : t+1 (good() + extra()) t bad() n 0. Now ubtituting m t for good(t) + bad(t) + extra(t), v t for bad(t)/n t, and olving it imilar to Aendix A, we get that the value of objective function i at leat OPT(1 1/e). D A Tight Examle - Proof of Theorem 4.1 In thi ection we rovide an examle to how that the Greedy algorithm can do no better than 1 1/e in the random-ermutation inut model, and thu exhibit that our analyi i tight. The examle i imilar to the one ued in [MSVV05] to how a lower-bound on randomized algorithm in the online wort-cae model. In thi intance, there are N bidder, each with a budget of L (a large integer). The querie are groued into N grou, Q 1, Q 2,..., Q N. Each grou ha L identical querie. Each query in Q i get the following bid: Bidder 1 through i 1 bid 0; bidder i through N bid 1. Clearly, OPT = LN, by allocating, for all i, all the querie in Q i to bidder i. We will aume that Greedy break tie in the following way: when an query q arrive, it will be allocated to the highet numbered bidder who bid 1 and ha available budget. The aumtion about bad tie-breaking can be removed by a imle erturbation of the bid: for examle, for all i, relace all the 1-bid of bidder i by 1+ɛ i, where 0 < ɛ 1 < ɛ 2 < < ɛ N 1. The budget can be adjuted accordingly. Now conider the erformance of Greedy on the equence of thee querie arriving in a random ermutation σ. Clearly, the firt L querie in σ will all be allocated to bidder N (who bid for all querie). Among the next L querie in σ, all will be allocated to bidder N 1, excet for any querie from Q N, which are left unallocated. Now among the third L querie in σ, ome are allocated to N 1, mot to N 2 and ome are lot. Let u intead count in a different manner: It i clear that bidder N, by ymmetry, i allocated at mot L/N querie from Q j, in exectation, j. Similarly, bidder N 1, by ymmetry, i allocated at mot L/(N 1) querie from Q j, in exectation, j N 1. In thi manner one can ee that bidder i i allocated at mot L/i querie from Q j, in exectation, j i. L N j }. Counting differently, for i = 1,.., N, the number of querie in Q i that get allocated i min{l, j i Summing thi u, we can how that the exected amount of money ent by Greedy i LN(1 1/e) = (1 1/e)OPT. We note that thi analyi i very imilar to that in [MSVV05] for the lower bound in the wort cae online etting, the two being a form of dual of each other. The difference i that the role of bidder and query grou i revered here it i the lat N(1 1/e) bidder who finih mot of their budget, while in [MSVV05] it wa the firt N(1 1/e) query grou that get almot comletely allocated. D.1 Tight examle in the i.i.d. model Recall that in the i.i.d. model we have an unknown ditribution over keyword, and the next query in the equence i icked indeendently from thi ditribution. In our examle there are N bidder. Conider a uniform ditribution over N keyword, where the i th keyword get the following bid: Bidder 1 through i 1 bid 0; bidder i through N bid 1. We will ue the tie breaking rule a dicued in Aendix D. We will amle LN querie from the above ditribution. Now by the Chernoff bound, we can how that, for all δ, there i a large enough L o that w.h.. each keyword i amled at mot L + δ/n time. Now take the amle ace in which each keyword occur at leat L δ/n time, and divide it into familie.t. in each family, every equence ha a fixed et of querie. Uing argument imilar to the one in Aendix D, we can how that exected erformance of greedy, conditional over any uch family, i at mot LN(1 1/e) + δ. Now taking exectation over all uch familie we get that exected erformance of greedy i at mot LN(1 1/e) + δ.

E The Lower Bound - Proof of Theorem 4.3 (Sketch of Proof) For the bound on determinitic algorithm, conider a very imle 2 boy, 2 girl etting, where boy 1 could be matched to both the girl, but boy 2 can only be matched to one of the two girl. By looking at the code of the determinitic algorithm, we can decide which girl boy 2 can be matched to, o that in one of the two random ermutation of the boy, only one air can be matched. Thi how a factor of 3/4. For the lower bound on randomized algorithm, we will ue Yao Lemma [Yao77] to rove thi tatement. We tart with a ditribution on inut of the following form: Take an n n comlete uer triangular matrix with 0, 1 entrie. Thi i the incident matrix of the biartite grah, with the row being the girl and column being boy. We ue the uniform ditribution over different inut correonding to all ermutation of the row name. A according to the model, each inut ha the column arrive in a random ermutation. Thu the ditribution i eentially uniform ditribution on both row and column ermutation of the comlete uer triangular matrix. A ooed to the roof in [KVV90] for the wort cae inut model, it turn out to be difficult to characterize the erformance of any determinitic algorithm on thi inut ditribution. Thi i becaue a determinitic algorithm can (in thi model) be mart and ue a lot of information from the at (a a very imle examle, if it ee a column with n 1 1 and then a column with n 1 then it know that the extra row i the row with n 1 ). We have not been able to come u with a general analyi for n, but we can do a brute force analyi for n = 3, in which we can take care of how any determinitic algorithm may ue all uch information from the at. The brute force analyi how that the erformance of any determinitic algorithm over thi inut ditribution i no more than 5/6, thu roving a lower bound of 5/6 for randomized algorithm in the random ermutation model.