Let us say we have to arrange x different types of coins (1,2,....x) in an n-slot shelf. The other condition is that each type of coin has a potential given by bi (i varies from 1 to x), which indicates that any arrangement in which there are greater than or equal to bi 'i-type' coins together is invalid. How can we arrive at the number of ways? I can't seem to formalise the expression. We need to satisfy this condition for all the coins.
Finding Number of Arrangements
0
$\begingroup$
combinatorics
permutations
dynamic-programming
1 Answers
0
You can do it with a recursive function call. Write a function $N(k,i,m)$ where $i$ is the type of the last coin in the row, $m$ is the number of that coin in a row at the end, $k$ is the total number of coins. Now write recurrences $N(k,i,1)=\sum_{\text{other types of coin}}\sum_m N(k-1,j,m)$ because if you add a different coin you have only one in a row and $N(k,i,m)=N(k-1,i,m-1)$ as long as you don't have too many type $i$ coins in a row.