Sorry to bother you guys yet again with (what I imagine are) relatively basic questions, but I was wondering if there is a "proper" or "best" way to evaluate a computationally difficult limit. The code I have so far is: (NOTE: This is an updated version of the code, thanks to the suggestions I received in the comments)

Clear[prob, h, f, fp, u, z, ud, dn, uc, cn, dnf, cnf, ratio]
prob[h_, f_] := Binomial[f, h]
fp[prob_] := prob^(1/2)
u[z_] := z
ud[fp_, u_, prob_, f_] := u[(f/2)] - Sum[fp[Sum[prob[j, f], {j, 0, i}]](u[(-f/2 + i + 1)] - u[(-f/2 + i)]), {i, 0, f - 1}]
dn[ud_, f_] := ud/f

What I'd like to do is find the limit for the function $dn(ud,f)$ as $f \rightarrow \infty$ To do so, I was using:

N[Limit[dn[ud[fp, u, prob, f], f], f -> Infinity], 10]

Which yields he result I'm currently getting:

Limit[(1/f)(0.5000000000 f - 1.000000000 Sqrt (2.000000000^f f - 1.000000000 DifferenceRoot[Function[{\[FormalY], \[FormalN]}, {(1 + \[FormalN] - f) \[FormalY][\[FormalN]] + (-\[FormalN] + 2 f) \[FormalY][1 + \[FormalN]] + (-3 - \[FormalN] - f) \[FormalY][2 + \[FormalN]] + (2 + \[FormalN]) \[FormalY][3 + \[FormalN]] == 0, \[FormalY][0] == 0, \[FormalY][1] == 1, \[FormalY][2] == 2 + f}]][f])), f -> \[Infinity]]

(Which itself is a sizable improvement over previous versions, so thanks for your help already!)

In reality, I don't need a super precise number for the limit, just something that's "close enough" (I leave that definition intentionally somewhat open- the more precise, the better, but getting an answer is the most important thing). Is there something I can do to allow Mathematica to be less precise (and so return an actual 'close' value for the limit)? Or is there a better way to code/find the operation?

Any ideas of what's going on/how to interpret the result?

If there's anything else I can include to make this question more clear, just let me know!

Thanks so much for everything guys!!!

  • $\begingroup$ Did you know Binomial[] is built-in? Also, your fp is just Sqrt, no? $\endgroup$ Sep 27, 2017 at 12:02
  • $\begingroup$ @J.M. I found out about Binomial after writing the code above and just never bothered to change it. Do you think I should do so? (I definitely am going forward, but I didn't bother to change what I had previously written.) And for the fp function- in this instance it is just sqrt, but different variations of the problem require different fp functions, hence why I left it in there. But again, if you think it'd be better to remove the fp definition entirely in this case I'll gladly do so!! Thank you!! $\endgroup$
    – AndrewC
    Sep 27, 2017 at 12:21
  • $\begingroup$ Binomial[] is less likely to overflow than computing with explicit factorials, so changing it is a good idea. For fp: the 0.5, being an inexact number, throws a wrench into symbolic stuff; use 1/2, if you really need to make the power explicit. $\endgroup$ Sep 27, 2017 at 12:25
  • 1
    $\begingroup$ To expand on @J.M.'s suggestion, use (1/2) in the exponent---just 1/2 will be parsed as (prob^1)/2. $\endgroup$
    – evanb
    Sep 27, 2017 at 12:35
  • $\begingroup$ Thanks guys! I changed the two things mentioned (the Binomial function and using prob^(1/2) instead of ^.5) That definitely helped speed up the result, however I'm still having trouble with what that result is. I'll update the question itself momentarily to reflect the code's current state and the limit result I'm getting (in case that provides any useful clues). Thanks again!!! $\endgroup$
    – AndrewC
    Sep 27, 2017 at 12:46

1 Answer 1


You can plot the function to see what it looks like:

Plot[dn[ud[fp, u, prob, f], f], {f, 1, 40}, AxesLabel -> {f, "dn(ud,f)"}]

enter image description here

It does not seem to approach a limiting value.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.