# expectation of conditional probability

#### sangiobbe

##### New Member
Hi there,

I have two questions which I found answers to slightly different version of them in books but not to those that I have in mind so please pay attention in responding.

1) I like to calculate the expectation of conditional probability Pr(X|Y) for all values of Y. Meaning I want to integrate Pr(X|Y) over all positive Y. What is the formula for that? I found the answer to expectation of Pr(X|Y) for all values of X.
[you can consider any arbitrary probability function]

2) How can I calculate the probability of Pr(X|YZ)? Where Z and Y are two different dependent events. I found the answer to Pr(XY|Z).

Thank you

#### BGM

##### TS Contributor
Are all the X, Y, Z you mentioned in both questions are all events? Not random variable?

So what is the meaning of "for all values of Y"?

#### sangiobbe

##### New Member
No In first questions, X, Y and Z are random variables. Hence when I say all values of Y, I mean support of Y.

#### BGM

##### TS Contributor
So if X is a random variable, then X is not an event and thus

$$\Pr\{X|Y\}$$ is meaningless.

#### sangiobbe

##### New Member
It should be possible to represent events with an appropriate sigma-algebra and random variables. So if it helps consider that X, Y and Z are R.Vs.

#### BGM

##### TS Contributor
Ok anyway let $$A$$ to be an event.

Then you can compute $$g(y) \triangleq \Pr\{A|Y = y\} ~~ \forall y \in \mathcal{Y}$$
where $$\mathcal{Y}$$ is the support.

Note that this is just a function of $$y$$ define on the support. So you can replace it by the random variable and define
$$g(Y) \triangleq \Pr\{A|Y\}$$ to be another random variable on [0,1] transformed from Y. So we can always talk about the expectation:
$$E[g(Y)] = E[\Pr\{A|Y\}]$$

#### sangiobbe

##### New Member
Thanks and do you have also an answer to the second question?

#### BGM

##### TS Contributor
Which one is event? Which one is random variable?

#### sangiobbe

##### New Member
Let me try to explain it with following story from economics:
Suppose there are two states of the world High (H) and Low (L). There are two firms competing in a market charging p1 and p2 as their prices.
I like to know the probability of state H when firm one charges p1 and firm 2 charges p2. Pr(H|p1,p2)?
Therefore given my notations in the above post, X is the event, and Y and Z are random variables.

#### sangiobbe

##### New Member
BTW, are you writing symbols in your post in Latex? Do you put the syntax in between dollar sign? I am new to posting math in forums. I don't know how I can write symbols in here.

#### BGM

##### TS Contributor
In this forum those math latex code is wrapped by the pair of tags
[noparse] [/noparse]

#### Dason

,
, $$, and$$[/noparse] tags without having to add extra spaces and stuff. I think bryangoodrich was the one that introduced me to the noparse tags.