I recently sat a technical interview with a prop trading and market making firm. I didn't pass the interview, and I was wondering about answering one of the questions they asked me.

So the interviewer had a deck of cards and said that each card is worth it's face values, with A = \$1, J = \$11, Q = \$12 and K = \$13. He then dealt out three cards face down and told me that he was willing to trade them with me for \$15. So I could choose to sell them to him for \$15 or buy them off him for \$15. Now I know the expected value of the 3 cards is \$21, so I should obviously choose to buy them off him to make an expected profit of \$6 per trade. But he also asked me how many times I wanted to make the trade, and I don't know how to answer that question. What goes into the decision making process to determine the number of times you execute a trade? He said I started off with \$1000

  • 1
    $\begingroup$ On average you make 6, how much do you lose in the worst case? How many such losses would you be willing to take before walking away with what's left of your 1000? (I am not sure what he has in mind, but I think he is asking you to set some a priori risk guidelines before you start playing). $\endgroup$ – Alex C May 31 '18 at 12:31
  • 4
    $\begingroup$ look at Kelly criterion. $\endgroup$ – kdragger May 31 '18 at 12:38
  • $\begingroup$ @kdragger Kelly Criteria is a great starting point and is what you get from maximizing the expectation of log wealth. More generally, you can solve for alternative decision rules based upon higher or lower risk aversion. With CRRA utility (such as log utility of Kelly betting), you obtain an optimal fraction of your total wealth to bet, which is slightly different. This question has a certain discreteness to it. $\endgroup$ – Matthew Gunn May 31 '18 at 19:16
  • 1
    $\begingroup$ IMHO this is a kind of an uninteresting game because there's no substantive risk of ruin. $\endgroup$ – Matthew Gunn May 31 '18 at 20:06
  • 1
    $\begingroup$ sounds like optivers first round $\endgroup$ – Tilefish Poele Jun 4 '18 at 5:43

If this was actually for Optiver, essentially they were just looking for you to be able to intuitively size your bets using the same logic that the Kelly Criterion sizes bets, without actually deriving it.

Essentially you should've deduced something like:

  1. Playing this game correctly is always non negative EV, so you want to place as much money in total at it as possible (so bet more).

  2. You have a finite source however and ever hitting 0 is a permanent loss of EV in future turns you could've kept playing this game (so bet less).

  3. You have a finite number of turns (at least in Optiver) (so bet more).

Synthesising all this you should be able to assume that,

  1. The higher the EV of the individual offer the more you should bet (obviously).
  2. The more turns you play, the closer you get to the end of the game, the more you should bet (EV being equal). In fact when they say its the last turn, you should always go all in. (Addresses point 3).
  3. The less money you have, the less you should bet, and in fact if you're self consistent, it should be proportional. (Addresses point 2)

This is all just qualitative Kelly Criterion.

They don't really care about risk aversion or utility theory based on my experience, in fact they stated they just want you to maximise dollar value.

  • 3
    $\begingroup$ Why should you go all in the last turn? If the objective is to maximize your expected winnings, the solution is to go all-in every turn. It the objective is to maximize your growth rate, you shouldn't go all in on any turn. $\endgroup$ – Matthew Gunn Jun 5 '18 at 13:59
  • $\begingroup$ Going all-in every turn does not maximise EV for +EV multiple turn games, that's the point of Kelly Criterion. As an extreme example, say you're playing betting on a biased coin-flip with even payouts which is slightly positive EV (51-49), and you get to play this game 1,000,000 times. According to you, we should go all-in from the start since we are +EV. However we have a 49% chance to lose all our money straight away, missing out on 999,999 more chances at this positive EV game. Going bankrupt on the last turn doesn't matter as you don't get to play the game anymore regardless of your profit $\endgroup$ – Tilefish Poele Jun 5 '18 at 23:54
  • $\begingroup$ @MatthewGunn Hence maximising EV on the last turn is just putting as much money as you have (or can afford to lose in the case of shorting) $\endgroup$ – Tilefish Poele Jun 5 '18 at 23:57
  • $\begingroup$ Imagine there's a fair coin where if it lands heads, you get paid 2 to 1. You get two flips. You bet $b$ of your wealth on the first flip, then 100% of your wealth on the 2nd flip. After the first flip, you have either $1 + 2b$ or $1 - b$ with equal probability. Therefore after the 2nd flip, you have either $0$, $3 + 6b$, or $3 - 3b$ with probability $\frac{1}{2}$, $\frac{1}{4}$, and $\frac{1}{4}$ respectively. The expected value is hence $\frac{3 + 6 b + 3 - 3 b}{4} = \frac{6 + 3b}{4}$. What value of $b \in [0, 1]$ maximizes the expected value? $\endgroup$ – Matthew Gunn Jun 6 '18 at 1:16
  • $\begingroup$ In the game I described above, going all in every round ($b=1$) for $n$ rounds gives you a $\left(\frac{1}{2}\right)^n$ probability of having $3^n$ and $1 - \left(\frac{1}{2}\right)^n$ probability of having 0, hence an expected value of $\left(\frac{3}{2}\right)^n$ . You cannot get an EV higher than that. In contrast, the kelly fraction would maximize $\frac{1}{2}\log(1+2b) + \frac{1}{2}\log(1 - b)$. The solution to that is $b_{kelly}=\frac{1}{4}$. $\endgroup$ – Matthew Gunn Jun 6 '18 at 1:34

As the problem is currently formulated, you have a binary decision (whether to buy the cards or not) and a single state variable (your current wealth). I'm assuming the deck is reshuffled every play.

A policy function will be a function $f: \mathbb{R} \rightarrow \{0, 1\}$ that will say whether to buy or not buy the cards as a function of your wealth.

How to find a sensible $f$? If your preferences over risk satisfy the Von Neumann-Morgernstern axioms, those preferences can be represented by an expected utility function. You can then compare the expected utility of buying the cards vs. not buying the cards and find which is higher.

As an example, I will use $u(x)=\log(x)$ which is the same objective of the Kelly criterion.

Expected Utility Theory

Let $w$ be a scalar denoting your wealth, $X$ a random variable denoting the sum of the three cards, and $u(x)$ a bernoulli utility function whose curvature formalizes a notion of risk aversion.

For $w=1000$, we can simply compare $u(w)$ with $\operatorname{E}[u(X+w-15)]$ where $u(x)$ is perhaps something like $u(x) = \log x$.

How much would we be willing to for this gamble?

Solve for $p$ in:

$$u(w) = \mathrm{E}[ u(w + X - p) ] $$

MATLAB code to do this:

cards = ones(4,1) * (1:13); % Matrix of all the cards
deck = cards(:);  % vectorize it
three_card_hands = combnk(deck, 3); % all combinations of 3 card hands
X = sum(three_card_hands, 2); % sum across columns to get a vector with all 3 card sums
w = 1000; % set initial wealth
myfun = @(p) mean(log(X+w-p)) - log(w)
p = fzero(myfun, 15)

I compute that at a wealth of \$1000 and using log utility you'd be willing to pay 20.9798 for the 3 cards. At a wealth or $w=50$, you'd still be willing to pay 20.3 for the cards. If you had only \$15, you'd still buy the cards because $\log(15) < \operatorname{E}[\log(15 + X - 15)]$. You always buy!

A useful, related concept is the certainty equivalent which I discuss in this answer.

Classic Kelly criteria

Kelly betting is to choose a bet size to maximize the expected growth rate of your wealth which is equivalent to maximizing the expected log wealth (i.e. you use a log utility function).

(Digression: maximizing your expected wealth typically leads to solutions where you bet everything on any positive expected value bet but go broke almost certainly. That's horribly dumb! Expected wealth is a poor objective. Kelly's insight is that maximizing the expected logarithm of wealth has far better properties)

The classic Kelly betting question of what fraction of your wealth to bet is a different question than the one presented here. For fun, we can solve for the Kelly fraction:

\begin{equation} \begin{array}{*2{>{\displaystyle}r}} \mbox{maximize (over $\alpha$)} & \operatorname{E}[\log(w + \alpha (X - 15))] \\ \end{array} \end{equation}

Solve this with MATLAB code:

a = fmincon(@(a) -sum(log(w+a*w*(X/15-1))), 1) 

I find optimal $\alpha^* \approx 1.2488$, that is, the Kelly fraction is to spend $\approx 124.88\%$ of your wealth each bet. (This can never take you below zero, because you can lose at most $\frac{12}{15}=80\%$ of your bet). If the $\frac{1}{22100}$, worst case happens of drawing three aces, you lose 99.9% of your wealth! In the median case, you add 50% to your wealth. (Yes, Kelly betting is quite aggressive.)

Risk of ruin? (Monte-Carlo simulation)

In a quick Monte-Carlo sim I wrote of 1 million runs of up to 2000 plays, the minimum wealth I ever had was 960, and the minimum ending wealth (after 2000 plays) was 11533.

The game is fantastically attractive at a price of 15.

Thinking more broadly

As @Attack68's answer describes, you almost certainly want to bring in classic, trading risk control techniques.

A real risk here is counterparty risk or risk the game is somehow different than what I've modeled here. (eg. why the heck would your counterparty play this insane game? Are you getting scammed?) If you lose more than \$40 playing this game, it raises serious questions that something is wrong and you're not playing the game modeled.

It can be useful to have risk controls robust to model misspecification. Playing an aggressive strategy that assumes your model is exactly correct can be quite dangerous. Wall Street has many stories of funds/firms blowing up due to risk outside the model.

  • $\begingroup$ I guess in your example if one starts changing risk aversion in a CRRA utility there might be a threshold where you stop playing the game altogether (except for extreme values of initial wealth). Not sure if my intuition is correct. Maybe I should solve that problem. $\endgroup$ – phdstudent Jun 5 '18 at 16:25

I have asked broadly similar questions in interviews to traders. Generally one is looking for candidates to evaluate the strength of the trade and consider their loss limits - there is a limit on the precise quantitative calculations a candidate can be expected to make.

In the interview I would have commented the following:

  • the maximum loss is \$12, and the maximum gain \$24.
  • the expected gain is \$6 and therefore this instinctively reflects an intuitively sound trade. If you went further and guessed the standard deviation of the return at \$6 then you have a Sharpe Ratio of 1.0 which is often considered very attractive, but not worth risking everything you own.
  • How much of your capital do you expose? I.e say you have a 95% VaR of \$100 then you can probably buy around 10 copies of the trade.

After the turn you expect a 6% return with upside potential, which is an heuristically respectable sum.


There are a few layers to this question.

The first question is the expected value of a hand, which is $21, and thus makes the game look attractive to play.

The second question in my head is my willingness to trust; is my counterparty good for the money, why are they offering to play such a skewed game, if I buy the cards will they really buy them back off me at a lower amount, is it a fair deck, are the cards genuinely shuffled (and not, for example, stacked low to high), does the dealer have a way of biasing the selection etc. We have to assume the interviewer allays all those fears.

However, the final layer is to look at the game over more than the first few hands; the question states the interviewer got a pack of cards out, so there are up to 17 hands to play. If we play all the hands, we get a certain profit of an almost certain amount (there will be 1 card left). So we could opt to play to the end, but we could opt to stop before we got there - what if the early cards were to our advantage? What is the chance that the values are perfectly evenly distributed?

Since we can always play to the end, if we have a choice before each hand over whether to continue or not, then we can construct a rule which allows us to take profit if we have had better cards early, above the amount we would obtain by playing to the end.

So perhaps the pertinent question is: How many decks of cards have you got?

  • $\begingroup$ My question is only about the first deal. The question was how many times do I want to buy those 3 cards. If I answered "ten times" I would get 10 copies of those first three cards. The question is how to decide how many copies of the first three cards to purchase. $\endgroup$ – IAlreadyHaveAKey Jun 4 '18 at 9:31
  • $\begingroup$ That doesn't make any sense. You've bought the cards, they are yours. He cannot sell them to you again. If you want more copies, it would depend on how you could redeem them. It seems much more sensible for the question to be how many hands you want to play. If he was asking how much you are willing to bet on those cards, I refer you back to my second point about trust. You might want to make the question more explicit, albeit I think you may have misunderstood. $\endgroup$ – Phil H Jun 4 '18 at 9:42
  • $\begingroup$ I don't keep the cards, they're theoretical assets. I also didn't misunderstand because after I answered he picked them up again and dealt out another three cards and offered a different price for them. I really didn't think the rules of the game were that hard to understand. $\endgroup$ – IAlreadyHaveAKey Jun 4 '18 at 9:45
  • $\begingroup$ Here is the question: there is an asset that has an expected value of $21, and it's being offered to me for $15. There are an unlimited number of these assets. How do I decide how many of them to buy? $\endgroup$ – IAlreadyHaveAKey Jun 4 '18 at 9:47
  • $\begingroup$ That entirely depends on the ability of the counterparty to pay. All trades are done within a context. The theoretical answer might be infinity; just borrow an infinite quantity of money and purchase an infinite number. But in reality there is a limit to how much money you want to risk, and how much you are willing to trust the interviewer. How much would you bet without inspecting the deck, or shuffling it? Would you bet the hedge fund on a game of cards? $\endgroup$ – Phil H Jun 4 '18 at 9:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.