Background: In many pen and paper RPGs there is often an option or bonus/penalty to rolls that incorporates rolling multiples of the required die and taking the best or worst of those rolls for your roll.
Example: Advantage/Disadvantage in D&D 5e is best/worst die in 2 twenty-sided die rolls. This generally alters the average roll (of 1d20 or one twenty-sided die equaling 10.5) by 3.325 total (average of 13.825 with Advantage, 7.175 with Disadvantage).
Example 2: Best two dice of three six-sided dice rolled. This usually improves the average roll (of 2d6 or two six-sided dice summed, 7) by 1.45833 (8.4583 3-repeating if best, 5.5416 6-repeating if worst) total.
Example 3: Best two of four six-sided dice rolled. This usually improves the average roll (of 2d6 or two six-sided dice summed, 7) by about 2.344136 (9.344136 if best, 4.655864 if worst) total.
Questions: I was wondering what the specific means of calculating certain total rolls (such as rolls totaling a specific number, or that number and higher) and averages would be? Or if that was more easy to calculate than simply finding all the possible combinations and totaling them.
Part A: Given X best of Y dice with Z number of sides, is there a simple expression one can write to calculate this easier than just summing all the combinations?
Part B: Given the above scenario, is there a simple expression one can write to calculate the number of rolls at/equaling a specific number?
Part C: Given the above scenarios, is there a simple expression one can write to calculate the number of rolls at/equaling or above a specific number?
Other notes: I imagine that this will include a lot of factorial math and the Permutation/Combination functions, but I'm not sure how to proceed.