I never heard of the knapsack problem before this post. But the w in the w*x terms appear to be 1, and he seems to want an exact value, not "less than or equal to". I think my brute force factorial technique is a solution, but dynamic programming may be more efficient? Not familiar with DP although I have heard of it. Was someone suggesting a random walk? _________________________________________________________________ Windows Live Hotmail and Microsoft Office Outlook – together at last. Get it now. http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033