The important question is, over which ring you are doing your arithmetics. 
In your case, you might have an underflow or overflow, that causes 
numerical instabilities, and then it fails. With more precision, you can 
get closer to the actual value. Look at "interval arithmetic" if you want 
to know how far off you are .. although, in just a naive way, you might not 
learn much. 

http://doc.sagemath.org/html/en/reference/rings_numerical/sage/rings/real_mpfr.html

Here is some code, at least I think that helps to see what's going on:

R = RealField(10000)
k1 = R(0.00625)
k2 = 1-k1
var('n,i')
n = 36000
s = R(0)
for i in range(250):
    s += (factorial(n) / (factorial(n-i) * factorial(i))) * k1**i * k2**(n-i
)
print s

gives

0.947491049318703965693315195818907250545247738953323351157688242799038164182834654325586006717138799834266755816612225812673011827267104875260342280287463690248195419447578868001821874832824903820941776088614995617521631073403902295821814597179921098521019022459150521334630258007711894834801292510616256075652784558751436391205302516555398676073076248906814077500702941626505444080457871430966277312778419447211953331422338689179001889337481460535834584811033104802307772701782294626984228570738200604743372065694169340874573319327300264683418429140125545301440214199596655449234383036164326420564207917968605114518572351265295649209600159454126162348768483409873096298069766846738493605756610054147501078184999036503113280198005209593455554638915332151057295832012247435700555417453595962011386131222068768508436002387131481639324947652383731292712592753548983956869775684927148943492465774284316457674079440919065900487193522872955644745032246156279469977061569042775258202117398515530488087111946760840988876290157194830320127835727688214899704093332651896201688127427985324270459277270603131904107812933405066986740817280071952905731157584960254946219689954169120727250511282516167438746053517582278821228357148649288922012280957371638143422689600345581275577566670036359541267415575946332824325420244404507029580754151733491858117416449913286719562707359485208152827459381791488105627913671592252650064666475016629242498962561388725417913163852731754933168585854578209010701820289212803170762389140177684975077808569775715460939081180370224054581731262484100874570530567055020726328891545275772427086412845452568085559529873889671688376630455090738937812768583331379883106398058331990778507885142251323625989179861391576702186318930980821216753096314642935483767194242707075774119422255806192823561653475207162802183411137164200937398565695854979867622359289821441009256350632881037347903826077250431773705471918294640963912459287248449573560862223432993249858434515053002243513097191940697852103766948698836708105908988063531306907145928463893379014059551869689945443589162444144245615227052467504553355110932286710792617816712615383502064606939366016027668330243629272575532615336454358305529499924620134960386469046409918328949918289750590410484209270878017343999477135672049996810509565759381803091714820695809003880668065516672536564894745683988544408823311341634532678976014832760390665499692986108393437718704042397379127587048146946404417424122363317135153342560907990075516352965489833113639409020833368020840289493912591640575720917352686446211125908299498893124150722507423106538537622186455086321806738565999944848008142123348494417598528950719958933125527611511739171028194902525483668801908939188715562670693699494171926579223989369765558174835282332616946776734916854093061556184035058599958353562573980264545393987221327745148177686258560521086170534910075751154701680661728694096822121291884310177881965534188217091771183408654249991189972407008966005126663014543024974937292439177920833

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to