D&D 5E has an "advantage" concept where instead of rolling 1d20, you roll 2d20 and take the highest. Likewise, disadvantage means rolling 2d20 and taking the lowest.
How does this affect the expected average outcome of the roll?
All this does is linearly adjust the normally-flat 5% probability for each number to occur. What results is a increased or decreased probability of any number above or below average to occur, positively for advantage and negatively for disadvantage. See this AnyDice function set, which yields the following:
Since the probability of achieving any given number is a linear function, we can use linear regression (via Wolfram Alpha and our sample data from AnyDice to eventually solve for
Additionally, what you're likely looking for is the probability that at least a particular number will be rolled, using either advantage or disadvantage. AnyDice, again, is king:
The mean result goes from 10.5 to 7.175 for disadvantage and to 13.825 for advantage. The odds go from a flat 5% for each of 1 through 20 to (disadvantage results shown; reverse the first column for advantage results):
(Middle column is how many of the 400 combinations of two numbers from 1-20 yield the result given in the first column.)
The math is straightforward
With an advantage you are looking for best of two results. To figure out your odds you need to multiply the chance of FAILURE together to find out the new chance of failure. For example if you need 11+ to hit rolling two dice and taking the best means instead of a 50% of failing you have only a 25% chance of failing (.5 times .5).
For a disadvantage where you take the worst of two dice roll you need to multiply the chances of SUCCESS to find out the new odds. For example if you need a 11+ to hit your chance success drops from 50% to 25% (.5 time .5).
Advantage 16+ to hit, goes from 25% chance of success to roughly 43% chance of success. (.75 time .75)
Disadvantage 16+ to hit, goes from 25% chance of success to roughly a 6% chance of success (.25 times .25)
The general rule of thumb that in the mid range of the d20 (from success on a 9+ to 12+) advantage grant roughly a equivalent to a +5 bonus and disadvantage a -5 penalty. The increase and decrease in odds tappers off when your odds of success approach 1 or 20. For example a advantage on a 19+ your chance of failure goes from 90% to 81% not quite a +2 bonus on a d20.
An interesting property of the system is that there always a chance of success and always a chance of failure. Unlike a modifier systems where enough modifiers can mean auto success or auto failure. (Unless you have a 20 is an automatic success and 1 a automatic failure)
A useful application of knowing the odds of rolling two dice is that you can just convert it to a straight bonus when rolling for a large number of NPCs. A bunch of goblins with an advantage from surprise that need 13+ to hit the players you can just apply a +4 (or +5 if you round up) bonus instead of rolling the second dice. This is because they have a 60% chance of failure on 13+. Taking .6 times .6 yields .36 a drop of 24%. Not quite a +5 bonus on a d20 dice.