This can be also rephrased as "chocolates in box" problem..Specifically , in this problem , we distribute identical objects to distinct boxes or locations ..
Here it can be applied as the gap between the symbols can be treated as distinct each of which will be treated as a box and the spaces which are to be filled in these gaps (boxes) can be treated as objects.And we will fill using space character only , hence the objects are of identical nature..
So the solution to such problem is the same as finding number of non negative integral solutions of the equation :
X1 + X2 + ..........+ Xn = r where 'r' objects and 'n' boxes are there and each box can have any non negative(including 0 number of objects) in it..
Hence the given problem can be written as :
X1 + X2 + ........ + X5 = 12 where each of the variables follow Xi >= 2 for 1 <= i <= 5..Hence to reduce it to standard form we rewrite it as :
X1 + 2 + X2 + 2 .... + X5 + 2 = 12 , where Xi >= 0 for 1 <= i <= 5
==> X1 + X2 ...... + X5 = 12 - 2 * 5 = 12 - 10 = 2
==> X1 + X2 ...... + X5 = 2
Hence n = 5 , r = 2..
Hence number of non negative integral solutions of the equation = n-1+rCr
= 5-1+2C2
= 6C2
= 15
Hence number of ways of filling the spaces in between the symbols = 15