# Casino game trente et quarante (probabilities)

I am currently working on side bets for the game 30 and 40 (known mainly in Europe) explained on this page : http://wizardofodds.com/games/trente-et-quarante/

If I try to sum-up the rules of the games: - The game is played with a 6 decks shoe - Each deck has 52 cards - Ace value is 1 and other faces have a value of 10. All other cards keep their value - The dealer has to draw 2 rows of cards independantly and consecutively. He deals the first row and stop when the total of the cards is equal or above 31 and do the same with the second row - Player can bet on the first or the second row to predict the color of the first card drawn and/or the row which is the closest from 31.

The idea is to add a side bet where the player can predict the number of cards that will be drawn for either the first row or the second row. In order to design the table of payments I need to know all probabilities.

I already know that the minimum number of cards drawn is 4 (imagine 3 cards with a 10 calue and any other cards) and the maximum is 28 cards (there are 24 aces in the shoe with a 1 value + 4 cards of "2"). My question is, what are the probabilities of having 4 cards drawn ? 5 cards drawn ? up to 28 cards drawn. Obviously each hand has to be qualified and for that, like I said, the addition of cards has to be >= to 31

The probability that $n$ cards are drawn is the probability that the sum of the first $n-1$ cards is below the limit and the sum of the first $n$ cards is above the limit:
$$p_n=\frac{(312-n)!}{312!}\sum_xH\left(30-\sum_{k=1}^{n-1}x_k\right)H\left(\sum_{k=1}^nx_k-31\right)\;,$$
where the sum is over all ordered $n$-tuples $x$ without replacement from the $312$ cards in the deck, and $H$ is the Heaviside step function, which is $0$ if the argument is negative and $1$ otherwise. This would be hard to do by hand, but it's not too hard to do with a computer. Here's code that performs the calculation, and here's the result:
The last value is easily checked by hand, since we need $28$ cards if and only if the first $27$ cards are all $24$ aces and $3$ of the $24$ twos:
$$p_{28}=\frac{\binom{24}3}{\binom{312}{27}}=\frac{23}{7205691002912587622645741591259619964}\;.$$