For testing independence, most software also reports another chi-squared statistic, called likelihood-ratio chi-squared. It equals
G2 = 2 ∑ [observed count × log (observed count / expected count)]
It has similar properties as the X2 statistic, such as
df = (r - 1) × (c - 1).
a. Show that G2 = X2 = 0 when each observed count = expected count.
b. Explain why in practice you would not expect to get exactly G2 = X2 = 0, even if the variables are truly independent.