Fog Creek Software
Discussion Board




Card Conundrum

I'm going to hand you a deck of normal playing cards-- 52 cards and no jokers. You're going to be placed into a darkened room.

The deck of cards will have 13 of the 52 cards turned face up. They're all mixed up in the deck. You don't know where they are. And you can't tell. Your challenge is to arrange the cards in two piles so that each pile has the same number of cards facing up.
That's your problem. But here's a hint: they don't have to be equal piles. But, if the main deck winds up with, say, 9 face-up cards, the other pile has to have 9 face-up cards, too.

Pete
Tuesday, November 18, 2003

Take the first 13 cards, reverse them all. This is the first pile. The second pile is the rest.

After we take the first 13, there are n turned over cards in the pile, and 13 - n in the rest. Reversing the first pile gives us 13 -n in the first pile as well.

QED

Paul Viney
Tuesday, November 18, 2003

*  Recent Topics

*  Fog Creek Home