Poisson random variable self-study question You  are invited to a party. Suppose the times at which invitees arrives are independent uniform(0,1) random variables. Suppose that aside from yourself the number of other people who are invited is a Poisson random variable with mean 10.
I want to find out


*

*The expected number of people who arrive before you

*The probability that you are the nth person to arrive


Answer: 


*

*Let X be the number of people who arrive before you.Because you are equally likely to be the first,second,or third,...,or nth arrival.
P{X=I}=$\frac1n\displaystyle\sum^n_1 i =\frac{n(n+1)}{2n}, i  =0,...,n$
Therefore
E[X]=$\frac{n+1}{2}$
and

*P{X=n}=$\frac{e^{-10}10^n}{n!}$ 
Are these answers correct? The author has not provided the correct answers.
 A: To check (1), note that the expected number of people arriving after you must equal the expected number of people arriving before you and that the sum of those is the expected number of people (besides yourself), which the problem states is equal to 10. Therefore the answer must be $10/2=5$.
For (2), use the hint you provided in your tags: these are conditional-probability problems.  Thus, we partition the event "I am the $n^\text{th}$ person to arrive" into the disjoint events

*

*"I am at position $n$" and "$k-1=n-1$ people arrive with me",

*"I am at position $n$" and "$k-1=n$ people arrive with me",

*"I am at position $n$" and "$k-1=n+1$ people arrive with me",  etc,

with $k=n, n+1, n+2, \ldots$.  Each of those events "$k-1$ people arrive with me" occurs with the Poisson probability associated with $k-1$.  Conditional on $k-1$, the chance that I am in position $n$ is the same as the chance that anyone else is in that position, which therefore must be $1/k$ when there are $k-1$ people plus myself.
In terms of $\lambda=10$ and letting $X$ be a Poisson$(\lambda)$ variable with distribution function $F_\lambda$, the answer therefore is
$$\sum_{k=n}^\infty \frac{1}{k} e^{-\lambda} \frac{\lambda^{k-1}}{(k-1)!}=\frac{1}{\lambda}e^{-\lambda}\sum_{k=n}^\infty \frac{\lambda^k}{k!}=\frac{1}{\lambda}\Pr(X\ge n) = \frac{1}{\lambda}(1-F_\lambda(n-1)).$$
A well-known relationship between the Poisson distribution and the Gamma distribution equates this to
$$\frac{1}{\lambda}(1-F_\lambda(n-1)) = \frac{1}{\lambda}\Gamma(\lambda;n)$$
where
$$\Gamma(\lambda;n) = \frac{1}{\Gamma(n)}\int_0^\lambda t^{n-1} e^{-t}\,\mathrm{d}t$$
is the Gamma distribution of parameter $x$.  Being proportional to a $\chi^2$ probability, which is a basic statistical computation, it can be obtained with just about any statistical software, as illustrated in R here, using its pgamma function.

library(data.table)
library(ggplot2)
lambda <- 10 # The Poisson parameter
x <- 1:30
X <- data.table(n=rep(x, 3), lambda=rep(c(5,10,20), each=length(x)))
#
# Here is where the chances are calculated.
#
X[, probability := pgamma(lambda, n)/lambda]
#
# Plot them.
#
ggplot(X, aes(n, probability)) + 
  geom_point(aes(color=factor(lambda)), size=2, alpha=0.8) + 
  guides(color=guide_legend(title=expression(lambda), title.vjust=0)) + 
  theme(legend.title=element_text(size=24)) + 
  ggtitle("(Unconditional) Chance of Being n in Line")

A: This is not a full answer, but may help you get there.
Say $N$ is the total number of people invited to the party, and $n$ is your position in the arrival sequence. Then from your setup we have that $N-1$ is Poisson distributed with mean 10. So you can answer your questions in two steps: First, you can compute the answers conditional on knowing $N$. Then, you must compute the final answers by incorporating the distribution of $N$.
Your post addresses only the first part. You are correct that $\Pr[n|N]=\frac{1}{N}$, and $\langle n|N\rangle=\frac{N+1}{2}$. To finish, you now need to incorporate the distribution of $N$.
(You also need to account for some unit offsets, i.e. it is $n-1$ people who arrive before you, and it is $N-1$ which is Poisson distributed).
Hope this helps!
A: Here's my attempt. Let's assume that the number of invitees (excluding you) to the party, $N$, is Poisson distributed with parameter $\lambda$:
$$N\sim \text{POI}(\lambda)$$
Let's further assume that all those invited actually attend the party. Moreover, let the arrival time of you and all other party attendees be uniformly distributed:
$$T_{i}\sim U(0,1)$$
where $i=1,2,\ldots,(N+1)$. Given that all the arrival times are independent and identically distributed, each attendee must equally share the probability of being the $i$th to arrive. Therefore, the probability of being the $i$th attendee, given $N$, is:
$$\text{Pr}(X=i\,|\,N=n)=\frac{1}{n+1}$$
where $i=1,2,\ldots,(n+1)$. Now, this is the conditional distribution. From here we can calculate the joint distribution:
$$\begin{align}
\text{Pr}(X=i,\,N=n)&=\text{Pr}(X=i\,|\,N=n)\cdot\text{Pr}(N=n)\notag\\
&=\bigg(\frac{1}{1+n}\bigg)\bigg(\frac{\lambda^{n}e^{-\lambda}}{n!}\bigg)
\end{align}$$
To arrive at the marginal distribution for $X$ we need to sum across all values for $N$:
$$\begin{align}
\text{Pr}(X=i)&=\sum_{n=i}^{\infty}\text{Pr}(X=i,\,\,N=n)\notag\\
&=\sum_{n=i}^{\infty}\bigg(\frac{1}{1+n}\bigg)\bigg(\frac{\lambda^{n}e^{-\lambda}}{n!}\bigg)
\end{align}$$
Note that the lower bound of the summation is that way because in order for you to have an $i$th placing, $n$ has to be larger than or equal to $i$. This is the answer to your second question. Finally, we can calculate the expected value of your arrival rank relative to the other attendees:
$$\begin{align}
E[X]&=\sum_{i=0}^{\infty}\sum_{n=i}^{\infty}\text{Pr}(X=i,\,\,N=n)\cdot i\notag\\
&=\sum_{i=0}^{\infty}\sum_{n=i}^{\infty}\bigg(\frac{1}{1+n}\bigg)\bigg(\frac{\lambda^{n}e^{-\lambda}}{n!}\bigg)\cdot i
\end{align}$$
Now the above expression may not seem very tractable. But due to the independent and identical distribution of the arrival times we can state the expected number of arrivals after you is the same as the expected number of arrivals before you. Therefore, by symmetry, the expected value of your rank relative to the other attendees can be reasoned as follows:


*

*If $\lambda=0$, then you would expect on average to be the first attendee i.e. $E[X]=1$.

*If $\lambda=1$, then you would expect on average be the first attendee half the time and the second attendee the other half i.e. $E[X]=1.5$.

*If $\lambda=2$, then you would expect on average be the first attendee a third of the time and the second attendee a third of the time and the third attendee a third of the time i.e. $E[X]=2$.


And so on...Thus you arrive at:
$$\begin{align}
E[X]&=\frac{\lambda}{2}+1
\end{align}$$
Interestingly, you verify this expression by evaluating the previously derived expression:
$$\begin{align}
E[X]&=\sum_{i=0}^{\infty}\sum_{n=i}^{\infty}\bigg(\frac{1}{1+n}\bigg)\bigg(\frac{\lambda^{n}e^{-\lambda}}{n!}\bigg)\cdot i\\
&=\frac{1}{\lambda}\sum_{i=0}^{\infty}\sum_{n=i}^{\infty}\bigg(\frac{\lambda^{n+1}e^{-\lambda}}{(n+1)!}\bigg)\cdot i\\
&=\frac{1}{\lambda}\sum_{n=0}^{\infty}\sum_{i=0}^{n}\bigg(\frac{\lambda^{n+1}e^{-\lambda}}{(n+1)!}\bigg)\cdot i\\
&=\frac{1}{\lambda}\sum_{n=0}^{\infty}\frac{n(n+1)}{2}\bigg(\frac{\lambda^{n+1}e^{-\lambda}}{(n+1)!}\bigg)\\
&=\frac{1}{\lambda}\sum_{n=0}^{\infty}\frac{n^{2}+n}{2}\bigg(\frac{\lambda^{n+1}e^{-\lambda}}{(n+1)!}\bigg)
\end{align}$$
Now, we use a change of variables:
$$M=N+1$$
and 
$$m=n+1$$
Leading to:
$$\begin{align}
E[X]&=\frac{1}{\lambda}\sum_{m=1}^{\infty}\frac{(m-1)^{2}+(m-1)}{2}\bigg(\frac{\lambda^{m}e^{-\lambda}}{m!}\bigg)\\
&=\frac{1}{2\lambda}\sum_{m=1}^{\infty}\big(m^2-m\big)\bigg(\frac{\lambda^{m}e^{-\lambda}}{m!}\bigg)\\
&=\frac{1}{2\lambda}\Big(E[M^2]-E[M]\Big)\\
&=\frac{1}{2\lambda}\Big(\text{Var}(M)+E[M]^{2}-E[M]\Big)\\
&=\frac{1}{2\lambda}\big(\lambda^{2}+2\lambda\big)\\
&=\frac{\lambda}{2}+1
\end{align}$$
Note, the answer to your first question regarding the expected number of people who arrive before you is simply:
$$E[X]-1=\frac{\lambda}{2}$$
Therefore with $\lambda=10$, you expect
$$\frac{\lambda}{2}=5$$
people to arrive before you. Furthermore, the probability of being the $i$th person to arrive can be shown graphically as (shown below for various $\lambda$):

