Question:
Activity of a certain enzyme was measured in the extracts from brain, heart and lung. In each tissue, the activity was measured many times, providing the following results (in arbitrary units):
brain: 65, 69, 70, 63, 70, 68.
heart: 102, 95, 98, 110.
lung: 112, 115, 113, 109, 95, 98, 100.
Write a program which computes and prints the given information for each of the tissues:
a) number of measurements
b) average enzyme activity
c) variance
d) standard deviation
Write a subroutine for each piece of the information above (that is, a subroutine that finds the number of measurements and returns it, a sub that finds out the average and returns it, a sub that finds the variance… and so on). The major part of your program must call the subroutines for each data set (brain, heart and lung) and print out the outcomes to the screen. Use the given formulas (n is the number of measurements):
For illustration, values for enzyme activity in the brain are computed as following:
Notes:
1) Find out the necessary built in function to compute the square root of a number in one of the Perl books.
2) For nice looking output, you can use printf rather than print (see lecture notes).