# Math Help - Computing Bell Number for set of n elements.

1. ## Computing Bell Number for set of n elements.

First of all, sorry if this is in the wrong area, if so, please move it. Anyway
suppose I have a set of 3 elements. Computing by hand it is obvious to see that the answer is 5. But what if I have 20 elements? I know I need to use bell number to solve this, but I am not sure how to do this.

Note: I only need to know how to do this for very simple cases, such as
n = 20, 10, 7, etc.

2. Originally Posted by gammaman
what if I have 20 elements? I know I need to use bell number to solve this, but I am not sure how to do this.
I can give you the recursive formula for Bell numbers.
$B(0)=1$ for convenience.
$B(n + 1) = \sum\limits_{k = 0}^n {{n \choose k} B(k)}$

If you more, I can post more.
Bell numbers http://www.mathhelpforum.com/math-he...relations.html

3. Yes, please post more, I am not very good at math. I am however a programmer, and need to use bell numbers. If you could show me a working example, (your choice of size n), that would be great!

4. Thanks, I actually found this earlier in my search for answers. It helps somewhat but I am still rather confused.

By the way on the same note. Would you know the follwowing?

If I have a set S{1,2,3} and partition like so

Code:
{1,2,3}
{2,3}  {1}
{1,3}  {2}
{3}      {1,2}
{3}  {2}  {1}
How do I determine the number of E-relations. I was reading through the document you posted but it is confusing to me. Is there a clear cut way to determine the number of E-relations?

5. Originally Posted by gammaman
Thanks, I actually found this earlier in my search for answers. It helps somewhat but I am still rather confused.

By the way on the same note. Would you know the follwowing?

If I have a set S{1,2,3} and partition like so

Code:
{1,2,3}
{2,3}  {1}
{1,3}  {2}
{3}      {1,2}
{3}  {2}  {1}
How do I determine the number of E-relations. I was reading through the document you posted but it is confusing to me. Is there a clear cut way to determine the number of E-relations?
Yes that is 5 partitions, B(5)=5
Here is a list of 20.

6. Thanks for working out the bell numbers for me. What about the E-relation though? Is the number of partitions of a set equal to the number of E-relations. So if S{1,2,3} has 5 partitions, does that mean it has 5 E-relations? What about s{1,2,3,4} has 15 partitions, does that mean it always has 15 E-relations?

7. Originally Posted by gammaman
Thanks for working out the bell numbers for me. What about the E-relation though? Is the number of partitions of a set equal to the number of E-relations. So if S{1,2,3} has 5 partitions, does that mean it has 5 E-relations? What about s{1,2,3,4} has 15 partitions, does that mean it always has 15 E-relations?
Yes, there is a one-to-one correspondence between partitions of a set and equivalence relations on the set. The Bell numbers count the partitions.