Historical Note (as told by Chris Olsen):
The Chi-square statistic was invented by Karl Pearson about 1900. Pearson knew what the Chi-square distribution looks like, but he was unsure about the degrees of freedom.
About 15 years later, Fisher got involved. He and Pearson were unable to agree on the degrees of freedom for the two-by-two table, and they could not settle the issue mathematically. Pearson believed there was 1 degree of freedom and Fisher 3 degrees of freedom.
They had no nice way to do simulations, which would be the modern approach, so Fisher looked at lots of data in two-by-two tables where the variables were thought to be
independent. For each table he calculated the Chi-square statistic. Recall that the expected value for the Chi-square statistic is the degrees of freedom. After collecting many Chi-square values, Fisher averaged all the values and got a result he described as “embarrassingly close to 1.”
This confirmed that there is one degree of freedom for a two-by-two table. Some years later this result was proved mathematically.