I'm not sure I understand what you're asking? You need to know the distribution of the test statistic ( or ) under the null hypothesis. This can be done in a number of ways (some obviously less practical than others depending on the size of n):

1. Enumerate the possibilities.

2. Use a table of critical values.

3. Use appropriate software.

4. A normal approximation can be used. It is found that if is true then

~

and that this approximation (with continuity correction) is adequat for .