Tagged: by: Arthur Hall Toggle Comment Threads | Keyboard Shortcuts

  • Unknown's avatar

    Jim Randell 8:10 am on 8 October 2019 Permalink | Reply
    Tags: by: Arthur Hall   

    Brainteaser 1730: Not so usual 

    From The Sunday Times, 12th November 1995 [link]

    As usual Eric was early for his morning train. Two express trains of the same length passed through the station in opposite directions, each at its own constant speed. Out of interest Eric timed them and noted that the faster one took 6 seconds to pass him, while the slower one took 8 seconds.

    As soon as they had passed he saw his travelling companion, Len, 30 yards along the platform. In his conversation later, Eric told Len that he had been standing exactly in line with the point at which the fronts of the trains coincided.

    Len then commented that, by coincidence, he had been standing exactly in line with the point at which the ends of the trains coincided. Eric was delighted because he was now able to work out the speeds of the trains.

    How long were the trains?

    This puzzle is included in the book Brainteasers (2002), under the title “Commuter computer”. The puzzle text above is taken from the book.

    [teaser1730]

     
    • Jim Randell's avatar

      Jim Randell 8:11 am on 8 October 2019 Permalink | Reply

      At time 0s the fronts of the two trains (each of length x yards) are in line with Eric.

      At time 6s, the faster train’s end passes Eric. So it is travelling at (x/6) yards/s.

      At time 8s, the slower train’s end passes Eric. So it is travelling at (x/8) yards/s.

      The ends of the trains pass each other (and Len) at time t, when the faster train has travelled its entire length plus 30 yards, and the slower train has travelled its entire length less 30 yards.

      So:

      tx/6 = x + 30
      tx/8 = x − 30

      These equations are solved to give:

      x = 210, t = 48/7

      Solution: The trains were 210 yards long.

      So the faster train is travelling at 35 yards/s (about 72 mph) and the slower train is travelling at 26.25 yards/s (about 54 mph).

      And the ends of the trains passed each other (and Len) 6/7 seconds after the end of the fastest train passed Eric.

      Like

  • Unknown's avatar

    Jim Randell 3:51 pm on 3 October 2019 Permalink | Reply
    Tags: by: Arthur Hall   

    Brainteaser 1724: Like a lamb 

    From The Sunday Times, 1st October 1995 [link]

    Mary had a little lamb,
    Its fleece was white as snow
    And everywhere that Mary went
    The lamb was sure to go.

    It followed her to school one day,
    But found the maths a bore,
    For lambs, you see, do all their counting
    On a scale of four.

    Thus when a lamb writes two times two
    Its answer looks like 10,
    While our 10 written by a lamb
    Is double-2 again!

    It much distressed them both to find
    They never could agree
    On how to write down any
    Of the numbers after three.

    At last they hit on some for which
    The lamb would only need
    Two figures placed in front of Mary’s,
    Then they were agreed.

    Which two figures?

    This puzzle is included in the book Brainteasers (2002). The puzzle text above is taken from the book.

    [teaser1724]

     
    • Jim Randell's avatar

      Jim Randell 3:52 pm on 3 October 2019 Permalink | Reply

      We are to infer from the puzzle text that the lamb counts using base 4, with the standard symbols 0, 1, 2, 3.

      So we need to find numbers in base 4 whose representation in base 10 is the same as the representation in base 4 but with the leftmost 2 digits removed.

      This Python program runs in 221ms.

      Run: [ @repl.it ]

      from enigma import irange, inf, nsplit, nconcat, printf
      
      # base 4 digits for number n
      base4 = lambda n: nsplit(n, base=4)
      
      # consider k-digit base 4 numbers, read as base 10 numbers, they need to be (k + 2) digits
      for k in irange(1, inf):
        # smallest k-digit base 4 number read as a base 10 number
        if len(base4(10 ** (k - 1))) > k + 2: break
        # largest k-digit base 4 number read as a base 10 number
        if len(base4((10 ** k - 1) // 3)) < k + 2: continue
      
        # consider possible (k + 2) digit base 4 numbers 
        for n in irange(4 ** (k + 1), 4 ** (k + 2) - 1):
          # represented in base 4
          ds = base4(n)
          # does removing the first two digits give the base 10 representation?
          if nconcat(ds[2:]) == n:
            printf("prefix = {p} [k={k}: {ds} (base 4) = {n} (base 10)]", p=nconcat(ds[:2]), ds=nconcat(ds))
      

      Solution: The 2-digit prefix is 30.

      The only viable numbers are:

      303320 (base 4) = 3320 (base 10)
      303321 (base 4) = 3321 (base 10)
      303322 (base 4) = 3322 (base 10)
      303323 (base 4) = 3323 (base 10)

      The program considers base 4 numbers that are 5-, 6- and 7-digits long, and looks for corresponding 3-, 4- and 5- digit base 10 numbers.

      Like

  • Unknown's avatar

    Jim Randell 8:37 am on 15 September 2019 Permalink | Reply
    Tags: by: Arthur Hall   

    Brainteaser 1712: Squambling 

    From The Sunday Times, 9th July 1995 [link]

    In “squambling” a number, the first (leftmost) digit is squared, the next is cubed, the next raised to the fourth power, and so on. The total of these answers provides a new number, ready for the squambling to begin again.

    For example:

    18 → 1² + 8³ = 513 → 5² + 1³ + 3⁴ = 107
    107 → 2402 → 100 → 1 → 1 → …

    If you take my age and squamble it you get a three-figure number. If you then squamble that answer you get my age next year.

    How old am I?

    This puzzle is included in the book Brainteasers (2002). The puzzle text above is taken from the book.

    [teaser1712]

     
    • Jim Randell's avatar

      Jim Randell 8:38 am on 15 September 2019 Permalink | Reply

      This Python program runs in 86ms.

      Run: [ @replit ]

      from enigma import (nsplit, irange, inf, printf)
      
      squamble = lambda n: sum(d ** n for (n, d) in enumerate(nsplit(n), start=2))
      
      assert squamble(18) == 513
      
      for n in irange(1, inf):
        sn = squamble(n)
        if not (99 < sn < 1000): continue
        s2n = squamble(sn)
        if not (s2n == n + 1): continue
        # output solution
        printf("{n} -> {sn} -> {s2n}")
        break
      

      Solution: You are 46.

      We have:

      46 → 232 → 47 → … → 43

      After 91 applications of the function we eventually reach a value of 43, which is stable (i.e. squamble(43) = 43).

      The next smallest value at which this occurs is 753:

      753 → 255 → 754

      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