TITLE: double decker, 13 card flush vs. 18+ of each color card. Who has the better odds of winning?
QUESTION [9 upvotes]: Two people, call them $A$ and $B$, decide to play a card game. They take 2 standard decks of playing cards and combine them into a "superdeck" of 104 cards, shuffle them well, and then draw 1 card at a time randomly without replacement. $A$ immediately wins if 13 cards of any single suit are drawn.  $B$ immediately wins if at least 18 black and at least 18 red cards are drawn. If they both "win" on the same card draw it is a tie (no decision) and they start over with all 104 cards after reshuffling. They bet even money—dollar for dollar matching. Who, if anyone, has the advantage of winning and by how much?
Note that all cards are shared "community" cards so the players are not drawing their own set of cards.
If someone would like to comment on if and how the probability changes if they draw their cards in tandem, that would be very interesting and informative. For example, two cards would be drawn at a time, giving one to $A$ and one to $B$, and then checked if anyone won or if they tied. This is an optional bonus question and not required to earn the checkmark for best answer.
Simulating 1,000,000,000 (1 billion) decisions (including ties) of the original question (shared cards), I got the following winning percentages:
$$
A\quad 38.7855918\%\\
B\quad 59.7770491\%\\
\textrm{Tie}\quad 1.4373591\%
$$
Minimum # of cards : $14$ (A disappointment as I was expecting it to be $13$)
Maximum # of cards : $42$
Average # of cards : $37.1902$
Note that at "first glance", some people might think that $A$ has the advantage because $A$ can win with as few as 13 cards but B needs 36 cards at a minimum to win. However, look at how much $B$ is actually favored to win. Another thing that somewhat surprised me is the average number of cards for someone to win (or tie) is about 37, only about 1 card more than $B$'s minimum needed to win. That might also imply that $A$ has an advantage. What if I reworded the question to also state that the average number of cards for a decision is slightly over 37, would most people then think at first glance that $A$ has an advantage, possibly a huge one? Yet another thing that might mislead people into thinking that $A$ has a large advantage is that $A$ is guaranteed not to lose if at least 42 cards are drawn. At that point either $A$ has won or tied. Kudos to the person that suspected that $B$ was the favorite from the start because he didn't let these false biases sway him towards $A$ being the favorite.
UPDATE:
I ran the alternate simulation giving each player their own cards and got some interesting results. $B$ remains the favorite at about $57.1\%$ to $A$'s $36.8\%$ which means the ties more than quadrupled to about $6.1\%$. The average number of cards slightly more than doubled from about 37 to about 75 with a low of 28 and a high of 94 (in ten million decisions).
Perhaps one way to simplify getting the answer to this original problem is to start the game by immediately turning over 35 cards since $B$ cannot win with less than 36 cards. Check if $A$ won at 35 cards. If not, then draw cards 36 thru 42 one at a time checking for a winner.  By draw 42 someone will have won or there is a tie. So would the prob of $A$ winning on a 35 card draw be:
$$
\large
\frac{4\times {26 \choose 13} \times {78 \choose 22}}{{104 \choose 35}}
$$
That is about $10\%$. There may be two 13 card flushes in that but we don't care as long as there is at least 1.
Also it is interesting to note that in the original game with shared cards, $42$ cards is the max for a win or tie because of the $25+17$ situation but with separate hands, that doesn't happen so the max # of cards drawn can exceed $84$ (which is $2$ * $42$) and in my simulation is did exceed it as it maxxed out at $94$ cards, not $84$.  For example, B could get $29$ black cards and $17$ red cards but A could have $12, 12, 11,$ and $11$ of each suit (respectively) so at that point, neither is a winner and $2$ more cards would be drawn (almost exhausting the deck of $104$).  The max number of cards ever for the separate card variation of this game seems like $94$ but I am not certain yet.
Another interesting point is that simulation of the separate card variation is considerably slower because the average approximate number of cards needed is about double ($75$ vs. $37$) and can go as high as $94$ which is almost the entire deck so it becomes "harder" (slower).

REPLY [2 votes]: From 13 to 35 cards, player A has a chance of winning while player B does not.
From 36 to 48 cards, both players have a chance to win or tie.
On the 49th card, player A wins for sure (as opposed to the 42nd that you claim). This is due to the pigeonhole principle: a 48 card hand could include 12 of each suit, so the 49th card must make one suit count 13. On the 70th card, player B wins for sure (B could have 52 of one color, and 17 of the other. The 70th draw guarantees 18 of each). Finally, as the data shows, a hand of size 42 guarantees that either A or B will win (or tie).
To calculate the probability that A has not won at some point up to $H$ draws, we can think about a hand as a count of how many of each suit is in it. If we let $h,c,d,s$ represent the count of each suit in the hand, then the number of hands with that count is $\binom{26}{h} * \binom{26}{c} * \binom{26}{d} * \binom{26}{s}$. The total number of hands would be the sum of this expression for all $h,c,d,s <=26$ such that $h+c+d+s = H$ -- this is equal to $\binom{104}{H}$. The total number of hands where A does not win is the same formula restricted to $h,c,d,s < 13$. Then we subtract this from the total to get the number of winning hands.
Similarly for B, we can think about a hand as the distribution of red and black cards, but with only two variables $r,b$ and 52 of each to choose from: ie $\binom{52}{r} * \binom{52}{b}$. We want to sum all these values such that $r,b \ge 18$ and $r+b = H$.
Since A and B share hands, we also need to count the number of overlapping non-winning hands. To do this, we use the same formula for notA, but with the additional constraint that $h+d < 18$ and $c+s < 18$. We can also count the number of overlapping winning hands by negating our constraints. 
Note that these results mean the probability that the event occurred at some point up to hand H. The probability that player A wins on exactly hand H is equal to the conditional probability that neither won on hand $H-1$, player A won on hand $H$, and both did not win on hand $H$. The probability of a tie is equal to the conditional probability that niether won on hand $H-1$, but both won on hand $H$.
Hand size: 35
A winning hands:    875816935792799067913677520
B winning hands:    0
AB both win:    0
AB do not win:  5824466077910326344645212520
Total hands:    5824466077910326344645212520
Probability A wins: 0.15036862
Probability B wins: 0
Probability both win: 0
Probability neither wins: 1

Hand size: 36
A winning hands:    2187651178880365105675308580
B winning hands:    1820897651953170094890722500
AB both win:    142265392956675598133160000
AB do not win:  7297276544784599224803786250
Total hands:    11163559982661458827236657330
Probability A wins: 0.19596358
Probability B wins: 0.16311084
Probability both win: 0.01274373
Probability neither wins: 0.65366931

Hand size: 37
A winning hands:    5140562828655596541853267120
B winning hands:    6516896859621871918556270000
AB both win:    777662543946706376569520000
AB do not win:  9637015796776783868919245000
Total hands:    20516812941107545952759262120
Probability A wins: 0.25055367
Probability B wins: 0.31763690
Probability both win: 0.03790367
Probability neither wins: 0.46971310

Hand size: 38
A winning hands:    11371534640110716298280913080
B winning hands:    16583787534879868803273455500
AB both win:    2937240057516237287701068000
AB do not win:  11156298594478430576538030000
Total hands:    36174380711952778390391330580
Probability A wins: 0.31435326
Probability B wins: 0.45844012
Probability both win: 0.08119669
Probability neither wins: 0.30840331

Hand size: 39
A winning hands:    23690714827333517325560337520
B winning hands:    35627336140083180992347849000
AB both win:    9013637288502121383132024000
AB do not win:  10913769064390124956655320000
Total hands:    61218182743304701891431482520
Probability A wins: 0.38698821
Probability B wins: 0.58197311
Probability both win: 0.14723791
Probability neither wins: 0.17827659

Hand size: 40
A winning hands:    46487893830302959963647058470
B winning hands:    68284216792403753485577822225
AB both win:    23655062504574195829192021600
AB do not win:  8362498839737622953543300000
Total hands:    99479546957870140573576159095
Probability A wins: 0.46731107
Probability B wins: 0.68641463
Probability both win: 0.23778820
Probability neither wins: 0.08406249

Hand size: 41
A winning hands:    85910617153854265768625366880
B winning hands:    119811369879258352469125806400
AB both win:    54462253713125886387171266400
AB do not win:  4025413150834950995978000000
Total hands:    155285146470821682846557906880
Probability A wins: 0.55324427
Probability B wins: 0.77155718
Probability both win: 0.35072417
Probability neither wins: 0.02592272

Hand size: 42
A winning hands:    149469721837112574467943550320
B winning hands:    195312503647991511458210679600
AB both win:    111854505778871561656317369600
AB do not win:  0
Total hands:    232927719706232524269836860320
Probability A wins: 0.64170002
Probability B wins: 0.83851121
Probability both win: 0.48021123
Probability neither wins: 0

Hand size: 43
A winning hands:    244715045843780655787896274880
B winning hands:    298674073002244768818180828000
AB both win:    207539848571922715193754188000
AB do not win:  0
Total hands:    335849270274102709412322914880
Probability A wins: 0.72864546
Probability B wins: 0.88930988
Probability both win: 0.61795534
Probability neither wins: 0

Hand size: 44
A winning hands:    376860795714204834746281144720
B winning hands:    431385093907717298743442357400
AB both win:    342636674014643377259003097400
AB do not win:  0
Total hands:    465609215607278756230720404720
Probability A wins: 0.80939291
Probability B wins: 0.92649604
Probability both win: 0.73588894
Probability neither wins: 0

Hand size: 45
A winning hands:    545804079983805943178849072960
B winning hands:    591482567719646428297316775840
AB both win:    516474360227080696501871975840
AB do not win:  0
Total hands:    620812287476371674974293872960
Probability A wins: 0.87917731
Probability B wins: 0.95275590
Probability both win: 0.83193321
Probability neither wins: 0

Hand size: 46
A winning hands:    743714191719739507973917271840
B winning hands:    772880007527858837939817663360
AB both win:    720334960962686849751053663360
AB do not win:  0
Total hands:    796259238284911496162681271840
Probability A wins: 0.93401013
Probability B wins: 0.97063867
Probability both win: 0.90464880
Probability neither wins: 0

Hand size: 47
A winning hands:    954779348149106412259124973760
B winning hands:    965300355892586485716310679040
AB both win:    937461920626270200583190679040
AB do not win:  0
Total hands:    982617783415422697392244973760
Probability A wins: 0.97166911
Probability B wins: 0.98237623
Probability both win: 0.95404534
Probability neither wins: 0

Hand size: 48
A winning hands:    1158159106785090614049190906340
B winning hands:    1154952335593086938765629404360
AB both win:    1146252824572363099661529404360
AB do not win:  0
Total hands:    1166858617805814453153290906340
Probability A wins: 0.99254450
Probability B wins: 0.98979629
Probability both win: 0.98234080
Probability neither wins: 0

Hand size: 49
A winning hands:    1333552706063787946460903892960
B winning hands:    1325964631130082475276750299840
AB both win:    1325964631130082475276750299840
AB do not win:  0
Total hands:    1333552706063787946460903892960
Probability A wins: 1.00000000
Probability B wins: 0.99430988
Probability both win: 0.99430988
Probability neither wins: 0

And here is the code:
import java.math.BigDecimal;
import java.math.BigInteger;


public class A {

    public static void main(String[] args) {

        for(int H=35; H<50; H++) {

            BigInteger AWIN = BigInteger.ZERO;
            for(int A=0; A<13; A++) {
                for(int B=0; B<13; B++)
                    for (int C=0; C<13; C++)
                        for (int D=0; D<13; D++)
                            if(A+B+C+D == H) {
                                BigInteger temp = BigInteger.ONE;
                                temp = temp.multiply((choose(26,A)));
                                temp = temp.multiply((choose(26,B)));
                                temp = temp.multiply((choose(26,C)));
                                temp = temp.multiply((choose(26,D)));
                                AWIN = AWIN.add(temp);
                            }
            }

            BigInteger BWIN = BigInteger.ZERO;
            if(H>35) {
                for(int R=18; R<H; R++) {
                    for(int B=18; B<H; B++)
                        if(R+B == H) {
                            BigInteger temp = BigInteger.ONE;
                            temp = temp.multiply((choose(52,R)));
                            temp = temp.multiply((choose(52,B)));
                            BWIN = BWIN.add(temp);
                        }
                }
            }

            BigInteger ABNOWIN = BigInteger.ZERO;
            if(H>35) {
                for(int A=0; A<13; A++) {
                    for(int B=0; B<13; B++)
                        for (int C=0; C<13; C++)
                            for (int D=0; D<13; D++)
                                if(A+B+C+D == H && (A+B < 18 || C+D < 18)) {
                                    BigInteger temp = BigInteger.ONE;
                                    temp = temp.multiply((choose(26,A)));
                                    temp = temp.multiply((choose(26,B)));
                                    temp = temp.multiply((choose(26,C)));
                                    temp = temp.multiply((choose(26,D)));
                                    ABNOWIN = ABNOWIN.add(temp);
                                }
                }
            }

            BigInteger ABWIN = BigInteger.ZERO;
            if(H>35) {
                for(int A=0; A<=26; A++) {
                    for(int B=0; B<=26; B++)
                        for (int C=0; C<=26; C++)
                            for (int D=0; D<=26; D++)
                                if(A+B+C+D == H && A+B >= 18 && C+D >= 18 && (A >= 13 || B >= 13 || C >= 13 || D >= 13)) {
                                    BigInteger temp = BigInteger.ONE;
                                    temp = temp.multiply((choose(26,A)));
                                    temp = temp.multiply((choose(26,B)));
                                    temp = temp.multiply((choose(26,C)));
                                    temp = temp.multiply((choose(26,D)));
                                    ABWIN = ABWIN.add(temp);
                                }
                }
            }

            BigInteger tot = BigInteger.ZERO;
            for(int A=0; A<=26; A++) {
                for(int B=0; B<=26; B++)
                    for (int C=0; C<=26; C++)
                        for (int D=0; D<=26; D++)
                            if(A+B+C+D == H) {
                                BigInteger temp = BigInteger.ONE;
                                temp = temp.multiply((choose(26,A)));
                                temp = temp.multiply((choose(26,B)));
                                temp = temp.multiply((choose(26,C)));
                                temp = temp.multiply((choose(26,D)));
                                tot = tot.add(temp);
                            }
            }

            AWIN = tot.subtract(AWIN);

            System.out.println("    Hand size: " + H);
            System.out.println("    A winning hands:\t" + AWIN.toString());
            System.out.println("    B winning hands:\t" + BWIN.toString());
            System.out.println("    AB both win:\t" + ABWIN.toString());
            System.out.println("    AB do not win:\t" + ABNOWIN.toString());
            System.out.println("    Total hands:\t" + tot.toString());

            BigDecimal topA = new BigDecimal(AWIN);
            BigDecimal topB = new BigDecimal(BWIN);
            BigDecimal topAB = new BigDecimal(ABWIN);
            BigDecimal topNAB = new BigDecimal(ABNOWIN);
            BigDecimal bot = new BigDecimal(tot);
            System.out.println("    Probability A wins: " + topA.divide(bot,8, BigDecimal.ROUND_HALF_UP).toString());
            System.out.println("    Probability B wins: " + topB.divide(bot,8, BigDecimal.ROUND_HALF_UP).toString());
            System.out.println("    Probability both win: " + topAB.divide(bot,8, BigDecimal.ROUND_HALF_UP).toString());
            System.out.println("    Probability neither wins: " + topNAB.divide(bot,8, BigDecimal.ROUND_HALF_UP).toString());
            System.out.println();

        }

    }

    static BigInteger choose(final int N, final int K) {
        BigInteger ret = BigInteger.ONE;
        for (int k = 0; k < K; k++) {
            ret = ret.multiply(BigInteger.valueOf(N-k))
                     .divide(BigInteger.valueOf(k+1));
        }
        return ret;
    }

}