Tagged: by: Martin Wallis Toggle Comment Threads | Keyboard Shortcuts

  • Unknown's avatar

    Jim Randell 9:44 am on 15 March 2022 Permalink | Reply
    Tags: by: Martin Wallis   

    Brain-Teaser 661: The logical choice 

    From The Sunday Times, 10th March 1974 [link]

    Four members who hold office in the Logic Club approve of each other. They recently decided among themselves that next year each of the four would hold an office now held by one of the other three.

    Other members wanted to know whether this was legal and who was moving to which office. So we asked them to explain themselves under the Club’s Friday rules: these rules say that a member must either make two correct statements or two incorrect statements.

    We unfortunately forgot that we were questioning them on a Tuesday, when members may keep the Friday rules or break them, just as they please.

    The President said: “What we are doing is legal. The man who will be Chairman next year keeps the Friday rules on Tuesdays”.

    The Chairman said: “I am keeping the Friday rules. I shall not become Secretary next year”.

    The Secretary said: “The Treasurer will become President next year. I am not keeping the Friday rules”.

    The Treasurer said: “The man who will be Secretary next year does not keep the Friday rules on Tuesdays. What we are doing is legal”.

    Which of them will be next year’s Chairman? Which will be next year’s Treasurer? Is what they are doing legal?

    This puzzle is included in the book The Sunday Times Book of Brain-Teasers: Book 2 (1981). The puzzle text above is taken from the book.

    [teaser661]

     
    • Jim Randell's avatar

      Jim Randell 9:45 am on 15 March 2022 Permalink | Reply

      If the questioning takes place on a Tuesday, where “members may keep the Friday rules (give two truth values the same) or break them (give two different truth values), just as they please”, to my mind this means the answers to the questions on a Tuesday can be any truth values, and we are none the wiser.

      I suspect we are meant to suppose that on a Tuesday the members either consistently keep the Friday rules (each pair of statements has the same truth value), or consistently break them (each pair of statements has one truth and one falsehood), and their pre-determined behaviour is known to the other officers. Then we can make progress.

      This Python program looks at all possible scenarios to find those which correspond to the described situation. It runs in 47ms.

      Run: [ @replit ]

      from enigma import (subsets, product, multiset, map2str, printf)
      
      # f = keeping Friday rules; x, y = statements
      check = lambda f, x, y: f == (x == y)
      
      # we can populate the following variables:
      #  j: map(current job -> new job);  p: map(new job -> current job)
      #  f: map(current job -> keeping Friday rules
      #  legal: boolean
      
      # collect results (<next C>, <next T>, <legal>)
      qs = multiset()
      
      # consider possible assignments
      people = (P, C, S, T) = "PCST"
      js = subsets(people, size=4, select="D")
      fs = subsets((0, 1), size=4, select="M")
      for (jv, fv, legal) in product(js, fs, (0, 1)):
        j = dict(zip(people, jv))
        p = dict(zip(jv, people))
        f = dict(zip(people, fv))
      
        # P: "is legal; next C keeps Friday rules
        if not check(f[P], legal, f[p[C]]): continue
        
        # C: "C is keeping Friday rules; C will not become S"
        if not check(f[C], f[C], j[C] != S): continue
      
        # S: "T will become P; S is not keeping Friday rules"
        if not check(f[S], j[T] == P, not f[S]): continue
      
        # T: next S does not keep Friday rules; is legal"
        if not check(f[T], not f[p[S]], legal): continue
        
        printf("[legal={legal} j={j} f={f}]", j=map2str(j, arr="->"), f=map2str(f))
        qs.add((p[C], p[T], legal))
      
      # output results
      for ((q1, q2, q3), n) in qs.most_common():
        printf("(1) {q1} -> C; (2) {q2} -> T; (3) legal = {q3} [{n} solutions]", q3=bool(q3))
      

      Solution:(1) The Secretary plans to become the next Chairman; (2) The President plans to become the next Treasurer; (3) It is not legal.

      The plan for the assignment of jobs is:

      P → T
      C → P
      S → C
      T → S

      They can choose to follow Friday rules or not as they wish, except P must be the opposite of S.

      Like

  • Unknown's avatar

    Jim Randell 8:54 am on 1 February 2022 Permalink | Reply
    Tags: by: Martin Wallis   

    Brain-Teaser 652: Stumped! 

    From The Sunday Times, 6th January 1974 [link] [link]

    The scoreboard at our local cricket ground shows the total number of runs scored, the number of wickets fallen and the scores of the two batsmen in at the time.

    At the match last Sunday we declared at 500 for 8 wickets, when our first man in had just reached 100 runs (I was the other opener and was already out for 20). The seventh batsman had also scored a century, and there were no ‘extras’ at all in the match (i.e. all the runs were scored by the batsmen).

    Some time after my dismissal I noticed that the scoreboard showed eight similar digits (e.g. 999 for 9, both men in having scored 99 each) and later the board showed eight consecutive digits in ascending order, though with 0 following 9 (e.g. 678 for 9; batsmen with 01 and 23).

    What were the two scores I had seen?

    This puzzle is included in the book The Sunday Times Book of Brain-Teasers: Book 2 (1981). The puzzle text above is taken from the book.

    [teaser652]

     
    • Jim Randell's avatar

      Jim Randell 8:56 am on 1 February 2022 Permalink | Reply

      The innings was declared 500 for 8, so the options are:

      For scores greater between 20 and 500 we have:

      444 for 4, (44 and 44)
      333 for 3, (33 and 33)
      222 for 2, (22 and 22)
      111 for 1, (11 and 11)

      The last of these is not possible. If only one batsman has been dismissed, it is the setter for 20, so the total score would be 20 + 11 + 11 = 42, not 111.

      The second time the scoreboard could be showing (assuming the “in” scores can have a leading zero):

      456 for 7, (89 and 01)
      345 for 6, (78 and 90)
      234 for 5, (67 and 89)
      123 for 4, (56 and 78)

      Again the last of these is not possible, as the sum of the scores of the “in” batsmen is more than the total score.

      So we have the following potential observations:

      444 → 456
      333 → 345, 456
      222 → 234, 345, 456

      But some of these transitions are not possible.

      222 → 234 – only 12 more runs have been scored but the “in” scores have increased by 45 and 67 = 112
      222 → 345 – only 123 more runs have been scored, but the “in” scores have increased by 56 and 68 = 124
      333 → 345 – only 12 more runs have been scored, but the “in” scores have increased by 45 and 57 = 102
      444 → 456 – only 12 more runs have been scored, but one of the “in” scores has increased by 45

      Which leaves only the following transitions:

      333 → 456
      222 → 456

      Consider the “333 for 3” → “456 for 7” transition:

      Initially the score is “333 for 3”, and the “in” batsmen have both scored 33. So the 3 dismissed batsmen must have scored 267 between them. We know one of these is the setter, who scored 20. Which leaves 247 to be scored between the remaining 2 dismissed batsmen. We’ll distribute the runs as 123 and 124 run to batsmen 3 and 4:

      1: 33 (not out)
      2: 20 (out, setter)
      3: 123 (out)
      4: 124 (out)
      5: 33 (not out)

      By the time we get to “456 for 7”, the first batsman must have increased his score to 89, and the remaining “in” batsman has a score of 1 (let’s say this is batsman 9):

      1: 89 (not out)
      2: 20 (out, setter)
      3: 123 (out)
      4: 124 (out)
      5: ≥ 33 (out)
      6: ? (out)
      7: ≥100 (out)
      8: ? (out)
      9: 1 (not out)

      But these already sum to 490, which is more than 456, so this situation is not possible.

      Consider the “222 for 2” → “456 for 7” transition:

      Initially the score is “222 for 2”, and the “in” batsmen have both scored 22. So the 2 dismissed batsmen must have scored 178 between them, and we know one of them is the setter, who scored 20. So the other must have scored 158 (let’s say that was the 3rd batsman):

      1: 22 (not out)
      2: 20 (out, setter)
      3: 158 (out)
      4: 22 (not out)

      By the time we get to “456 for 7” the 1st batsman must have increased his score to 89, and the remaining “in” batsman has a score of 1 (let’s say this is batsman 9):

      1: 89 (not out)
      2: 20 (out, setter)
      3: 158 (out)
      4: ≥22 (out)
      5: ? (out)
      6: ? (out)
      7: ≥100 (out)
      8: ? (out)
      9: 1 (not out)

      This leaves 66 runs to distribute between 4, 5, 6, 7, 8. Which is possible.

      So this is the only possible situation.

      Solution: The two scores are: “222 for 2, (22 and 22)” and: “456 for 7, (89 and 01)”.

      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