E
Erol Akman
Hi,
I have following (crazy) task and was hoping to solve it via perl, but
I need your help, please.
I have an array of values and need to calculate every possible average
and sort it by the average data:
@array = qw(4 6 2 7 1 8 3 5 9 10);
This should be printed out:
4+2 = 6, Average =3
4+6+2 = 12, Average=4
4+6 = 10, Average=5
....
10+4+6+2+3 = 25, Average=5
also nice to have, but not must have: I need to see which scalar perl
used to sum up, maybe "4+6+2 = 12, Average=4, scalar 0,1,3 were summed
up"
I know, its nuts, but I really need this.
Background: I have lots and lots of data like 23.33, 12.25, 84.56 and
so on and hundreds of values like 54, 32, 45. I don't know which and
how many of these values where summed up to get the data above. My
idea was to calculate every possible average to find out which values
where summed up and averaged out.
Is this possible? Can you help me?
Best regards
Erol
I have following (crazy) task and was hoping to solve it via perl, but
I need your help, please.
I have an array of values and need to calculate every possible average
and sort it by the average data:
@array = qw(4 6 2 7 1 8 3 5 9 10);
This should be printed out:
4+2 = 6, Average =3
4+6+2 = 12, Average=4
4+6 = 10, Average=5
....
10+4+6+2+3 = 25, Average=5
also nice to have, but not must have: I need to see which scalar perl
used to sum up, maybe "4+6+2 = 12, Average=4, scalar 0,1,3 were summed
up"
I know, its nuts, but I really need this.
Background: I have lots and lots of data like 23.33, 12.25, 84.56 and
so on and hundreds of values like 54, 32, 45. I don't know which and
how many of these values where summed up to get the data above. My
idea was to calculate every possible average to find out which values
where summed up and averaged out.
Is this possible? Can you help me?
Best regards
Erol