in reply to Stumped with a math question in my Perl program

I need to come up with a scaling factor for the data from Experiment-2, to make it as close as possible to the data in Experiment-1

"as close as possible" can have several different interpretations. From a mathematical stand point, you have to define an error function and find the scaling factor that minimizes it.

Besides that, there is an obvious solution:

my @e1 = (2, 3.23, 7, 9, 11.3479); my @e2 = (3.3333, 1.433, 8.0577, 9.7344, 13.3377); my $sum = 0; $sum += $e2[$_]/$e1[$_] for 0..$#e1; my $f = $sum / @e1; say "average scaling factor: $f";
That will minimize the error (e2-e1*f)/e1.