Im having trouble calculating the variance for $X_m$ and $X_k$ for the following table:
"We now consider a random household and let the stochastic variables $X_k$ og $X_m$ be defined in the following way: $X_k$: The woman's working hours measured in hours per. week $X_m$: The man's working hours measured in hours per. week"

I calculated the marginal distribution for Xm: $$ P(X_m = 0) = 0.08$$ $$P(X_m = 20) = 0.12$$ $$P(X_m = 40) = 0.8$$ I've already calculated the mean for $X_m$, which i did by using the marginal distribution values $$\text{mean} = 0.08 \cdot 0 +0.12 \cdot 20 +0.8 \cdot 40 =34.4$$
Now i am to calculate the Variance, however it seems as though there are multiple variance formulas available however im not sure which to use.
There are two possible formulas for the variance. I will illustrate both.
Assuming $\mu = E(X_m) - 34.4,$ as you say, $V(X_m) = (.08)(0-34.4)^2 + (.12)(20-34.4)^2 +(.80)(40-34.4)^2 = 144.64.$
An alternate formula for the variance: $E(X_m^2) = (.08)0^2+(.12)20^2+(.8)40^2 = 1328$ $V(X_m) = E(X_m^2) - \mu^2 = 144.64.$
Simulation: As a check. With 10 million iterations, we can expect about four significant digits of accuracy. Thw mean of a very large sample should be approximately the same as the population mean. The variance of a very large sample should be approximately the same as the population variance. Agreement is satisfactory.