I have the following homework problem:
The number of successes in $n$ trials is to be used to test the null hypothesis that the parameter $\theta$ of a binomial population equals 0.5 against the alternative that it does not equal 0.5.
a) find the likelihood ratio statistic.
b) use the result of part (a) to show that the critical region of the likelihood ratio test can be written as $x·lnx+(n−x)·ln(n−x) \geq K$.
Here's my attempt:
a) $\lambda =\frac{0.5^{n}}{(\frac{x}{n})^{x}(1-\frac{x}{n})^{n-x}}$ where I got the denominator from the fact that $\theta _{mle}=\frac{x}{n}$
b) the critical region is $\frac{0.5^{n}}{(\frac{x}{n})^{x}(1-\frac{x}{n})^{n-x}}\leq k$ which implies that ${(\frac{x}{n})^{x}(1-\frac{x}{n})^{n-x}}\leq \frac{0.5^{n}}{k}$. Then I tried taking the $log$ of both sides but the $log$ of the left side does not match what the question is asking for. Can anyone help?