# ::Free Statistics and Forecasting Software::

v1.2.1

### :: 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.

 Send output to: Browser Blue - Charts White Browser Black/White CSV Number of Tosses Probability Chart options Width: Height:

 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

 Cite this software as: Weldon Larry, (2017), The Law of Averages (v1.0.3) in Free Statistics Software (v1.2.1), Office for Research Development and Education, URL https://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
 To cite Wessa.net in publications use:Wessa, P. (2023), Free Statistics Software, Office for Research Development and Education, version 1.2.1, URL https://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.2.1Algorithms & Software : Patrick Wessa, PhDServer : www.wessa.net
 © Wessa.Net 2002-2023