Answer
The expected values are computed from the observed values, and they are based on the assumption that the two variables are independent.
The formula for computing the expected values for each cell is :
Expected value = $\frac{(row sum)(column sum)}{grand total}$.