> 
# The Concept of Significance 
> 
# We can calculate the probability of finding x heads in a n random coin toss (p=0.5) as follows: 
> 
P(n,x)=n!/(x!*(nx)!)*(p^x*(1p)^(nx)); 

(1) 
> 
# we P(n,x) is the corresponding element in the Pascal triangle. 
> 
# We can calculate the probability of finding 10 heads in a 20 coin toss as 
> 
n:=20: x:=10: v:=20x+1: 
> 
n!/(x!*(nx)!)*(0.5^x*(10.5)^(nx)); 

(2) 
> 
# We can calculate the probability of finding 10 heads or more in a 20 coin toss as 
> 
convert([seq(n!/(x!*(nx)!)*(0.5^x*(10.5)^(nx)),x=x..n)], '`+`' ); 

(3) 
> 
# If that probability is lower than 0.05 then we can claim with 95% certainty # that the coin most likely is not random. In this case the coin is random 
> 
# We can calculate the probability of finding 14 heads in a 20 coin toss as 
> 
n:=20: x:=14: v:=20x+1: 
> 
n!/(x!*(nx)!)*(0.5^x*(10.5)^(nx)); 

(4) 
> 
# We can calculate the probability of finding 14 heads or more in a 20 coin toss as 
> 
convert([seq(n!/(x!*(nx)!)*(0.5^x*(10.5)^(nx)),x=x..n)], '`+`' ); 

(5) 
> 
# If that probability is lower than 0.05 then we can claim with 95% certainty # that the coin most likely is not random. In this case the coin is random. 
> 
# We can calculate the probability of finding 15 heads in a 20 coin toss as 
> 
n:=20: x:=15: v:=20x+1: 
> 
n!/(x!*(nx)!)*(0.5^x*(10.5)^(nx)); 

(6) 
> 
# We can calculate the probability of finding 15 heads or more in a 20 coin toss as 
> 
convert([seq(n!/(x!*(nx)!)*(0.5^x*(10.5)^(nx)),x=x..n)], '`+`' ); 

(7) 
> 
# If that probability is lower than 0.05 then we can claim with 95% certainty # that the coin most likely is not random. In this case the coin is not random. 
> 
# If we conclude that the process is random then the outcome in each period is completly random. 
> 
# This means that we cannot quantify the probability of geting a head in the next period because the # outcome an all periods are completly random. However if we can prove that the outcome has not been generated by a random process then we can quantify the probability of sucess without falling in to the gambling fallacy. 
Legal Notice: The copyright for this application is owned by the authors. Neither Maplesoft nor the authors are responsible for any errors contained within and are not liable for any damages resulting from the use of this material. This application is intended for noncommercial, nonprofit use only. Contact the authors for permission if you wish to use this application in forprofit activities.