paulgorman.org

< ^ txt

Mon Aug 17 09:04:04 EDT 2015 Went to bed before nine last night, and woke up before seven. (I guess I had a bit of a sleep deficit!) Stopped to do a little shopping at Target on my way into work. It's already seventy-eight degrees at nine in the morning. Supposed to hit eighty-seven today. Had to drive to the Tyner home to show Mrs. Tyner how to maximize a window. Wish I had air conditioning in my car. Hmph. Questions: - Using pf rules, can we do vlan tagging? Sure, vlans just show up as interfaces, so we can write rules from one to another like we do between any two interfaces. What was my question about this?? - In the D&D 5e advantage/disadvantage system (where you roll two d20 with advantage and take the higher roll), how much is that worth in terms of +N? It's a pretty huge swing --- +/-6.65, or 33%! Not very elegant or optimized, but: #!/usr/bin/env python # Quantify the +N for the D&D 5e advantage roll. from random import randint rolls = 100000 rollsA = [] rollsB = [] difference = [] for i in range(1, rolls): a = randint(1, 20) rollsA.append(a) b = randint(1, 20) rollsB.append(b) if (a > b): difference.append(a - b) if (b > a): difference.append(b - a) if (a == b): difference.append(0) print 'Control Average: ' + str(((sum(rollsA) + sum(rollsB)) / (rolls * 2.0))) print 'Average +N: ' + str(float(sum(difference)) / float(rolls)) --- falstaff --- august % python ./advantageroll.py [746] Control Average: 10.507085 Average +N: 6.64991 --- falstaff --- august % python ./advantageroll.py [746] Control Average: 10.475585 Average +N: 6.66161 --- falstaff --- august % python ./advantageroll.py [746] Control Average: 10.49418 Average +N: 6.6514 --- falstaff --- august % python ./advantageroll.py [746] Control Average: 10.483295 Average +N: 6.63373 --- falstaff --- august % python ./advantageroll.py [746] Control Average: 10.517715 Average +N: 6.64749 --- falstaff --- august % python ./advantageroll.py [746] Control Average: 10.506985 Average +N: 6.64915 --- falstaff --- august % python ./advantageroll.py [746] Control Average: 10.51534 Average +N: 6.63384

< ^ txt