# How to express this multi-player card probability mathematically?

I am having trouble conceptualizing how this would be expressed mathematically and could use your help! I have access to Maple and MATLAB so feel free to post examples.

The Problem:

Bill and John are playing a game where they each draw cards from a deck of 52. If they draw an Ace of Hearts, they win 100 dollars. If they draw a King of Hearts, they win 50 dollars. If they draw any other card, they lose 1 dollar. They can draw as few or as many cards as they want (essentially drawing without replacement).

What is the probability of Bill selecting an Ace of Hearts out of his 5 next cards, given that he has already lost 12 times and there are 30 cards left (John has played and lost also)? Remember, as each player draws more cards the probability of the next card being an Ace of Hearts increases.

Calculate Bill's expected value for playing this game, given that John has already played 10 cards and lost. Right now I am getting stuck on this calculation when scaling to multiple prizes; here is what I have so far:

$$\displaystyle{a}=\frac{{\Gamma{\left({M}+{1}\right)}\cdot\Gamma{\left({N}-{M}+{1}\right)}}}{{\Gamma{\left({M}-{K}+{1}\right)}\cdot\Gamma{\left({N}-{M}-{P}+{K}+{1}\right)}}}$$

which equals the number of arrangements for each prize. K is the number of prizes to select, P is the number of prizes in the game, M is the number of cards Bill chooses, and N is the number of cards left in the game. (Getting a feeling of hypergeometric distribution here)

and $$\displaystyle{c}=\frac{{\Gamma{\left({N}+{1}\right)}}}{{\Gamma{\left({N}-{P}+{1}\right)}}}$$ for the number of total cases.

How do I add the prizes into the mix to calculate expected value?

Notes:

The formula(s) must be scalable to more than 2 players, more than 2 prizes, and more than 52 cards.

Thanks!

According to the examples given, the multiple-player nature of this game is irrelevant. In the example where there are $30$ cards remaining in the deck, and we are asked about the probability of an ace of hearts in Bill's next five cards, the fact that Bill drew $12$ of the $22$ cards that were removed and John only drew $10$ doesn't matter--all that we need to know about those cards is that all $22$ were losing cards, so the ace and king of hearts are still in the deck.

So the ace of hearts is somewhere in the remaining $30$ cards, and we are interested in the next five cards Bill draws. These do not need to be the next five cards drawn; all that matters is that each of these cards was in the deck of $30$ at the time we asked the question, there are five of these cards, and each of the $30$ remaining cards in the deck was equally likely to be the ace of hearts. That is, the ace might be one of the five cards Bill draws next, or one of the $25$ other cards that were in the deck when we asked the question. That gives five ways to draw the ace and $25$ ways not to draw the ace, all equally likely, for a probability of $5/30 = 1/6.$

For the optional question:

Bill's expected value for the rest of the game depends on how many cards he draws. If he only draws the five cards mentioned in the first part of the question, consider where both the ace and king of hearts might be in the deck of $30$ cards. There are $30\times29=870$ possible placements of those two cards (treating all other cards as identical). Of those placements, $5\times25=125$ let Bill draw the ace but not the king (win $100,$ lose $4$), $5\times25=125$ let Bill draw the king but not the ace (win $50,$ lose $4$), $5\times 4=20$ let Bill draw both the king and the ace (win $150,$ lose $3$) and the remaining $870-125-125-20 = 600$ give Bill five losing cards. So the expected value is $$\frac{125\times96 + 125\times46 + 20\times147 + 600\times(-5)}{870}.$$

To scale the formula, note that the original number of cards ($52$) is irrelevant; it only matters how many cards remain when we compute the probability and which prizes remain in that deck. For $M$ cards drawn from $N$ remaining, with two prizes, there are $N\times(N-1)$ arrangements, $M\times(N-M)$ ways to draw the first prize only, $M\times(N-M)$ ways to draw the second prize only, and $M\times(M-1)$ ways to draw both prizes.

For more prizes you need more cases, such as "draw the third prize only" or "draw the first and third prizes but not the second." (For $P$ prizes there are $2^P$ cases.) For each case, if $K$ prizes are drawn and $L=P-K$ are not drawn there are \begin{multline} M\times(M-1)\times(M-2)\times\cdots\times(M-K+1) \\ \times (N-M)\times(N-M-1)\times(N-M-2)\times\cdots\times(N-M-L+1) \tag{*} \end{multline} such arrangements out of a total of $N\times(N-1)\times(N-2)\times\cdots\times(N-P+1)$ equally-likely arrangements of the cards.

Formulas like $M\times(M-1)\times(M-2)\times\cdots\times(M-K+1)$ are actually quite easy to implement in computer algebra; you just multiply a sequence of consecutive integers together, where $M$ is the largest and $M-K+1$ is the smallest of the integers you multiply.

For example, if there are $300$ cards remaining in the deck, including $10$ prize cards, when you start drawing, and you draw $20$ cards, then $N=300,$ $M = 20,$ $N-M=280,$ and $P=10.$ The total number of arrangements is $300 \times 299 \times 298 \times \cdots \times 291.$ To count the number of those arrangements in which you draw the first, second, and seventh prizes (three of the prize cards), and no others, you have $K=3$ and $L=7$, so $M-K+1 = 18,$ $N-M-L+1 = 274,$ and so plugging these values into the formula labeled with (*) we have $$20\times19\times18 \times 280\times279\times278\times277\times276\times275\times274$$ ways to win those three prizes.

If you have a small number of cards and many prizes, you may also have to exclude cases that would have more prizes than cards in either the "drawn" or "undrawn" set. There are zero ways to draw $K$ prizes when $K>M$ (because that says the number of prize cards you draw is greater than the total number of cards you draw) and zero ways to draw $K$ prizes when $L = P-K > N-M$ (because that says the number of prize cards you did not draw is greater than the total number of cards you did not draw). Making the number of cards larger, however, is easy (at least mathematically--for a very large number of cards you may have to be concerned with numbers that overflow the bounds of your computer arithmetic; changing the sequence of computations can help in that case).

• Very intriguing. I am especially curious about the scalability of this EV calc to more prizes or cards remaining (say 10 prizes in 300 cards). Could the above be simplified or is there a scale limit? I get the below in Maple, but that is using only your example; r is remaining cards, p is cards John plays, and each w is the prize. $$\displaystyle-{p}\cdot\frac{{{r}^{2}+{\left(-{w}{\left[{1}\right]}-{w}{\left[{2}\right]}-{1}\right)}\cdot{r}+{\left({w}{\left[{1}\right]}+{w}{\left[{2}\right]}-{w}{\left[{3}\right]}\right)}\cdot{p}+{w}{\left[{3}\right]}}}{{{r}\cdot{\left({r}-{1}\right)}}}$$ – LMY Jun 1 '17 at 15:21
• Ten prizes and ten or more cards drawn would give you $1024$ cases, which is a lot to do by hand but not difficult for a computer algebra system. For each case you have the computer count the number of prizes drawn and then apply the formula for that case. It's not clear to me that it's worth simplifying the expressions if you have MATLAB and Maple; let the computer do the work. – David K Jun 1 '17 at 15:33
• I guess my question is how to scale the equation to support more prizes or more cards? I am a little fuzzy on your M equation, perhaps another example would help. Thank you – LMY Jun 1 '17 at 15:37
• Excellent example! Does the below look correct to you? (probability only) Thanks! $$\displaystyle\frac{{\Gamma{\left({M}+{1}\right)}\cdot\Gamma{\left({N}-{M}+{1}\right)}\cdot\Gamma{\left({N}-{P}+{1}\right)}}}{{\Gamma{\left({M}-{K}+{1}\right)}\cdot\Gamma{\left({N}-{M}-{L}+{1}\right)}\cdot\Gamma{\left({N}+{1}\right)}}}$$ – LMY Jun 1 '17 at 16:39