Given 'n', 'm', 'k', 'x' and 'y' integer values...
I have a numeric ArrayList with 'n' positions and I need to create 'k' other arrays using the values in the first array and with 'm' positions. How can I did it ensuring that the sum of the numbers is 'x' with a maximum margin of error of 'y' and the arrays to be as different as possible between them?
I will use this in a test generator to randomize the questions. The numbers represent the difficult of the questions. When I tried to do it I randomize situations and checked if they were correct, but that is very slow. Someone knows a better way to do this?