AKQ Betting Game Equilibrium
Updated
Problem statement
Two players, X and Y, play the AKQ game with a three-card deck: an Ace, a King and a Queen. The Ace beats both other cards, and the King beats the Queen.
Before the deal, each player puts pot / 2 dollars into the pot, so the pot starts with pot dollars. Then each player gets one card from the shuffled deck and sees only their own card. All six ways to deal the two cards are equally likely.
There is one betting round:
Xeither checks or betsbetdollars.- If
Xchecks, both cards are shown and the higher card wins the pot. - If
Xbets,Yeither folds or calls. IfYfolds,Xwins the pot. IfYcalls,Yalso puts inbetdollars, both cards are shown, and the higher card wins everything in the pot.
A player's profit is the money they take from the pot minus all the money they put in, including their starting pot / 2. For each card it can hold, X chooses a probability of betting, and Y chooses a probability of calling a bet. Both players play optimally: X wants the largest expected profit for X, Y wants the smallest, and neither player can do better by changing only their own probabilities.
Return [bluff, call, value], where:
bluffis the probability thatXbets when holding the Queen,callis the probability thatYcalls a bet when holding the King, andvalueis the expected profit ofXper hand.
Under the constraints, all three numbers are the same for every pair of optimal strategies. Each value is accepted if its absolute error or its relative error is at most 10^-9.
Function
akqGameEquilibrium(pot: int, bet: int) → double[]Examples
Example 1
pot = 2bet = 1return = [0.3333333333333333,0.3333333333333333,0.05555555555555555]Each player puts in 1 and the bet is 1. X always bets the Ace and never bets the King. Y always calls with the Ace and always folds the Queen.
When Y holds the King, a bet comes from the Ace or from a bluffing Queen. Calling a bluff wins the pot and the bet, 2 + 1 = 3 more than folding. Calling the Ace loses the 1 paid to call. X bluffs just often enough that the King earns the same by calling or folding, so bluff × 3 = 1 and bluff = 1/3.
When X holds the Queen, checking always loses. A bluff loses 1 more when called, and it wins the pot of 2 when the King folds. Y calls just often enough that the Queen earns the same by bluffing or checking. The other card is the Ace or the King, each with probability 1/2, so (1/2)(-1) + (1/2)(call × (-1) + (1 - call) × 2) = 0, which gives call = 1/3.
Compared with simply showing the cards, X only gains when the Ace bets into the King and the King calls: probability 1/6 × 1/3, gain 1. The Queen's bluffs gain nothing on average. So value = 1/18, about 0.0556. The answer is about [0.3333, 0.3333, 0.0556].
Example 2
pot = 3bet = 1return = [0.25,0.5,0.08333333333333333]The pot is 3 and the bet is 1. The King gains 3 + 1 = 4 by calling a bluff and loses 1 by calling the Ace, so bluff = 1/4. For the Queen to break even, (1/2)(-1) + (1/2)(call × (-1) + (1 - call) × 3) = 0, so call = 1/2. Then value = 1/6 × 1/2 × 1 = 1/12. The answer is about [0.25, 0.5, 0.0833].
Example 3
pot = 7bet = 2return = [0.2222222222222222,0.5555555555555556,0.18518518518518517]The pot is 7 and the bet is 2. The King gains 7 + 2 = 9 by calling a bluff and loses 2 by calling the Ace, so bluff × 9 = 2 and bluff = 2/9. For the Queen to break even, (1/2)(-2) + (1/2)(call × (-2) + (1 - call) × 7) = 0, so call = 5/9. Then value = 1/6 × 5/9 × 2 = 5/27. The answer is about [0.2222, 0.5556, 0.1852].
Constraints
2 <= pot <= 10^61 <= bet < pot
More Susquehanna International Group (SIG) interview questions
- Extract Company Tickers from NewsONSITE INTERVIEW · Seen Jul 2026
- Correct Three Protractor ReadingsONSITE INTERVIEW · Seen May 2025
- Estimate X from the Sum of Two NormalsONSITE INTERVIEW · Seen May 2025
- Catch Fish with Reusable BaitsOA · Seen Nov 2026
- Bold Play to Reach a GoalOA · Seen Nov 2026
- Cats, Truth and Who Has MoreOA · Seen Nov 2026
- Counting Cows by Their LegsOA · Seen Nov 2026
- Enough Muffins for the LineOA · Seen Nov 2026
- Expected Consecutive Pairs Among Chosen NumbersOA · Seen Nov 2026
- Four-by-Four Boundary GridOA · Seen Nov 2026
Similar questions at other companies
- Integers With Multiple Sum of Two CubesCharta Health · PHONE SCREEN · ONSITE INTERVIEWCharta Health interview questions
- Dice-Walk Winning ProbabilityGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
- Retrieve Vectors by Cosine SimilarityHarvey · ONSITE INTERVIEWHarvey interview questions
- Integer BreakAmazon · ONSITE INTERVIEW
- Knight Probability in ChessboardGoldman Sachs · ONSITE INTERVIEWGoldman Sachs interview questions
- Path Between Two Nodes of a Fibonacci TreeDatabricks · ONSITE INTERVIEWDatabricks interview questions
- Count Staircases with Strictly Increasing StepseBay · ONSITE INTERVIEWeBay interview questions
- Babysitter Quote with Hourly RatesUpstart · ONSITE INTERVIEWUpstart interview questions
- Calculate a Token-List ExpressionCollege Vine · ONSITE INTERVIEW
- Maximize the Even-Odd Index Product GapInfosys · ONSITE INTERVIEWInfosys interview questions