Using 6 yes-no questions to find a card in a standard deck

95 Views Asked by At

The following is the question:

I have chosen a single card from a standard 52-card deck. You may ask any questions whose answer is “yes” or “no” about the card, even complicated ones like “is your card either a picture card in clubs or the five of any suit?”.

Give a list of 6 yes-no questions which, when asked, ensures that after those six questions have been answered, you will know exactly what card I have.

Argue that it is impossible to come up with a list of five yes-no questions which would always let you know exactly what card I have.

Here is what I have so far:

1.) Is your card red

2.) Is your card a heart or a spade

3.) Is your card less than or equal to 7?

4.) Is your card less than or equal to 4, or a face card?

5.) Is your card in {A,2},{5,6},{8,9},{J,Q}.

6.) Is your card in {A,3},{5,7},{8,10},{J,K}.

EDIT: Here is the final product after comments

As for the second part of the question, I believe the reason this isn't possible is that each yes or no question needs to eliminate half of the possibilities regardless of the answer. Because of this, with five questions, you will be left with two possibilities every time.

2

There are 2 best solutions below

2
On BEST ANSWER

To get a list of six questions that can identify the card, where you are only allowed to write six questions total that must be asked in order no matter what answers you get, you have already figured out the first two questions. For the third question, as suggested in comments, you could ask if the rank of the card is in the set $\{A,2,3,4,5,6,7\}.$ This splits the remaining possibilities in half no matter which suit the first two questions revealed.

For the fourth question, you can take all the questions that would have been the fourth in all the branches you would have taken if you were allowed to make up questions depending on the previous answers, and combine them; that is, if "yes" on the third question means you want to know if the card is an $x,$ $y,$ or $z$ and "no" means you want to ask if it is a $u,$ $v,$ or $w,$ then ask if it is a $u,$ $v,$ $w,$ $x,$ $y,$ or $z$. Similarly, for the fifth question ask about all the possible values you could have asked about in the fifth question in any branch, and similarly for the sixth question.

This is essentially the same strategy you took in identifying the suits, where on the second question you ask if the card is a heart (even if the first answer was "no", implying that it cannot be a heart) or a spade (even if the first answer was "yes", implying that it cannot be a spade).

A way to envision the questions is that you somehow make a map from the cards in a standard deck to the numbers from $0$ to $63$ written in binary. (Some numbers will not be used, and that's OK.) Then your first question will be equivalent to whether the first binary bit is $1,$ your second question is whether the second binary bit is one, etc. The first two questions that you devised correspond to mapping the hearts to the numbers $48$ through $63,$ diamonds to $32$ through $47$, spades to $16$ through $31$, and clubs to $0$ through $15.$

Note that if your questions are efficient, you may be able to identify the card after just five questions. It is only in some circumstances that you will need to ask six.

0
On

Let us say a set of $n$ questions sufficiently identifies that each card is unique, hence a combination of $n$ yes and no's can decisively tell you what the card is, The total combination of yes and no's is given by $2^n$, therefore $2^n \ge 52$, and rightly said by you, $5$ doesn't satisfy this