The Glade 4.0
https://gladerebooted.net/

Need math/logic help again
https://gladerebooted.net/viewtopic.php?f=2&t=294
Page 1 of 1

Author:  Lydiaa [ Wed Sep 23, 2009 11:46 pm ]
Post subject:  Need math/logic help again

The question
"in a deck of 52 cards (without jokers), a person randomly picks a card. You have 5 question to which the person will answer yes or no only. What 5 questions will ensure that you know the number and suit of the card at the end of the 5th question".

This has me totally stumped. Any help would be great :D

Author:  Corolinth [ Thu Sep 24, 2009 2:05 am ]
Post subject:  Re: Need math/logic help again

The short answer is that there is no set of five questions that will answer it for every case, as the information you receive changes the question you ask next. I'll illustrate:

"Is the card red?" This question eliminates half the deck.
"Is the card a heart?" If the card turned out to be black, then this question provides redundant information.

However, those two questions (or variations on them) do eliminate 75% of the deck. From here, I need to know if the face cards are considered to have a numerical value (11-13) and if aces are considered high or low. I'm fairly certain the system can be solved in five binary questions, but the nature of the system changes once you've narrowed down to a suit. Though there may be some uncertainty because 52/32 lies between 1 and 2.

Author:  Raell [ Thu Sep 24, 2009 2:27 am ]
Post subject:  Re: Need math/logic help again

Corolinth wrote:
However, those two questions (or variations on them) do eliminate 75% of the deck. From here, I need to know if the face cards are considered to have a numerical value (11-13) and if aces are considered high or low. I'm fairly certain the system can be solved in five binary questions, but the nature of the system changes once you've narrowed down to a suit. Though there may be some uncertainty because 52/32 lies between 1 and 2.


If you assume that the ace is 1 and the face cards are numbered 11 to 13 you can get rid of six or more cards by asking if it is a prime number.

Still, two questions to narrow that down...**** beyond me.

Author:  Micheal [ Thu Sep 24, 2009 3:13 am ]
Post subject: 

As Corolinth describes, determining the suit uses two questions, the second one depending on the answer to the first. I've tried several permutations, but to ascertain a 1 in 13 possibility I need four more questions, questions four, five, and six dependent on the answer to the previous question. I haven't figured out how to do it in three questions.

Author:  Nevandal [ Thu Sep 24, 2009 4:02 am ]
Post subject:  Re: Need math/logic help again

This probably wont help, but here's another way to subdivide the cards that might not have been thought of yet.

ace
one
two
six
ten

four
five
nine
jack
king

three
seven
eight
queen

Author:  Katas [ Thu Sep 24, 2009 4:15 am ]
Post subject:  Re: Need math/logic help again

Coro,

52/32 is greater than 1, aye.

However, cards are easier to sort out than you may think.

For example, is the card between 2 and 10? That eliminates either 4 or 9 out of 13.

Assuming we're down to 4, it's Does the card have a man on the card?

If yes, is it the king, if no, is it the queen?

So I can get to a face card in 5 questions.

It's the other side of things that has me puzzled.

Hrm. Just had a thought. Questions like 'Is the card used in Sueca?'

http://en.wikipedia.org/wiki/Sueca_(game)

It is played with 40 cards (remove the 8s, 9s, 10s from a standard 52 card deck). The rank of the cards in each suit, from highest rank to lowest one, is:
Ace, 7, King, Jack, Queen, 6, 5, 4, 3, 2.

That could help narrow down further and faster if we think about card games and less about numbers.

Author:  TheRiov [ Thu Sep 24, 2009 7:40 am ]
Post subject: 

Euchure is played with 9,10,J,Q,K,A

Author:  TheRiov [ Thu Sep 24, 2009 7:56 am ]
Post subject: 

I can get it in 6. I cannot figure out how to get it in 5 yet. Logically I would think you can divide the list of possiblities by 2 each time:
52->26->23->7 or 6->4 or 3->2 or 1->2 or 1

but I cannot figure out how to ensure that final choice is down to 1 possiblity, not 2.

in five questions

Is it a black card? 52->26 pos
Is it a <Suit>? 26->13 possiblities
If we assign Ace a value of 1, Jack =11,Queen=12, King 13, is the card an Even or an Odd?
13->7 or 6 Possiblities
Using the same scheme, is the card in the top half of the values? 3 or 4 possiblities?

Author:  Raell [ Thu Sep 24, 2009 7:58 am ]
Post subject:  Re:

TheRiov wrote:
Euchure is played with 9,10,J,Q,K,A



Most folks I know use the fives as well... :twisted:

Author:  TheRiov [ Thu Sep 24, 2009 8:02 am ]
Post subject: 

score is kept with 5s, (or 6/4 or on paper) but the cards are not part of a play deck.

Author:  Corolinth [ Thu Sep 24, 2009 8:42 am ]
Post subject: 

Assumptions do not help, you have to know. That's why I asked if we can assign a numerical value to face cards, and if aces are considered to have a value of less than 2 or greater than king.

You want your questions to eliminate half of the deck regardless of how they're answered. Asking if the card is used in Euchre would help, as a 6/7 split is as close to half as would be possible. The problem is that it relies on the person holding the card to know what Eucre is and how it's played.

Also, your fifth and final answer must be, "Is it <specific card>?" That means that the remaining four questions must narrow your possibilities down to two. If you are unable to do that in four questions, than you can not solve the system explicitly for any given card. Yes, you might be able to get it for "face cards," but that accounts for only twelve cards in the deck. Twelve out of fifty-two isn't good enough.

Author:  TheRiov [ Thu Sep 24, 2009 8:56 am ]
Post subject: 

not per the terms of the original problem statement.

Quote:
What 5 questions will ensure that you know the number and suit of the card at the end of the 5th question".

you dont have to confirm it with a question. the way I phrased my questions I'm not assuming anything--I'm framing the question--defining the terms of the answer. The only problem comes if you get to situation where you have an odd number of possiblities and the card is in the larger pool. (if you have 1 question to pull 1 card out of 3)

if a "neither" yes or no answer is possible then you can do it.

Author:  Corolinth [ Thu Sep 24, 2009 9:43 am ]
Post subject:  Re: Need math/logic help again

Yes, you do have to confirm it with a question. The problem is solved by narrowing the original set of 52 down to smaller and smaller subsets. The first question about the color reduces you to a 26 unit subset. The second question brings you down to a 13 unit subset. At this point, you have three questions to narrow your set down further. In order to solve the system explicitly, you have to have reduced yourself to a subset of 2 by the end of the fourth question. That way when I ask, "Is it the queen of hearts?" and you say, "No," I know that the card is, in fact, the king of hearts.

Looking over the range of possible outcomes, the best case scenario leaves me with 6 cards after the third question, and 3 cards after the fourth question. This means that my fifth question can not provide me with enough information to figure out the card. Oh, there are certain possibilities for the card that would allow me to get an answer. If the card is a face card, I could do it by asking with my third question whether the card is a face. The problem is, what happens if the card isn't a face? Then I'd have two questions to narrow down a ten card set.

In the end, this system is unsolvable. Any individual solution relies on luck and good fortune at one of the last three questions, and will fail any attempt at rigor.

Author:  TheRiov [ Thu Sep 24, 2009 10:36 am ]
Post subject: 

Incorrect, if you narrowed down the possiblities to 2 possible cards (say a 2 and 3 of clubs) you could still ask "Is the card value Odd" and get a positive lock on the correct answer without ever asking for a specific card.

I agree that you need a 6th question to ensure a correct answer in all scenarios, But at no point do you need to ask if the card is a card until.

Author:  LadyKate [ Thu Sep 24, 2009 10:40 am ]
Post subject:  Re: Need math/logic help again

Corolinth wrote:
In the end, this system is unsolvable. Any individual solution relies on luck and good fortune at one of the last three questions, and will fail any attempt at rigor.


This is pretty much the solution we have come up with at work. (Yeah, I passed it around.) We can only narrow it down to 3 by the end of the 4th question.

Author:  Corolinth [ Thu Sep 24, 2009 10:59 am ]
Post subject:  Re:

TheRiov wrote:
Incorrect, if you narrowed down the possiblities to 2 possible cards (say a 2 and 3 of clubs) you could still ask "Is the card value Odd" and get a positive lock on the correct answer without ever asking for a specific card.
At this point, asking if the card value is odd is the same as asking about a specific card. "Is the card odd?" is the same as asking, "Is the card the three of clubs?" Once you have a set of two, any binary question is asking about a specific element of the set. You have two elements remaining and your question, regardless of the answer you receive, eliminates one element.

Author:  Stathol [ Thu Sep 24, 2009 11:10 am ]
Post subject: 

Unless I'm sorely mistaken, the yes/no nature of the problem dictates that no series of questions is guaranteed to produce a definite, single-card solution any faster than simple recursive binary division of the cards. Or, in laymens' terms, dividing the deck in half with every question.

The problem, then, is that log2(52) = ~5.7. The minimum number of yes/no questions for a definite solution is therefore 6.

Author:  TheRiov [ Thu Sep 24, 2009 11:14 am ]
Post subject: 

the difference being that "is the card Odd" can be asked at any point in the sequence and still be counted upon to eliminate potentially just over half the available possiblities.

On the other hand, "Is the card the two of clubs" can ONLY be asked at the final stage and only if the list of possiblities is between the Two of Clubs and some other card.

since the original problem asks for a list of questions that will always solve the problem, "Is this card X card" cannot be a solution as the question is dependent on the answers. Where as the generic question "odd or even" or "is it the lesser of the two remaining cards" or something of that nature, would continue to be valid for all possiblities.

Author:  Stathol [ Thu Sep 24, 2009 11:28 am ]
Post subject: 

I should amend my answer to clarify that what I said is only true if every card in the deck is unique. If all of the cards were, say, the 4 of clubs, then obviously it takes a lot fewer questions :P

Ultimately, it doesn't matter what questions you ask or how clever you get in dividing them. It doesn't even matter what the values of the cards actually are. They could be cards numbered with random (but unique) numbers between 1 and 1 million. Despite all appearances, this is not really a number theory problem. It would work the same even with a "skewed" deck where 2/3 of the cards were odd, or where 90% of them were prime. In fact, it doesn't even matter that they use numbers or letters at all. They may as well be printed with 52 unpronouncible and meaningless symbols.

Assuming that your "opponent" can truly chose any card, it simply is not possible to select *exactly* 1 value from a set of 52 unique values using only 5 binary operations for all possible initial choices.

Author:  TheRiov [ Thu Sep 24, 2009 11:33 am ]
Post subject: 

yes and no Stathol. The ability to use 6 questions is dependent on having the ability to eliminate half of the possible outcomes with a yes, no question.

however, now that I think about it you could pare down the lists by asking Is the card a member of <fully defined list of all members of that subset>

Author:  Stathol [ Thu Sep 24, 2009 11:45 am ]
Post subject: 

I'm probably not explaining this very well. :|

Look at it this way:

You have a pile of 52 pebbles. Your opponent marks one with some invisible sign that only he can see. You are allowed to divide this pile of pebbles into two parts, and then divide *those* into two parts, etc. This process can be done 5 times, and you can divide them any way you please. That is, you can divide them up 50/50 each time or 90/10, whatever.

Inevitably, you will have no more than 32 piles at the end. It is mathematically impossible for each of those no more than 32 piles to contain exactly one pebble unless 20 pebbles have mysteriously ceased to exist. Therefore, at least one of the final piles must contain at least 2 pebbles. Ergo, your opponent can choose a pebble which will wind up in that pile..

Author:  Corolinth [ Thu Sep 24, 2009 12:44 pm ]
Post subject:  Re:

TheRiov wrote:
the difference being that "is the card Odd" can be asked at any point in the sequence and still be counted upon to eliminate potentially just over half the available possiblities.

On the other hand, "Is the card the two of clubs" can ONLY be asked at the final stage and only if the list of possiblities is between the Two of Clubs and some other card.
That's why I specified that the last question be, "Is it <specific card>?" rather than asking about the two of clubs.

At some point, you will have to ask a question that does not eliminate half of all possible cards. Our second question of, "Is it <suit>?" Can't be counted upon to eliminate half of your cards if it's asked before the question that determines color. If it is that suit, you eliminate 75% of the deck, but if it's not that suit you only eliminated 25%. Likewise, the question of whether the card is even can't be counted upon to eliminate half of your cards, as face cards may not be considered to have a numerical value. The important part isn't to ask questions that eliminate half of your cards at any point in the sequence, it's that they eliminate half of the cards remaining at the time you ask the question.

When you are ready to ask your final question, you have two cards left, and you know what they both are.

Author:  Rafael [ Thu Sep 24, 2009 5:36 pm ]
Post subject: 

I'm going to agree with Stathol. By using your first to questions to eliminate 3 of the suits, you are left w/ 13 cards.

Unless the card is a face card and you, you cannot solve this problem with 5 questions. i.e. unless the eliminate at least 10 of the 13 cards with your third question, than you cannot solve it with the third question.

However, given a sixth question, you should be able to solve this puzzle with up to 64 cards, given the cards fit some sort pattern you can use to ask yes/no questions that pare the searchable deck left.

Page 1 of 1 All times are UTC - 6 hours [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/