Grieve (grieve) wrote,

Math puzzle

I ran across this problem today, and I feel like it must have been solved before, but I am not sure where to look. Suppose you have X objects and Y buckets. The question is how many unique ways can I distribute the X objects into the Y buckets.

For example if I have 2 objects and 3 buckets I can distribute the two objects as follows:
2 0 0
0 2 0
0 0 2
1 1 0
1 0 1
0 1 1

Which gives me six unique ways to distribute the objects.

With 3 objects and 3 buckets there are 10 ways to do it. My question is what is the algorithm given X and Y which will give you all unique combinations?
Tags: math

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.