I don't agree with that. The number of ways of allocating N identical objects (or cakes) among M distinct bins (or children) is the binomial coefficient .

Let K denote the number of children who receive at least one piece of cake. It's clear that at least children must receive at least one piece of cake (where means the least integer greater than or equal to N/2). The greatest number of children who can receive at least one piece of cake is M or N, whichever is smaller.

Therefore K can be any number between and . For each such value of K, we can give one piece of cake to each of those K children. There will then be N–K remaining pieces of cake, which allows N–K lucky children to receive a second piece of cake.

There are ways of choosing the children who receive at least one piece. For each such choice, there are ways to choose the lucky children who get 2 pieces. Thus the total number of ways of allocating the cakes is . I don't see any way to simplify that answer.