Enigmatic Code

Programming Enigma Puzzles

Tantalizer 436: Rhyme and reason

From New Scientist #987, 12th February 1976 [link]

The poems of Prudence Meek are for all estates and conditions of men. They can be bought bound in velvet or in rags, printed in silver or in grey, scented with myrrh or with soap.

“Selling like hot cakes?” she was asked recently on a radio chat show.

“Verily”, she replied, “27 bound in velvet, 29 printed in silver, 34 scented with myrrh in less than a week. Half those scented with myrrh were printed in silver”.

“How about those scented with soap?”

“Three were not only printed in silver but also bound in velvet.”

“And total sales?”

“57”, the poetess confessed coyly, “but I’ll have you know that I had sold more luxury editions (the sort with velvet, silver and myrrh) than the total sales of Beverley Bunion’s disgusting odes”.

Knowing Bunion’s sales figure, the interviewer could then announce Miss Meek’s score in luxury editions.

What is it?

I’ve marked this puzzle as “flawed”, as, although it is possible to solve it and get a unique answer, the answer I found was different from the published solution. So it seems the setter had a different puzzle in mind.

[tantalizer436]

One response to “Tantalizer 436: Rhyme and reason

  1. Jim Randell 6 February 2019 at 8:05 am

    I get a different answer to the published solution.

    My approach is to assign a number to each of the 8 possible variations of the book. Together these numbers need to sum to 57, and satisfy the other conditions given.

    Once we have a viable set of numbers we know that the total sales of Bunion is fewer than the sales of the Velvet+Silver+Myrrh (= VSM) volume.

    But if the interviewer is able to deduce VSM knowing the number of B’s sales, it seems to me that VSM must take on the maximum possible value (and B must be one less than this, which is also the maximum possible value for B).

    This Python program runs in 82ms.

    Run: [ @repl.it ]

    from collections import namedtuple
    from enigma import irange, filter_unique, printf
    
    # we only need decompositions of 17 in pairs
    d17s = list((i, 17 - i) for i in irange(0, 17))
    
    # tuple for results
    T = namedtuple("T", "VSM VSS VGM VGS RSM RSS RGM RGS B")
    
    # accumulate results
    rs = list()
    
    # "what about those scented with soap?"
    # "3 were not only printed in silver, but also bound in velvet"
    VSS = 3
    
    # "34 were scented with myrrh"
    # so, VSM + VGM + RSM + RGM = 34,
    # and, "half those scented with myrrh were printed in silver"
    # so, VSM + RSM = 17, VGM + RGM = 17
    for (VSM, RSM) in d17s:
    
      # "29 were printed in silver"
      # so, VSM + VSS + RSM + RSS = 29, and we already have VSM, VSS, RSM
      RSS = 29 - (VSS + VSM + RSM)
    
      # from above, VGM + RGM = 17
      for (VGM, RGM) in d17s:
    
        # "27 were bound in velvet"
        # so, VSM + VSS + VGM + VGS = 27
        VGS = 27 - (VSM + VSS + VGM)
    
        # total is 57, and we only have RGS to assign
        RGS = 57 - (VSM + VSS + VGM + VGS + RSM + RSS + RGM)
    
        r = T(VSM, VSS, VGM, VGS, RSM, RSS, RGM, RGS, 0)
    
        # ignore any set with negative values
        if any(v < 0 for v in r): continue
    
        # B's sales were less than VSM
        for B in irange(0, VSM - 1):
          rs.append(r._replace(B=B))
    
    # if we knew B we would know VSM
    (rs, _) = filter_unique(rs, (lambda r: r.B), (lambda r: r.VSM))
    
    # output solutions
    for r in rs:
      printf("B={B} -> VSM={VSM} [{r}]", B=r.B, VSM=r.VSM)
    

    Solution: The number of luxury editions sold is 17.

    And Bunion’s sales must be 16.

    The breakdown of Meek’s sales is:

    VSM = 17
    VSS = 3
    VGM = k
    VGS = 7 – k
    RSM = 0
    RSS = 9
    RGM = 17 – k
    RGS = 4 + k

    where k = 0..7.

    Which gives a total of 57.

    Checking the other conditions:

    Velvet = 17 + 3 + k + (7 – k) = 27
    Silver = 17 + 3 + 0 + 9 = 29
    Myrrh = 17 + k + 0 + (17 – k) = 34
    Myrrh + Silver = 17 + 0 = 17
    Soap + Silver + Velvet = 3


    The published solution is:

    Answer: 13.

    Draw three intersecting circles, putting in x luxury editions and y editions in grey, velvet and myrrh. You will find that x + y = 13. To resolve this uniquely, Bunion must have sold 13 copies.

    Adopting this approach I get:

    VSM = x
    VSS = 3
    VGM = y
    VGS = 24 – (x + y)
    RSM = 17 – x
    RSS = 9
    RGM = 17 – y
    RGS = x + y – 13

    These sum to 57, and satisfy the other equations.

    We get viable sets of numbers when x and y are chosen such that none of the above give negative results (so we have 13 ≤ x + y ≤ 24 and x, y ≤ 17).

    To fix x + y = 13 (the smallest possible value) we would require some additional condition such as: RGS = 0, VGS = 11, or RSM + RGM = 21

    It’s possible that if the setter approached the problem this way they just added the 7 enclosed regions together to get 57, forgetting the RGS region (which corresponds to the “outside” of the diagram), implicitly setting RGS = 0.

    And if we do assume RGS = 0 (we could add an extra clause to the puzzle to state that the volume was not available in Rags+Grey+Soap, or just that no-one had bought this combination), then we do indeed get a solution of VSM = 13 (and B = 12).

    Although I did not come across any further correction/clarification for this puzzle in the Google Books archive of New Scientist.

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: