Tagged: by: John Fletcher Toggle Comment Threads | Keyboard Shortcuts

  • Unknown's avatar

    Jim Randell 6:42 am on 23 February 2025 Permalink | Reply
    Tags: by: John Fletcher   

    Teaser 3257: Powers of deduction 

    From The Sunday Times, 23rd February 2025 [link] [link]

    One evening, Sherlock Holmes challenges Watson and Mycroft to a game of Cluedo.

    He places one each of the six “person” cards, six “weapon” cards and nine “room” cards into the murder bag, shuffles the rest and deals them out equally.

    Mycroft sees his cards and says, “If I guessed what was in the murder bag now, my chance of being correct is one in an integer that is a power greater than two”.

    “I’m saying nothing”. Watson replies. “I’d only give something away”.

    “Commendably prudent”, Sherlock says, “but the same is true for you”.

    Watson studies his cards, then looks agitated. “How could you know that?”

    “Sherlock isn’t cheating”. Mycroft reassures him. “He didn’t even know how many person cards you’re holding”.

    How many room cards is Mycroft holding?

    [teaser3257]

     
    • Jim Randell's avatar

      Jim Randell 8:14 am on 23 February 2025 Permalink | Reply

      After the culprit is selected there are 5 person, 5 weapon and 8 room cards remaining, and these are distributed among the 3 players (so, 6 cards each).

      If a player is holding p person cards, w weapon cards, and r room cards, then the probability of making a correct accusation from the cards he is not holding is:

      P = (1/(6 − p)) × (1/(6 − w)) × (1/(9 − r))
      1/P = (6 − p) × (6 − w) × (9 − r)

      This Python program finds possible (p, w, r) hands that have a 1/(n^k) chance of giving a correct guess, where k > 2.

      from enigma import (decompose, irange, inf, powers, first, lt, printf)
      
      # there are only a few higher powers than squares to consider
      (M, pows) = (6 * 6 * 9, set())
      for k in irange(3, inf):
        ps = first(powers(2, inf, k), count=lt(M))
        if not ps: break
        pows.update(ps)
      
      # find hands of 6 cards, with a 1/power chance of a correct guess
      for (p, w, r) in decompose(6, 3, increasing=0, sep=0, min_v=0):
        if p > 5 or w > 5: continue
        N = (6 - p) * (6 - w) * (9 - r)
        if N not in pows: continue
        # output possible hands
        printf("p={p} w={w} r={r} -> N={N}")
      

      The only cards that give a required 1/power chance are:

      (p w r) = (3 3 0) = 1/81 (81 = 3^4)
      (p w r) = (1 1 4) = 1/125 (125 = 5^3)

      Mycroft declares he has one of these hands, and Sherlock declares Watson has one of these hands. It is not possible for there to be more than one (3 3 0) hand, but if there are a (3 3 0) and a (1 1 4) then the remaining hand is also a (1 1 4), and if there are two (1 1 4) hands then the remaining hand is a (3 3 0), and so Sherlock also has one of these hands.

      Hence the three hands are (1 1 4) (1 1 4) (3 3 0) (in some order). So when Mycroft declares he has one of these, Sherlock can see that he (Sherlock) also has one, and so Sherlock can declare that Watson must too have one of these hands.

      Which means Mycroft and Sherlock both know that each of them has one of these three hands, and if either of them has (3 3 0) they know the other two must both have (1 1 4).

      So Sherlock must be holding (1 1 4) (as Mycroft states that he does not know which of the possible hands Watson is holding), and the only way Mycroft can be certain that Sherlock has (1 1 4) is if he (Mycroft) is holding (3 3 0).

      And so: Mycroft = (3 3 0), Watson = (1 1 4), Sherlock = (1 1 4).

      Solution: Mycroft is holding no room cards.

      Like

      • Jim Randell's avatar

        Jim Randell 9:44 pm on 23 February 2025 Permalink | Reply

        I’ve not seen another solution to this puzzle yet, so here is a complete solution.

        The following Python program runs in 60ms. (Internal runtime is 476µs).

        from enigma import (
          namedtuple, decompose, irange, inf, powers, first, lt,
          subsets, filter_unique, unpack, intersect, seq2str, printf
        )
        
        # there are only a few higher powers than squares to consider
        (M, pows) = (6 * 6 * 9, set())
        for k in irange(3, inf):
          ps = first(powers(2, inf, k), count=lt(M))
          if not ps: break
          pows.update(ps)
        
        # find hands of 6 cards, with a 1/power chance of a correct guess
        Hand = namedtuple('Hand', 'p w r')
        hs = list()
        for (p, w, r) in decompose(6, 3, increasing=0, sep=0, min_v=0):
          if p > 5 or w > 5: continue
          N = (6 - p) * (6 - w) * (9 - r)
          if N not in pows: continue
          # output possible hands
          printf("[({p}, {w}, {r}) -> N={N}]")
          hs.append(Hand(p, w, r))
        
        # collect possible scenarios
        ss = list()
        # M and W each have one of these hands
        for (M, W) in subsets(hs, size=2, select='M'):
          # and S has the remaining cards
          S = Hand(5 - M.p - W.p, 5 - M.w - W.w, 8 - M.r - W.r)
          if S.p < 0 or S.w < 0 or S.r < 0: continue
          ss.append((M, W, S))
        
        # find situations where S _cannot_ determine W.p
        ss1 = filter_unique(ss, unpack(lambda M, W, S: S), unpack(lambda M, W, S: W.p)).non_unique
        
        # find situations where M _can_ fully determine S's hand
        ss2 = filter_unique(ss, unpack(lambda M, W, S: M), unpack(lambda M, W, S: S)).unique
        
        # look for common situations
        for (M, W, S) in intersect([ss1, ss2]):
          printf("M={M} W={W} S={S}", M=seq2str(M), W=seq2str(W), S=seq2str(S))
        

        Like

  • Unknown's avatar

    Jim Randell 7:55 am on 22 December 2024 Permalink | Reply
    Tags: by: John Fletcher   

    Teaser 3248: Miss Scarlet in the study 

    From The Sunday Times, 22nd December 2024 [link] [link]

    In Cluedo, one “room” card (from nine possible ones), one “person” card (from six) and one “weapon” card (from six) are placed in a murder bag. The remaining 18 cards are shared out (four or five per player). Players take turns to suggest the contents of the murder bag. If wrong, another player shows the suggester a card, eliminating one possibility. The first person to know the contents of the murder bag will immediately [reveal their solution and] claim victory.

    My brothers and I are playing, in the order Michael-John-Mark-Simon. After several completed rounds, we all know the murder was committed in the Study. Michael and I know the murderer was Miss Scarlet with one of four weapons. Mark and Simon know the weapon and have narrowed it down to four people. Being new to Cluedo, we don’t learn from others’ suggestions.

    From this point on, what are Michael’s chances of winning (as a fraction in its lowest terms)?

    To clarify the wording, the intention is that once a player has deduced the contents of the murder bag, they reveal their solution, and do not have to wait for their next turn.

    [teaser3248]

     
    • Jim Randell's avatar

      Jim Randell 8:12 am on 22 December 2024 Permalink | Reply

      Not learning from another players accusation means that a player may repeat an accusation that has previously been suggested (and shown to be false), but it does make working out the probabilities easier.

      Each of the players has narrowed down the scenario to one of four possibilities.

      Initially Mike has a 1/4 chance of choosing the right weapon (assuming he suggests one of his four possibilities).

      And a 3/4 chance of choosing the wrong weapon. The card shown to him must be the weapon he suggested, so he is reduced to 3 possibilities.

      And the other players proceed similarly.

      If none of them make a correct accusation, then in the next round each player is down to 3 possibilities.

      And in the following round (if any), each player is down to 2 possibilities.

      Then in the next round (if any), each player is down to 1 possibility, and so Mike (who goes first) will make a correct accusation.

      So we can calculate the probability of Mike winning each round:

      from enigma import (Rational, printf)
      
      Q = Rational()
      
      # each of <n> players has a <k> remaining scenarios
      (n, k, r, q) = (4, 4, 0, 1)
      while True:
        # p = probability of Mike winning this round
        p = Q(1, k)
        # accumulate probability of Mike winning some round
        r += q * p
        if p == 1: break
        k -= 1
        # q = probability of there being a next round
        q *= (1 - p)**n
      
      # output solution
      printf("r = {r}")
      

      Solution: Michael’s chances of winning are 25/64.

      Which is about 39%.

      Note: This applies if the players have to wait for their turn before making a certain accusation, which was my original interpretation of the puzzle. The intended interpretation is that players can declare a solution as soon they are certain of it, so Michael does not have to wait for his fourth turn.

      Like

      • Jim Randell's avatar

        Jim Randell 10:20 am on 23 December 2024 Permalink | Reply

        Originally I took the text “players take turns to suggest the contents of the murder bag” at face value, but the intention of the puzzle is that once a solution has been deduced with certainty it is declared without waiting for the next turn.

        In this case Michael can declare a solution after making his third round suggestion (where he has only two scenarios remaining). If his suggestion is wrong, he knows the remaining scenario is the correct one.

        We can adjust the code given above for this interpretation of the puzzle text:

          p = (Q(1, k) if k > 2 else 1)
        

        Solution: Michael’s chances of winning are 107/256.

        Which is about 42%.

        If he has to wait for his turn before making his certain accusation, his chances of winning are 25/64 (about 39%).

        Like

      • Frits's avatar

        Frits 12:06 pm on 23 December 2024 Permalink | Reply

        “The card shown to him must be the weapon he suggested”.

        “eliminating one possibility”. What is a possibility (one of the 9x6x6 possibilities?).

        I have never played Cluedo.

        I am considering not trying to solve recent Teasers anymore as I have felt for a couple of weeks that solving Teasers has 2 layers. The first layer being to interpret a puzzle text that seems to have been constructed to use as few words as possible instead of explaining the rules in a way that leaves no interpretation.

        Like

    • Pete Good's avatar

      Pete Good 7:21 pm on 22 December 2024 Permalink | Reply

      Jim, I followed the same thought process as you did but there is another interpretation which enables Michael to win in the third round.

      In this round, he has an equal chance of suggesting the right weapon or the wrong weapon. If he suggests the right one then nobody will show him its card so he knows that it is in the murder pack. If he suggest the wrong one then somebody will show him its card so he knows that the other weapon card is in the murder pack. Either way, he knows the contents of the murder bag and can immediately claim victory!

      I can’t see anything in the teaser wording that avoids this except that the fraction you obtain cannot be reduced to lower terms. I’d be interested to know what you think.

      Like

      • Jim Randell's avatar

        Jim Randell 11:11 pm on 22 December 2024 Permalink | Reply

        @Pete: I see what you mean.

        It depends on the exact mechanics of the gameplay. I was assuming that you can only make one accusation on your turn (“players take turns to suggest the contents of the murder bag”), and then your turn ends, so you have to wait until your next turn to make another accusation.

        But it does also say “the first person to know the contents of the murder bag will immediately claim victory”. Does that mean you can make an accusation out of turn? If so, then Mike can jump in with a correct accusation immediately after his third go without waiting for the fourth round. And his chance of winning will be a different fraction to the value I calculated.

        Looks like it is another puzzle where the wording could be clearer.


        Also, although it has been a while since I played Cluedo, I don’t think this is how play proceeds in the actual game. I recall there is an “interrogation” phase of moving around between rooms, “I suspect X in room Y with weapon Z”, and then (if possible) another player shows you a card that can disprove the suspicion (i.e. one of X, Y, Z). But later in the game you can make an accusation (during your turn), and if it is correct you win, but if it is wrong you are out of the game.

        But this doesn’t seem to be the same as the gameplay given in this puzzle.

        Like

        • Brian Gladman's avatar

          Brian Gladman 9:22 am on 23 December 2024 Permalink | Reply

          @Jim : John Owen (the teaser coordinator for the Sunday Times Teaser) has posted on this page to say that players can announce their win as soon as they know it without waiting f or their turn. This rather suggests that the third round win for Michael is the intended solution.

          Like

c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel
Design a site like this with WordPress.com
Get started