Talk:Bernoulli numbers: Difference between revisions

→‎B(1)?: new section
(→‎Algorithm?: Added.)
(→‎B(1)?: new section)
 
(7 intermediate revisions by one other user not shown)
Line 1:
__TOC__
== Bernoulli numbers, why and whyfor ==
 
I added the Bernoulli numbers task for serveral reasons:
== Bernoulli numbers, the   ''why''   and whyforthe   ''why for'' ==
I added the Bernoulli numbers task for serveralseveral reasons:
 
::* they're an important sequence
Line 7 ⟶ 9:
 
The numerator can get quite large. &nbsp; Here is a list of the non-zero Bernoulli numbers from &nbsp; '''B'''<sub>0</sub> &nbsp; to &nbsp; '''B'''<sub>200</sub>:
 
<pre style="height:100ex">
(Shown at four-fifth size.)
B(n) Bernoulli number expressed as a fraction
 
<pre style="heightfont-size:100ex80%">
B(n) Bernoulli number expressed as a fraction (right justified and aligned on the solidi)
──── ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
0 1/1
Line 122 ⟶ 127:
: I didn't want to suggest or demand any particular method on how to generate Bernoulli numbers. &nbsp; People are free to use any method they want. &nbsp; The link to the ''Wolfram MathWorld (TM)'' has some examples, the REXX example uses formula 33. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 16:11, 11 March 2014 (UTC)
 
:: I just copied the Wikipedia algo. (with <strike>atribution</strike> attribution). People don't have to use it, but they don't have to search for at least one algo. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 01:20, 12 March 2014 (UTC)
 
::: Yes, it sure ''looks'' simple. &nbsp; The programming solutions that used it also looks simple and clean. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 01:56, 12 March 2014 (UTC)
 
-----
 
The double sum formula used by the REXX example is #33 from the entry [http://mathworld.wolfram.com/BernoulliNumber.html Bernoulli number] on The Eric Weisstein's World of Mathematics (TM).
<br><br>
::::::: <math> B_n = \sum_{k=0}^n \frac{1}{k+1} \sum_{r=0}^k (-1)^r \binom kr r^n </math>
<br>
:::::::::::::: where &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <math> \binom kr</math> &nbsp; &nbsp; &nbsp; is a binomial coefficient.<br>
 
<br> -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 01:00, 18 March 2014 (UTC)
 
==use of memoization==
In the REXX programming solution, I added memoization for the COMB and PERM functions (combinations and permutations).
<pre>
For computing the Bernoulli numbers up to (and including):
50 values, memoization was 17% faster.
100 " " " 38% "
200 " " " 42% "
</pre>
 
== B(1)? ==
 
I propose to leave the choice of B(1)=1/2 or B(1)=-1/2 open to solution authors. It's essentially arbitrary anyway, and the solutions already provided are split. I see no reason to prescribe one over the other. [[User:Thebigh|Thebigh]] ([[User talk:Thebigh|talk]]) 13:39, 27 October 2021 (UTC)
781

edits