# How do we derive the number of ways to divide $n$ non-identical objects into $r$ groups such that each group gets $0$ or more number of objects [duplicate]

How do we get $r^n$ as the number of divisions possible. Please give a full description.

-

## marked as duplicate by muzzlator, Ross Millikan, Thomas, vonbrand, AmzotiApr 17 '13 at 16:25

See math.stackexchange.com/questions/47345/…, somewhere in the answers there is a description for why the formula for non-identical groups is $r^n$ and why it's different for when the objects are identical –  muzzlator Apr 17 '13 at 15:45
If the groups are not labelled, the answer is not $r^n$. If they are labelled, the first object can be put into any one of the groups ($r$ choices), and for every such choice the second object can be put into any one of the groups, and so on. –  André Nicolas Apr 17 '13 at 15:49

Assuming the groups are labeled $1,...,r$, think of your objects as $n$ people standing in a line. Each division then is a word in the letters $1,...,r$ of length $n$: give each guy a sign with his group number. Hence there are $r^n$ such partitions.

-

Hint:

$(a_1,a_2, \dots, a_n) \to (1,2, \dots r)$

Since, you can have any number of objects in one box.

$(a_1) \to (1,2, \dots r) =r$ ways

$(a_2) \to (1,2, \dots r)=r$ ways

.

.

.

$(a_n) \to (1,2, \dots r)= r$ ways

$(a_i) \to (1,2, \dots r)$ represents the possible slots for $a_i$.

-