Why Null Hypothesis for contingency tables is 'independent'? For contingency tables I don't understand why the Null Hypothesis is 'independent'.
We calculate Sum(Observed^2 / Expected) - N and compare this with the chi-squared distribution table.
Let's say:
Sum(Observed^2 / Expected) - N = 4
Chi-square value = 5.1
So 4 < 5.1 and we do NOT reject the Null Hypothesis, they are independent.
But if 4 < 5.1, then the difference between all Observed and Expected is smaller than our Critical Value, so surely they are correlated and therefore not independent?
ADDITIONAL INFORMATION
I got confused because I was doing this question:

and in the answer:

they state the Null Hypothesis is "no difference", which read like they are not independent?

The values you call "expected" are more precisely the values we'd expect if the rows and columns of the contingency table were independent. (The logic is: if the $i^{\text{th}}$ row has a $\frac{R_i}{N}$ fraction of the values, and the $j^{\text{th}}$ column has a $\frac{C_j}{N}$ fraction of the values, and these are independent, then we expect a $\frac{R_i}{N} \cdot \frac{C_j}{N}$ fraction of the values in the $(i,j)$ cell. That corresponds to an expected count of $\frac{R_i}{N} \cdot \frac{C_j}{N} \cdot N = \frac{R_i \cdot C_j}{N}$.)
So if the "observed" values are close to the "expected" values, that means that the data we actually see is consistent with what we'd expect to see if we have independence. So the null hypothesis is not ruled out.

Why does "no difference" correspond to "independent"? More precisely, "no difference between the two rows" corresponds to "independence between rows and columns".
The null hypothesis says "there is no difference in preference between the two genders". So for example the event "a random viewer is male" and the event "a random viewer prefers Stranded" are independent: knowing that the random viewer is male gives no information about the viewer's preferences.

Side notes:

*

*I'm not sure why it's clear to you that from $\chi^2 = \sum_i \frac{O_i^2}{E_i} - N$ being small, we conclude that $O_i$ (the observed values) are close to $E_i$ (the expected values). It's the right conclusion! But it's easier to see from the equivalent formula $\chi^2 = \sum_i \frac{(O_i - E_i)^2}{E_i}$: if this is small, then every $(O_i - E_i)^2$ must be small.

*A correction - when we don't reject the null hypothesis, we don't conclude that the rows and columns are independent. We simply say "this is not sufficient evidence to conclude that they're not independent".

