wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> hard >> Guessing Cards Suit
(Message started by: Barukh on Apr 3rd, 2004, 3:56am)

Title: Guessing Cards Suit
Post by Barukh on Apr 3rd, 2004, 3:56am
A magician takes a deck of 36 cards (nine cards of each suit) lying face down. He guesses predicts the suit of the top card, turns it up and puts aside. Then he guesses predicts the suit of the second card, turns it up and puts aside, and so on with the entire deck.

The deck for the trick was prepared by his secret assistant who knows the order of the cards. He uses the fact that the cards in the deck are slightly non-symmetric, and so the magician can distinguish between two possible orientations of every card. The assistant is not allowed to alter the order of the cards, but he can choose the orientation.

What is the best strategy the magician and the assistant should agree upon in order to maximize the number of guaranteed guesses correct predictions?

Source: Moscow Mathematical Olympiad.

Corrected the formulation to (hopefully) avoid confusion.

Title: Re: Guessing Cards Suit
Post by KarmaBandit on Apr 3rd, 2004, 3:37pm
No solution, just my initial thoughts:

First, It seems the only information passed to the magician is the bit of info from each card, and the running total of how many cards of each suit have been seen. Is there something else I'm missing?

Second, maybe multiple strategies would be better than a single one, and the first few cards could be used to encode which strategy to use? Since the assistant knows all the cards, he could choose the optimal strategy, and then encode it.

But even with these no doubt amazing insights, the best I can think of stills gets only half of them. Help!

Title: Re: Guessing Cards Suit
Post by Icarus on Apr 3rd, 2004, 4:47pm
I don't have a better answer yet either, but some numbers to put it in perspective: there are 36!/9!4 [approx] 2.15 x 1019 different arrangements of the cards with regard only to suit. There are 236 [approx] 6.87 x 1010 different messages that the assistant can send by arrangement of card backs. If this is the only means the assistant has of communicating, it is impossible to specify the suit of every card. Working from some very naive assumptions, I get that somewhere between 20 and 24 cards is the maximum possible. But the assumptions were very poor, so this could well be wrong.

I am sure this can be bettered, but I will give the only method I have thought of so far, which is probably KarmaBandit's as well: take the cards two at a time and use the backs to encode a two bit result giving the suit of the second card. In this way you can guarantee 1/2 the deck.

Title: Re: Guessing Cards Suit
Post by Barukh on Apr 4th, 2004, 7:09am

on 04/03/04 at 15:37:55, KarmaBandit wrote:
First, It seems the only information passed to the magician is the bit of info from each card, and the running total of how many cards of each suit have been seen. Is there something else I'm missing?

You've got it right.


Quote:
But even with these no doubt amazing insights, the best I can think of stills gets only half of them. Help!

You may get 19 cards quite easily.

In fact, I know at least 24 cards are possible, but I still refrain from looking into the solution.

Title: Re: Guessing Cards Suit
Post by asterix on Apr 10th, 2004, 8:48am
Just a thought for possible improvement, although I think this only improves their odds, not the number of guaranteed guesses. Make more use of the alternate cards.
For instance, plan on guessing black for the first card. Up will mean clubs, down means spades. If that gives the correct answer, then start over, perhaps alternating so that you will assume the next card is red; Up means hearts, down means diamonds. If the next card turns out to be the wrong color, then its orientation plus the next card's orientation will give the suit of the next card.
You could improve that a little more by counting cards and always planning on making the assumed guesses for whichever color is more prevalent (if a lot of blacks turn up at first, you'll be assuming red). It will make things a little more complicated but improve the odds even more if you don't go by color but by whichever two suits are most prevalent (give the suits a priority: clubs, spades, hearts, diamonds: and of the two most common suits, whichever comes first in that list would get the up orientation).
That plus the fact that you always know the last card of the deck should get you above 50%, but I'm not sure it helps on the guaranteed guesses.

Title: Re: Guessing Cards Suit
Post by asterix on Apr 10th, 2004, 9:11am
Sorry, I tried it out, and in the worst case scenario, it seems my method would still only give you 19 correct.

Title: Re: Guessing Cards Suit
Post by Leonid Broukhis on Apr 24th, 2004, 11:43am

on 04/03/04 at 16:47:44, Icarus wrote:
There are 236 [approx] 6.87 x 1010 different messages that the assistant can send by arrangement of card backs.


It is at most 235, because the last one is always useless.
Starting from there, when the two cards are left of the same suit,
no information is needed, and if they are of different suits, 1 bit is enough, so the last two cards are a given.
When there are 3 cards left, unless they are of 3 different suits, all 3 can be guessed correctly, and if they are, the expected number is 2 2/3, etc.
This does not give us the guaranteed number, though.

Title: Re: Guessing Cards Suit
Post by Icarus on Apr 24th, 2004, 2:10pm

on 04/24/04 at 11:43:36, Leonid Broukhis wrote:
It is at most 235, because the last one is always useless.


No, it is useful. The magician sees the back of this card - and gets the information from it, before he makes his final prediction.

The first card, however, may not give any information, unless only the magician and the assistant are allowed to touch the cards, or some other means is in place to assure that the magician will see the deck as a whole in a particular orientation. If the assistant is in some other room, and an uninterested third party carries the deck, he may end up reversing the deck, so the magician has no way of knowing what orientation the card ought to be in for a "yes" bit vs. a "no" bit. If this is the case, the magician and assistant will have to sacrifice one bit of information just to inform the magician of how the other cards should be oriented.

Title: Re: Guessing Cards Suit
Post by rmsgrey on Apr 24th, 2004, 9:21pm
I also believe that the last card's orientation is irrelevant - having seen all but one card's face, it would be a poor magician who couldn't tell you what that last card was even without the signal...

Title: Re: Guessing Cards Suit
Post by Leonid Broukhis on Apr 24th, 2004, 11:47pm

on 04/24/04 at 14:10:02, Icarus wrote:
No, it is useful. The magician sees the back of this card - and gets the information from it, before he makes his final prediction.

And what exactly he does not know already? The running counts per suit are 9, 9, 9, and 8.

Quote:
The first card, however, may not give any information, unless only the magician and the assistant are allowed to touch the cards, or some other means is in place to assure that the magician will see the deck as a whole in a particular orientation. If the assistant is in some other room, and an uninterested third party carries the deck, he may end up reversing the deck, so the magician has no way of knowing what orientation the card ought to be in for a "yes" bit vs. a "no" bit. If this is the case, the magician and assistant will have to sacrifice one bit of information just to inform the magician of how the other cards should be oriented.


The conditions say nothing about any room or a third party. We can safely assume that the orientation is kept. Why twist the conditions in an unfavorable way?

Let me propose something. As we're trying to find a guaranteed number, let's pretend the assistant has to prepare a deck that happens to be partially ordered: 4 A's in any suit order, 4 K's, 4 Q's, .... so the algorithm would not be able to use any count disparity.

Title: Re: Guessing Cards Suit
Post by Barukh on Apr 25th, 2004, 6:42am

on 04/24/04 at 23:47:28, Leonid Broukhis wrote:
Let me propose something. As we're trying to find a guaranteed number, let's pretend the assistant has to prepare a deck that happens to be partially ordered: 4 A's in any suit order, 4 K's, 4 Q's, .... so the algorithm would not be able to use any count disparity.

I am not sure I understand your proposal. Note that the assistant is not allowed to change the order of the cards...

Title: Re: Guessing Cards Suit
Post by Leonid Broukhis on Apr 25th, 2004, 9:03am

on 04/25/04 at 06:42:51, Barukh wrote:
I am not sure I understand your proposal. Note that the assistant is not allowed to change the order of the cards...

Therefore the algorithm should work for all arrangements, including the one I've mentioned, in which the number of arrangements of the suffix of the sequence decreases the slowest.
In any case, 235 is greater than 20!/5!4 and less than 21!/5!36!, that is, the magician drops the first 16 cards, doing random guesses but collecting their orientation information, then correctly predicts the last 20 (let's say he has an arithmetic decompressor in his head). As the algorithm must guarantee the number of correctly guessed suits, it must not depend on the actual card sequence, and as they cannot be rearranged, they cannot convey any additional information.

Title: Re: Guessing Cards Suit
Post by Barukh on Apr 25th, 2004, 9:24am
I see...


on 04/25/04 at 09:03:44, Leonid Broukhis wrote:
...that is, the magician drops the first 16 cards, doing random guesses but collecting their orientation information, then correctly predicts the last 20 (let's say he has an arithmetic decompressor in his head).

Are you saying that 20 is the maximum he can correctly guess?

Title: Re: Guessing Cards Suit
Post by Nigel_Parsons on Apr 25th, 2004, 5:56pm
The question, as phrased, is complex & misleading. It asks for the number of 'Guaranteed guesses'. If they are guaranteed then they are not guesses (which suggests a lack of knowledge) but predictions.

It is clear that the suit of the final card is guaranteed.
The suit of the penultimate card can also be guaranteed (if two of the same suit are left), or, if two different suits are left, the orientation of the penultimate card shows whether that card is first or second (alphabetically) of the two remaining (i.e. Clubs, Diamonds, Hearts, Spades)
For the forgoing cards, the orientation should merely show 1 of 2 possibilities (e.g. black/red) giving a 50/50 chance of guessing (these are not guaranteed guesses.)

When down to three cards, there are 3 possibilities: 3 of a suit (the magician will get all three), two of one suit (the orientation of the first card will tell if it is the odd one or not, again allowing the magician to get all three) this will leave either two the same (guaranteed) or one of each (orientation shows alphabetical order), or 3 suits. The orientation of the first card will show if it is the single card of one colour giving certaintity if it is or 50/50 otherwise.

The above makes it clear that the orientation can help to provide a better than 50/50 chance for each of the last three cards.
So in the earlier stages the single one bit inference can either be set as "1= black, 2=Red", or 1=choose most likely(i.e the suit with most remaining),  2=choose second most likely.
If there are two equally likely suits, the meaning of the signal changes. 1= choose first in alphabet(of two) 2= choose second. This means both magician and assistant need to keep close count, but it will improve the odds.

Title: Re: Guessing Cards Suit
Post by Icarus on Apr 25th, 2004, 7:59pm

on 04/24/04 at 23:47:28, Leonid Broukhis wrote:
And what exactly he does not know already? The running counts per suit are 9, 9, 9, and 8.


Maybe the assistant could use it tell the magician whether or not his fly is open! ;)

Okay - my thinking was more than a little fuzzy on that one!

Title: Re: Guessing Cards Suit
Post by Leonid Broukhis on Apr 25th, 2004, 11:30pm

on 04/25/04 at 09:24:37, Barukh wrote:
I see...

Are you saying that 20 is the maximum he can correctly guess?


Of course not. He can correctly guess all 36, but I do not see how more than 20 predictions can be guaranteed. Out of the remaining 16, the expected number of correct guesses is around 4 (slightly higher because of the count disparity), but it does not mean that 24 correct guesses are guaranteed.

What is more interesting is how to get those 20 guaranteed predictions using a simple algorithm.

Title: Re: Guessing Cards Suit
Post by Barukh on Apr 26th, 2004, 1:19am
As there seems to be a confusion in the formulation (I would blame my broken English), I changed it, removing any appearance of word “guess” and using “prediction” instead.


on 04/25/04 at 23:30:45, Leonid Broukhis wrote:
I do not see how more than 20 predictions can be guaranteed…

What is more interesting is how to get those 20 guaranteed predictions using a simple algorithm.

There is a fairly simple strategy that guarantees 23 correct predictions (I wish it was mine). Here’s the hint: [hide]Out of the first 18 cards, there are at least 5 cards of the same suit[/hide].

Title: Re: Guessing Cards Suit
Post by Leonid Broukhis on Apr 26th, 2004, 12:02pm

on 04/26/04 at 01:19:29, Barukh wrote:
There is a fairly simple strategy that guarantees 23 correct predictions (I wish it was mine). Here’s the hint: [hide]Out of the first 18 cards, there are at least 5 cards of the same suit[/hide].

Sweet! Isn't it ironic how I would prevent others from making unfavorable assumptions while falling into the same trap myself?  :-[ Nobody says the magician has to predict correctly which particular cards' suit he is going to predict correctly.
Here is a correction to the hint: [hide]Out of 18 cards, either at least 2 suits have no less than 5 cards, or a suit has at least 6 cards.[/hide]
You're saying there is a way to pull at least another one?

Title: Re: Guessing Cards Suit
Post by Barukh on Apr 27th, 2004, 12:11am

on 04/26/04 at 12:02:56, Leonid Broukhis wrote:
Isn't it ironic how I would prevent others from making unfavorable assumptions while falling into the same trap myself?  :-[ Nobody says the magician has to predict correctly which particular cards' suit he is going to predict correctly.

Excellent point :D! But somehow, I didn't think about this at all.


Quote:
You're saying there is a way to pull at least another one?

Yes. I don't know the strategy though.

Title: Re: Guessing Cards Suit
Post by Leonid Broukhis on Apr 27th, 2004, 12:26pm
I've spoiled myself some fun by clicking on a link in some search results (in Russian) and by scrolling a little too much, but I've learned that 25 are possible, but the algorithm is much more complex than the one for 24, which is quite ingenious by itself. A hint: [hide]out of every three cards, at least two have the same .....[/hide]

Title: Re: Guessing Cards Suit
Post by SWF on Apr 27th, 2004, 5:14pm
Using Leonid's clue: [hide]
Two out of every three are the same color (red or black). Start off guessing every card is black and use the back of the card to identify whether it is spades or clubs. As soon as you get one wrong, start guessing the same color for the next three cards. The predominant color in that set of three is identified by the orientation of the last card that was wrong. As others have described the last two in the deck will always be correct (switch strategy at that point).

That should give at least 25 right most of the time, except possibly when you get the first card wrong. In that case, the orientation of the wrong card in the 2nd to last group of three gives one bit, and the back of the 3rd to last card gives a bit: two bits can identify what suit the 3rd to last card, so you correctly guess the final 3 cards[/hide].

Title: Re: Guessing Cards Suit
Post by Leonid Broukhis on Apr 27th, 2004, 5:53pm

on 04/27/04 at 17:14:39, SWF wrote:
That should give at least 25 right most of the time, except possibly when you get the first card wrong. In that case, the orientation of the wrong card in the 2nd to last group of three gives one bit, and the back of the 3rd to last card gives a bit: two bits can identify what suit the 3rd to last card, so you correctly guess the final 3 cards[/hide].


In that case, your first group of 3 cards starts at the 2nd card, and the last group only has 2 cards, so you lose a bit of information and still get only 24.

Title: Re: Guessing Cards Suit
Post by SWF on Apr 27th, 2004, 8:10pm
I see.  For some reason, I was assuming the 3rd to last card was the minority suit in the final group of three, and ignored that it could be 4th or 5th from the end.

Title: Re: Guessing Cards Suit
Post by Leonid Broukhis on Apr 30th, 2004, 1:18pm
I have an idea that might lead to a solution for 25 cards, but I could not figure out the implementation. In the solution for 24 cards, the assistant must lie in his prediction for one out of the first 16 cards that could be predicted correctly (that is, are of the current dominant suit). This way one prediction is lost, but 4 bits are gained. theoretically allowing to recoup the loss and guess one more card.

Title: Re: Guessing Cards Suit
Post by Leonid Broukhis on Apr 30th, 2004, 7:31pm
Here is another idea. Given 2 (input) bits predicting a suit for 2 cards,
we predict the suit of at least one card, take 2 (output) bits from the backs of the two cards, and either gain a bit (which card's suit was predicted), or have an extra correct prediction. The oportunities for lies also exist: a lie can encode an extra bit in the color of the mispredicted suit.

Unfortunately, all my attempts at mixing and matching the schemes and lies result in no more than 24 guaranteed guesses and wasted bits here and there.

Title: Re: Guessing Cards Suit
Post by Leonid Broukhis on Apr 30th, 2004, 7:58pm
Here is how to predict at least 5 out of the last 6 cards given one input bit i:

(suits of cards are referred to as A to F, orientations - as a to f)

(i,a) predicts A and/or B.

If A != B, then (predicted(B), c) predicts C

(b, d) predicts D

e predicts E
F is known

Title: Re: Guessing Cards Suit
Post by grimbal on May 1st, 2004, 10:15am
Thanks, Leonid!  I know now how to guarantee 24 predictions.

Shortly: [hide]
provided one bit of information from previous cards, you can guess 2 cards in a group of 3 and provide one bit of information out.[/hide]

Title: Re: Guessing Cards Suit
Post by rmsgrey on May 1st, 2004, 2:53pm
I can find a naive implementation which guarantees (given an input bit to a group of 3) either 2 right and an output bit, or all 3 right and no output - in the case where the first two cards have the same suit - in which case you can't tell which of the first two is being accurately described, so can't create a bit that way. Of course, if you wished, you could choose to sacrifice the third card in order to pass two bits (second and third card orientations) but I can't believe that's optimal...

Oh, and the problem statement still bugs me - I keep reading it as asking for maximizing the number of predictions where the magician knows before turning the card which suit it actually is - while using current methods, a number of correct predictions are uncertain in advance. The minimal rewording to remove this niggle would be to move "guaranteed" to before number. The one I'd prefer would be "maximize the number of correct predictions in the worst case"

Title: Re: Guessing Cards Suit
Post by grimbal on May 1st, 2004, 5:00pm
You are right.  I assumed that the magician is told after his prediction if it was true or not.  This gives him back one bit of information.  And for number of predictions, 24 would be the guaranteed minimum of correct predictions.

Title: Re: Guessing Cards Suit
Post by fieldazed on Dec 2nd, 2012, 6:38am
This is a very cool puzzle.  Have been working on a similar problem on a different site and have a solution for 26 correctly predicted out of 36 if anyone has any interest in reviving this topic.

Title: Re: Guessing Cards Suit
Post by fieldazed on Dec 4th, 2012, 11:36am
hidden below is a solution that guarantees at least 25 of 36 to get the juices flowing if anyone chooses.  think it's still quite challenging to go from 25 to 26.  at least is was for me.  anyway, fwiw -

[hide]The orientation of the first and second cards gives the suit to respond to both cards 2 and 3.  Will address the case if both are the same suit later but if cards 2 and 3 are different suits, the assistant could choose either to be correctly predicted giving the magician an extra "bit" of information.  The orientation of card 3 then acts as the first card and this process can be repeated.  So cards x(2,3) (4,5) (6,7) (8,9) (10,11) (12,13) could give 6 correct suit predictions and 7 extra bits (the seventh being the orientation of card 13).  Using five of these bits along with the orientation of the next five cards defines the suits of those next five cards.  Incorrectly indicating any one or none of those five can be achieved sixteen or 2^4 different ways - five extra bits spent and four bits returned with four of five suits predicted.  Repeating this two more times gives a total of 18 out of 28 suits correct with four extra bits yielding 22 of 32 correct.  The orientation of cards 33 and 34 defines the suit of card 34 and the last two suits can both be predicted as earlier described in this thread.

If one of pairs (2,3) (4,5) (6,7) (8,9) (10,11) (12,13) were the same suit, 7 of 13 would be predicted correctly with only six extra bits.  The orientation of card (14) gives a seventh extra bit.  Continuing from here as above yields 23 out of 33 suits predicted correctly and the last two cards predicted as before.  This method or similar can be extended to examples where two or more of the initial six pairs are the same suit.[/hide]

Title: Re: Guessing Cards Suit
Post by jollytall on Dec 30th, 2012, 2:18am
It will be a bit long, sorry:

First comment:
In the convicts guessing hats problem (100 stood in a row, everybody can see all those in front of them and can loudly guess his hat's colour being B or W) the best solution is if every guess includes all the information that can be collected seen (in front of him) and heard (behind him). This would give a hint here that also the best strategy MIGHT need to use extra information of the future (the assistant can flip through all the cards in advance) and the success of past guessings.

Second comment:
A nice solution to give 3 out of 5 in any case is as follows:
Guess Black for the first one and decide C/S based on the direction. If indeed B, then we have one hit and need to guess right 2 from 4 (easy).
If the first is Red, then the direction does not refer to this card, but the next three, giving whether B or R are more (in the THREE ahead!). Knowing that, we can guess 2nd to 4th all for this colour, the direction giving the split between C/S or D/H. If all three are right then we have the 3/5. If one was wrong (2 are always right), then that can give an extra bit, what we use for the 5th card, i.e. still has 3 out of 5.
This gives us 21/35, and the last one is always given, so it gives 22.
This is far from ideal, but again shows that a logic MIGHT use information running ahead.

Third comment:
All the posts so-far use only the Suit of the cards. I am not sure how to use, but there is much more information available. All the turned up cards has also a value. Using the first x card, there are surely patterns that can be idetified. Then one bit of information can say, whether to use it or not, or few bits can be used to identify a logic, how to use this pattern and it can give a lot of vaulable information for the remaining cards. This almost surely improves significantly the expected value of the right guesses, but I do not see, if at all, it can also improve the worst case value. Nonetheless, we should not exclude this option either.

Having said all these, I have a solution that uses much less information, but still gives a solution to guess right at least [hide]27[/hide].

See next post for the details.

Title: Re: Guessing Cards Suit
Post by jollytall on Dec 30th, 2012, 2:18am
The basics of the logic:
Every time the Magician is left with n cards, he knows exactly the distribution of C+D+H+S=n. He also might or might not have a Carry Over Bit from the previous step(s).
Here I do one restriction already. I do not allow to use more than 1 COB. There might be better strategies, where e.g. the deck is split into blocks and every block leaves a COB, while at the end we use all those COBs collected. In my modell I do not allow that.

Based on the information the Magician has, he can have three basic strategies:

Strategy A
Say a given Suit, regardless whether he has COB or not and what way the card stands. Theoretically this strategy would even allow to carry over 2 bits, one brought from earlier and one from this card. Still, as said above, in this case I only carry over one bit.
He is either right or wrong, but surely carries over 1 COB.

Strategy B
Try to use only 1 bit of information, either because there is no COB brough from earlier, or simply because he does not want to use it, does not need it.
Here the Assistant has almost unlimited potential strategies. As shown above, the Assistant might decide what the meaning of that bit that is going to be used, based on millions of options, using all the information he has about the deck. Nonetheless, I make again a great simplification. He can only assign 1 or 0 based on the suit of the CURRENT (next to be guessed) card.It still gives him 16 potential strategies (what to show for every C,D,H,S). My modell has to choose the best out of these 16 strategies (and of course both the Assistant and the Magician must remember for every C+D+H+S left - but this is why they are magicians).
But the goodness of the Assistant assignment also depends on what the Magician says when he is using this one bit of information. Again, he has 16 options (4 suits to choose from if he got a 1, times, 4 suits to choose from if he got a 0).
Depending on the Assistant strategy and the Magician strategy there are still two potential outcomes. He guessed right or he did not (if not then there are 3 potential wrong outcomes).
If he guessed right then I consider the 1 bit he had used, is used up completely. He might have had a second bit not used, so he can have a COB still for the next step.
If he guessed wrong then this information was not for this card (see the second comment in my previous post, what happens with the 1st from the 5 if it is Red), so it can be carried over. Theoretically again, he could carry over THIS bit and also the SECOND bit not used (if he had one). As said twice above, I do not allow this, he carries on maximum ONE bit. By the way it seem logic also to do this. If he had 2 bits available then he should not make a mistake. If one bit is not enough to make sure, use the second too. So, it is not a real restriction I think, but again, theoretically there might be a better solution.

Strategy C
He uses 2 bits of information. This Strategy is only available if he has got a COB from earlier and also uses the bit from the current card. Here I assume he uses completely BOTH bits and therefore guesses this card surely, but looses the chance to have a COB carried forward.
This again seems to be logic, but in reality it is a restriction again. There could have been a mixed strategy, what I exclude. E.g. there are three kind of suits left in the deck only, C,D,H. If the first bit is 0 then it is Black and therefore C and the second bit does not need to be used, can be carried over. If it is 1, then it is Red, so we need the second bit as well to decide D/H. In my model, I do not allow this: if he decides to use 2 bits, then both are gone in this step, no COB.
It is theoretically a restriction, but I think in reality not really. Either it can occur as above if there are three suits left only, what is already a simplified case, i.e. not likely that the loss of this bit will change the worst case scenario. Alternatively, a mixed strategy could also be used, e.g. if there are still 4 suits but very uneven distribution (CDHs). In this case it might be a good logic to use the first bit for B/R. If B then do not use the second bit, but guess C (C>>s) and let a small chance for guessing wrong, in which case the remaining distribution is even more unequal, thus easier.

With smartly using a combination of only these three strategies I can get to my result.

See next post.

Title: Re: Guessing Cards Suit
Post by jollytall on Dec 30th, 2012, 2:19am
I do the whole thing rolling backwards:

n=1

The 36th card is given in any case (what is left). With a naming convention CDHSb (where C is the number of Clubs left, etc. and "b" is either TRUE or FALSE showing whether there is a COB available), we can say that 1000T, 1000F, 0100T, etc. are all giving 1 guaranteed cards using StrategyA above (say the Suit regardless of any information).
In the future description the symmetrical permutations are leave out (1000T=0010T).

***

n=2

If the 35-36th are the same then again (2000T or 2000F), they are given using StrategyA. If they are different (1100T or 1100F), then the 35th can indicate which of the 2 is it (Strategy B, using only one bit, no need to use the COB).

***

n=3

If the 34-36th are the same, then solved (3000T or 3000F, Strategy A).
If they are 2100T or 2100F, then the 34th should indicate whether it is the rare or not (Strategy B, 1 guaranteed guess and leads to 1100T/1100F or 2000T/2000F). Anyway, they are again solved.
The only problem is if the last 3 are all different (1110). 1110F cannot be solved without carried over bit (use Strategy A, guess something and will be 1100T), giving in total only 2 good guesses. With a COB 1110T it can be solved with Strategy C giving one good guess and leading to 1100F.

***

n=4

The 33-36th has even more options:
4000b leads to 3000b using Strategy A.
3100b. The 33rd should tell whether rare or not, using Strategy B, leading to 3000b or 2100b.
2200b. The 33rd should tell which is it (Strategy B, leading to 2100b).

It really gets interesting here.

2110F. If there is no COB, we have 3 potential suits in position 33 and only one bit of information. Surely cannot be done with 100% accuracy, i.e. cannot guess all the 4 right. To have 3 right is pretty easy.

2110T. Using a mixed strategy all the 4 can be guessed right.
Let's use the COB to tell whether it was a rare (D or H) or it was one of the two C-s.
If C then we say so (right guess) and use the card information as a COB for the last ones (1110T - 3 good guesses guaranteed), i.e. altogether 4 good guesses done.
If not C then we use the second available bit too, and guess D or H right, leaving us with 2100F, again 3 more good guesses guaranteed.
So, with a mixed strategy 2110T=4. Nonetheless, as I said in my posts above I do not allow mixed strategy, and thereore my 2110T=3 only.

1111F. If we have no carry over bit, then the 33rd is a guess (Strategy A) but gives a COB, so the last three can be solved (1110T).
1111T. Even if we have a COB, then it can be good to fix the 33rd (Strategy C giving 1110F=2).
So both 1111F=3 and 1111T=3.

***

n>4
The number of options grows on, so I used a program to work out the best logic, using all the above information (no mixed strategy). This gives the [hide]27[/hide] maximum. The below table shows the most available for various n-s (always the worst combination. I have all the combination in details, if you are interested).
It would make sense, to build in the mixed strategy as well, to see if it can further increase the number.

[hide]
Best available for TotalNumber=1 is 1
Best available for TotalNumber=2 is 2
Best available for TotalNumber=3 is 2
Best available for TotalNumber=4 is 3
Best available for TotalNumber=5 is 4
Best available for TotalNumber=6 is 4
Best available for TotalNumber=7 is 5
Best available for TotalNumber=8 is 6
Best available for TotalNumber=9 is 6
Best available for TotalNumber=10 is 7
Best available for TotalNumber=11 is 8
Best available for TotalNumber=12 is 8
Best available for TotalNumber=13 is 9
Best available for TotalNumber=14 is 10
Best available for TotalNumber=15 is 10
Best available for TotalNumber=16 is 11
Best available for TotalNumber=17 is 12
Best available for TotalNumber=18 is 12
Best available for TotalNumber=19 is 13
Best available for TotalNumber=20 is 14
Best available for TotalNumber=21 is 14
Best available for TotalNumber=22 is 15
Best available for TotalNumber=23 is 16
Best available for TotalNumber=24 is 16
Best available for TotalNumber=25 is 17
Best available for TotalNumber=26 is 18
Best available for TotalNumber=27 is 18
Best available for TotalNumber=28 is 19
Best available for TotalNumber=29 is 20
Best available for TotalNumber=30 is 21
Best available for TotalNumber=31 is 22
Best available for TotalNumber=32 is 23
Best available for TotalNumber=33 is 24
Best available for TotalNumber=34 is 25
Best available for TotalNumber=35 is 26
Best available for TotalNumber=36 is 27
[/hide]

Title: Re: Guessing Cards Suit
Post by fieldazed on Jan 1st, 2013, 9:32am
hello there jollytall - great to now know of your interest in this puzzle.  your solution is quite good.  think tho there may be a glitch in your program and your method correctly guarantees a minimum of 24 out of 36 cards.

Title: Re: Guessing Cards Suit
Post by jollytall on Jan 3rd, 2013, 7:58am
Can easily be. It would be good if someone else (you, maybe) could reproduce it and see which is the first number where our results differ.
I will also make a double-check.

Title: Re: Guessing Cards Suit
Post by fieldazed on Jan 3rd, 2013, 8:48am
Did not run a program.  Made my previous statement based on studying your method as well as seeing the pattern in your results break at TotalNumber = 30 without any logic that i can discern as to why.

Title: Re: Guessing Cards Suit
Post by jollytall on Jan 3rd, 2013, 9:00am
This is worse than that :-(
There was a typo in the program. Now the best is only 19...
Need to implement the mixed strategy in it. That might improve back again closer to your 26.

Title: Re: Guessing Cards Suit
Post by fieldazed on Jan 7th, 2013, 11:33am
here's a hint as to a strategy that at least i needed to guarantee a minimum of 26 out of 36 correctly predicted suits:

[hide]if you can find two different yet distinguishable paths, depending on which is indicated by the assistant gives another bit of info.[/hide]

Title: Re: Guessing Cards Suit
Post by jollytall on Jan 10th, 2013, 11:52am
I tried the simple mixed strategy, i.e. if we have a COB available then either we use it or we don't depending on how many different suits are still there.
If 4 then we use it always and guess right.
If 3 then we use one bit for the most likely one (or one of them if there are 2 or 3 equally likely ones) and 2 bits for the other 2 less frequent.
If 2 or 1 different suits are left, then we do not use this method at all, one bit is enough to guess right the card and can carry on the COB brought.

Unfortunately it did not change my 19.

Conclusion: That is surely not good if you use your available bit for solving the upcoming cards. As said above by Leo, it is sometimes a better strategy if one is intentionally missed in order to convey messages with it.



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board