I have tried to solve this but I can't. Does somebody know the answer?
Ref: Puzzle World, Ed. Nob Yoshigahara and Richard Bozulich, Ishi Press, Summer 1992, Pilot Edition.
I have tried to solve this but I can't. Does somebody know the answer?
Ref: Puzzle World, Ed. Nob Yoshigahara and Richard Bozulich, Ishi Press, Summer 1992, Pilot Edition.
Since this does not have the no-computers tag I have used a computer to
find the single solution
- withP,U,Z,L,E,W,O,R,D
being unique digits in $[0,9]$, and
- all instances ofx
free to be any digit.
That solution isP,U,Z,L,E,W,O,R,D = 6,9,5,0,3,7,8,2,1
.
Numerically on the left, and with the characterX
for4
on the right:695503 PUZZLE 6684445 PPOXXXZ ------- * ------- * 3477515 EXWWZDZ 2782012 RWORLDR 2782012 RWORLDR 2782012 RWORLDR 5564024 ZZPXLRX 4173018 XDWELDO 4173018 XDWELDO ------------- + ------------- + 4649051550835 XPXULZDZZLOEZ
I did it in a relatively similar way to a manual approach
I haven't made all the inferences I would make manually, but I have reduced the space in steps that would probably be used as part of a manual approach (one would prune more of the space than we need to with a computer, since they calculate so fast):
If one labels the multiplicandxxxxxxx
asx6,x5,x4,x3,x2,x1,x0
then the innermost generator (the third function) looks for values ofP,U,Z,Z,L,E
(with unique digitsP,U,Z,L,E
) andx3
(in $[0,9]$) that produce a validx,W,O,R,L,D,x
intermediate sum (with unique digitsP,U,Z,L,E,W,O,R,D
) - there are $242$ such choices.
The generator that wraps around that (the second function) then runs through these choices and looks for values ofx5,x4,x2,x1
that produce intermediate sums with the matchingW,O,L,D
- this yields $2,315$ choices.
The generator that wraps around that (the first function) then runs through these choices and looks for values ofx6,x0
that produce a final result matchingx,P,x,U,x,Z,x,Z,x,L,x,E,x
- this yields a single result (the two multiplicands as stings).
The Python code:
from itertools import combinations, permutations def iterSolutions(): for puzzle, puzzleInt, x1, x2, x3, x4, x5 in iterValid_Puzzle_PuzzleInt_X1_X2_X3_X4_X5(): p, u, z, z, l, e = puzzle pX = (10 * x1 + 100 * x2 + 1000 * x3 + 10000 * x4 + 100000 * x5) for x6 in range(10): pR = puzzleInt * (1000000 * x6 + pX) for x0 in range(10): r = str(puzzleInt * x0 + pR) newP = len(r) > 11 and r[-12] or '0' if newP == p: newU = len(r) > 9 and r[-10] or '0' if newU == u: newZ = len(r) > 7 and r[-8] or '0' if newZ == z: newZ = len(r) > 5 and r[-6] or '0' if newZ == z: newL = len(r) > 3 and r[-4] or '0' if newL == l: newE = len(r) > 1 and r[-2] or '0' if newE == e: yield puzzle, ''.join(str(v) for v in (x6, x5, x4, x3, x2, x1, x0)) def iterValid_Puzzle_PuzzleInt_X1_X2_X3_X4_X5(): for puzzle, puzzleInt, x3, w, o, d in iterValid_Puzzle_PuzzleInt_X3_W_O_D(): for x1 in range(10): s1 = str(puzzleInt * x1) wNew = len(s1) > 5 and s1[-6] or '0' if wNew == w: for x2 in range(10): s2 = str(puzzleInt * x2) oNew = len(s2) > 4 and s2[-5] or '0' if oNew == o: l = puzzle[4] for x4 in range(10): s4 = str(puzzleInt * x4) lNew = len(s4) > 2 and s4[-3] or '0' if lNew == l: for x5 in range(10): s5 = str(puzzleInt * x5) dNew = len(s5) > 1 and s5[-2] or '0' if dNew == d: yield puzzle, puzzleInt, x1, x2, x3, x4, x5 def iterValid_Puzzle_PuzzleInt_X3_W_O_D(): for puzzleSelection in combinations('9876543210', 5): for p,u,z,l,e in permutations(puzzleSelection): puzzle = ''.join((p,u,z,z,l,e)) puzzleSet = set(puzzle) puzzleInt = int(puzzle) for x3 in range(10): s3 = str(puzzleInt * x3) if len(s3) == 5: w = '0' elif len(s3) < 5: continue else: w = s3[-6] d,l,r,o = s3[-2:-6:-1] if l != puzzle[4]: continue if len(puzzleSet | set((w,o,r,d))) == 9: yield puzzle, puzzleInt, x3, w, o, d
Running that code (sub-second):
Which is saying the only solution is>>> for solution in iterSolutions(): ... solution ... ('695503', '6684445') >>>
695503 * 6684445
, the multiplication I showed above.
x
) represent a different digit? $\endgroup$ – Shuri2060 Aug 21 '16 at 14:44x
digits in the multiplicand are equal then all the intermediate sum values would all be equal (post-left-shift) too, so all ofW,O,R,L,D
would all be equal tox
too, butP,U,Z,L,E,W,O,R,D
are surely meant to be unique digits (otherwise we could just say0 * 0 = 0
); so it must be that anyx
is free to be any digit (elias suggests it may only be possible if some leading digits are also0
) $\endgroup$ – Jonathan Allan Aug 22 '16 at 0:46