Q:

Explicit conditional expectation formula with respect to $\sigma$-algebra

For some reason, I seem to be having a much more difficult time with the applied part of a question I'm working on than the theoretical part. The following is the first, theoretical part (Folland 3.17): given a measure space $(X, \mathcal{M},\mu)$ with $\mu$ $\sigma$-finite, and letting $\mathcal{N}$ be a $\sigma$-subalgebra and $\nu = \mu|_\mathcal{N}$ (where we assume $\nu$ to be $\sigma$-finite) , I have shown that for $f \in L^1(\mu)$ there exists a $\mathcal{N}$-measurable function $g \in L^1(\nu)$ (the conditional expectation of $f$) such that $\int_E f \, d\mu = \int_E g \, d\nu$ for $E \in \mathcal{N}$, namely $g = f \, d\mu/d\nu$.
The applied part where I'm stuck involves letting $X = \mathbb{Z}$, $\mathcal{M} = \mathcal{P}(X)$, $\mu$ be the counting measure, and $\mathcal{N} \subset \mathcal{M}$ be the collection of all $E \in \mathbb{Z}$ such that if $n$ is even then $n \in E$ $\Leftrightarrow$ $n+1 \in E$. The goal is to let $f,g$ be as above, and write $g$ explicitly in terms of $f$. The task seems so simple, yet I can't figure out how to apply what I've shown earlier to complete the task. Any help/tips would be appreciated.

A:

Note that for $E \in \mathcal{N}$ we have $$\int_E f d\mu = \sum_{z \in E}f(z)$$ because $\mu$ is counting measure.
Now note that $\mathcal{N}$ is countably generated by the atoms $\{ n,n+1 \}$ with $n$ an even integer. The conditional expectation $g$ of $f$ given $\mathcal{N}$ is constant on these atoms because it is $\mathcal{N}$-measurable. Therefore, for $z\in \{ n,n+1\} =: F$, 
$$g(z) = \frac{1}{\nu(F)} \int_Ffd\mu = \frac{1}{2}\sum_{z \in F}f(z).$$
We see that $g(z)$ is the average value of $f$ on the set $\{ n,n+1 \}$.

