[Math] Choose 10 balls and put them in 4 baskets [Simple? combinatorial problem]

combinatorics

I have 10 balls(no distinction between them), i want to restribute all of them to 4 baskets(a basket can have them all and the others can be empty),so i care about counting how many ways i can put those balls into 4 baskets.

(basket1,basket2,basket3,basket4) some correct combinations are (0,10,0,0),(1,9,0,0),(1,1,1,7) and so on, is there some formula that can help me with that?

After some trial and error i thought about (k+n-1)!/n!(k-1)! which gives me
(4+10-1)!/10!(4-1)! = 286 ways (is my thought correct?, if so why exactly?)

2nd question:what if i want basket number 4 to have ALWAYS at least 1 ball, i thought that possible ways to put balls from 10 balls to 1 basket is 10ways so i used above formula again to (now i have 3 baskets and at best case 9 people) (3+9-1)!/9!(3-1)! = 55ways meaning 55*10=550 ways.Is my thinking process correct?

Best Answer

You are correct for the first problem but not the second. Represent each ball by $\star$ and the separations between baskets by $\vert$. Then a typical arrangement would be, for example, $$\star\star\star\star\vert\star\star\star\star\star\vert\ \vert\star$$ In this case, the baskets hold $4, 5, 0,$ and $1$ ball, respectively. The number of ways to do this is $${\textrm{# symbols} \choose \textrm{#stars}} = {10 + 4 - 1 \choose 10}$$ As for the second problem, it is a restricted version of the first, so you should be skeptical that you ended up with a greater number of possibilities. The simple way to do the second problem is to start with one ball in the fourth basket, then ignore it. Now you have $9$ balls to distribute in $4$ baskets, so the calculation will be as above, but with $9$ instead of $10$.