Comments (8)
... 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.
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.
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.
... 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.
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.
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.
I have no idea, hence why this is an issue as opposed to already being fixed.
from ninjabot.
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)
- Add (accurate) timer support
- Fix up networking code HOT 1
- webtools - DuckDuckGo instant answers HOT 3
- weather HOT 10
- regex: have a timeout for regex execution HOT 2
- core: make plugins run in threads HOT 7
- Tests damnit
- dice.py error HOT 1
- core: implement SSL connections to IRC HOT 8
- THE FUCKING WEATHER.
- regex: sanitise newlines HOT 3
- use sets instead of lists where apropos HOT 1
- Investigate why HTTPS requests are so slow on Debian HOT 2
- Investigate why the bot leaks memory HOT 2
- race condition crash when sending the queue HOT 4
- linkinfo: race condition HOT 5
- Ninjabot instance has no attribute 'message_queue' HOT 1
- Migrate from imp to importlib completely.
- Investigate why asyncio SSL support breaks HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ninjabot.