Description

Now I wonder if i can write a proper script to do these calculations (improper one starts slowing down for 14th fish). This time wolfram alpha helped again.

7 years ago
Permalink

Comment has been collapsed.

Is there a Wolfram Alpha formula which spits out the answer? I just tried putting in BellB(x) until I got the right answer (comparing the length of the result with the length of the expected result every time).

I suppose scripts will have problems with the big numbers, they won't even fit in a regular number type (of the languages I know).

7 years ago
Permalink

Comment has been collapsed.

I did this, but with the SymPy module in Python.

7 years ago
Permalink

Comment has been collapsed.

Yes, I also found the number by trying different inputs to Bell formula.

7 years ago
Permalink

Comment has been collapsed.

http://fredrikj.net/blog/2009/03/computing-generalized-bell-numbers/

from mpmath import *
def bellexact(n,x=1):
    mp.prec = 20
    size = int(log(bell(n,x),2))+10
    mp.prec = size
    return int(bell(n,x)+0.5)

It gives the exact bell number.

7 years ago*
Permalink

Comment has been collapsed.

Well, according to this solution you can pretty easily calculate it for O(n^2) with Dynamic Optimization. Storing the results is the annoying part. XD

7 years ago
Permalink

Comment has been collapsed.

I just googled a small set and ended up with a list of enough to have the right number ;)

7 years ago
Permalink

Comment has been collapsed.

Trivial question after knowing the Function name.
Wiki page leads to a table of n for n <500.

7 years ago
Permalink

Comment has been collapsed.

View attached image.
7 years ago
Permalink

Comment has been collapsed.

this was useful,
list off bell numbers

7 years ago
Permalink

Comment has been collapsed.

Found this interesting formula to quickly estimate (accurate enough to get the order, which was enough in this case) the bell numbers:
def bell_number(N):
return Decimal((1/math.e)) * sum([Decimal((k**N))/Decimal((math.factorial(k))) for k in range(ITERATIONS)])
where ITERATIONS is some constant, 1000 goes quickly and is quite accurate.

7 years ago
Permalink

Comment has been collapsed.

Didn't think to look for a list and I didn't have MATLAB available, so I just kept guessing using Wolfram Alpha and Dobiński's formula until it worked.

7 years ago
Permalink

Comment has been collapsed.

i needed 6 guesses. Wolfram Alpha is awesome!

7 years ago
Permalink

Comment has been collapsed.

Thanks for the puzzles.

7 years ago
Permalink

Comment has been collapsed.

Thanks again for the challenge! I don't have any interest in this particular game, but it was fun to work on!

7 years ago
Permalink

Comment has been collapsed.

You do not have permission to comment on giveaways.