Solution to Puzzle #47: Each Digit Only Once

First of all, need to thank Ankita and Mohit again for the puzzle…wonderful one. Got lots and lots of answers, and as it turns out, there are quite a few answers. Proper treatment of the answer requires a video but unfortunately I do not have my iPad with me this weekend, and hence the answer is only in text.

Before we get to the answers, some special mentions:

– Alok Kuchlous for writing a program to provide me all the answers where 3 digits + 3 digits = 4 digits, and the requirements of the puzzle are met

– Anirudh Baddepudi for being the only one who gave an answer for 4 digits + 2 digits = 4 digits

– Anku Jain for being the first one to send an answer

– Mittal family (Alok, Parul, Smiti and Muskaan) for making this puzzle a family bonding event

– Sanjeev+Armaan Dugar, Ankita and Adhish are the other notable mentions with correct answers.

The question required a fair bit of trial and error, but still one could reason the following –  Either x and y both need to be 3 digits each and z being 4 digits, or x & y can be 4 and 2 digits each (with z again as 4 digits) in a special scenario [explained below in Anirudh’s answer].

4 digits + 2 digits = 4 digits (reproducing Anirudh’s answer):

1978+65=2043

I found this puzzle quite intriguing and very challenging. I first realised that there has to be one number which is in the thousands in this, and automatically assumed that the thousands digit will be 1. This gave the the following digits left:

0, 2, 3, 4, 5, 6, 7, 8, 9. Then, I tried to play around with having two 3 digit numbers adding up to the four digit number, but it was quite frustrating realising that this doesn’t work. Hence, I tried something simpler, with having a four digit number as ‘x’ and a two digit number as ‘y’ in the equation. Therefore, 9 must be in the hundreds place in ‘x.’

Then, I decided to try make the problem simpler, trying it with having a sum of 2 ‘two’ digit numbers, such that its sum when added to 1900 with give me three different digits. For this, the sum of these two ‘2’ digit numbers must be more than a hundred. So looking at various sums, and rules with which the ending digits will be different (and with intuition that the two numbers will be consecutive or have a relationship like that as these questions usually will have an answer of that kind), I came up with this:

78+65=143. Plugging this in to the original form, I got:

1978+65=2043.

3 digits + 3 digits = 4 digits (reproducing Alok Mittal’s answer)

Here is some logic:

– The digit in the thousands place in z needs to be “1” as addition of two 3 digit numbers will be less than 2000 and since z is a four digit number it has to be at least 1000

– if zero is in one of the numbers being added, it can’t be at unit position (else the other unit number will repeat) or at hundreds position (else even with a carry, the result will be same as other hundreds place number). So it has to be in tens position. In such a case clearly the units sum has to produce a carry. Quickly one can run through cases here and there doesn’t seem to be a solution of this nature

– Zero is in the result number. The corresponding position numbers being added then have to produce a carry, and then its a hit and trail on those

Here is a short program that Alok Kuchlous wrote (which I cannot understand), and also all the answers:

————————– puzzle.rb ————————————–

numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

numbers.permutation.each do |p|
x = p[0..2].join(”).to_i
y = p[3..5].join(”).to_i
z = p[6..9].join(”).to_i
puts “#{x.to_s} + #{y.to_s} = #{z.to_s}” if x < y && x + y == z
end
——————————————————————————–

> ruby puzzle.rb | grep 0

Solutions:
246 + 789 = 1035

249 + 786 = 1035
264 + 789 = 1053
269 + 784 = 1053
284 + 769 = 1053
286 + 749 = 1035
289 + 746 = 1035
289 + 764 = 1053
324 + 765 = 1089
325 + 764 = 1089
342 + 756 = 1098
346 + 752 = 1098
347 + 859 = 1206
349 + 857 = 1206
352 + 746 = 1098
356 + 742 = 1098
357 + 849 = 1206
359 + 847 = 1206
364 + 725 = 1089
365 + 724 = 1089
423 + 675 = 1098
425 + 673 = 1098
426 + 879 = 1305
429 + 876 = 1305
432 + 657 = 1089
437 + 589 = 1026
437 + 652 = 1089
439 + 587 = 1026
452 + 637 = 1089
457 + 632 = 1089
473 + 589 = 1062
473 + 625 = 1098
475 + 623 = 1098
476 + 829 = 1305
479 + 583 = 1062
479 + 826 = 1305
483 + 579 = 1062
487 + 539 = 1026
489 + 537 = 1026
489 + 573 = 1062
624 + 879 = 1503
629 + 874 = 1503
674 + 829 = 1503
679 + 824 = 1503
743 + 859 = 1602
749 + 853 = 1602
753 + 849 = 1602
759 + 843 = 1602

Hope you enjoyed the puzzle!

This entry was posted in Solution and tagged , . Bookmark the permalink.

Leave a Reply

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