Giter VIP home page Giter VIP logo

Comments (8)

cyphar avatar cyphar commented on July 27, 2024

... the randomness comes from random.randint(1, 6). If you start skewing (or weighing) Poisson distributed randomness, you start to miss the whole point of it.

from ninjabot.

ackwell avatar ackwell commented on July 27, 2024
elif self.TYPE == self.SINGLE:
    # Just give the total (not actually very accurate)
    total = random.randint(die * self.F_LOWER_LIMIT, sides * die)

Doesn't look like random.randint(1, 6) to me. Unless my concept of probability is completely wrong, the code above is not entirely accurate.

from ninjabot.

ackwell avatar ackwell commented on July 27, 2024

The problem is that it pretends it is throwing one very large die, as opposed to lots of smaller die, hence the inaccuracy. Manually 'rolling' each 'die' individually is far too slow on large roll requests.

from ninjabot.

cyphar avatar cyphar commented on July 27, 2024

... are we talking about statistical or theoretical probability? If we are referring to the statistical aspects of rolling dice, you're correct -- it isn't completely accurate. However, if we assume Poisson distribution of dice rolls, that is correct.

from ninjabot.

ackwell avatar ackwell commented on July 27, 2024

The former. Given the example of 2d6, it should be much more likely that a diceroll of 7 (6 possible throws) occur than that of 2 or 12 (1 possible throw).

Bloody email didn't use markup.

from ninjabot.

cyphar avatar cyphar commented on July 27, 2024

Ok ... how would you like to weigh it? Halve, then skew toward 0 (using %) and then add them again? What is a safe way of skewing numbers?

from ninjabot.

ackwell avatar ackwell commented on July 27, 2024

I have no idea, hence why this is an issue as opposed to already being fixed.

from ninjabot.

cyphar avatar cyphar commented on July 27, 2024

From my understanding, you'd have to raise to a power and modulo it. I'm looking into it now.

EDIT:
Nope. We'll just normal distribution it.

from ninjabot.

Related Issues (20)

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.