# A deck of playing cards.

Greetings everyone!

Over the past few months I've grown to love this community quite a lot. Therefore, I decided to contribute something to you guys. I'm not sure if it's a repost or not, but I wasn't able to find it so far so hopefully it'll prove interesting. The problem is the following:

You are blind. You are also given a deck that consists of 52 playing cards, which naturally have faces and backs. You also like to keep your cards neat and tidy, meaning that all the cards are faced the same way. However, your evil step brother comes in, grabs your deck full of face down cards and takes N cards from it. He then proceeds to turn those N cards face UP and returns them in the deck in that particular way (meaning they are now face up and somewhere random in the deck). However, he also claims that if you manage to separate two packs from the deck, that have an exactly equal number of face up cards he will become your eternal slave until the end of time. Being the genius of your family you are, you win the bet and trick your step brother. How is this possible?

Note 1: The cards are exactly the same, meaning "feeling" which cards are face up is not an acceptable solution.

Note 2: The cards are not bent in any way, meaning that, again, "feeling" which cards are face up is not an acceptable solution.

Note 3: Your step brother tells you exactly how many cards he turned face up in the deck. So, you know the exact value of N.

Note 4: N can practically be any number from 1 to 52.

Emphasis 1: The 2 packs do NOT necessarily need to be equal.

Emphasis 2: When the brother returns the face up cards in the deck, he returns them into random positions, or perhaps shuffles them, it doesn't really matter. What matters is that in the end you end up with 52 cards, N of which are face up.

Well there it is :) This is my first discussion "attempt", so please have pity on me.

Good luck!

Note by Ivan Sekovanić
6 years, 4 months ago

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

• Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
• Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
• Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold
- bulleted- list
• bulleted
• list
1. numbered2. list
1. numbered
2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in $$ ... $$ or $ ... $ to ensure proper formatting.
2 \times 3 $2 \times 3$
2^{34} $2^{34}$
a_{i-1} $a_{i-1}$
\frac{2}{3} $\frac{2}{3}$
\sqrt{2} $\sqrt{2}$
\sum_{i=1}^3 $\sum_{i=1}^3$
\sin \theta $\sin \theta$
\boxed{123} $\boxed{123}$

Sort by:

Just to make things a bit more interesting, what if you were to take two equal piles from the deck, each having n<26 cards? Is it still possible to get an equal number of face up cards in each pile?

- 6 years, 4 months ago

Hmm, nice addition! :) I'll have to think this through a bit though :)

- 6 years, 4 months ago

I really enjoy this problem. I can elaborate upon Stephen's answer. Take any N cards from the deck. These cards must contain k cards that are face up, where k can be any number from 0 to N, inclusive. Then, the rest of the deck must have N-k cards that are face up. If we flip over the pile of N cards that we took from the deck, k will now be face down and N-k will now be face up. Thus both piles have the same number of face up cards. I hope this was a good explanation. If not, try this. I really enjoy this guy.

- 6 years, 4 months ago

Good job :) That is the correct explanation of the problem.

- 6 years, 4 months ago

Just grab any N cards from the deck and flip all N cards over...done. :)

- 6 years, 4 months ago

That is indeed correct. :) Care to explain why, though?

- 6 years, 4 months ago

First N must be even. Second i'm assuming he didn't shuffle the face up cards into the rest of the stack. If both are true then the solution is to take the deck and from the top to the bottom put the cards 1,3,5,7,..,51 into stack A and put the cards 2,4,6,8,...,52 into stack B. each of these stacks will have the same number of face up cards because N is even and if h is the first face up card then all the face up cards can be numerated as h,h+1,h+2,...,h+N-1. Now all the even cards will be sent to B and all the odd cards will be sent to A. Thus because N is even both A and B have the same number of face up cards.

- 6 years, 4 months ago

I'm sorry, but both of your statements are not true: I'll make sure I add this to the general explanation. N can be any number from 1 to 52. He does in fact shuffle the face up cards in the rest of the deck - they're put in random positions.

• If the facts were true though, this would be a pretty nice explanation. Nonetheless, well done. :)

- 6 years, 4 months ago