An ad publisher selects three ads to place on each page, in order
from the top. Click-through rates (CTR's) at each position differ for
each advertiser, and each advertiser has a different CTR
for each position. Each advertiser bids for click-throughs, and each
advertiser has a daily budget, which may not be exceeded. When a click-through
occurs, the advertiser pays the amount they bid.
In one day, there are 101 click-throughs to be auctioned.
Here is a table of
the bids, CTR's for positions 1, 2, and 3, and budget for
each advertiser.
| Advertiser |
Bid |
CTR1 |
CTR2 |
CTR3 |
Budget |
| A |
$.10 |
.015 |
.010 |
.005 |
$1 |
| B |
$.09 |
.016 |
.012 |
.006 |
$2 |
| C |
$.08 |
.017 |
.014 |
.007 |
$3 |
| D |
$.07 |
.018 |
.015 |
.008 |
$4 |
| E |
$.06 |
.019 |
.016 |
.010 |
$5 |
The publisher uses the following strategy to allocate the three ad slots:
- Any advertiser whose budget is spent is ignored in what follows.
- The first slot goes to the advertiser whose expected yield for the first slot
(product of the bid and the CTR for the first slot) is the greatest. This advertiser
is ignored in what follows.
- The second slot goes to the advertiser whose expected yield for the second slot
(product of the bid and the CTR for the second slot) is the greatest. This advertiser
is ignored in what follows.
- The third slot goes to the advertiser whose expected yield for the third slot
(product of the bid and the CTR for the third slot) is the greatest.
The same three advertisers get the three ad positions until one of two things happens:
- An advertiser runs out of budget, or
- All 101 click-throughs have been obtained.
Either of these events ends one phase of the allocation.
If a phase ends because an advertiser ran out of budget, then they are
assumed to get all the clicks their budget buys. During the same phase,
we calculate the number of click-throughs received by the other two
advertisers by assuming that all three received click-throughs in
proportion to their respective CTR's for their positions (round to the
nearest integer). If click-throughs remain, the publisher reallocates all three
slots and starts a new phase.
If the phase ends because all click-throughs have been allocated, assume that
the three advertisers received click-throughs in proportion to their respective
CTR's (again, rounding if necessary).
Your task is to simulate the allocation of slots and to determine how many
click-throughs each of the five advertisers get.