Jeff Aa wrote at Thu, 19 Sep 2002 19:08:44 +0200:
I liked your algorithm as it is quick and easy.
But on the other hand the results aren't as good as possible.
Actually, I do believe that the results are as good as possible, for any
distribution of numbers. 8-) consider that the first pass
Jeff wrote at Thu, 19 Sep 2002 01:27:27 +0200:
But could it be, we missed the simplest, but acceptable algorithm:
[snipped my algorithm for shortness]
mmm - looks like a more complex approach to me?
Hrm, yep.
I liked your algorithm as it is quick and easy.
But on the other hand the
-Original Message-
From: Janek Schleicher [mailto:[EMAIL PROTECTED]]
Sent: 19 September 2002 16:47
To: [EMAIL PROTECTED]
Subject: RE: lots of numbers...
I liked your algorithm as it is quick and easy.
But on the other hand the results aren't as good as possible.
Actually, I do
if you have a list of numbers:
67, 50, 78, 12, 19, 98, 33, 55, 10, 8, 39, 48, 13, 70, 36, 87, 82, 44, 32,
78, 9,
let´s say you have 500 numbers of the range between 10 and 100.
What you really want are groups each with 3 numbers.
The summe of the numbers in a group should be near as
Angerstein wrote at Wed, 18 Sep 2002 17:20:29 +0200:
if you have a list of numbers:
...
What you really want are groups each with 3 numbers.
The summe of the numbers in a group should be near as possible on the
average value.
My simple idea:
sort the numbers.
put the first, the last
-Original Message-
From: Janek Schleicher [mailto:[EMAIL PROTECTED]]
Sent: 18 September 2002 16:34
To: [EMAIL PROTECTED]
Subject: Re: lots of numbers...
I think, it's better to weight the sorted numbers
with their sum rank, in the above example it would be:
Of course, you
Jeff Aa wrote at Wed, 18 Sep 2002 18:56:52 +0200:
Your analysis is interesting. I am no mathemagician either, but it
occurs to me that it would be easy to code your analysis more
efficiently than using the sum rank, something like this: (not
debuggered)
use strict;
# Note that this
-Original Message-
From: Janek Schleicher [mailto:[EMAIL PROTECTED]]
Sent: 18 September 2002 18:32
To: [EMAIL PROTECTED]
Subject: RE: lots of numbers...
You meant my $iterations = int( scalar @numbers / 3 );
(However, the scalar cast isn't necessary)
my $iterations = int(@numbers