# Conditional Expectations of 2 Variables

• transmini
In summary: The book itself doesn't have an answer listed in the back of the book and I don't have a solutions manual, so I was relying on Chegg to check my answer. However, Chegg lists the answer as ##(1-p)e+p## and models ##\lambda## as a Bernoulli random variable. I don't see how making ##\lambda## a Bernoulli random variable makes sense, as nowhere in the problem do they mention ##\lambda## varies; it's always the same mean.Is my answer incorrect and Chegg's correct? If so, why would we follow Chegg's solution, rather than my own? Or is this just one of the many problem's

## Homework Statement

Suppose that the number of eggs laid by a certain insect has a Poisson distribution with mean ##\lambda##. The probability that anyone egg hatches is ##p##. Assume that the eggs hatch independently of one another. Find the expected value of ##Y##, the total number of eggs that hatch.

## Homework Equations

##E(Y_1) = E(E(Y_1|Y_2))##

## The Attempt at a Solution

Call ##Y_1 = Y## and ##Y_2 = N## with ##N## being the number of eggs laid.

Then ##E(Y|N=n) = \sum_{y=0}^{n} y(\frac{n!}{y!(n-y)!})p^y (1-p)^{n-y} = np##
since given that ##n## eggs are laid, the number of eggs hatching has a constant probability ##p## and thus the number of eggs that hatch would be a binomial distribution.

so ##E(Y) = E(E(Y|N=n)) = E(np) = pE(n) = p\sum_{n=0}^\infty ne^{-\lambda}\frac{\lambda^n}{n!}##
since the number of eggs laid is modeled by a Poisson distribution.
and then ##E(Y) = p\lambda##

The book itself doesn't have an answer listed in the back of the book and I don't have a solutions manual, so I was relying on Chegg to check my answer. However, Chegg lists the answer as ##(1-p)e+p## and models ##\lambda## as a Bernoulli random variable. I don't see how making ##\lambda## a Bernoulli random variable makes sense, as nowhere in the problem do they mention ##\lambda## varies; it's always the same mean.

Is my answer incorrect and Chegg's correct? If so, why would we follow Chegg's solution, rather than my own? Or is this just one of the many problem's Chegg has a wrong answer to?

What course / book is this associated with?

You are correct that the answer is in fact ##p \cdot \lambda##. There is a more elegant way of doing this problem via Poisson splitting, though setting up as a conditional expectation is a powerful general approach.

- - - -
If you need a book with solutions to check against (perhaps half of the problems as is common), there are a lot out there. Blitzstein has a good intro book...

StoneTemplePython said:
What course / book is this associated with?

You are correct that the answer is in fact ##p \cdot \lambda##. There is a more elegant way of doing this problem via Poisson splitting, though setting up as a conditional expectation is a powerful general approach.

- - - -
If you need a book with solutions to check against (perhaps half of the problems as is common), there are a lot out there. Blitzstein has a good intro book...

The book is Mathematical Statistics with Applications, 7th Edition - Wackerly, Mendenhall, Scheaffer. I just used the conditional expectation as that's what homework set it was assigned from. I don't think we've covered Poisson splitting yet.

transmini said:
The book is Mathematical Statistics with Applications, 7th Edition - Wackerly, Mendenhall, Scheaffer. I just used the conditional expectation as that's what homework set it was assigned from. I don't think we've covered Poisson splitting yet.

Your approach works fine. If it were me, doing this via conditioning I would have calculated

##E(Y|N=n) = E\big[ \mathbb I_1 + \mathbb I_2 + ...+ \mathbb I_n\big] =E\big[ \mathbb I_1\big] + E\big[\mathbb I_2\big] + ...+ E\big[\mathbb I_n\big] = p + p + ... + p = np ##

i.e. rather than using binomial distribution directly, decompose the result into a sum of coin tosses (indicator random variables) and then apply linearity of expectations, and then do the second leg as you have.
- - - -
with respect to the Chegg 'solution', an interesting check is to rerun the exact same argument on the complementary portion that don't hatch with probability ##q := (1-p)##

which gives

##(1-q)e+q##

we could associate this with a random variable ##Z## if you like.

The point is that we have a random variable ##X## that is poisson distributed with mean ##\lambda## but

##X = Y + Z##

In general for a decomposition like this ##Y## and ##Z## could be dependent, but expectations are linear, so we don't need to contemplate dependencies. Using the chegg solution you get

##E\big[X\big]= E\big[Y + Z\big] = E\big[Y\big[ + E\big[Z\big] =(1-p)e+p + (1-q)e+q = e + 1##

but in general you have

##\lambda = E\big[X\big] \neq e + 1##

transmini said:

## Homework Statement

Suppose that the number of eggs laid by a certain insect has a Poisson distribution with mean ##\lambda##. The probability that anyone egg hatches is ##p##. Assume that the eggs hatch independently of one another. Find the expected value of ##Y##, the total number of eggs that hatch.

## Homework Equations

##E(Y_1) = E(E(Y_1|Y_2))##

## The Attempt at a Solution

Call ##Y_1 = Y## and ##Y_2 = N## with ##N## being the number of eggs laid.

Then ##E(Y|N=n) = \sum_{y=0}^{n} y(\frac{n!}{y!(n-y)!})p^y (1-p)^{n-y} = np##
since given that ##n## eggs are laid, the number of eggs hatching has a constant probability ##p## and thus the number of eggs that hatch would be a binomial distribution.

so ##E(Y) = E(E(Y|N=n)) = E(np) = pE(n) = p\sum_{n=0}^\infty ne^{-\lambda}\frac{\lambda^n}{n!}##
since the number of eggs laid is modeled by a Poisson distribution.
and then ##E(Y) = p\lambda##

The book itself doesn't have an answer listed in the back of the book and I don't have a solutions manual, so I was relying on Chegg to check my answer. However, Chegg lists the answer as ##(1-p)e+p## and models ##\lambda## as a Bernoulli random variable. I don't see how making ##\lambda## a Bernoulli random variable makes sense, as nowhere in the problem do they mention ##\lambda## varies; it's always the same mean.

Is my answer incorrect and Chegg's correct? If so, why would we follow Chegg's solution, rather than my own? Or is this just one of the many problem's Chegg has a wrong answer to?

I am not familiar with Chegg's book (or whatever it is), but YOU are correct. In fact, you might like to prove a more useful result: ##Y## is itself a Poisson random variable with mean ##\lambda p.##

## What is the concept of conditional expectation of 2 variables?

The conditional expectation of 2 variables is a statistical concept that measures the expected value of one variable given the value of another variable. It is used to explore the relationship between two variables and understand how one variable affects the other.

## How is conditional expectation calculated?

The conditional expectation of 2 variables is calculated by taking the expected value of one variable, given the value of the other variable. This can be represented mathematically as E(Y|X) = ∑ y * P(Y=y | X=x), where Y is the dependent variable, X is the independent variable, and P(Y=y | X=x) is the probability of Y taking a specific value given X takes a specific value.

## What is the difference between conditional expectation and unconditional expectation?

The conditional expectation of 2 variables takes into account the value of one variable, while the unconditional expectation does not consider any specific value. In other words, the conditional expectation is calculated for a specific condition, while the unconditional expectation is calculated for all possible values of the variables.

## What is the significance of conditional expectation in statistical analysis?

Conditional expectation is an important tool in statistical analysis as it helps to understand the relationship between two variables. It can also be used to make predictions and identify patterns in data. Additionally, it allows us to control for the effects of one variable while analyzing the impact of another variable.

## What are some real-world applications of conditional expectation?

Conditional expectation is commonly used in fields such as economics, finance, and psychology. It can be applied to analyze consumer behavior, stock market trends, and human decision-making. It is also used in machine learning and data analysis to make predictions and identify patterns in large datasets.