All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Binomial Baffle (Posted on 2014-12-30)
If we expand (1 + 0.2)2014 by the binomial theorem, we get:
A(0) + A(1) + A(2) + .......+ A(2014) where:
A(j) = C(2014, j) *(0.2)j and:
C(x, y) = x!/(y!*(x-y)!)

Find the value of j for which A(j) is maximum.

 No Solution Yet Submitted by K Sengupta Rating: 3.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution | Comment 1 of 2
DefDbl A-Z
Dim crlf\$, loge10, twopi

Function mform\$(x, t\$)
a\$ = Format\$(x, t\$)
If Len(a\$) < Len(t\$) Then a\$ = Space\$(Len(t\$) - Len(a\$)) & a\$
mform\$ = a\$
End Function

ChDir "C:\Program Files (x86)\DevStudio\VB\projects\flooble"
Text1.Text = ""
crlf\$ = Chr(13) + Chr(10)
Form1.Visible = True
DoEvents

twopi = Atn(1) * 8
loge10 = Log(10)
l2014f = lxf(2014)
For j = 0 To 2014
term = l2014f - lxf(j) - lxf(2014 - j) + j * Log(0.2) / loge10
If term > Max Then Max = term: jmax = j
Next
Text1.Text = Text1.Text & jmax & Str(Max) & Str(10 ^ Max) & crlf

Text1.Text = Text1.Text & crlf

Text1.Text = Text1.Text & " done"
End Sub

Function lxf#(x#)
If x# < 171 Then
fact# = 1
If x# > 1 Then
For i = 2 To x#
fact# = fact# * i
Next
End If
lo# = log10#(fact#)
Else
lo# = log10#(x#) * (x# + 0.5)
lo# = lo# + (-x# + 1# / (12# * x#) - 1# / (360# * x# * x# * x#) + 1# / (1260# * x# * x# * x# * x# * x#)) / loge10#
lo# = lo# + log10#(twopi#) / 2#
End If
lxf# = lo#
End Function

Function log10(x)
log10 = Log(x) / loge10
End Function

finds j=335 has the maximum A(j), which is ~= 7.05447607762139 * 10^157.

The program uses logarithms to avoid overflow and the output is:

335 157.848464765072 7.05447607762139E+157

 Posted by Charlie on 2014-12-30 14:35:48

 Search: Search body:
Forums (0)