7. (12%) To test the hypothesis that a coin is fair (i.e., p = 0.5) by a number of tosses of the coin, we wish to impose the following restrictions:
(1) The probability of rejecting the hypothesis when it is actually correct must be 0.05 at most.
(2) The probability of accepting the hypothesis when actually p differs from 0.5 by 0.1 or more
(i.e., p ≥ 0.6 or p ≤ 0.4) must be 0.05 at most.
Determine the minimum sample size that is necessary, and state the resulting decision rule?