Test for independence
A member of the sport club decided to run a survey among his peers to investigate a strange thing he noticed - more males play squash than females. He decideds to find out if there is some relationship between the gender of a person and their favorite sport. The following table is a result of the survey.
Record of males and females answers to the question "Which sport is your favorite to play?"

The table shows a raw dataset - to make it useful, let's quantify the data in a two-way frequency table.
Observed frequencies table
This table shows the observed frequencies of the dataset. Notice the number of male squash players when compared to female squash players - is there a preference to playing squash dependent on the gender? Let's build a hypothesis for that.
The for our scenario is...
The
The for our scenario is...
Notice that we are not mentioning specific sports or specific genders - we are trying to cover all scenarios possible, so that there is no third hypothesis to influence our results.
The expected result
When we look at our observed numbers, one combination immediately stands out: squash. Almost three times as many male play squash as female.
So, what would these numbers look like if gender and sport choice had nothing to do with each other? To make a fair comparison, we have to keep the row and column totals the same. Changing the total number of men or women in our survey would change the whole picture we are trying to test, simply by changing the distribution of the genders (which might influence our view of the dataset).
Now that established that the totals are fixed, we can build a table of expected frequencies to compare against our observed frequencies. To find these expected frequencies, we simply keep the overall proportions from the totals the same. For the expected frequency of female playing squash, , the ratios looks like this:
where 21 is the total number of tennis players, 27 is the total number of females, 60 is the overall total. For all practical purposes, the GDC will find the expected frequencies for you.
Expected frequencies table
Now, we just use the 2WAY CHI test in our GDC to find the p-value and proceed as usual.