Enigmatic Code

Programming Enigma Puzzles

Tantalizer 230: Women’s lib

From New Scientist #780, 27th January 1972 [link]

Merry giggles were the order of the day at the Girton reunion. But presently the talk turned to serious things, at any rate among the five Naval History graduates of the class of ’62. The topic of immediate interest was the salary earned by each in her chosen profession.

Queenie, it emerged, was not doing as well as the architect; nor Sue as well as the boxer; nor Pamela as well as the commando. Rose was doing better than the engineer and Sue better than the commando, who was doing better than the dentist. Queenie was doing better than Rose.

And as for Tania — well, you can work that out for yourself.

What does each of the five do for a living?

The previous puzzle was Tantalizer 228, so there is no Tantalizer 229.

[tantalizer230]

One response to “Tantalizer 230: Women’s lib

  1. Jim Randell 11 August 2021 at 9:01 am

    We can use the [[ SubstitutedExpression ]] solver from the enigma.py library to assign values from 1-5 to the symbols ABCDE and PQRST, such that the conditions are met, and then the values can be matched up.

    The following run file executes in 64ms.

    Run: [ @replit ]

    #! python3 -m enigma -r
    
    SubstitutedExpression
    
    # assign values 1-5 to ABCDE, PQRST
    --digits="1-5"
    --distinct="ABCDE,PQRST"
    
    # "Q was not doing as well as A"
    "Q < A"
    
    # "S was not doing as well as B"
    "S < B"
    
    # "P was not doing as well as C"
    "P < C"
    
    # "R was doing better than E"
    "R > E"
    
    # "S was doing better than C"
    "S > C"
    
    # "C was doing better than D"
    "C > D"
    
    # "Q was foing better than R"
    "Q > R"
    
    # "mention T"
    "T > 0"
    
    # map values to symbols
    --code="v2s = lambda vs, ss: dict(zip(vs, ss))"
    # pair names to jobs
    --code="ans = lambda js, ns: (lambda j=v2s(js, 'ABCDE'), n=v2s(ns, 'PQRST'): map2str((n[i], j[i]) for i in irange(1, 5)))()"
    --answer="ans((A, B, C, D, E), (P, Q, R, S, T))"
    

    Solution: Pamela = engineer; Queenie = commando; Rose = dentist; Sue = architect; Tania = boxer.

    The order (highest paid to lowest paid) is:

    Tania (boxer)
    Sue (architect)
    Queenie (commando)
    Rose (dentist)
    Pamela (engineer)

Leave a Comment

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