# ::Free Statistics and Forecasting Software::

v1.1.23-r7
Secure website (SSL) | Donate to wessa.net

### :: Law of Averages - Free Statistics Software (Calculator) ::

All rights reserved. The non-commercial (academic) use of this software is free of charge. The only thing that is asked in return is to cite this software when results are used in publications.

The classic textbook by Freedman, Pisani and Purves called this version of the convergence of means the 'law of averages'. It was to dispel the myth that, for example, a large number of tosses of a fair coin would result in an equal number of heads and tails. It also shows that the symmetric random walk creates apparent trends much like stock market prices, even though using these trends for prediction would be folly since the expectation over the future is just the most recent value.

 Number of Tosses Probability Chart options Width: Height:

Click here to edit the underlying code of this R Module.

 Source code of R module n <- as.numeric(par1) p <- as.numeric(par2) heads=rbinom(n-1,1,p) a=2*(heads)-1 b=diffinv(a,xi=0) c=1:n pheads=(diffinv(heads,xi=.5))/c bitmap(file="test1.png") op=par(mfrow=c(2,1)) plot(c,b,type="n",main="Law of Averages",xlab="Toss Number",ylab="Excess of Heads",lwd=2,cex.lab=1.5,cex.main=2) lines(c,b,col="red") lines(c,rep(0,n),col="black") plot(c,pheads,type="n",xlab="Toss Number",ylab="Proportion of Heads",lwd=2,cex.lab=1.5) lines(c,pheads,col="blue") lines(c,rep(.5,n),col="black") par(op) dev.off()
 Top | Output | Charts | References | History | Feedback

 Cite this software as: Weldon Larry, (2008), The Law of Averages (v1.0.2) in Free Statistics Software (v1.1.23-r7), Office for Research Development and Education, URL http://www.wessa.net/rwasp_rwalk.wasp/ The R code is based on : Weldon Larry, Stat Ed Programs for Demos in R, Simon Fraser University, URL http://www.stat.sfu.ca/~weldon/title.doc Weldon Larry, R Programs for Statistics Education, Simon Fraser University, URL http://www.stat.sfu.ca/~weldon/Programs Weldon Larry, Instructions for using R programs for Statistics Education, Simon Fraser University, URL http://www.stat.sfu.ca/~weldon/instructions.doc
 Top | Output | Charts | References | History | Feedback
 Top | Output | Charts | References | History | Feedback
 To cite Wessa.net in publications use:Wessa, P. (2013), Free Statistics Software, Office for Research Development and Education, version 1.1.23-r7, URL http://www.wessa.net/ © All rights reserved. Academic license for non-commercial use only. The free use of the scientific content, services, and applications in this website is granted for non commercial use only. In any case, the source (url) should always be clearly displayed. Under no circumstances are you allowed to reproduce, copy or redistribute the design, layout, or any content of this website (for commercial use) including any materials contained herein without the express written permission. Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. We make no warranties or representations as to the accuracy or completeness of such information (or software), and it assumes no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site. Software Version : 1.1.23-r7Algorithms & Software : Patrick Wessa, PhDServer : www.wessa.net
 © Wessa.Net 2002-2013

 [Select module] Main Menu Equation Plotter   Scientific Forecasting   Descriptive Statistics -Central Tendency -Variability -Skewness/Kurtosis -Quartiles -Percentiles -Stem and Leaf -Histogram -Kernel Density -Harrell-Davis -Univariate EDA -Bootstrap -Blocked Bootstrap -Mean Plot -SD Plot -(P)ACF -Spectrum -SD Mean-Plot -Variance Reduction -Correlation -Kendall Rank Corr. -Simple Regression -Bivariate KDE -Box-Cox Linearity -Regression Validation -Back-Back Histo. -Partial Correlation -Trivariate Scatter -Kendall tau Matrix -Notched Boxplots -Star Plot   Distributions -Normal ML Fit -Beta ML Fit -Cauchy ML Fit -Exponential ML Fit -Gamma ML Fit -Lognormal ML Fit -Logistic ML Fit -Neg. Binom. ML Fit -Poisson ML Fit -Weibull ML Fit -Tukey lambda PPCC -Box-Cox Normality   Hypothesis Tests -Mean -Skewness/Kurtosis   Multiple Regression -Estimate Equation   About this server

 Home Page Equation Plotter Time Series Analysis Multiple Regression Descriptive Statistics Statistical Distributions Hypothesis Testing Simon Fraser University Aston University Academic citations Computations Archive Search Computations R Project FAQ About Wessa.net Powered by Linux Server status page Any R Server'Herman Ole Andreas Wold''Gwilym Jenkins''Sir Ronald Aylmer Fisher''George Udny Yule''Gertrude Mary Cox''Sir Maurice George Kendall'Installed PackagesHistory list Edit R Code