The expectation of Random variable X under distribution P is defined as
E[X]=x∑xP[X=x]
If the random variable X is a function of other random variables z1,...,zn, and these have Joint distribution D, then we sometimes specify this in the subscript of the big E,
Ez1,...,zn∼D[X]=z1,...,zn∑X(z1,...,zn)D(z1,...,zn)