Random Numbers and Sums

Started by
12 comments, last by GameDev.net 19 years, 7 months ago
Quote:Original post by Krumble
Perhaps I'm misunderstanding the problem, but consider this:

Given 8 numbers between 1 and 16, the maximum sum you can obtain is 16*8 = 128 and the minimum you can obtain is 1*8 = 8. When you choose your first number, this range [8, 128] is going to change.


Krumble, I believe the assumption is that you are sampling without replacement.

Timkin
Advertisement
Quote:Original post by Timkin

Personally, I'd just store the brute force solution and perform a tree lookup.



This tree would be 16^8 leaves right? That's 42 billion ish....

I'm porting a flash version to palm and pocket/pc as well so I'd like something with a small memory footprint..

Cheers,
Paul

No, not 16^8.

16!/8! == 5.18918400 x 10^8
Pallo, if storing the 12000+ entries takes too much space and calculating them as needed takes too much time, you could settle somewhere in between. Store the first few moves in a table and make a brute force search for the rest.

This topic is closed to new replies.

Advertisement