Git Product home page Git Product logo

Comments (2)

vigna avatar vigna commented on September 3, 2024 1

Since both formulae are approximated, technically they're both wrong.

Since your approximation is very far from reality (technically: it is asymptotically wrong), probably it would be better to replace it with an approximation closer to reality (technically: one that is asymptotically right).

Does that sound better?

Note that your "formula" L · (1 - nL / P)^n gives values much greater than 1 even for n = 2 (try L=1000, P=1000000).

from book.

dhardy avatar dhardy commented on September 3, 2024

I think both formulae are wrong? If you take a corner case like nL = P the probability of no overlap, there are P × n! / n = L · n! states with no overlap of P^n states total.

For the first unused value, there are n+1 positions it could lie; for the second, there are n+2 etc. (x! / n!) — but now with (x-n)! combinations of the x = P - nL unused values, i.e.

prob(no overlap) = (L · n! / P^n) · x! / (n! · (x-n)!)
 = L · x! / ((x-n)! · P^n)
 = L · (P - nL)! / (P - n(L + 1))! · P^-n

Where n is comparatively small, this is approximately:

L · (P - nL) ^ n · P^-n
 = L · (1 - nL / P)^n

Aha, this is approximately your formula!

from book.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.