Application Center - Maplesoft

App Preview:

The Concept of Significance

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

Image 

 

 

> # The Concept of Significance
 

>
 

> restart;
 

>
 

> # 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!*(n-x)!)*(p^x*(1-p)^(n-x));
 

P(n, x) = `/`(`*`(factorial(n), `*`(`^`(p, x), `*`(`^`(`+`(1, `-`(p)), `+`(n, `-`(x)))))), `*`(factorial(x), `*`(factorial(`+`(n, `-`(x)))))) (1)
 

> # we P(n,x) is the corresponding element in the Pascal triangle.
 

>
 

>
 

> Example-1
 

> # We can calculate the probability of finding 10 heads in a 20 coin toss as
 

> n:=20: x:=10: v:=20-x+1:
 

> n!/(x!*(n-x)!)*(0.5^x*(1-0.5)^(n-x));
 

.1761970520 (2)
 

> # We can calculate the probability of finding 10 heads or more in a 20 coin toss as
 

> n:=20: x:=10:
 

> convert([seq(n!/(x!*(n-x)!)*(0.5^x*(1-0.5)^(n-x)),x=x..n)], '`+`' );
 

.5880985260 (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
 

>
 

>
 

> # Example-2
 

> # We can calculate the probability of finding 14 heads in a 20 coin toss as
 

> n:=20: x:=14: v:=20-x+1:
 

> n!/(x!*(n-x)!)*(0.5^x*(1-0.5)^(n-x));
 

0.3696441650e-1 (4)
 

> # We can calculate the probability of finding 14 heads or more in a 20 coin toss as
 

> n:=20: x:=14:
 

> convert([seq(n!/(x!*(n-x)!)*(0.5^x*(1-0.5)^(n-x)),x=x..n)], '`+`' );
 

0.5765914916e-1 (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.
 

>
 

>
 

> # Example-3
 

> # We can calculate the probability of finding 15 heads in a 20 coin toss as
 

> n:=20: x:=15: v:=20-x+1:
 

> n!/(x!*(n-x)!)*(0.5^x*(1-0.5)^(n-x));
 

0.1478576660e-1 (6)
 

> # We can calculate the probability of finding 15 heads or more in a 20 coin toss as
 

> n:=20: x:=15:
 

> convert([seq(n!/(x!*(n-x)!)*(0.5^x*(1-0.5)^(n-x)),x=x..n)], '`+`' );
 

0.2069473266e-1 (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.
 

>
 

>
 

>
 

> # Gambling Fallacy
 

> # 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 non-commercial, non-profit use only. Contact the authors for permission if you wish to use this application in for-profit activities.