Fog Creek Software
Discussion Board

wanna play (pair matching card game)

I wouldn't give you a penny for that game. Here's why.

Let's say all the color pairs are matched. That means 13 red pairs, 13 black pairs, you win.

Now let's say there is 12 red pairs in the deck, we pick them all from the top of the deck. With the 28 remaining card, there will always be exactly 12 black pairs and two mixed pairs. Why? Two red cards in the stack, they can't be in a pair, otherwise you would get a total of 13 pairs, and I would too since all the black cards would be together. So the two red cards are matched with one black card each, leaving 24 black cards together, I get the same number of pairs as you do and you win.

Same math with 11 red pairs. That means four red cards in mixed pairs, hence 22 black cards left together, or 11 pairs.

No matter how mixed up the cards are, it's a tie, and you win. Hence, I wouldn't give you a penny.

Wednesday, April 10, 2002

mrbozo is correct, the only is I wouldn't bet period.

Joel C. Taitt
Thursday, April 11, 2002

Yes, every game ends with Player and House having the same number of cards in their pile - a win for the House.

If Player takes p pairs, House takes h pairs, and we discard d mismatches, then there are 2p+d red cards and 2h+d black cards.  Standard deck implies p=h.

Brian McKeever
Thursday, April 11, 2002

I'm confused.  Does the discard pile get recycled, or are there a fixed number of turns in the game (26)?

And, if it does get recycled, can I presume that it's shuffled before its cards are drawn again?

Steve Shabino
Monday, April 15, 2002

Nevermind.  It clearly doesn't matter :)

Steve Shabino
Monday, April 15, 2002

I found it easier to think this way: If we have a perfectly interleaved pack of cards (red-black-red-black-etc), you win.  Now, take any black card that's in between two reds and move it next to another black card (that was also between two reds).  you'll get a pair of black cards and a pair of red cards.  Do the same again with another black that's surrounded by reds (move next to a different black that's surrounded by reds).

It's easy to see that the blacks chosen in each case were randomly picked from the pack.  So, by moving 'x' blacks around like this, we should have 'x' pairs of each black and red.  That means, either the pack in perfectly interleaved or it has an equal number of red/black pairs.  you win again.

Vineeth Subramanyam
Tuesday, April 16, 2002

Here is a "adversarial model" way of looking at this.
Begin with 26 black and red cards with each player.
Split the cards into pairs so that there are 13 pairs
on both sides.
Red tries to "spoil" as many black pairs using his
cards (this also costs red pairs of its own colour).
If red uses two cards to destroy two black pairs
by inserting a red card between the black cards, black
can still get back one pair by putting the two "destroyed" pairs on top of each other (BRBBRB). So by destroying
one of his own pairs, red can destroy only one black
pair. So black will always have atleast as many pairs as

R Krishnan
Monday, April 29, 2002

*  Recent Topics

*  Fog Creek Home