Combinations Problem (math not excel)

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
24,355
There is a supper club. They have a dining room with tables. Members come to a dinner (or not), sit at a table (don't switch tables) and eat.
If the club has n members, how many different dinners can they have? (denoted D(n))

1) a member may or may not attend a dinner

2) the order of seating at a table does not matter.
ABC sitting a table is the same as CBA sitting at a table

3) the order of the tables does not matter.
AB at one table, C at another and D at another (denoted by AB, C, D) is the same a C, AB, D

Examples:

If n=0, there is only one possible dinner, the dinner where on one attends. D(0) = 1

If n=1, there are two possible dinners, the null dinner and the dinner where A sits alone.
D(1)=2
[no one]
A

If n=2, D(2)=4
[no one]
A (A attends, B does not)
B (B attends, A does not)
A, B (A and B sit at different tables)
AB (A and B sit at the same table)

n=3 D(3)=15
[-]
A
B
C
A, B
A, C
A, B, C
B, C
AB
AB, C
AC
AC, B
BC
BC, A
ABC

What is a general formula for D(n)?

I thought that I had a recursive rule.

Let D(n,k) be the number of possible dinners of a club with n members where the largest table size has exactly k diners.
D(3,3)=1, D(3,2)=6, D(3,1)=7, D(3,0)=1
D(n) = sum(k=0 to n) D(n,k)

INCORRECT RULE:
D(n, k)= COMBIN(n,k) * D(n-k)
This fails because it creates duplicates.

Does anyone have a notion of how to calculate D(N) other than "list them all"?

Thank you.
 
Can it be that easy?

Yes. It follows directly from the recursive relationship you identified:
69a03eb4da41010f23c186553a856e72acc0dd6e


Is there an upper limit to the number of people who can sit at a table? If so, the member/table problem will start to diverge from the Bell numbers once n exceeds that number.

You'll also get divergence if you put some bounds at the lower end. I'm not tempted to join Mike's "club" if 25 of us come for dinner and we all sit at separate tables :).
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
One thing I wondered about though. Is there an upper limit to the number of people who can sit at a table? If so, the member/table problem will start to diverge from the Bell numbers once n exceeds that number.
No limit to the number of people at a table or the number of tables in the room.

Thanks to all for all of this, I see that I have a bit of studying to understand the math behind this.
 
Upvote 0
Now, a perfect ending to this thread will be to come up with a closed formula (no loops, no recursion) for a Bell number.

No one in the world has ever been able to do it, but that does not not frighten us. :)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,909
Messages
6,122,189
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top