# Thread: Generating functions...need some help here

1. ## Generating functions...need some help here

A textbook defines the generating function f of a random variable X as:

$f(\theta) = E[\theta^X] = \sum_{k} \theta^kP(X=k)$

Can anybody please explain that to me?

So far I know:
Generating function of random variable X can also be defined as:
$X(\theta) = x_0 + x_1 \theta + x_2 \theta^2 + x_3 \theta^3 + ...$

So if we do differentiation:
$X'(\theta) = x_1 + 2x_2 \theta + 3x_3 \theta^2 + ... = \sum_{k} kx_k \theta^{k-1}$

Taking $\theta = 1$,
$X'(1) = \sum_{k} kx_k = E[X]$

How is this related to the very first equation?

Any help is much appreciated.

2. Originally Posted by chopet
A textbook defines the generating function f of a random variable X as:

$f(\theta) = E[\theta^X] = \sum_{k} \theta^kP(X=k)$
What is your question? In this scenario, the generating function is just the expectation of the probability mass function.

3. ok. I am confused. I thought the equation was meant to be a generality of all cases, not just the case for "expectation of probability mass".

4. Originally Posted by chopet
A textbook defines the generating function f of a random variable X as:

$f(\theta) = E[\theta^X] = \sum_{k} \theta^kP(X=k)$

Can anybody please explain that to me?

So far I know:
Generating function of random variable X can also be defined as:
$X(\theta) = x_0 + x_1 \theta + x_2 \theta^2 + x_3 \theta^3 + ...$
Ask yourself: "What are the $x_i$'s here?"

RonL

5. Lemme try to reconstruct my understanding after your inputs.

X is random variable 0,1,2,3,... with corresponding probability densities $x_0, x_1, x_2, x_3...$ (which all add to 1).

We define the generating function of X as:
$X(\theta) = x_0 + x_1 \theta + x_2 \theta^2 + ...$

Turning it around, we can now see a new random variable $\theta^X$ (this is the key part which i couldn't see before), and the generating function is also the Expectation of this new variable, $E(\theta^X)$

Of course, this is not to be confused with E(X), which is derived from the differentiation of the 1st equation, and equating $\theta = 1$.

Am I correct?