Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

#1: Initial revision by user avatar Peter Cooper Jr.‭ · 2020-10-25T02:56:32Z (about 4 years ago)
I'm not a "mathematician" by trade, I'm a software engineer, so there may be a better way out there, but I figured I'd write up what I do know about just in case my perspective was useful.

The best ways I've found for understanding these kinds of probability problems is with a dedicated calculator designed for them.

So, for example, you can use [Anydice with a "program"](https://anydice.com/program/13e) saying

    output [highest 3 of 4d6]

for your initial example, and it provides a graph showing the distribution. You can change the "3", "4", and "6" for any values of *k*, *n*, and *s* you want.

My understanding (which may be wrong, but *think* is how it works) is that Anydice isn't a numeric Monte Carlo approximation or the like, but that it actually works through all the possibilities for each die being rolled to find the real probability curve. I'm not aware of the source code being publicly available, though, but even if it were available I'm not sure one could derive a general formula from it for all possible *k*/*n*/*s*.

In general randomness has been tricky to model and easily see the patterns of, even with modern programming languages. As "big data" analysis grows as a field, even more tools designed to help model probabilistic events are being developed like "[Bean Machine](https://ericlippert.com/2020/09/23/introducing-bean-machine/)". You might be able to use tools like those to look for the "general insight" you're searching for.