KatInterview

Computing Equilibrium Bids in Single-Item Auctions

Arrays & HashingAuto-graded · 18 test cases
HardAuto-gradedArrays & Hashinggame-theoryauction-theoryexpected-value

Last updated

Tests understanding of dominant strategy equilibria in second-price auctions and Bayesian Nash equilibria in first-price auctions with uniform value distributions.

You are analyzing bidding strategies in single-item auctions with two participants. Your personal valuation for the item is v, where 0 < v < 1. The competing bidder has a valuation drawn uniformly at random from the interval [0, 1], and you know this distribution but not their actual value.

Compute the equilibrium bid for two auction formats:

Second-Price Auction (Vickrey):

  • The participant submitting the higher bid wins the item
  • The winner pays an amount equal to the losing bid (not their own bid)
  • The loser pays nothing
  • Your payoff if you win is your valuation minus the payment; if you lose, your payoff is zero
  • Assume the opponent bids truthfully (submits their actual valuation)

First-Price Auction:

  • The participant submitting the higher bid wins the item
  • The winner pays their own bid
  • The loser pays nothing
  • Your payoff if you win is your valuation minus your bid; if you lose, your payoff is zero
  • Assume both bidders follow the symmetric Bayesian Nash equilibrium strategy for this setting

Return a dictionary with two keys:

  • "second_price_bid": your optimal bid in the second-price format
  • "first_price_symmetric_equilibrium_bid": your equilibrium bid in the first-price format

Constraints

  • 0 < v < 1
  • Both bidders are risk-neutral (maximize expected payoff)
  • Valuations are private and statistically independent
  • Ties occur with probability zero under the continuous distribution
  • All values are floats

Examples

Example 1

Input: compute_auction_bids(0.5)

Output: {'second_price_bid': 0.5, 'first_price_symmetric_equilibrium_bid': 0.25}

Example 2

Input: compute_auction_bids(0.1)

Output: {'second_price_bid': 0.1, 'first_price_symmetric_equilibrium_bid': 0.05}

Example 3

Input: compute_auction_bids(0.75)

Output: {'second_price_bid': 0.75, 'first_price_symmetric_equilibrium_bid': 0.375}

Example 4

Input: compute_auction_bids(0.99)

Output: {'second_price_bid': 0.99, 'first_price_symmetric_equilibrium_bid': 0.495}

Hints

Hint 1

In a second-price auction, consider what happens when you bid above or below your true value compared to different possible opponent bids.

Hint 2

For any opponent bid, analyze whether deviating from truthful bidding in the second-price format can improve your payoff.

Hint 3

In the first-price auction, the symmetric equilibrium bid function is linear in v. Use the indifference condition: at the equilibrium bid, you should be indifferent between winning at that bid and losing.