# Likelihood ratio test for sex ratio

I am trying to solve this problem: Assume that each child is male with probability $p$ independently of all other children.

We observed 19711 male births out of a total of 38562 births in American families with two children each. Use the likelihood ratio test statistic to test the hypothesis $H_0: p=1/2$ against a suitable alternative, which you should specify.

We also found 17703 males out of 35042 similar births in Finland. Use the generalised likelihood ratio test to test the hypothesis that $p$ has the same value in each country versus a suitable alternative.

For the first part we have $X_1,..X_{38562}$ I.I.D. r.v. with distribution $\mathrm{Ber}(p)$.

The alternative hypothesis should be $H_1 : p \in [0,1]$.

Now as we know that the sample mean is the MLE for Bernoulli distributions, we have likelihood ratio, with $n= 38562$: $$\displaystyle \lambda(X)= \frac{(1/2)^n}{\overline x^{\sum x_i} \cdot (1-\overline x)^{(n-\sum x_i)} }$$ So the likelihood ratio statistic is: $$\Lambda(X) = -2 \log(\lambda(X))$$ Hence our test is that we reject $H_0$ iff $\Lambda(x) \geq k$ for a constant $k$ such that $$P(\chi^2_1 \geq k) = \alpha.$$ Where $\alpha$ is the required size. We can do that as $n$ is large and we know that the likelihood ratio statistic converges in distribution to the chi squared with 1 degree of freedom

(QUESTION: the degrees of freedom should be $\mathrm{Dim}([0,1])- \mathrm{Dim}({1/2})= \mathrm{Dim}([0,1])$ why do we assign dimension 1 to this? I think we do, because otherwise 0 degrees of freedom wouldn't make much sense...)

I thought a sensible choice of $\alpha$ would be 0.05 so I worked out $k= 3.841$.

How do I proceed now? Putting the values in the likelihood ratio statistic leads to impossible calculations...

Any advice on this last bit or on the following part would be really appreciated!!

What's "impossible"? If you mean you're trying to calculate a numerical value for the likelihood & then take its logarithm, then the numbers involved will be stupidly big. Work out an expression for the log-likelihood first - using $\log(x^y)=y\log(x)$ &c. - & then put the numbers in.
The degrees of freedom are 1 because under the alternative you have one free parameter ($p$), & under the null no free parameters - $p$ is constrained to be $\frac{1}{2}$.