Errata

Figure 2.14
The figure is wrong in the book. This is the correct script.

global meanMan

on new me
  return me
end

on getTheMean me,numbers
  set num to 0.000
  set total to 0.000
  repeat with j = 1 to count(numbers)
    set num to num +1
    set total to total + getAt(numbers,j)
  end repeat
  set answer to total /num
  return answer
end
Figure 2.15
The figure is wrong in the book. This is the correct script.
global deviation
global meanMan

on new me
  return me
end

on getMeanDeviation me,numbers
  set theMean to getTheMean(meanMan,numbers)
  set means to 0.000
  repeat with i = 1 to count(numbers)
    set means to means + abs(theMean - getAt(numbers,i))
  end repeat
  set answer to (means /count(numbers))
  return answer
end