A garage has $N$ parking spots. Only once per day (at midnight) are cars allowed to enter it. The number of cars wanting to enter each midnight is geometrically distributed, i.e. $P(X=k)=p(1-p)^i$ for some $0<p<1$. All cars are let in as long as there is space.
Cars can leave whenever they want. The probability that a car, that was parked in the garage just after midnight, leaves the garage before midnight next day is $q$ (independent of other cars, or how long it has been there).
I'm trying to model the number of cars present just before midnight, and find how many cars cars there are on average in the garage.
At first I thought some kind of queueing system would be in order, but I can't seem to take the discrete nature of the arrivals into account. My second thought was creating a Markov chain and just brute-forcing my way to find the probabilities of each transition $P_{ij}$
$$P_{ij}=\sum_{k=j-i}^{N-i} P(\text{k cars arrive})\cdot P((i+k)-j \text{ cars leave})+\sum_{k=N+1-i}^{\infty}P(k \text{ cars arrive})\cdot P((N-j) \text{ cars leave})$$ The second sum takes care of the scenarios where more cars wish to enter than there's room for, so the garage holds exactly N cars right after midnight (meaning that $N-j$ cars will have to leave during the day so the number of cars before next midnight is $j$).
Now this doesn't really seem an elegant way, and I also haven't got to the second question. Does anyone have a suggestion on how to model this?