平均値をとる意味:
ある物理量をndata 回測定し, その平均をとり物理量の測定. 測定回数(ndata)を大きくすることはどのような意味を持つのだろうか?

準備

サブルーチンの読み込み     (* おまじない *)

<< Graphics`Graphics`  
<< Statistics`NormalDistribution`
<< Statistics`DataManipulation`        
<<Statistics`DescriptiveStatistics`

正規分布の密度関数

fNormal[x_, m_, s_] := 
          1/Sqrt[2  Pi s^2] Exp[-((x - m)/s)^2/2];

ndata = 10;         
div = 0.1;                  (* ヒストグラム横軸の刻み幅 *)
midpoints = Table[i, {i, -6, 6, div}];    
ndataM = 100;     \( (*\ 
          ndataM : \ 平均値の分布を調べるために用意するデ - タの数\ *) \)

平均値の分布が測定回数とどのような関係にあるのか調べよ

測定回数　ndata=10

ndata = 10;
data = 
        RandomArray[NormalDistribution[0, 1], 
          ndata];
freq = BinCounts[data, {-6, 6, div}]/ndata/div;               
Print["\:30d2\:30b9\:30c8\:30b0\:30e9\:30e0"];
fig1 = 
        Histogram[freq, FrequencyData -> True, 
          HistogramCategories -> 
            midpoints];
fig2 = 
        Plot[ fNormal[x, 0, Sqrt[1]], {x, -6, 6}, 
          PlotStyle -> {RGBColor[0, 0, 1]}];
me = 
      Mean[data]; 
    va = Variance[data];
fig3 = 
        Plot[ fNormal[x, me, Sqrt[va]], {x, -6, 6}, 
          PlotStyle -> {RGBColor[0, 1, 
                0]}];
Print["\:30d2\:30b9\:30c8\
\:30b0\:30e9\:30e0\:3068\:6b63\:898f\:5206\:5e03\:66f2\:7dda"];
Show[fig1, fig2, 
        fig3];
Print["data\:6570 = ", 
        ndata];
Print["\:5e73\:5747 = ", 
        me, "   (\:7406\:8ad6\:5024 ", 0, " \:3068\:306e\:5dee = ", 
        me - 0, " )"];
Print["\:6a19\:6e96\:504f\:5dee = ", 
          Sqrt[va], "   (\:7406\:8ad6\:5024 ", 
          1, " \:3068\:306e\:5dee = ", Sqrt[va] - 1, " )"];

data = 
        Table[Mean[
            RandomArray[NormalDistribution[0, 1], 
              ndata]], {ndataM}];
freq = BinCounts[data, {-6, 6, div}]/ndata/div;               
Print["\:5e73\:5747\:5024\:306e\:30d2\:30b9\:30c8\:30b0\:30e9\:30e0"];
fig1 = 
        Histogram[freq, FrequencyData -> True, 
          HistogramCategories -> 
            midpoints];
me = Mean[data]; 
    va = Variance[
        data];
Print["data\:6570 = ", 
        ndataM];
Print["\:5e73\:5747\:5024\:306e\:5e73\:5747 = ", 
        me, "   (\:7406\:8ad6\:5024 ", 0, " \:3068\:306e\:5dee = ", 
        me - 0, " )"];
Print["\:5e73\:5747\:5024\:306e\:6a19\:6e96\:504f\:5dee = \
", Sqrt[va/ndata], "   (\:7406\:8ad6\:5024 ", 
          Sqrt[1/ndata], " \:3068\:306e\:5dee = ", 
          Sqrt[va] - Sqrt[1/ndata], " )"];

測定回数 ndata=30

ndata = 30;
data = 
        RandomArray[NormalDistribution[0, 1], 
          ndata];
freq = BinCounts[data, {-6, 6, div}]/ndata/div;               
Print["\:30d2\:30b9\:30c8\:30b0\:30e9\:30e0"];
fig1 = 
        Histogram[freq, FrequencyData -> True, 
          HistogramCategories -> 
            midpoints];
fig2 = 
        Plot[ fNormal[x, 0, Sqrt[1]], {x, -6, 6}, 
          PlotStyle -> {RGBColor[0, 0, 1]}];
me = 
      Mean[data]; 
    va = Variance[data];
fig3 = 
        Plot[ fNormal[x, me, Sqrt[va]], {x, -6, 6}, 
          PlotStyle -> {RGBColor[0, 1, 
                0]}];
Print["\:30d2\:30b9\:30c8\
\:30b0\:30e9\:30e0\:3068\:6b63\:898f\:5206\:5e03\:66f2\:7dda"];
Show[fig1, fig2, 
        fig3];
Print["data\:6570 = ", 
        ndata];
Print["\:5e73\:5747 = ", 
        me, "   (\:7406\:8ad6\:5024 ", 0, " \:3068\:306e\:5dee = ", 
        me - 0, " )"];
Print["\:6a19\:6e96\:504f\:5dee = ", 
          Sqrt[va], "   (\:7406\:8ad6\:5024 ", 
          1, " \:3068\:306e\:5dee = ", Sqrt[va] - 1, " )"];

data = 
        Table[Mean[
            RandomArray[NormalDistribution[0, 1], 
              ndata]], {ndataM}];
freq = BinCounts[data, {-6, 6, div}]/ndata/div;               
Print["\:5e73\:5747\:5024\:306e\:30d2\:30b9\:30c8\:30b0\:30e9\:30e0"];
fig1 = 
        Histogram[freq, FrequencyData -> True, 
          HistogramCategories -> 
            midpoints];
me = Mean[data]; 
    va = Variance[
        data];
Print["data\:6570 = ", 
        ndataM];
Print["\:5e73\:5747\:5024\:306e\:5e73\:5747 = ", 
        me, "   (\:7406\:8ad6\:5024 ", 0, " \:3068\:306e\:5dee = ", 
        me - 0, " )"];
Print["\:5e73\:5747\
\:5024\:306e\:6a19\:6e96\:504f\:5dee = ", 
        Sqrt[va/ndata], "   (\:7406\:8ad6\:5024 ", 
        Sqrt[1/ndata], " \:3068\:306e\:5dee = ", 
        Sqrt[va] - Sqrt[1/ndata], " )"];

測定回数 ndata=100

ndata = 100;
data = 
        RandomArray[NormalDistribution[0, 1], 
          ndata];
freq = BinCounts[data, {-6, 6, div}]/ndata/div;               
Print["\:30d2\:30b9\:30c8\:30b0\:30e9\:30e0"];
fig1 = 
        Histogram[freq, FrequencyData -> True, 
          HistogramCategories -> 
            midpoints];
fig2 = 
        Plot[ fNormal[x, 0, Sqrt[1]], {x, -6, 6}, 
          PlotStyle -> {RGBColor[0, 0, 1]}];
me = 
      Mean[data]; 
    va = Variance[data];
fig3 = 
        Plot[ fNormal[x, me, Sqrt[va]], {x, -6, 6}, 
          PlotStyle -> {RGBColor[0, 1, 
                0]}];
Print["\:30d2\:30b9\:30c8\
\:30b0\:30e9\:30e0\:3068\:6b63\:898f\:5206\:5e03\:66f2\:7dda"];
Show[fig1, fig2, 
        fig3];
Print["data\:6570 = ", 
        ndata];
Print["\:5e73\:5747 = ", 
        me, "   (\:7406\:8ad6\:5024 ", 0, " \:3068\:306e\:5dee = ", 
        me - 0, " )"];
Print["\:5206\:6563 = ", va, "   (\:7406\:8ad6\:5024 ", 
          1, " \:3068\:306e\:5dee = ", va - 1, " )"];

data = 
        Table[Mean[
            RandomArray[NormalDistribution[0, 1], 
              ndata]], {ndataM}];
freq = BinCounts[data, {-6, 6, div}]/ndata/div;               
Print["\:5e73\:5747\:5024\:306e\:30d2\:30b9\:30c8\:30b0\:30e9\:30e0"];
fig1 = 
        Histogram[freq, FrequencyData -> True, 
          HistogramCategories -> 
            midpoints];
me = Mean[data]; 
    va = Variance[
        data];
Print["data\:6570 = ", 
        ndataM];
Print["\:5e73\:5747\:5024\:306e\:5e73\:5747 = ", 
        me, "   (\:7406\:8ad6\:5024 ", 0, " \:3068\:306e\:5dee = ", 
        me - 0, " )"];
Print["\:5e73\:5747\
\:5024\:306e\:6a19\:6e96\:504f\:5dee = ", 
        Sqrt[va/ndata], "   (\:7406\:8ad6\:5024 ", 
        Sqrt[1/ndata], " \:3068\:306e\:5dee = ", 
        Sqrt[va] - Sqrt[1/ndata], " )"];

測定回数 ndata=1000

ndata = 1000;
data = 
        RandomArray[NormalDistribution[0, 1], 
          ndata];
freq = BinCounts[data, {-6, 6, div}]/ndata/div;               
Print["\:30d2\:30b9\:30c8\:30b0\:30e9\:30e0"];
fig1 = 
        Histogram[freq, FrequencyData -> True, 
          HistogramCategories -> 
            midpoints];
fig2 = 
        Plot[ fNormal[x, 0, Sqrt[1]], {x, -6, 6}, 
          PlotStyle -> {RGBColor[0, 0, 1]}];
me = 
      Mean[data]; 
    va = Variance[data];
fig3 = 
        Plot[ fNormal[x, me, Sqrt[va]], {x, -6, 6}, 
          PlotStyle -> {RGBColor[0, 1, 
                0]}];
Print["\:30d2\:30b9\:30c8\
\:30b0\:30e9\:30e0\:3068\:6b63\:898f\:5206\:5e03\:66f2\:7dda"];
Show[fig1, fig2, 
        fig3];
Print["data\:6570 = ", 
        ndata];
Print["\:5e73\:5747 = ", 
        me, "   (\:7406\:8ad6\:5024 ", 0, " \:3068\:306e\:5dee = ", 
        me - 0, " )"];
Print["\:6a19\:6e96\
\:504f\:5dee = ", Sqrt[va], "   (\:7406\:8ad6\:5024 ", 
        1, " \:3068\:306e\:5dee = ", Sqrt[va] - 1, " )"];

data = 
        Table[Mean[
            RandomArray[NormalDistribution[0, 1], 
              ndata]], {ndataM}];
freq = BinCounts[data, {-6, 6, div}]/ndata/div;               
Print["\:5e73\:5747\:5024\:306e\:30d2\:30b9\:30c8\:30b0\:30e9\:30e0"];
fig1 = 
        Histogram[freq, FrequencyData -> True, 
          HistogramCategories -> 
            midpoints];
me = Mean[data]; 
    va = Variance[
        data];
Print["data\:6570 = ", 
        ndataM];
Print["\:5e73\:5747\:5024\:306e\:5e73\:5747 = ", 
        me, "   (\:7406\:8ad6\:5024 ", 0, " \:3068\:306e\:5dee = ", 
        me - 0, " )"];
Print["\:5e73\:5747\
\:5024\:306e\:6a19\:6e96\:504f\:5dee = ", 
        Sqrt[va/ndata], "   (\:7406\:8ad6\:5024 ", 
        Sqrt[1/ndata], " \:3068\:306e\:5dee = ", 
        Sqrt[va] - Sqrt[1/ndata], " )"];