October 9th, 2010, 12:44 AM  #1 
Newbie Joined: Oct 2010 Posts: 2 Thanks: 0  java problem
suppose you are given 100 gold coins labeled w/ numbers 1 through n. Coin n has weight and worth that is sqrroot(n). Given one minute if computatuin, how close can you come to dividing the 100 coins into piles of 50 coins each of nearly equal weight... The output should be a difference in the weight, followed by a list...

October 9th, 2010, 05:54 AM  #2 
Global Moderator Joined: Nov 2006 From: UTC 5 Posts: 16,046 Thanks: 933 Math Focus: Number theory, computational mathematics, combinatorics, FOM, symbolic logic, TCS, algorithms  Re: java problem
The greedy algorithm takes under a millisecond and is about 0.399 off. What other algorithms do you know? Hillclimbing? Simulated annealing?


Tags 
java, problem 
Thread Tools  
Display Modes  

Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Java 2 methods help  JamesKirk  Computer Science  0  February 26th, 2011 11:13 AM 
The Java Closure controversy  John Creighton  Computer Science  1  October 28th, 2010 11:22 AM 
Java code  Quantum++  Computer Science  1  September 16th, 2010 09:22 AM 
Java  NetBeans  Mark  Computer Science  5  October 30th, 2007 07:49 AM 
Java versus C++  johnny  Computer Science  17  October 21st, 2007 07:12 PM 