## Likelihood Ratio Statistic & P-value

Good day everyone, and thank you for taking the time to look at my question.

1. The problem statement, all variables and given/known data

2. Relevant equations
So far I have only worked on question 1, as I was not able to solve it.
The likelihood ratio test statistic is defined as follows:
λ = 2 Log(L(theta-hat)/L(theta-hat_0))
Where L is the likelihood function, the product of all the pdfs/pmfs, and theta-hat is the maximum likelikhood estimator, the value of theta that maximizes the likelihood function. Theta-hat_0 is the same, but it is restricted to be in accordance with the H0 hypothesis.

I sincerely apologize for the lack of Latex, I am still learning how to work with it, I hope it didn't make it too vague. The definition of wikipedia is equivalent, and might be more clear?

3. The attempt at a solution

Alright, so what I've done so far is define the likelihood function as the product of the two pmfs, and I took theta to consist of p1 and p2, although I'm not sure that is allowed? Should I instead use theta = p1-p2?
L(p1,p2) =

Now, finding theta-hat, I just took derivatives with respect to p1 and p2, and set it to zero. It gave me p1 = x / m and p2 = y / n.
I then did the same for theta-hat_0, but I first set p1 = p2 which gave me theta-hat_0 = (x+y) / (m+n)

However, plugging this all into the expression for λ doesn't give me a very pretty expression, which tells me that maybe I'm doing something wrong.

I get λ =

Could anyone indicate where I went wrong, if this is wrong? Maybe I'm not seeing some of the trivial simplifications here.
Filling it all in though, I get a value of around 2, which isn't too bad I guess. However, the next part with the P-values I don't understand. Looking at my book, which describes it in a rather vague way in my opinion, it has to do with the chi-square function and degrees of freedom?

Thank you

Edit: If it clarifies, I could post what my lamda is without filling in the values, but its basically 2Log of the pmfs multiplied with p1 = x/m, p2 = y/n, divided by the pmfs multiplied with p1 = p2 = m+n/(x+y)
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "http://mathhelpforum.com/advanced-statistics/218841-likelihood-ratio-statistic-p-value.html", "fetch_time": 1481233526000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2016-50/segments/1480698542655.88/warc/CC-MAIN-20161202170902-00262-ip-10-31-129-80.ec2.internal.warc.gz", "warc_record_offset": 172473888, "warc_record_length": 10501, "token_count": 550, "char_count": 2122, "score": 3.875, "int_score": 4, "crawl": "CC-MAIN-2016-50", "snapshot_type": "longest", "language": "en", "language_score": 0.9714083671569824, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00031-of-00064.parquet"}