0
$\begingroup$

I am having real trouble getting my mind around this counting stuff business. The simpler things work fine and I at least know (and, I believe, understand) the formulas for counting permutations and combinations (with and without repetition). But when it comes to putting them to use in practice, especially when the problem becomes a bit more complex often has me stomped :/

The problem I'm wrestling at the moment is: If we have $b$ buckets of paint (no bucket will ever run out), and we want to paint $n$ numbered balls in a way so that no more than $k$ balls gets the same color. How many ways is there to do this? Also does it matter whether the balls are numbered or not?

There is nothing about the values of $b$, $n$ and $k$.

I am not sure, but I don't think it matters whether the balls are numbered or not, there wouldn't be more ways to paint them just because there is a number on them, or?

I am trying to visualize this as having $b$ bins that we fill with balls and each bin has $k$ slots, we can then fill each bin with maximum $k$ balls. This menas that we have s slots: $$k*b=s$$ I then try to count how many ways there are to put $n$ balls into $s$ slots as $${s \choose n} = \frac{s!}{(s-n)!n!}$$

But when I try to check this against the case where $b=4, n=3$ and $k=2$ my formula give: $${4*2 \choose 3} = \frac{8!}{(8-3)!3!}=\frac{8*7*6}{3*2}=56$$ However counting the combinations (the tedious way) with colors $\{b,r,g,o\}$: $$b, b, r \\b,b,g \\b,b,o \\b,r,b\\b,r,r\\b,r,g$$ and so forth gives me that the answer should be 60. For this simple case I suppose we could just count how many arrangements there could be with $3$ equal colors (which would be $4$) and subtract that from the total number of possible way to pick $3$ balls from $4$ colors ($4^{3}=64$). But the question is about the general case.

How should I think about these problems and how do I solve the problem presented?

  • 0
    In your example you seem to distinguish $b,b,r$ and $b,r,b$. Are you not then dealing with the case where the balls are labelled/numbered? And is it not now clear that labelling the balls does make a difference?2017-02-25
  • 0
    You are completely right of course, it's obvious really, but it just dosen't occur to me sometimes. Thanks for an effective pointer!2017-02-25

1 Answers 1

0

I would recommend using the Inclusion-Exclusion Principle, which you have done in the second to last paragraph.

In fact if the balls are not distinguishable (which from the context of the problem I assume they aren't) the problem can be reduced to solving the following equation $x_1 + x_2 + \cdots + x_b = n$ in the non-negative integers, where $x_1$ is the number of balls coloured with the first colour and so on. Without the limit for maximum number of balls with the same colour, this is an easy combinatorial problem, known as Stars and Bars.

We can handle the additional conditions with the Inclusion-Exclusion Principle, although it's slightly tedious work. Let $c_i$ be the condition that there are no more than $k$ balls coloured with the $i-th$ colour. Then the wanted number is:

$$N(c_1,\cdots, c_2) = N - \sum N(\overline{c_i}) + \sum_{i

Where N is the number of all possible colouring (solutions to $x_1 + x_2 + \cdots + x_b = n$), while $N(\overline{c_i})$ is the number of colourings not satisfying the condition $c_i$.

If the balls are numbered, then they are distinguishable. Then the same formula would work, although the method od finding the values for the $N$'s will be different, but not much harder.

  • 0
    Thanks for your answer, the original question was actually about numbered balls, I corrected it now, but your answer covered it anyway so thanks :)2017-02-25