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:
Black is d20, orange is highest of 2d20, blue is lowest of 2d20.
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 probability of x = 0.5x - 0.25
- multiply by 100, and there's your percent chance that you'll roll any particular number.
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:
Black is d20, orange is highest of 2d20, blue is lowest of 2d20.
Data:
Advantage
# %
1 100
2 99.75
3 99
4 97.75
5 96
6 93.75
7 91
8 87.75
9 84
10 79.75
11 75
12 69.75
13 64
14 57.75
15 51
16 43.75
17 36
18 27.75
19 19
20 9.75
Disadvantage
# %
1 100
2 90.25
3 81
4 72.25
5 64
6 56.25
7 49
8 42.25
9 36
10 30.25
11 25
12 20.25
13 16
14 12.25
15 9
16 6.25
17 4
18 2.25
19 1
20 0.25
The halfling's Lucky trait deals with the die roll (PHB, p. 28):
When you roll a 1 on an attack roll, ability check, or saving throw, you can reroll the die and must use the new roll.
And so does Advantage/Disadvantage, since it refers to the same trait (PHB, p. 173):
For example, if a halfling has advantage on an ability check and rolls a 1 and a 13, the halfling could use the Lucky trait to reroll the 1.
The Divination wizard's Portent feature, on the other hand, deals with the check as a whole:
You can replace any attack roll, saving throw, or ability check ... with one of these foretelling rolls.
And here comes the interesting part - the three emphasized terms are only mentioned in rules as actions, not numbers:
The description of attack rolls (PHB, p. 194):
To make an attack roll, roll a d20 and add the appropriate modifiers.
If the total of the roll plus modifiers equals or exceeds the
target’s Armor Class (AC), the attack hits.
Saving throws (PHB, p. 179):
To make a saving throw, roll a d20 and add the appropriate ability
modifier. [...]
A saving throw can be modified by a situational bonus or penalty [...]
[...] proficiency in a saving throw lets a character add his or her
proficiency bonus to saving throws made using a particular ability
score. [...]
And ability checks (PHB, p. 171):
To make an ability check, roll a d20 and add the relevant ability
modifier. As with other d20 rolls, apply bonuses and penalties, and
compare the total to the DC.
All three go the standard way:
- Roll a d20, get a number
- In case of (dis-)advantage: roll another d20, get a new number (or
keep the old)
- Add bonuses/penalties, get the final number
- Compare the final number with the AC/DC and get the final
success/failure answer
From the strict RAW reading of Portent, we have to replace steps 1–4 (the whole check) with a number (foretelling roll), which makes no sense, as the result has to be boolean – success/failure.
If we loosen the restrictions, the logical thing to say would be "In the context of Portent, attack roll/saving throw/ability check is the number to be compared with the AC/DC" (i.e. the result of Step 3 above). In this interpretation "You must choose to do so before the roll" means that the decision is made before Step 1 and therefore no actual die roll happens. The modifiers are applied to the foretold roll as normal. This interpretation is reinforced by an unofficial tweet from March 2015 by rules designer Jeremy Crawford:
The portent die is intended to replace a d20 roll only, not any modifiers applied to it.
This result is Rules As Intended as well; the whole point is that the character knows in advance what is going to happen.
Best Answer
It adds up to a +0.5 to all rolls
The average roll of a die is 10.5, which is just the average value of the numbers 1-20.
We re-roll any die that comes up as 1, and since we stick with whatever that outcome is, we can just replace the 1 in the list with the average roll again, and recalculate the average, giving us an average roll of 10.975.
Therefore, the halfling luck trait is approximately a +0.5 to all d20 rolls.
This is the distribution, as generated from a quick and dirty matlab script I wrote. As you can expect, it's pretty uniform for all values that are not 1 (note that there's still some variation, because it comes from actual random numbers and not an analytic calculation):
Advantage and Disadvantage
I modified my script to see how it would affect advantage and disadvantage.
For disadvantage:
For Advantage:
We can see that there's about a +0.6 bonus for disadvantage, whereas there's only a +0.3 bonus for advantage. Of course, this makes sense, because rolling a 1 is more impactful for disadvantage than it is for advantage, as the plots make clear.
Also worth noting is that the fact that you only reroll one die doesn't really seem to change the average value. Again, this makes sense because you only have a 1/400 chance of rolling two ones.