In how many ways can we choose 6 candies from 8 brands that are available? (It is assumed that repetition of a brand is allowed) I have the solution and I know it is $\ \binom{13}{7} $ but I think it should be $\ 8^6 $ because:
We need to choose 6 candies and there are 8 brands to choose from for each candy. So there are $\ 8×8×8×...×8=8^6 $ ways to choose them.
Please help me understand why my logic is wrong.
The correct answer as you have mentioned is $\binom{13}{7}$ and this is a stars and bars problem.

Now lets see why $8^6$ is wrong.
Lets say the brands are $A,B,C,D,E,F,G,H$

Then a selection of $6$ candies can be represented as a string.

$ABCAAF$ where $3$ candies from $A$ and $1$ candy from $B,C,F$

Consider another set of candies $AAABCF$ this has a similar configuration as the first one $3$ from $A$ and $1$ from $B,C,F$. This string was already counted and thus there is some overcounting involved.

Similarly there are many examples of overcounting in $8^6$
Can't we do it by taking the  combination of 48 taken 6 at a time? Here I am imagining that there are 8 empty buckets and each has a capacity to hold six candies.So , it would be 48!/{(42!)6!}. What is the mistake in this technique?Please correct me.