At 17:29 08/10/01, Chris wrote: >I was asked to figure out all of the different ways you can add up various >combinations of the digits 1 through 9 to create different totals. For >instance, you can get 8 by adding 1+7 or 2+5 or 3+4 or 1+2+4 (for each >addition, each numeral can only be used once.)
Isn't it just 2^9 = 512? Simpler example, to show why: for the same problem but just the digits 1 - 3, you have these possibilities: 0 + 0 + 0 0 + 0 + 3 0 + 2 + 0 0 + 2 + 3 1 + 0 + 0 1 + 0 + 3 1 + 2 + 0 1 + 2 + 3 If I've understood your problem correctly, this is definitely not one of those situations where writing a program for an iterative solution is quicker than analysing it by hand ;-) best, Mo Mo Holkar Undying King Games [EMAIL PROTECTED] http://www.ukg.co.uk -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
