I have an interesting question but I am a bit confused on a certain aspect of it and I am hoping I can get it cleared up. I am also not very confident in my answers so it is very possible I am making some big or small mistakes.
Suppose that in any 1 hour time period, either a person shows up to wait for a new doctor, or no one shows up, with probabilities $p$ and $(1-p)$ respectively.
Now suppose we check the waiting room after M hours, where $M$ is Poisson distributed with parameter $\lambda$.
I was asked,
What would
$P[S_{M}=k]$ be for $k=0,1,.... $and
$E[M|S_{M}=k]$
Il explain what I have and where I am confused now.
$P[S_{m}=0]=(1-p)^{m}$
$P[S_{m}=1]=(m | 1) (1-p)^{m-1}(p)$ . . .
$P[S_{m}=k]=(m|n)(1-p)^{m-k}(p)^{k}$
( where (m|k) stands for m choose k)
Now the issue here is that I am calculating the probability using little m, not big random variable M like in the question
But $P[S_{M}=k]= \sum_{m=k}^{\infty} P[S_{m}=k]P[M=m]$ moreover M is Poisson so we know its pdf.
So is that as simplified as I could make it?
Essentially, $$P[S_{M}=k]=P[S_{k}=k]P[M=k]+P[S_{k+1}=k]P[M=k+1]+...$$
For the expected value part I am more lost, so far I have used Bayes theorem to get that
$$P[M=m|S_{M}=k]= \frac{P[S_{m}=k]P[M=m]}{P[S_{M}=k]}$$
but this to isnt very neat, it consists of $(m|k)(1-p)^{m-k}(p)^{k} \lambda^{m}e^{- \lambda}/m!$ all divided by the original expression,
thus by best thought would be that using law of total expectation
$$E[M|S_{M}=k]=P(M=1|S_{M}=k)+2P(M=2)|S_{M}=k]+....$$
but again I am not sure this is clean or correct,
I am looking for some guidance and help on understanding either where I went wrong, or how to understand it better.
Also I believe I could represent M as a sum of the events that a person showed versus they did not. For example, could expressions for other such questions be asked such as the $E[M_{0}|S_{M}=k]$ where $M=M_{0}+M_{1}$ where these represent the total number of hours that a person did show up and the total hours that they did not, summed.
Thanks all in advance.