# You have #n# pieces of pie to be given out to #k# people, and all #n# pieces are given out. How do you find a formula for the total number of ways to give out pie?

##
Each person gets at least one piece of pie, but every person gets at least as many pieces of pie as the person in front of them.

Each person gets at least one piece of pie, but every person gets at least as many pieces of pie as the person in front of them.

##### 2 Answers

#### Explanation:

Assume that the pieces of pie are indistinguishable, but that the

Under these assumptions, the problem of handing out

Let

describes a situation with

Now, with

ways (check!).

In general, we have to distribute

ways.

Additional note:

Using the notation

which we may recognise as a multinomial distribution, that tells us how to distribute

This is a partitions problem, and so the number is found by

#### Explanation:

This may not be the most efficient way to reach the answer, but here we go...

The first thing to realize is that we're really talking about distribution of the excess pieces of pie (the amount of pie that is up and above the minimum one piece per person). We can express this as

The next thing to realize is that we can distribute

- we can give all of
#E# to the last person in line - we can give one piece of
#E# to each person, up to#E# people - we can give some number of
#E# to some number of people, following the rule of each person getting at least as much as the person in front of them

Take for instance when

which sums to 5 ways (I'll use

It turns out that this is a simple case within the vast mathematical world of *partitions* - in this case, the number of ways a number can be added up to (in our current case, 4) where each number in the sum is a natural number

The notation for partitions is

Rather than try to explain something I don't understand, I'll simply say that the below link has a brief explanation of what partitions are and how they work, plus list the first 30 or so (and so, for example, if

https://en.wikipedia.org/wiki/Partition_(number_theory)

And a video from one of my favourite youtube channels, Numberphile:

And here's a calculator:

http://www.wolframalpha.com/widgets/view.jsp?id=ca10ab4a89d9f0f6f378b89881f63ba3

I'll add that this only works if