%23%20%2F%2F%2F%20script%0A%23%20requires-python%20%3D%20%22%3E%3D3.11%22%0A%23%20dependencies%20%3D%20%5B%22marimo%3E%3D0.23.9%22%2C%20%22numpy%3E%3D2.0%22%2C%20%22matplotlib%3E%3D3.9%22%2C%20%22scipy%3E%3D1.14%22%2C%20%22tnorma%3E%3D0.0.3%22%5D%0A%23%20%2F%2F%2F%0A%0Aimport%20marimo%0A%0A__generated_with%20%3D%20%220.25.2%22%0Aapp%20%3D%20marimo.App()%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%20Ensemble%20average%0A%0A%20%20%20%20%3E%20Marcos%20Duarte%2C%20Renato%20Naville%20Watanabe%3Cbr%3E%0A%20%20%20%20%3E%20%5BLaboratory%20of%20Biomechanics%20and%20Motor%20Control%5D(https%3A%2F%2Fbmclab.pesquisa.ufabc.edu.br%2F)%3Cbr%3E%0A%20%20%20%20%3E%20Federal%20University%20of%20ABC%2C%20Brazil%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20How%20to%20use%20this%20guide%0A%0A%20%20%20%20Ten%20movement%20trials%20have%20different%20durations.%20How%20can%20we%20compare%20their%20typical%20shape%20without%20pretending%20that%20their%20timing%20was%20identical%3F%0A%0A%20%20%20%20We%20will%20normalize%20cycles%2C%20calculate%20a%20mean%20curve%2C%20and%20compare%20error%20bars%2C%20shaded%20bands%2C%20and%20median%2Fquartile%20displays.%0A%0A%20%20%20%20Predict%20the%20result%20before%20running%20each%20example.%20Try%20the%20**Exercises**%20before%20opening%20their%20worked%20solutions.%20Finish%20with%20the%20**Checkpoint%20questions**%20and%20**Problems**%3B%20the%20latter%20provide%20final%20answers%20only.%0A%0A%20%20%20%20Open%20this%20file%20locally%20in%20marimo%2C%20on%20%5Bmarimo.app%5D(https%3A%2F%2Fmarimo.app%2F)%2C%20or%20in%20%5Bmolab%5D(https%3A%2F%2Fmolab.marimo.io%2Fnotebooks).%20The%20examples%20are%20self-contained.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Python%20setup%0A%0A%20%20%20%20We%20use%20NumPy%20for%20arrays%2C%20Matplotlib%20for%20plots%2C%20SciPy%20for%20filtering%2C%20and%20%60tnorma%60%20to%20normalize%20each%20trial%20to%20the%20same%20percent%20cycle.%20The%20notebook%20declares%20these%20dependencies%20for%20standalone%20use.%0A%0A%20%20%20%20An%20ensemble%20average%20is%20the%20pointwise%20mean%20across%20aligned%20trials%20or%20subjects.%20A%20band%20of%20%24%5Cpm%241%20standard%20deviation%20is%20an%20optional%20display%20of%20between-trial%20dispersion%3B%20it%20is%20not%20the%20definition%20of%20the%20mean%20and%20is%20not%20a%20confidence%20interval%20for%20that%20mean.%0A%0A%20%20%20%20Let's%20simulate%20some%20data%20and%20explore%20different%20aesthetic%20variations%20to%20present%20the%20ensemble%20average.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20import%20numpy%20as%20np%0A%20%20%20%20import%20matplotlib.pyplot%20as%20plt%0A%0A%20%20%20%20from%20tnorma%20import%20tnorma%0A%20%20%20%20if%20not%20hasattr(np%2C%20'NaN')%3A%20%20%23%20tnorma%200.0.3%20still%20uses%20np.NaN%2C%20removed%20in%20NumPy%202%0A%20%20%20%20%20%20%20%20np.NaN%20%3D%20np.nan%0A%20%20%20%20return%20np%2C%20plt%2C%20tnorma%0A%0A%0A%40app.cell%0Adef%20_(np%2C%20plt)%3A%0A%20%20%20%20%23%20slighly%20different%20data%20with%20slightly%20different%20duration%20(number%20of%20points)%0A%20%20%20%20from%20scipy.signal%20import%20butter%2C%20filtfilt%0A%20%20%20%20%23%20Butterworth%20filter%0A%20%20%20%20b%2C%20a%20%3D%20butter(1%2C%20(5%2F(100%2F2))%2C%20btype%20%3D%20'low')%0A%20%20%20%20_rng%20%3D%20np.random.default_rng(4)%0A%20%20%20%20N%20%3D%2010%0A%20%20%20%20y%20%3D%20np.empty(%5B120%2C%20N%5D)%20*%20np.nan%0A%20%20%20%20for%20i%20in%20range(N)%3A%0A%20%20%20%20%20%20%20%20t%20%3D%20np.arange(0%2C%20100%20%2B%20_rng.integers(-20%2C%20high%3D20))%20%2F%20100%0A%20%20%20%20%20%20%20%20y%5B0%3A%20t.size%2C%20i%5D%20%3D%202*np.sin(2%20*%20np.pi%20*%20t)%20%2B%20_rng.standard_normal(t.size)%20%2F%202%20%2B%20t.size%20%2F%2020%0A%20%20%20%20%20%20%20%20y%5B0%3A%20t.size%2C%20i%5D%20%3D%20filtfilt(b%2C%20a%2C%20%20y%5B0%3A%20t.size%2C%20i%5D)%0A%0A%20%20%20%20plt.figure(figsize%3D(9%2C%204))%0A%20%20%20%20plt.plot(y)%0A%20%20%20%20plt.xlabel('data%20points')%0A%20%20%20%20plt.title('Plot%20of%20trials')%0A%20%20%20%20plt.show()%0A%20%20%20%20return%20(y%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20**Exercise%201.**%20Before%20averaging%2C%20why%20is%20padding%20every%20trial%20to%20120%20samples%20not%20sufficient%20to%20align%20a%20movement%20cycle%3F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%2F%2F%2F%20details%20%7C%20Solution%20to%20Exercise%201%0A%0A%20%20%20%20Padding%20makes%20array%20sizes%20equal%20but%20does%20not%20match%20movement%20phase.%20Here%20each%20valid%20trial%20is%20mapped%20to%200%E2%80%93100%25%20cycle.%20This%20assumes%20that%20corresponding%20percentages%20represent%20comparable%20phases%3B%20it%20does%20not%20align%20every%20event%20within%20the%20cycle.%0A%20%20%20%20%2F%2F%2F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20To%20calculate%20the%20mean%20and%20standard%20deviation%20across%20these%20trials%20the%20different%20trials%20must%20have%20the%20same%20number%20of%20points.%3Cbr%3E%0A%20%20%20%20We%20can%20do%20this%20with%20the%20%5Btime%20normalization%20of%20data%5D(https%3A%2F%2Fgithub.com%2Fdemotu%2Ftnorma)%2C%20where%20we%20will%20normalize%20each%20trial%20to%20the%20same%20percent%20cycle%20(from%200%20to%20100%25)%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(np%2C%20plt%2C%20tnorma%2C%20y)%3A%0A%20%20%20%20%23%20yn%2C%20tn%2C%20indie%20%3D%20tnorma(y%2C%20axis%3D0%2C%20step%3D1%2C%20k%3D3%2C%20smooth%3D0%2C%20mask%3DNone%2C%0A%20%20%20%20%23%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20nan_at_ext%3D'delete'%2C%20show%3DFalse%2C%20ax%3DNone)%0A%20%20%20%20%23%20Normalize%20each%20complete%20trial%20independently%3B%20the%20NaN%20padding%20is%20not%20a%20shared%20cutoff.%0A%20%20%20%20_normalized%20%3D%20%5Btnorma(y%5B%3A%2C%20_i%5D%2C%20nan_at_ext%3D%22delete%22)%5B0%5D.reshape(-1)%20for%20_i%20in%20range(y.shape%5B1%5D)%5D%0A%20%20%20%20yn%20%3D%20np.column_stack(_normalized)%0A%20%20%20%20tn%20%3D%20np.linspace(0%2C%20100%2C%20yn.shape%5B0%5D)%0A%20%20%20%20%23%20plot%20of%20the%20normalized%20data%0A%20%20%20%20plt.figure(figsize%3D(10%2C%205))%0A%20%20%20%20plt.plot(yn)%0A%20%20%20%20plt.xlabel('Cycle%20%5B%25%5D')%0A%20%20%20%20plt.title('Plot%20of%20normalized%20trials')%0A%20%20%20%20plt.show()%0A%20%20%20%20return%20tn%2C%20yn%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20So%2C%20the%20trials%20have%20the%20same%20number%20of%20points%2C%20now%20we%20can%20calculate%20the%20mean%20and%20standard%20deviation%20curves%20and%20plot%20the%20ensemble%20average%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(np%2C%20plt%2C%20tn%2C%20yn)%3A%0A%20%20%20%20ym%2C%20ysd%20%3D%20np.mean(yn%2C%20axis%3D1)%2C%20np.std(yn%2C%20axis%3D1%2C%20ddof%3D1)%20%23%20one%20line%20is%20all%20we%20need%0A%20%20%20%20%23%20plot%20of%20the%20ensemble%20average%0A%20%20%20%20plt.figure(figsize%3D(10%2C5))%0A%20%20%20%20plt.errorbar(tn%2C%20ym%2C%20ysd%2C%20linewidth%3D2)%0A%20%20%20%20plt.xlabel('Cycle%20%5B%25%5D')%0A%20%20%20%20plt.title('Plot%20of%20ensemble%20average')%0A%20%20%20%20plt.show()%0A%20%20%20%20return%20ym%2C%20ysd%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20**Exercise%202.**%20At%2050%25%20cycle%2C%20three%20trials%20have%20values%202%2C%204%2C%20and%206.%20Find%20the%20mean%20and%20sample%20standard%20deviation.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%2F%2F%2F%20details%20%7C%20Solution%20to%20Exercise%202%0A%0A%20%20%20%20The%20mean%20is%204.%20The%20sample%20variance%20is%20%24%5B(2-4)%5E2%2B(4-4)%5E2%2B(6-4)%5E2%5D%2F(3-1)%3D4%24%2C%20so%20the%20sample%20SD%20is%202.%20The%20plotted%20mean%20%C2%B1%20SD%20band%20extends%20from%202%20to%206.%20It%20describes%20dispersion%2C%20not%20uncertainty%20in%20the%20mean.%0A%20%20%20%20%2F%2F%2F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20And%20here%20are%20some%20aesthetic%20variations%20to%20show%20the%20ensemble%20average%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(np%2C%20plt%2C%20tn%2C%20ym%2C%20ysd)%3A%0A%20%20%20%20plt.rc('axes'%2C%20labelsize%3D10%2C%20%20titlesize%3D12)%0A%20%20%20%20plt.rc('xtick'%2C%20labelsize%3D10)%0A%20%20%20%20plt.rc('ytick'%2C%20labelsize%3D10)%0A%20%20%20%20plt.figure(figsize%3D(10%2C%207))%0A%0A%20%20%20%20ax1%20%3D%20plt.subplot(221)%0A%20%20%20%20ax1.set_title('Errorbar%20every%20two%20data%20points%20and%20zero%20cap%20size')%0A%20%20%20%20ax1.errorbar(tn%2C%20ym%2C%20ysd%2C%20color%20%3D%20%5B0%2C%200%2C%201%2C%200.5%5D%2C%20capsize%3D0%2C%20errorevery%3D2%2C%20lw%3D4)%0A%0A%20%20%20%20ax2%20%3D%20plt.subplot(222)%0A%20%20%20%20ax2.set_title('Mean%20curve%20and%20shaded%20area')%0A%20%20%20%20ax2.fill_between(tn%2C%20ym%2Bysd%2C%20ym-ysd%2C%20color%20%3D%20%5B0%2C%200%2C%201%2C%200.5%5D)%0A%20%20%20%20ax2.plot(tn%2C%20ym%2C%20color%20%3D%20%5B0%2C%200%2C%201%2C%20.8%5D%2C%20lw%3D2%2C%20label%3D'Data')%0A%20%20%20%20ax2.legend(fontsize%3D14%2C%20loc%3D'best'%2C%20framealpha%3D.8)%0A%0A%20%20%20%20ax3%20%3D%20plt.subplot(223)%0A%20%20%20%20ax3.set_title('Semi-transparent%20shaded%20areas%20overlap%20well')%0A%20%20%20%20ax3.fill_between(tn%2C%20ym%2Bysd%2C%20ym-ysd%2C%20color%3D%5B0%2C%200%2C%201%2C%200.5%5D%2C%20edgecolor%3DNone)%0A%20%20%20%20y2%20%3D%20np.mean(ym)%20-%20ym%20%2B%20ym%5B0%5D%0A%20%20%20%20ax3.fill_between(tn%2C%20y2%2Bysd%2C%20y2-ysd%2C%20color%3D%5B1%2C%200%2C%200%2C%200.5%5D%2C%20edgecolor%3DNone)%0A%20%20%20%20ax3.set_xlabel('Cycle%20%5B%25%5D')%0A%20%20%20%20p1%20%3D%20plt.Rectangle((0%2C%200)%2C%201%2C%201%2C%20color%3D%5B0%2C%200%2C%201%2C%200.5%5D)%0A%20%20%20%20p2%20%3D%20plt.Rectangle((0%2C%200)%2C%201%2C%201%2C%20color%3D%5B1%2C%200%2C%200%2C%200.5%5D)%0A%20%20%20%20%23%20Explicit%20proxy%20handles%20give%20the%20two%20shaded%20regions%20descriptive%20labels.%0A%20%20%20%20ax3.legend(%5Bp1%2C%20p2%5D%2C%20%5B'Group%201'%2C%20'Group%202'%5D%2C%20fontsize%3D14%2C%20loc%3D'best'%2C%20framealpha%3D.8)%0A%0A%20%20%20%20ax4%20%3D%20plt.subplot(224)%0A%20%20%20%20ax4.set_title('Combine%20errorbar%20and%20shaded%20area')%0A%20%20%20%20ax4.errorbar(tn%2C%20ym%2C%20ysd%2C%20color%20%3D%20%5B0%2C%200%2C%201%2C%200.5%5D%2C%20capsize%3D0%2C%20lw%3D1.5)%0A%20%20%20%20y2%20%3D%20np.mean(ym)%20-%20ym%20%2B%20ym%5B0%5D%0A%20%20%20%20ax4.fill_between(tn%2C%20y2%2Bysd%2C%20y2-ysd%2C%20color%3D%5B1%2C%200%2C%200%2C%200.5%5D%2C%20edgecolor%3DNone)%0A%20%20%20%20ax4.set_xlabel('Cycle%20%5B%25%5D')%0A%20%20%20%20p1%20%3D%20plt.Line2D((0%2C%201)%2C%20(1%2C%201)%2C%20color%3D%5B0%2C%200%2C%201%2C%201%5D%2C%20lw%3D1.5)%0A%20%20%20%20p2%20%3D%20plt.Rectangle((0%2C%200)%2C%201%2C%201%2C%20color%3D%5B1%2C%200%2C%200%2C%200.5%5D)%0A%20%20%20%20%23%20Explicit%20proxy%20handles%20give%20the%20two%20shaded%20regions%20descriptive%20labels.%0A%20%20%20%20ax4.legend(%5Bp1%2C%20p2%5D%2C%20%5B'Group%201'%2C%20'Group%202'%5D%2C%20fontsize%3D14%2C%20loc%3D'best'%2C%20framealpha%3D.8)%0A%0A%20%20%20%20plt.suptitle(r'%24%5Cmathrm%7BAesthetic%5C%2Cvariations%5C%2Cfor%5C%2Cthe%5C%2Censemble%5C%2Caverage%7D%24'%2C%20fontsize%3D18%2C%20y%3D1.04)%0A%20%20%20%20plt.tight_layout()%0A%20%20%20%20plt.show()%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20**Exercise%203.**%20If%20an%20outlier%20is%20added%20to%20otherwise%20similar%20trials%2C%20which%20summary%20is%20generally%20less%20sensitive%3A%20mean%2FSD%20or%20median%2Fquartiles%3F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%2F%2F%2F%20details%20%7C%20Solution%20to%20Exercise%203%0A%0A%20%20%20%20The%20median%20and%20quartiles%20depend%20on%20ranks%20and%20are%20generally%20less%20sensitive%20to%20an%20extreme%20value.%20Neither%20summary%20removes%20the%20need%20to%20inspect%20why%20the%20trial%20differs.%0A%20%20%20%20%2F%2F%2F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20Instead%20of%20mean%20and%20standard%20deviation%20we%20can%20use%20median%20and%20the%20first%20and%20third%20quartiles%3A%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(np%2C%20plt%2C%20tn%2C%20yn)%3A%0A%20%20%20%20ym_1%20%3D%20np.median(yn%2C%20axis%3D1)%0A%20%20%20%20(yq1%2C%20yq3)%20%3D%20(np.abs(ym_1%20-%20np.percentile(yn%2C%2025%2C%201))%2C%20np.abs(np.percentile(yn%2C%2075%2C%201)%20-%20ym_1))%0A%20%20%20%20plt.figure(figsize%3D(9%2C%205))%0A%20%20%20%20plt.errorbar(tn%2C%20ym_1%2C%20np.vstack((yq1%2C%20yq3))%2C%20linewidth%3D2)%0A%20%20%20%20plt.xlabel('Cycle%20%5B%25%5D')%0A%20%20%20%20plt.title('Plot%20of%20ensemble%20average%20(median%20and%20quartiles)')%0A%20%20%20%20plt.show()%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20import%20marimo%20as%20mo%0A%0A%20%20%20%20return%20(mo%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Checkpoint%20questions%0A%0A%20%20%20%201.%20Does%20normalization%20preserve%20absolute%20movement%20duration%3F%0A%0A%20%20%20%202.%20Is%20mean%20%C2%B1%20SD%20a%2095%25%20confidence%20interval%3F%0A%0A%20%20%20%203.%20Should%20repeated%20trials%20from%20one%20person%20automatically%20count%20as%20independent%20participants%3F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%2F%2F%2F%20details%20%7C%20Checkpoint%20answers%0A%0A%20%20%20%201.%20No%3B%20keep%20the%20original%20durations%20separately.%0A%20%20%20%202.%20No.%0A%20%20%20%203.%20No%3B%20the%20unit%20of%20analysis%20matters.%0A%20%20%20%20%2F%2F%2F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Problems%0A%0A%20%20%20%20Try%20these%20independently%3B%20open%20a%20panel%20only%20to%20check%20your%20final%20answer.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20**Problem%201.**%20Four%20trials%20have%20values%201%2C%203%2C%205%2C%20and%207%20at%20one%20phase.%20Find%20their%20mean%20and%20median.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%2F%2F%2F%20details%20%7C%20Answer%20to%20Problem%201%0A%0A%20%20%20%20Mean%20%3D%204%3B%20median%20%3D%204.%0A%20%20%20%20%2F%2F%2F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20**Problem%202.**%20How%20many%20phase%20samples%20span%200%E2%80%93100%25%20inclusive%20with%20a%201%25%20interval%3F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%2F%2F%2F%20details%20%7C%20Answer%20to%20Problem%202%0A%0A%20%20%20%20101.%0A%20%20%20%20%2F%2F%2F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Go%20deeper%0A%0A%20%20%20%20Compare%20the%20mean%20and%20median%20displays%20using%20the%20same%20simulated%20trials.%0A%0A%20%20%20%20%23%23%23%20Video%20lectures%20on%20the%20Internet%0A%0A%20%20%20%20%5BMIT%20Introduction%20to%20Probability%20and%20Statistics%3A%20video%20lectures%5D(https%3A%2F%2Focw.mit.edu%2Fcourses%2F18-05-introduction-to-probability-and-statistics-spring-2022%2Fvideo_galleries%2Fvideo-lectures%2F)%20review%20averages%20and%20dispersion.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20References%0A%0A%20%20%20%20-%20%5BTime%20normalization%5D(https%3A%2F%2Fgithub.com%2Fdemotu%2Ftnorma).%0A%0A%20%20%20%20-%20%5BNumPy%20standard%20deviation%20and%20ddof%5D(https%3A%2F%2Fnumpy.org%2Fdoc%2Fstable%2Freference%2Fgenerated%2Fnumpy.std.html).%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
07c3c86e9750e9038f4a5b29166d84d4