Coins in a fountain is a problem in combinatorial mathematics that involves a generating function. In this problem, a fountain is an arrangement of non-overlapping unit circles into horizontal rows in the plane so that consecutive circles in the bottom row are tangent to each other, and such that each circle in a higher row is tangent to two coins from the next row below it. Above the bottom row, consecutive coins are not required to touch. The problem asks for the number of different fountains of
n
k
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 1 | 1 | 2 | 3 | 5 | 9 | 15 | 26 | 45 | 78 | 135 | 234 | ... |
f(n,k)
Such generating function are extensively studied in[2]
Specifically, the number of such fountains that can be created using n coins is given by the coefficients of:
This is easily seen by substituting the value of y to be 1. This is because, suppose the generating function for is of the form:
\sumn\sumkCn,kxnyk
then, if we want to get the total number of fountains we need to do summation over k. So, the number of fountains with n total coins can be given by:
\sumkCn,kxnyk
which can be obtained by substituting the value of y to be 1 and observing the coefficient of xn.
Proof of generating function .Consider the number of ways of forming a fountain of n coins with k coins at base to be given by
f(n,k)
g(n,k)
This is because, we can view the primitive fountain as a normal fountain of n - k coins with k - 1 coins in the base layer staked on top of a single layer of k coins without any gaps. Also, consider a normal fountain with a supposed gap in the second last layer (w.r.t. the base layer) in the r position. So, the normal fountain can be viewed as a set of two fountains:
So, we get the following relation:
Now, we can easily observe the generating function relation for to be:
and for to be:
Substituting in and re-arranging, we get the relation:
\begin{align} F(x,y)&=\dfrac{1}{1-xyF(x,xy)}&=\dfrac{1}{1-\dfrac{xy}{1-x2yF(x,x2y)}} &= … &=\dfrac{1}{1-\dfrac{xy}{1-\dfrac{x2y}{1-\dfrac{x3y}{ … }}}} \end{align}