Power of an experiment quantifies the chance that you will reject the null hypothesis if some alternative hypothesis is really true. It refers to the ability of a study to detect a difference that is real and is the likelihood of avoiding a false negative.
The statistical power is the ability of a test to detect an effect, if the effect actually exists. Power analysis can either be retrospective or prospective.
Prospective analysis is often used to determine a required sample size to achieve target statistical power, while a retrospective analysis computes the statistical power of a test given sample size and effect size.

Consider several samples of the same size from a given population and compute some statistic t for each of these samples. Let t$_{1}$, t$_{2}$....., t$_{k}$ be the values of the statistic for these samples. Each of these values may be used to test some null hypothesis H$_{0}$. Some values may lead to the rejection of $H_{0}$ while others may lead to acceptance of $H_{0}$. These sample statistics $t_{1}$, $t_{2}$....., t$_{k}$ may be divided into two mutually disjoint groups, one leading to the rejection of $H_{0}$ and the other leading to acceptance of $H_{0}$. The statistics which lead to the rejection of $H_{0}$ give us a region called Critical region $(C)$ or Rejection region $(R)$, while those which lead to the acceptance of $H_{0}$ give us a region called Acceptance region $(A)$. Thus if the statistic t $\in$ $C$, $H_{0}$ is rejected and if t $\in$ $A$, $H_{0}$ is accepted.
The sizes of type 1 and type 2 errors in terms of the critical region are defined below.
$\alpha$ = $P$[Rejecting $H_{0}$ when $H_{0}$ is true]

= $P$[Rejecting $\frac{H_{0}}{H_{0}}$]

= $P$[ $t \in$ $\frac{C}{H_{0}}$]

and $\beta$ = $P$[Accepting $H_{0}$ when $H_{0}$ is wrong]
=$P$[Accepting $H_{0}$ when $H_{1}$ is true]

= $P$[Accepting $\frac{H_{0}}{H_{1}}$]

= $P$[ $t \in$ $\frac{A}{H_{1}}$]

where $C$ is the critical region, $A$ is acceptance region and $C \cap A$ = $\phi$, $C \cup A$ = $S$ (sample space)
The value of test statistic which separates the critical region and the acceptance region is called the critical value or significant value.
It depends upon :

1) The level of significance used and
2) The alternative hypothesis, whether it is two-tailed or single-tailed.
For large samples ($n$ > 30), the standardised variable corresponding to the statistic $t$,

$Z$ = $\frac{t - E(t)}{S.E.(t)}$  $\sim$ $N$(0,1)  asympotically as n tends to infinity.

Value of $Z$ under the null hypothesis is known as test statistic. The critical value of the test statistic at level of significance $\alpha$ for a two tailed test is given by $Z_{\alpha}$, where $Z_{\alpha}$ is determined by the equation:

$P$(|$Z$| > $Z_{\alpha}$) = $\alpha$

$Z_{\alpha}$ is the value so that the total area of the critical region on both tails is $\alpha$. Since normal probability curve is a symmetrical curve.

$P$($Z$ > $Z_{\alpha}$) + $P$($Z$ < - $Z_{\alpha}$) = $\alpha$

= $P$($Z$ > $Z_{\alpha}$) + $P$($Z$ > $Z_{\alpha}$) = $\alpha$  (By symmetry)

2$P$ ($Z$ > $Z_{\alpha}$) = $\alpha$

$P$ ($Z$ > $Z_{\alpha}$) = $\frac{\alpha}{2}$

In case of single tail alternative we have,

Right tailed test : $P$($Z$ > $Z_{\alpha}$)  = $\alpha$

Left tailed test : $P$($Z$ < - $Z_{\alpha}$) = $\alpha$

Critical values of $Z$ at commonly used levels of significance for both two tailed and single tailed tests using normal probability tables are listed below:
Level of Significance
Example 1 : In order to test whether a coin is perfect, it is tossed 5 times. The null hypothesis of perfectness of the coin is accepted if and only if atmost 3 heads are obtained. Find the power of the test corresponding to the alternative hypothesis when the probability of head is 0.4.

Solution : Let $X$ : Number of heads in $n$ = 5 tosses of a coin
$p$ = Probability of a head in a random toss of the coin

Null hypothesis $H_{0}$ : $p$ = $\frac{1}{2}$
Alternative hypothesis $H_{1}$ : $p$ = 0.4
Critical region : $X$ > 3
Power of the test for testing $H_{0}$ against $H_{1}$ is given by

1 - $\beta$ = P(Reject $H_{0}$ when $H_{1}$ is true)

= $P$ (Reject $\frac{H_{0}}{H_{1}}$)

= $P$( $X$ > 3 / $p$ = 0.4)

= $\sum_{r=4}^{5} ^{5}C_{r}(0.4)^{r}(0.6)^{5-r}$

= $^{5}C_{4}$(0.4$)^{4}$(0.6) + (0.4)$^{5}$

= 5 $\times$ ($\frac{4}{10}$)$^{4}$ $\times$ $\frac{6}{10}$ + ($\frac{4}{10}$)$^{5}$

= ($\frac{2}{5}$)$^{4}$ [3 + $\frac{2}{5}$]

= $\frac{272}{3125}$

 Example 2 : A fair coin is tossed 5 times, if more than 4 heads are obtained the null hypothesis will be rejected. Obtain the critical region.

Solution : Let $X$ denote the number of heads obtained is 5 tosses of a coin
$H_{0}$ : The coin is perfect
$H_{0}$ : $p$ =$\frac{1}{2}$

Under $H_{0}$, $X$ $\sim$ $B$( $n$ = 5, $p$ = $\frac{1}{2}$)

$P$($X$ = $x$ / $H_{0}$) = $^{n}C_{x}$ p$^{x}$ q$^{n - x}$      
  
= $^{5}C_{x}$ ($\frac{1}{2}$$^{x}$) ($\frac{1}{2}$$^{5-x}$)

$P$($X = x$ / $H_{0}$)  = $^{5}C_{x}$ $\times$ $\frac{1}{2}$$^{5}$

= $^{5}C_{x}$ $\times$ $\frac{1}{32}$$^{5}$

We need to find the critical region.
Critical region is also known as the rejection region.

Reject $H_{0}$ if more than 4 heads are obtained
Critical Region = {$X$ > 4} = {$X$ > 5}