# A Game of Dice and Logic II

Part 1, same game rules, slightly different cards

This question is broken - my program for proper analysis failed in some catastrophic way, and the question does not work as planned.

The intended solution is below in spoilers.

A friend and I are playing a cooperative game. He has two D7 dice and 5 cards in front of him. They read;

HIDDEN IS < SHOWN
HIDDEN IS EXACTLY ONE AWAY FROM SHOWN
HIDDEN IS ONE OF 1/4/7
HIDDEN PLUS SHOWN IS A MULTIPLE OF 4
THIS DIE CANNOT BE PLACED ANYWHERE ELSE


The game works as thus; my friend rolls two dice and looks at both of them. He then places one of those two dice on one card (thereby revealing it to me). That die is the SHOWN die, and the one he did not place is the HIDDEN die. He may only play a die on a card if that placement would make a true statement.

He paused as he looks at his dice.

"Well, either of my dice could only go on one card."

He paused again, deep in thought. He revealed a die and placed it on a card.

"That still isn't enough for me to know what your other die is," I said, exasperated.

"Yeah, but if I had placed the other die, you would have said the same thing!" he exclaimed.

"Well, why didn't you?" I questioned.

"Because at least this way, you had a better chance of guessing my hidden die."

What die did he place, where did he place it, and what is the hidden die?

Very mild aid (as said in comments below);

The order in which the statements were said aloud are NOT the same order they logically evaluate, and it makes a difference.

There seems to he confusion, so here is the restated problem, proper logic chronologicality intact.

My friend has two dice and tells me that his first die could only go on one card, and his second die can only go on one card. These cards may but need not be the same card.

He then thinks for a moment, and realizes that no matter which die he plays, I still wont know which die he has hidden, so decides to place the die that grants me the highest odds of guessing correctly, given that I only saw what die he placed on which card, and he hadn't given me any additional clues at that point (except the one-card clue)

If there is still confusion tomorrow, I will post my analysis then as a top-level with the full patterned reasoning.

Intented, but faulty solution below;

First of all, why did this question not work? For some reason, the language I was using the the analysis did not see 5+7 as a divisble-by-four pair, so 2-7 with 2 being played was the "intended" solution - as I was on the bus today, looking over the answers, I couldn't see the fault in logic. Then I checked my program, and it *also8 seemed correct.

For some weird reason, when I ran 5+7%4 by itself, it did not pop out zero, which is particularly odd.

Apologies for the error, I'll leave this up simply as a testament to this failure of a question.

• I would love to know how you make a fair d7. (I guess you make a skew-pyramid-y d14 and label the faces in pairs. But suppose you actually want 7 faces?) Mar 12 '20 at 17:55
• Does "either of my dice could only go on one card" mean "for each of my dice, there is exactly one card I could put it on"? Mar 12 '20 at 17:56
• Yes, they needn't (but may) go on the same card. Mar 12 '20 at 18:25
• @Mathgeek just going for my newb badges (critic) and need something to downvote.. this puzzle is ripe for one. Nice to see you reposed this one with greater clarity. Mar 13 '20 at 15:27
• Lmfao, this isn't technically downvote-worthy, but I don't exactly blame you :) Mar 13 '20 at 16:26

I can only uniquely determine the pair of dice that the friend rolled, but I am unable to determine conclusively which of those two dice he showed to the narrator, because the odds of guessing the other seem to me THE SAME in either case.

First, I believe that the rolled dice are:

2 and 7

My reasoning is as follows:

from all the possible pairs that may be rolled, because of the single-card rule, we can eliminate all of the following for the following reasons:
-pairs that are one apart, as the Greater (G) die can be placed on both cards 1 and 2.
-non-identical pairs that sum to a multiple of 4, as the G can be placed on both cards 1 and 4
-non-identical pairs in which both dice are among 1/4/7, as the G die can be placed on both cards 1 and 3
-non-identical pairs where the Lesser (L) die is 1, as the G die can be placed on both cards 1 and 3.
-non-identical pairs where the L die is 4, as the G die can be placed on both cards 1 and 3.
-the combination 4,4, as both dice can go on cards 3 and 4.

That leaves the following combinations:
1,1 2,2 2,4 2,5 2,7 3,3 3,6 3,7 5,5 6,6 7,7
Both players know this information, as the friend tells the narrator that each die can only go on one card.

Now, from the statement that the friend chooses to place the die that gives the highest odds of guessing, we can assume that the friend did not role an identical pair combo, which means the friend only rolled 2,4 2,5 2,7 3,6 or 3,7.
Specifically, these dice in these combos could be placed on the following cards:
-2,4 (L on card 3, G on card 1)
-2,5 (L on card 5, G on card 1)
-2,7 (L on card 3, G on card 1)
-3,6 (L on card 5, G on card 1)
-3,7 (L on card 3, G on card 1)

For four of these five possibilities, it is possible to show one die and have the other be conclusively determined, because there is only one outcome which would not violate the single-card rule:
2,4: if the 4 is shown on card 1, the narrator can conclude the pair must be 2,4
2,5: if the 5 is shown on card 1, the narrator can conclude the pair must be 2,5
3,6: if the 6 is shown on card 1, the narrator can conclude the pair must be 3,6
3,7: if the 3 is shown on card 3, the narrator can conclude the pair must be 3,7

From this, we can conclude that the friend must have rolled 2,7.
At this point, it seems to me that no matter which of these dice is shown, the narrator will have exactly two valid guesses:
If the 2 is shown on card 3, the narrator can determine that either 2,4 or 2,7 was rolled.
If the 7 is shown on card 1, the narrator can determine that either 2,7 or 3,7 was rolled.
To me, it seems that the odds of the narrator guessing correctly are the same in either case.

• That is exactly the conclusion I came to as well. Mar 13 '20 at 8:12
• Final apologies, the intended solution was 2.7, with the 2 on 14, because there were two 2.? options and three 7.? options, but it turns out there was an issue somewhere in my language that made 12%4 not equal zero. Thank you for playing anyways, sorry for any frustration. Mar 13 '20 at 12:46

Having twice arrived at the conclusion that the situation described in the puzzle is impossible, I've done it again extremely carefully and systematically. I reach the same conclusion, and at this point while I fully admit that I may be getting it wrong I think it's more likely that either I am misunderstanding the terms of the puzzle, or there's an actual error in it.

I'm not spoilerizing this because it would make it extra-tedious to read, and because either the puzzle is wrong, or the reasoning is wrong, or the reasoning is starting from a misunderstanding of the puzzle, and in any of these cases there isn't really anything to spoil.

So, here goes.

First of all, let's be clear about what's said and what's meant at each stage. I take it that

• when Mathgeek says "That still isn't enough ...", it means even with the knowledge that each die has just one card it can go on;
• when the friend says "if I had placed the other die, you would have said the same thing" it means if the friend had made the same statement about each die permitting just one card and then placed the other die instead;
• when the friend says "this way, you had a better chance" it means that Mathgeek is choosing from a smaller number of possibilities (but still > 1)
• when the friend has said "either could only go on one" and then placed the die they actually placed, compared with what would have happened
• if they had said the same thing and then placed the other die;
• in neither of those scenarios are we supposed to assume that Mathgeek knows either "if I had placed the other die, you would have said the same thing" or "this way, you had a better chance".

If any of that is wrong, then I respectfully submit that the problem is unclearly (or even misleadingly) posed, and request clarification.

OK. So, at the outset there are 28 possibilities: 11 12 13 14 15 16 17; 22 23 24 25 26 27; 33 34 35 36 37; 44 45 46 47; 55 56 57; 66 67; 77. Which are ruled out by "either of my dice could only go on one card"? All of those where the dice are one apart (that would allow the larger die to go on either of the first two cards) -- that's 12 23 34 45 56 67. All of those where the dice are unequal and the smaller one is 1,4,7 (that would allow the larger die to go on the first or third card) -- that's 13 14 15 16 17 46 47. All of those where the dice are unequal and add up to a multiple of 4 (that would allow the larger die to go on the first or fourth card) -- that's 26 35 57. That's all the possibilities using the first card; we'e also ruled out the second. Third and fourth rules out 44. And that's all the ways in which either die could go on two cards. So we know, and Mathgeek knows in both the scenarios envisaged above, that we have one of these die-pairs: 11 22 33 55 66 77 24 25 27 36 37.

Now, we know (but Mathgeek doesn't in either of those scenarios, and doesn't in the original conversation until right at the end) that the dice are unequal, because "this way you had a better chance" -- if the dice were the same then those two scenarios would be exactly equivalent and the chance would be the same either way. So the actual situation must be one of: 24 25 27 36 37. It can't be 24, 25, or 36, because in that case placing the larger die on HIDDEN IS < SHOWN would (given what we established in the previous paragraph that Mathgeek knows at the relevant time in each scenario) enable Mathgeek first to eliminate all cases of doubles, as we just did (but using the "<" on the card in place of our knowledge that "better chance" implies unequal dice), and then to deduce the identity of the smaller die. So the actual situation is 27 or 37.

Now, let's once again consider those two scenarios. In one of them, Mathgeek's friend places 7 on HIDDEN IS < SHOWN. Mathgeek goes through the reasoning we have described above and concludes that the situation must be one of {24, 25, 27, 36, 37}, uses the 7 to infer that it's 27 or 37, and protests appropriately that the friend hasn't provided enough information to know the other die: there are two possibilities.

The other scenario comes in two versions depending on whether the dice actually show 27 or 37. If it's 27, then Mathgeek's friend places 2 on HIDDEN IS ONE OF 1/4/7. Mathgeek can now take the list 11 22 33 55 66 77 24 25 27 36 37 and remove everything with no 2, leaving 22 24 25 27, and also everything where the other die isn't 1/4/7, leaving 24 and 27. Two possibilities, same as in the first scenario. This won't do because then "this way, you had a better chance" isn't true whichever scenario is actual.

In the other version of the second scenario, Mathgeek's friend places 3 on HIDDEN IS ONE OF 1/4/7. Mathgeek can now take the list 11 22 33 55 66 77 24 25 27 36 37 and remove everything with no 3, leaving 33 36 37, and also everything where the other die isn't 1/4/7, leaving ... only 37. This also won't do because in this scenario Mathgeek can infer the number on the hidden die.

So, either (1) I have misunderstood what the problem is actually saying, and politely request some clarification; or (2) I have made a logical error, in which case I would like to know where; or (3) the puzzle is in fact flawed.

Here's a bit of fairly dumb Python code making the above more concrete.

# a card is a function from (hidden,shown) to (True if OK, False if not)
def card1(h,s): return h<s
def card2(h,s): return abs(h-s)==1
def card3(h,s): return h in [1,4,7]
def card4(h,s): return (h+s)%4==0
def card5(h,s): return not (card1(h,s) or card2(h,s) or card3(h,s) or card4(h,s))

# Here are all our cards
cards = [card1, card2, card3, card4, card5]

# Each die has exactly one card it can go on?
def both1(a,b):
if sum(card(a,b) for card in cards) != 1: return False
if sum(card(b,a) for card in cards) != 1: return False
return True

# all possible rolls
pairs = [(i,j) for i in range(1,8) for j in range(1,8) if i <= j]

# all possibilities consistent with "first die can only go on one card"
hint1 = [(a,b) for (a,b) in pairs if both1(a,b)]

for (a,b) in hint1:
# hide a, show b
c = [card for card in cards if card(a,b)]
assert(len(c)==1)
c = c[0] # the card b is placed on
# what possibilities does Mathgeek see, having seen that die on that card?
poss = [(a1,b1) for (a1,b1) in hint1 if ((a1==b and c(b1,b)) or ((b1==b and c(a1,b))))]
nb = len(poss) # number of options
# hide b, show a
c = [card for card in cards if card(b,a)]
assert(len(c)==1)
c = c[0] # the card a is placed on
# what possibilities does Mathgeek see, having seen that die on that card?
poss = [(a1,b1) for (a1,b1) in hint1 if ((a1==a and c(b1,a)) or ((b1==a and c(a1,a))))]
na = len(poss) # number of options
print(f"Roll {a},{b}: showing {a} -> {na} choices, showing {b} -> {nb} choices")


and the output it produces:

Roll 1,1: showing 1 -> 1 choices, showing 1 -> 1 choices
Roll 2,2: showing 2 -> 1 choices, showing 2 -> 1 choices
Roll 2,4: showing 2 -> 2 choices, showing 4 -> 1 choices
Roll 2,5: showing 2 -> 1 choices, showing 5 -> 1 choices
Roll 2,7: showing 2 -> 2 choices, showing 7 -> 2 choices
Roll 3,3: showing 3 -> 2 choices, showing 3 -> 2 choices
Roll 3,6: showing 3 -> 2 choices, showing 6 -> 1 choices
Roll 3,7: showing 3 -> 1 choices, showing 7 -> 2 choices
Roll 5,5: showing 5 -> 1 choices, showing 5 -> 1 choices
Roll 6,6: showing 6 -> 1 choices, showing 6 -> 1 choices
Roll 7,7: showing 7 -> 1 choices, showing 7 -> 1 choices


where I apologize for not stopping it saying "1 choices" :-) but the point is that there's no case where the two options have different numbers of choices that are bigger than 1.

In case it's not clear, e.g., the third line says: if the actual dice are {2,4} and you reveal 2 and hide 4, then Mathgeek has two consistent options to choose from; if instead you reveal 4 and hide 2, then Mathgeek has only one consistent option.

• You made a very very tiny sequencing error here that ruins the resulting logic. Notably, the last sentence is your second spoiler block is FALSE. Mar 12 '20 at 18:28
• Oh, duh, you're right. Reconsidering appropriately. Mar 12 '20 at 18:37
• Hmm, it doesn't seem like it actually makes a difference. Writing up my next wrong answer now. Mar 12 '20 at 18:52
• There is a very minor difference that actually does matter, between what he says, and when he established certain logic. When did my friend say each clue? When was he thinking about each clue? Assume everything he says is off the cuff and his statements themselves weren't deliberately planned to give you certain information at certain times. Mar 12 '20 at 18:55
• Sorry, I didn't mean that it doesn't make a difference to the reasoning; I mean it doesn't make a difference to the outcome. I still get essentially the same undesirable conclusion, even though the path to it is a little different. Mar 12 '20 at 18:55

Starting over (I'm using the notation HS, as in 93 where 9 is hidden and 3 is shown):

If we operate on only one sentence at a time:

1A: "Well, either of my dice could only go on one card."

The conclusion here is that each die only satisfies one card. There are many rolls that fit this criteria: 11, 22, 24, 25, 27, 33, 36, 37, 42, 52, 55, 63, 66, 72, 73, and 77.

Then, you say: "That still isn't enough for me to know what your other die is,"

You have concluded that the shown value has more than one possible hidden value. Of the above rolls, that eliminates a shown 1 and a shown 4. We reduce the possible rolls to 22, 25, 27, 33, 36, 37, 42, 52, 55, 63, 66, 72, 73, and 77.

2: "Yeah, but if I had placed the other die, you would have said the same thing!"

You can conclude from this that the hidden die must also have multiple potential hidden values, had it been the shown die. Therefore, the hidden die cannot be 1 or 4, further reducing the set to 22, 25, 27, 33, 36, 37, 52, 55, 63, 66, 72, 73, and 77.