title: Finding maximum difference between power functions
body: <p>How do I estimate the maximum difference between the power functions?
  (power of CLT test and power of binomial test, n=40)</p>
  
  <pre><code>power.z = function(mu,n) {
    power = 1 - pnorm( 1.645 - (mu - 75)/(2.5/sqrt(n)) , 0, 1)
    return(power)
  }
  
  power.bin = function(mu,n) {
    p = 1 - pnorm(75, mu, 2.5)
    power = 1 - pnorm( 1.645*sqrt(.25/(p*(1-p))) - (p-.5)/sqrt(p*(1-p)/n), 0, 1)
    return(power)
  }
  
  power.z(75.8, 40)   ## 0.6476032
  power.bin(75.8, 40) ## 0.4763833
  </code></pre>