1

There are $2n$ people standing in a queue for tickets costing 5 doublezons each. Everyone wants to buy one ticket; $n$ of the people have a 10-doublezon banknote and $n$ of them a 5-doublezon coin. Initially, the cashier has no money.

How many orderings of the people in the queue are there for which the cashier can always give a 5-doublezon coin back to each 10-doublezon note owner? What is the probability that the cashier will be able to return cash to everyone for a random ordering of the queue?

So basically the first person in the queue must be one of those $n$ people with 5-doublezon coin (otherwise the cashier wouldn't have change for that person) and next person can be either one of $n-1$ people with 5-doublezon coin or one of $n$ with a banknote; however, at every moment the number of customers who paid with a banknote cannot exceed the number of customers who paid with a coin, and if these numbers are equal at some point, the next customer must pay with a coin to give the cashier some change for next customer.

The original number of customers is $2n$, so the upper bound of the number of possible orderings is $(2n)!$ We can fix the first customer since he must pay with 5-doublezon coin, so then we can choose between $n$ customers paying with a banknote or $n-1$ customers paying with a coin; if the first option is chosen, then the next customer must pay with a coin; if, however, second customer pays with a coin again, the following may be either again one with a coin, or someone paying with a banknote (and the following can also pay with a banknote, until a moment when number of those who paid with a banknote is equal to the number of those who paid with a coin, when the cashier again has no change).

That's an intuition I have for this problem; however, I don't know how to proceed more formally or how to go about finding a formula, let alone the answering the probability question.

applicant
  • 671
  • Not exactly the same, but probably helpful: http://math.stackexchange.com/questions/990747/cashier-has-no-change-catalan-numbers-probability-question –  Oct 12 '16 at 21:42

1 Answers1

1

Let represent the line as a binary sequence where $1$ stands for a person having a coin, while a $0$ stands for person having banknote. In order for anyone to "buy" a ticket any initial sequence of the binary sequence we just defined has to have no more $0$'s than $1$'s. These sequences are called Dyck words and for a given $n$ the length of such word of length $2n$ and having $n$ $1$'s and $n$ $0$'s is given by the Catalan Numbers. As for every "good" sequence we have a corresponding Dyck word and vice versa we have that the total number of "good" sequence is:

$$C_n = \frac{1}{n+1}\binom{2n}{n}$$

Of course the total number of possible sequences is $(2n)!$, so the probability that a random sequence is a "good" sequence is:

$$\frac{\binom{2n}{n}}{(2n)!(n+1)} = \frac{1}{n! \cdot n! \cdot (n+1)}$$

Stefan4024
  • 35,843