Is it okay for me to say that this brings out my inner math nerd? It does.
Disclaimers/Notes:
Note: The code below is in the “R” language. It is free, open source, primarily developed by masters and PhD’s in stats, and runs on all the operating systems. I like to use RStudio as the development environment, it is also free.
Also note that I learned on basic/advanced/expert D&D in the late 1980's, and am not yet up to speed on the details of 5th edition, thus I follow and study. To figure parts of this out, like proficiency bonus, I made a barbarian character on D&D beyond, with strength 18, and all other stats at 11. I had hoped it wouldn't bork the numbers up, but hope is not a guarantee. It looks like there is a +6 to hit because when I click roll it gives me a d20+6 to hit.

As a third note, I intend to make a summary section with a nice table, when I am done, and put it at the bottom. Thank you for being patient. Hopefully this will be a useful answer.
The previous answers do 98% of the job, so this is only about 2%. Seriously, check out the answers by Pyrotechnical and Derek first.
Starting in on the answer:
There are many breeds of average, and some are more meaningful than others depending on the context. Several versions include: arithmetic (classic), geometric, harmonic, power and censored (truncated, winsorized). Wikipedia There are many (many many) ways to skin this cat.
The context here is that the character is going into battle, and the player wants to maximize the expected damage and indicate transitions in that, depending on the style of weapon use for a barbarian.
Now I like to look at the 95% confidence interval instead of the mean. This gives me a 19 in 20 chance (in general) of reality overlapping my predicted region which is not bad odds.
I take into account:
- First Attack: 1d6
- Second Attack: 1d6
- Crit hit on a 20
- a basic enemy, the AC is 15 for goblin
- a strength of 18 (+4 to damage, after dice rolls)
- proficiency bonus to attack (+6) <-- this might be incorrect
- when rolling a crit, the damage bonus is added only once per hit, after the dice are summed.
I use this R code:
#libraries
library(ggplot2)
library(dplyr)
library(psych)
#parameters
#how many repeats
n_tries <- 1e5
#parameters
target_ac <- 16
weapon_dmg <- 6
to_hit_mod <- 6
to_dmg_mod <- 4
weapon <- "dual"
log <- data.frame(dmg=numeric(length=n_tries),
hit = numeric(length=n_tries))
for(i in 1:n_tries){
# if(weapon == "dual"){
rolls <- sample(1:20, 2, replace=T)
dmg <- sample(1:6, 2, replace=T)
dmg2 <- sample(1:6, 2, replace=T)
# } else {
# rolls <- sample(1:20, 1, replace=T)
# dmg <- sample(1:6, 2, replace=T) %>% sum()
# dmg2 <- sample(1:6, 2, replace=T) %>% sum()
# }
to_hit <- 0
for(j in 1:length(rolls)){
#miss
if(rolls[j] + to_hit_mod < target_ac){
dmg[j] <- 0
to_hit <- to_hit +1
}
#crit
if(rolls[j]==20){
dmg[j] <- dmg[j] + dmg2[j]
}
#add damage bonus
if(dmg[j]>0 & j==1){
dmg[j] <- dmg[j] + to_dmg_mod
}
}
log$dmg[i]<- sum(dmg)
log$hit[i] <- to_hit > 0
}
log$hit <- as.factor(log$hit)
ggplot(log, aes(x=dmg, fill=dmg>0)) + geom_histogram(binwidth = 1) +
xlab("Damage per hit") +
ggtitle(weapon)
idx1 <- which(log$dmg >0)
print(summary(log[,1])) #all
print(summary(log[idx1,1])) #given a hit
print(quantile(log[,1], c(0.025,0.5, 0.975)))
summary(log$hit)
And I get this distribution:

Here are my summary stats:
> print(summary(log[,1])) #all
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.000 2.000 6.000 6.411 10.000 28.000
> print(summary(log[idx1,1])) #given a hit
Min. 1st Qu. Median Mean 3rd Qu. Max.
1.000 5.000 8.000 8.042 11.000 28.000
> print(quantile(log[,1], c(0.025,0.5, 0.975)))
2.5% 50% 97.5%
0 6 16
> summary(log$hit)
0 1
30347 69653
Which means my 95% confidence interval for damage is between 0 and 16, and my median damage per round is 6, while my mean per round is 6.411. It looks like only about 1/3 of rounds have no hit.
If I adjust for a single hit with a greatsword, I get the following plot:

I get the following summary stats
> print(summary(log[,1])) #all
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.000 0.000 8.000 6.383 12.000 28.000
> print(summary(log[idx1,1])) #given a hit
Min. 1st Qu. Median Mean 3rd Qu. Max.
6.00 9.00 11.00 11.61 13.00 28.00
> print(quantile(log[,1], c(0.025,0.5, 0.975)))
2.5% 50% 97.5%
0 8 18
> summary(log$hit)
0 1
54967 45033
This says that a greatsword gives mean of 6.383, and fails to hit more than it hits. I ran this for one hundred thousand times, so the uncertainty in the mean is likely smaller than the second decimal place.
When I compare this vs. Pyrotechnical the damage per round is very different, primarily because of accounting for AC.
Next steps (work in progress):
- make 3 cases: dual, greatsword, greataxe
- look at levels: 1, 2, 5, 9, 13, 16, 17, 20
- find "weak", "average" and "strong" monster AC's and see if the ideal set changes
- try pulling in the bounds, so something like 50% CI instead of 95%
- think about encounters, so how many goblins, bugbears, or drow are gone through in 10 rounds.
Also, if you don't have the libraries then you can put this at the top of your code:
#list of packages
listOfPackages <- c('dplyr', #data munging
'ggplot2', #nice plotting
'psych')
#if not installed, then install and import
for (i in 1:length(listOfPackages)){
if(!listOfPackages[i] %in% installed.packages(fields = "Package")){
install.packages(listOfPackages[i] , dependencies = TRUE)
}
require(package = listOfPackages[i], character.only = T, quietly = T)
}
rm(i, listOfPackages)