The number of parts produced per shift in two factories during six shifts is given below.
Factory A
Number of parts (x): 40 45 50
Frequency (f): 1 3 2
Factory B
Number of parts (x): 42 47 52
Frequency (f): 2 2 2
Calculate the standard deviation for each factory and state which factory has the more consistent production.