wood burning stoves 2.0*
The moose likes Programming Diversions and the fly likes Fill in numbers from 1 to 9 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "Fill in numbers from 1 to 9" Watch "Fill in numbers from 1 to 9" New topic
Author

Fill in numbers from 1 to 9

Rakesh Joshi
Ranch Hand

Joined: Feb 24, 2006
Posts: 218
Fill in numbers 1, 2, 3, 4, 5, 6, 7, 8 and 9 into ..... to make the equations work.
----------------------
- ....(+)....(=).... -
- --- ---------(/) -
- ....(-)....(=).... -
- -------------(=) -
- ....(=)....(*).... -
----------------------

[ March 28, 2006: Message edited by: Rakesh Joshi ]
[ March 28, 2006: Message edited by: Rakesh Joshi ]

Life is a Game play it.
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

I translated this to

Solutions are [71][17]8954632 (a-i).
Most Multiplications get greater than 9 (3*4) so I started there.
1*x is smaller than 10 for every x in (1-9), but would lead to
1*x = x and that's impossible.
h*i=g and i*f=c don't have g or c on the left side.
Therefore h,i,f must be at least 2.
Since 2*5 is 10, every multiplication is too big if a 5(or bigger) and no 1 is involved.
2*3 and 2*4 are the only candidates, which is consistent to our problem: i occures two times and is therefore 2.
h and f are 3 or 4.
Therefore c is 6 or 8 and g is 6 or 8.

If f is 3 or 4, we only have 1,7 and 9 left for d.
But e+f=d, therefore d must be greater than f, which might be 7 or 9.
If d would be 7, e would need to be 3 or 4, which is impossible, since f or h are 3 and 4.
d = 9.
e+ (3,4) = 9 => e:={6, 5}, but since g is 6 or c is 6, e=5 and therefore f=4.

For a and b we have 1 and 7 left, which leads concluent to c=8.
But whether a or b are 1 or 7 is not decideable.

To verify my assumption I elegantly skipped the possibility to create a permutation, and let Random poof my assumption:



http://home.arcor.de/hirnstrom/bewerbung
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Fill in numbers from 1 to 9