Probability of people in a queue Here is a simple model of a queue. The queue runs in discrete time (t = 0, 1, 2, . . .), and at each unit of time the first person in the queue is served with probability p and, independently, a new person arrives with probability q. At time t = 0, there is one person in the queue. Find the probabilities that there are 0, 1, 2, 3 people in line at time t = 2.
So i haven't read up on random variables yet, so i was wondering how to figure out this problem. I'm having trouble setting this up. I get since the notion of independence is implied there will be some multiplicatiom, but the ideas i've thought of just don't seem to make sense. Here is my best attempt in how to set up so far:
For the case of 2 people in line.
$P(2 ppl) = 3pqq(1-q)$ also what does multiplying by "p" have to do with anything if this is about people in a queue?
 A: Assuming new arrivals in an interval always occur after any possible service happens; so that nobody can arrive at an empty queue, be served, and immediately depart.
To have $Z=n$ people in the queue after two intervals you need $1-X+Y=n$, where $X$ is the number of departures, and $Y$ the number of arrivals.  
It's given that at most one person arrives in a given time interval, and at most one person leaves in an interval.  So we can have 0,1,2 arrivals and 0,1,2 departures.  However, no more people can depart after an interval than were in the queue, so some orders of departure and arrival are prohibited.
$\begin{align}
P(Z=0) & = P([X=1,Y=0]\cup [X=2,Y=1]) 
\\ & = [\color{white}{p\,(1-q)\,1\,(1-q)+ (1-p)\,(1-q)\,p\,(1-q)}] + [\color{black}{p\,q\,p\,(1-q)}] 
\\ & = p\,(2-p)\;(1-q)^2 + p^2\,q(1-q) 
\\[2ex] P(Z=1) & = P([X=0, Y=0]\cup [X=1, Y=1]\cup [X=2, Y=2]) 
\\ & = [\color{white}{(1-p)^2(1-q)^2}]+ [\color{white}{p\,(1-q)\,1\,q + 3\,p\,q\,(1-p)\,(1-q)}]+[\color{white}{p^2q^2}]  
\\[2ex] P(Z=2) & = P([X=0, Y=1]\cup [X=1, Y=2])
\\ & = [\color{white}{(1-p)^2\,2\,q\,(1-q)}] + [\color{white}{2\,p\,(1-p)\,q^2}]  
\\[2ex] P(Z=3) & = P([X=0, Y=2])
\\ & = [(1-p)^2\,q^2]
\end{align}$
