# Postcards: A math problem

**URL:** <https://boards.straightdope.com/t/postcards-a-math-problem/274526>\
**Category:** Factual Questions\
**Created:** [November 13, 2004, 3:58am UTC](https://boards.straightdope.com/t/postcards-a-math-problem/274526 "2004-11-13T03:58:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fox\_Paws](https://avatars.discourse-cdn.com/v4/letter/f/85e7bf/32.png) [@Fox\_Paws](https://boards.straightdope.com/u/Fox_Paws)\
**Post date:** [November 13, 2004, 3:58am UTC](https://boards.straightdope.com/t/postcards-a-math-problem/274526/1 "2004-11-13T03:58:25Z")

</div>

Help! Apparently I have forgotten more math than I thought I had. Here’s the problem:

> [@](#):
>
> Pat wants to buy five postcards choosing from an adequate supply of four different types of postcards. How many different selections are possible?

The provided answer is

56

I don’t get it. Can somebody please help me? This is driving me nuts! As always, be sure to show your work 🙂

---

<div class="post-metadata">

**Author:** ![ITR\_champion](https://avatars.discourse-cdn.com/v4/letter/i/c67d28/32.png) [@ITR\_champion](https://boards.straightdope.com/u/ITR_champion)\
**Post date:** [November 13, 2004, 4:27am UTC](https://boards.straightdope.com/t/postcards-a-math-problem/274526/2 "2004-11-13T04:27:27Z")

</div>

It’s a multi-choose problem, more commonly thought of this way. There are _f_ flavors of ice cream available, and you order a sundae with _n_ scoops. how many different sundaes are possible. The answer is (f+n)!/((f-1)!n!).

Here we have 4 flavors and 5 scoops, so the answer is 8!/(3!5!) = 56.

Here’s one way to think of it. Call the flavors A, B, C etc… Now imagine that you’re going to put all the scoops of flavor A in a line, then put a spoon at the end of that line, then add all the scoops of flavor B to the line, then add another spoon, then add all the scoops of flavor C, etc… You place a total of _f+n_ objects in the line, _f_+1 of them are spoons. So the total number of possible arrangements is just the number of possible ways to arrange the spoons, which is _f+n_ choose _f_-1.

---

<div class="post-metadata">

**Author:** ![Mathochist](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@Mathochist](https://boards.straightdope.com/u/Mathochist)\
**Post date:** [November 13, 2004, 4:29am UTC](https://boards.straightdope.com/t/postcards-a-math-problem/274526/3 "2004-11-13T04:29:10Z")

</div>

> [@Fox Paws](#):
>
> Help! Apparently I have forgotten more math than I thought I had. Here’s the problem:
> 
> The provided answer is
> 
> 56
> 
> I don’t get it. Can somebody please help me? This is driving me nuts! As always, be sure to show your work 🙂

Count the number of partitions of five into integers. For an n-part partition, multiply by the number of ways of choosing those n kinds of cards from four kinds total. Be careful not to count a combination twice.

---

<div class="post-metadata">

**Author:** ![MikeS](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@MikeS](https://boards.straightdope.com/u/MikeS)\
**Post date:** [November 13, 2004, 7:27am UTC](https://boards.straightdope.com/t/postcards-a-math-problem/274526/4 "2004-11-13T07:27:36Z")

</div>

> [@ITR champion](#):
>
> It’s a multi-choose problem, more commonly thought of this way. There are _f_ flavors of ice cream available, and you order a sundae with _n_ scoops. how many different sundaes are possible. The answer is (f+n)!/((f-1)!n!).
> 
> Here we have 4 flavors and 5 scoops, so the answer is 8!/(3!5!) = 56.
> 
> Here’s one way to think of it. Call the flavors A, B, C etc… Now imagine that you’re going to put all the scoops of flavor A in a line, then put a spoon at the end of that line, then add all the scoops of flavor B to the line, then add another spoon, then add all the scoops of flavor C, etc… You place a total of _f+n_ objects in the line, _f_+1 of them are spoons. So the total number of possible arrangements is just the number of possible ways to arrange the spoons, which is _f+n_ choose _f_-1.

This is essentially correct, except for a few typos:  
[ul]  
[li]The overall answer is (f + n - 1)!/((f - 1)! n!).[/li][li]You think of placing f + n - 1 objects in a line, f - 1 of which are spoons.[/li][li]The number of ways to arrange the spoons is (f + n - 1) choose (f - 1).[/li][/ul]  
I’m pretty sure this is the usual answer you’ll find in a combinatorics textbook. Still, the general gist was right. 🙂

---

<div class="post-metadata">

**Author:** ![Cabbage](https://avatars.discourse-cdn.com/v4/letter/c/f07891/32.png) [@Cabbage](https://boards.straightdope.com/u/Cabbage)\
**Post date:** [November 13, 2004, 9:46am UTC](https://boards.straightdope.com/t/postcards-a-math-problem/274526/5 "2004-11-13T09:46:32Z")

</div>

Another way to do it, which I think is kind of nice, uses generating functions:

Represent each of the four different types of postcards with the letters a-d. We can represent each selection of five postcards with a monomial such as:

(a^2)(b^1)(c^0)(d^2)

(i.e., we chose two “a” postcards, 1 b, zero c’s, and 2 d’s).

Since we’re choosing five postcards, we want the exponents in the monomial to add up to five.

How do we get a collection of all these monomials? Simply multiply:

(1 + a + a^2 + … + a^5)(1 + b + … + b^5)…(1 + d + … + d^5)

That product will give us all of the possible monomials.

But since we just want to count the ones whose exponents add to five, that’s equivalent to finding the coefficient of x^5 in:

(1 + x + x^2 + … + x^5)^4

This product is:

1+ 4_x + 10_x^2 + 20_x^3 + 35_x^4 + **56** _x^5 + 80_x^6 + 20_x^17 + 104_x^7 + 125_x^8 + 140_x^9 + 146_x^10 + 140_x^11 + 125_x^12 + 104_x^13 + 80_x^14 + 56_x^15 + 35_x^16 + 10_x^18 + 4\*x^19 + x^20

This also shows, for example, that there are 146 different combinations of 10 postcards (if we choose at most five of each type).

---

<div class="post-metadata">

**Author:** ![Happy\_Fun\_Ball](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/happy_fun_ball/32/17664_2.png) [@Happy\_Fun\_Ball](https://boards.straightdope.com/u/Happy_Fun_Ball)\
**Post date:** [November 13, 2004, 3:16pm UTC](https://boards.straightdope.com/t/postcards-a-math-problem/274526/6 "2004-11-13T15:16:05Z")

</div>

> [@Cabbage](#):
>
> Another way to do it, which I think is kind of nice, uses generating functions:

Nice! Good methodology.

---

<div class="post-metadata">

**Author:** ![Fox\_Paws](https://avatars.discourse-cdn.com/v4/letter/f/85e7bf/32.png) [@Fox\_Paws](https://boards.straightdope.com/u/Fox_Paws)\
**Post date:** [November 13, 2004, 3:29pm UTC](https://boards.straightdope.com/t/postcards-a-math-problem/274526/7 "2004-11-13T15:29:05Z")

</div>

I now see the error in the method I was using. Thanks, gang!
