Rystil Arden said:Actually, the choice of that particular approximation has less of an effect than it would seem at first, since characters with large numbers of low stats also tend to eb hopeless![]()
Private Sub GoBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GoBtn.Click
Dim iterationsCount As Integer
Dim totalPoints As Long = 0
Dim avgPoints As Double
If Integer.TryParse(Me.NumTb.Text, iterationsCount) Then
Dim rnd As New System.Random
For i As Integer = 0 To iterationsCount
totalPoints += RollCharacter(rnd)
Next
avgPoints = totalPoints / iterationsCount
RsltsLbl.Text = avgPoints.ToString
End If
End Sub
Private Function RollCharacter(ByVal rnd As Random) As Integer
Dim charPoints As Integer = 0
Dim diceRslts As New List(Of Integer)
Dim rollValue As Integer
Dim maxVal As Integer = 0
Dim totalMod As Integer = 0
Dim maxStat As Integer = 0
For i As Integer = 1 To 6
'roll 4d6, drop the lowest
rollValue = 0
diceRslts.Clear()
For d As Integer = 0 To 3
diceRslts.Add(rnd.Next(1, 7))
Next
diceRslts.Sort()
For d As Integer = 1 To 3
rollValue += diceRslts(d)
Next
'get point value, adjust total modifier
Select Case rollValue
Case 3
totalMod += -4
charPoints += 0
Case 4
totalMod += -3
charPoints += 0
Case 5
totalMod += -3
charPoints += 0
Case 6
totalMod += -2
charPoints += 0
Case 7
totalMod += -2
charPoints += 0
Case 8
totalMod += -1
charPoints += 0
Case 9
totalMod += -1
charPoints += 1
Case 10
totalMod += 0
charPoints += 2
Case 11
totalMod += 0
charPoints += 3
Case 12
totalMod += 1
charPoints += 4
Case 13
totalMod += 1
charPoints += 5
Case 14
charPoints += 6
totalMod += 2
Case 15
charPoints += 8
totalMod += 2
Case 16
charPoints += 10
totalMod += 3
Case 17
charPoints += 13
totalMod += 3
Case 18
charPoints += 16
totalMod += 4
End Select
maxStat = Math.Max(maxStat, rollValue)
Next
If totalMod > 0 AndAlso maxStat > 13 Then
Return charPoints
Else
Return RollCharacter(rnd)
End If
End Function
Umm...you found the mode instead of the mean. Its not really a fair average unless the distribution is Gaussian, which it is not.Qwyxzl said:My take on this problem is a bit different and thus I cam out with a different result. What we are looking for is not an average but the point buy value that is the most likely to occur out of all of the possible combinations of valid characters. In order to do this I created a program that generates every possible combination (16777216 sets of scores). As it generates them it determines if a given set is acceptable (7816299 sets) or not (8960917 sets). If a set is acceptable then it determines the point value of the set (using values less than 9 = 0). Then I add to an array containing all possible point buy values (0-96) the probability of generating that score. The point buy value that has the highest total is 28. I wrote it in c if anyone is interested in looking at it.
Qwyxzl
Rystil Arden said:Umm...you found the mode instead of the mean. Its not really a fair average unless the distribution is Gaussian, which it is not.
I am curious about researching the expected DMG point value of a "Standard" "4d6, drop the lowest"(4d6dl) D&D character.
Nope. Expected Value has a very specific definition in probability. And its not the mode. It is written as the function E[]Qwyxzl said:The original question was not to find the average but to find the point buy value that best represented the 4d4dl generation method.
Therefore I think the best representation is the mode.
Qwyxzl