This is for a game, calculating the probability of success if one were to enter the dungeon, but removing the game and simplifying, it comes down to this:
Given a set of cards with numbers on, and a number of cards to draw, what is the probability the sum of the cards is greater than or equal to a specified number?
The deck is a specified variable, and cards are removed once drawn.
kinda bad example because I don't know how to calculate non trivial things efficiently yet which is why I'm asking
specified number to draw: 1
deck: 1 1 1 2
number to reach: 2
= probability: 1/4
I know that if I wanted to calculate the expected value, I would just get the expected value of each card and multiply by the cards drawn, because of magic expected value maths, but this obviously does not apply here, because the expected value is a compromise between probability and effect.
The easiest way to do this is to write a program. Like this Python program: