Enigmatic Code

Programming Enigma Puzzles

Enigma 1114: Christmas changes

From New Scientist #2270, 23rd December 2000 [link]

Christmas is said to change things and so this enigma is an old puzzle with some changes.

Problem: You have to assign a digit to each of the 10 letters in the sum here:

When you have decided on an assignment of digits to the 10 letters, then your assignment is a solution of the problem if it satisfies at least one of the following conditions:

• At least one digit is assigned to more than one letter.
• When the digits are put into the addition sum it is not correct.
• The digit assigned to “U” is smaller than the digit assigned to “H”.

You need to find an assignment of digits to the 10 letters which is NOT a solution of the problem.

What is the value of BLEAT in your assignment?

[enigma1114]

Advertisements

One response to “Enigma 1114: Christmas changes

  1. Jim Randell 22 May 2017 at 8:35 am

    We need to find an assignment of digits to letters that is not a solution to the embedded problem.

    So all the listed conditions must be false. i.e. No digits are assigned to more than one letter; and the sum must come out correctly when the digits are substituted in; and the digit assigned to “U” is larger than the digit assigned to “H”.

    In other words this is a straightforward alphametic sum puzzle, so we can use the SubstitutedSum() solver from the enigma.py library, with a check on the solutions to ensure U > H.

    This program runs in 64ms.

    from enigma import SubstitutedSum
    
    SubstitutedSum(["JESUS", "SHEEP"], "STABLE").go(lambda s: s['U'] > s['H'])
    

    Solution: BLEAT = 68570.

    The full sum is:

    95131 + 12554 = 107685

    Without the condition that U > H there is a further solution:

    95121 + 13554 = 108675

    We can also use the generalised alphametic solver (SubstitutedExpression()) that is part of the enigma.py library to save us having to write a program at all. Here’s the run file. It executes in 144ms.

    #!/usr/bin/env python -m enigma -r
    
    SubstitutedExpression
    --answer="BLEAT"
    "JESUS + SHEEP = STABLE"
    "U > H"
    

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: