Presumably each integer is equally likely to be an output?
–
Daniel LittlewoodMar 4 '13 at 21:49

2

What is random in the question? What is its probability distribution? What do you know about $f$? If nothing more than you have written here, then there probably isn't any description of the expected value that is nicer than "the expected value of such-and-such".
–
Henning MakholmMar 4 '13 at 21:49

It looks like the range should be $[0,x-1]$, that is, that $x-1$ is included.
–
Ross MillikanMar 4 '13 at 22:00

The meaning of the question is not very clear (see the comments), perhaps due to some confusion between random variables and deterministic quantities. A way I can make sense of it is to consider a Markov chain $(X_n)_{n\geqslant0}$ such that $X_0=x$, for some $x\geqslant0$, and such that, conditionally on $X_{n-1}=y$, $X_n$ is uniformly distributed on $\{0,1,\ldots,y-1\}$ if $y\geqslant1$ and $X_n=0$ if $y=0$. The question would be to compute $\mathbb E(X_n)$ for every $n\geqslant0$. Could you confirm this is the model you have in mind?
–
DidMar 4 '13 at 22:48

According to an answer by the OP in the comments, the question is to consider a Markov chain $(X_n)_{n\geqslant0}$ such that $X_0=x$, for some $x\geqslant1$, and, for each $n\geqslant1$, conditionally on $X_{n-1}=y$, $X_n$ is uniformly distributed on $\{0,1,\ldots,y-1\}$ if $y\geqslant1$ and $X_n=0$ if $y=0$. The question is to compute $\mathbb E(X_n)$ for every $n\geqslant0$.

A standard approach is to note that $\mathbb E(X_n\mid X_{n-1}=0)=0$ and, for every $y\geqslant1$,
$$
\mathbb E(X_n\mid X_{n-1}=y)=\frac1y\sum_{k=0}^{y-1}k=\tfrac12(y-1).
$$
To sum up,
$$
2\mathbb E(X_n)=\mathbb E(X_{n-1}-1;X_{n-1}\geqslant1)=\mathbb E(X_{n-1})-1+\mathbb P(X_{n-1}=0).
$$
On the other hand, $\mathbb P(X_n=0\mid X_{n-1}=0)=1$ and, for every $y\geqslant1$,
$$
\mathbb P(X_n=0\mid X_{n-1}=y)=\frac1y,
$$
hence
$$
\mathbb P(X_n=0)=\mathbb P(X_{n-1}=0)+\mathbb E(1/X_{n-1};X_{n-1}\geqslant1).
$$
At this point it seems necessary to compute recursively $\mathbb E(1/X_{n};X_{n}\geqslant1)$ but I am suddenly not so sure that this would make the end of the road any nearer...