how do you calculate average damage for DPR comparisons?

I have asked a few questions about optimization and DPR and i dont understand how those numbers are reached.

lets take for example a monster with 15 AC and a level 1 fighter with a greatsword and +2 on strength.

i think that die average is just a simple divide by 2.

  • d4 average = 2
  • d6 average = 3
  • d8 average = 4
  • d10 average = 5
  • d12 average = 6
  • d20 average = 10

a greatsword does 2d6, so a average of 6 damage.

adding prof and str to the roll makes gives it a + 4 making a d20 roll between 5 and 24.

does this make a ac15 with +0 the same as an ac11 with +4?

an AC 11 gives 9 out of 20 chance to hit = 9/20 = 0.45 = 45% to hit.

then the 6 damage divided by the percentile to hit for 0.45 * 6 = 2.7 damage per round.

are my calculations correct or am i missing something?