Help - Search - Members - Calendar
Full Version: SR4 Net Hits Probability Distribution
Dumpshock Forums > Discussion > Shadowrun
p00ya
I'm new to SR4's net hits system and I was finding it hard to estimate the probability of meeting particular thresholds on opposed tests. I decided to make these nethits statistical tables as an aid.

I couldn't derive an elegant closed form expression for either the PDF or CDF here. The expected value is the intuitive (n-m)/3. The variance seems to be cubic in n, asymptotically. I generated the exact entries in Mathematica and then rounded them off for presentation. I've only listed positive entries.

You can get a PDF at a point k by taking the difference of vertically adjacent entries.
Ol' Scratch
I think it's a case of over-thinking things, personally.

On average, you can usually expect one hit for every three dice you have to throw and a guarantee (under many circumstances) of one hit for every four dice you have via a semi-optional rule. If you have a threshold of 3, you'll want at least 9 dice to throw and if you have 12 or more you can ask to just buy the hits. Simple. And for every three dice below that "requirement," your chance of succeeding lowers by one hit. Do you really need any sort of complicated math beyond that in most circumstances?

I mean, if you have the time to stop the game in order to crunch some numbers, and there's a chance you won't even bother with an action, do you really need to waste the time to crunch those numbers to begin with? Because if it's something important where life and death are on the line, you're probably going to try it regardless of the math. And if it's not, what's the harm in trying it to see how Lady Luck treats you?
Saint Sithney
QUOTE (Dr. Funkenstein @ Apr 12 2010, 01:32 AM) *
I think it's a case of over-thinking things, personally.


Basically it's as the Doctor says. You should be able to grok your estimated chances quickly enough, and, if it's important, weight them with Edge.

I did however one time calculate the chances of creating a lvl 6 Fake SIN using Forgery from Unwired and capped, depleating dice pools from SR4a. The probability was so astronomically small that it would take Aeons to bang out a single lvl 6 SIN. Though, I didn't factor in the fact that the time between tests is so long that you could probably spend Karma on all 20 rolls and have it refreshed each time...
p00ya
QUOTE (Dr. Funkenstein @ Apr 12 2010, 04:32 PM) *
On average, you can usually expect one hit for every three dice you have to throw and a guarantee (under many circumstances) of one hit for every four dice you have via a semi-optional rule. If you have a threshold of 3, you'll want at least 9 dice to throw and if you have 12 or more you can ask to just buy the hits. Simple.


Of course it's simple, that's just a binomial distribution. It gets harder for net hits because that's not a threshold test on your DP. The rule of thumb above just isn't useful.

Say you have a DP of 18 and you figure your opponent has a DP of 9. Sure, you can guess that you'll get one hit for every 3 dice E(X)=6 and your opponent will have the same E(Y)=3. Using that logic you probably figure your chances are high that you can get 3 net hits or more. How high? Well, the answer is less than 1%. Because of the high variance, you can't do linear subtraction with the expected values of X and Y and figure that the difference has a good probability.

Edit: the above 'answer' is just wrong. The answer is about 58%, as Dr Funkenstein would expect.
Heath Robinson
The table seems to be incomplete to me. The probability of a 1 dice pool getting 1 net hit against a 2 dice pool should be listed as ~0.148 by my calculations.

I also have completely different numbers for practically every k=1 entry (i.e. success on an opposed test) that has a value of m greater than 1. Either your calculations are wrong, or mine are.

QUOTE (Dr. Funkenstein @ Apr 12 2010, 09:32 AM) *
I think it's a case of over-thinking things, personally.

I don't. Looking at the statistical properties of the RNG is always useful, especially when creating characters.

Did you know that a 1 dice pool wins against a 5 dice pool about 4% of the time? Did you know that a 5 dice pool wins against a 9 dice pool (i.e. the same difference in absolute dice terms as 1 against 5) about 14% of the time? A 9 dice pool beats a 13 dice pool (same dice imbalance as 1 vs 5 again) about 20% of the time.

Knowing your odds is never so simple as comparing your E(X) values. To think otherwise is foolish.
Ol' Scratch
I don't see how that can possibly be less than 1%. Just using a random online dice roller, I get the following results from ten sets of rolls.

[ Spoiler ]

Not a single time did the 18d6 fail to out roll the 9d6, and only once was it even a close call. I'm no math wiz, not by a long shot, but I'm pretty sure 100% (of the sample) is more than "less than 1%" by quite a huge margin. Are your sure your math is right? Or am I not understanding what you're trying to say?
Heath Robinson
QUOTE (Dr. Funkenstein @ Apr 12 2010, 10:37 AM) *
I don't see how that can possibly be less than 1%. Just using a random online dice roller, I get the following results from ten sets of rolls.

Not a single time did the 18d6 fail to out roll the 9d6, and only once was it even a close call. I'm no math wiz, not by a long shot, but I'm pretty sure 100% (of the sample) is more than "less than 1%" by quite a huge margin. Are your sure your math is right? Or am I not understanding what you're trying to say?

He said that the chance of getting 3 or more Net Hits was less than 1%.

So, getting 3 or more hits if the opposing DP rolled no hits, getting 4 or more if the opposing DP rolled 1 hit, etc.
Ol' Scratch
QUOTE (Heath Robinson @ Apr 12 2010, 03:30 AM) *
Knowing your odds is never so simple as comparing your E(X) values. To think otherwise is foolish.

I didn't say it was that simple. I said was it really that important to stop in the middle of a game to calculate your odds when the situation is either 1) so important you're going to try it anyway despite the odds or 2) so indifferent that you may as well try the action anyway just to see what happens. And in most circumstances, you can guestimate if an action will be successful based upon how many dice are being rolled.

I just don't see why an exact percentage number is required or even really helpful. "I can succeed at this action 80% of the time." What does that knowledge actually do for you in practice?
Ol' Scratch
QUOTE (Heath Robinson @ Apr 12 2010, 03:40 AM) *
He said that the chance of getting 3 or more Net Hits was less than 1%.

So, getting 3 or more hits if the opposing DP rolled no hits, getting 4 or more if the opposing DP rolled 1 hit, etc.

Ah, I guess I missed that part. Still, 3/5 successes in that sample kind of suggests that "less than 1%" isn't accurate. I even spammed the random roller a few times and didn't see a fail rate anywhere close to that number. In fact, it comes a lot closer to matching my "dumb guy" math; he had 9 more dice than his opponent, so he could expect getting those 3 net hits a little more than half the time. No?

And yeah, I just did a whole mess of those rolls (using a different roller, even) and it still came out that way.

I'm not trying to harsh on anyone. I just don't understand where these numbers are coming from or the desired result.
Faraday
QUOTE (Dr. Funkenstein @ Apr 12 2010, 02:40 AM) *
I just don't see why an exact percentage number is required or even really helpful. "I can succeed at this action 80% of the time." What does that knowledge actually do for you in practice?

Theoretically speaking, it would allow you to optimize your actions if you knew the probability of success for every action you took before taking said action. Not really worth the hassle to get those probabilities though, IMO.
p00ya
QUOTE (Heath Robinson @ Apr 12 2010, 05:30 PM) *
The table seems to be incomplete to me. The probability of a 1 dice pool getting 1 net hit against a 2 dice pool should be listed as ~0.148 by my calculations.


I get the same, but yes my table is incomplete (it doesn't show negative k values, or where m > n). Your example there would be equilavent to n = 2, m = 1, k = -1, and I get 4/27 for the PDF.
Heath Robinson
QUOTE (Dr. Funkenstein @ Apr 12 2010, 10:40 AM) *
I didn't say it was that simple. I said was it really that important to stop in the middle of a game to calculate your odds when the situation is either 1) so important you're going to try it anyway despite the odds or 2) so indifferent that you may as well try the action anyway just to see what happens. And in most circumstances, you can guestimate if an action will be successful based upon how many dice are being rolled.

Who cares about doing it in the middle of a game?
Ascalaphus
We had a related discussion yesterday;

At what point is it better to spend edge on a roll before rolling (to get exploding 6's and make the pool bigger), or after (to re-roll failed dice)?
DWC
QUOTE (Ascalaphus @ Apr 12 2010, 06:51 AM) *
We had a related discussion yesterday;

At what point is it better to spend edge on a roll before rolling (to get exploding 6's and make the pool bigger), or after (to re-roll failed dice)?


Obviously, the inflection point moves around based on your Edge score and your dice pool. I did an approximation (only open ended the 6s like 6 times) a little while ago and the results were pretty close to what I expected. If I can dig them up, I'll share them, but it worked out that unless your Edge was big and your dice pool was fairly small you were way better off rerolling failures.
Mongoose
In you chart, you say to treat blank entries as 0.000. The n=1,k=1,m=2+ entries are blank, but its obviously possible to score a success with one die when the opposition has 2+ dice. Granted, its only really an issue when both pools are fairly small, but it seems an odd oversight.
Also, you say you only listed positive entries. How could you have calculated any negative probabilities?
Banaticus
QUOTE (p00ya @ Apr 12 2010, 02:29 AM) *
Say you have a DP of 18 and you figure your opponent has a DP of 9. Sure, you can guess that you'll get one hit for every 3 dice E(X)=6 and your opponent will have the same E(Y)=3. Using that logic you probably figure your chances are high that you can get 3 net hits or more. How high? Well, the answer is less than 1%.

So far, I've come to 2.25%: http://i9.photobucket.com/albums/a66/bubbajoe12345/18to9.png which I don't think is right, it seems like it should be more.
I used the formula (n!/r!(n-r)!)*p^r*(1-p)^(n-r) with n as the number of hits, r the number of rolls and p as 1/3 (1 or 2 on a 6-sided die).

I figured that getting at least one hit would be the same chance as getting at least two hits, plus the chance or rolling only one; rolling at least two was the same as rolling at least three plus two.
n=1,r=1 chance of rolling a 1, this + 2 = at least one
...
n=1,r=9
n=2,r=2 chance of rolling a 2, this + 3 = at least one two
...
n=2,r=9
n=3,r=3 chance of rolling a 3, this + 4 = at least one three
...
n=8,r=8 chance of rolling an 8, this + 9 = at least one eight
n=8,r=9
n=9,r=9 = chance of rolling at least one nine

On the top row of the table are the percentages that "at least" one hit will be rolled with 18 dice, at least two hits, etc.
On the left hand columwn are the percentages that "at least" one hit will be rolled in 9 dice, at least two hits, etc.
In the middle, I multiplied the two percentages together. For instance, there's a 66.20% chance of rolling at least 1 hit in 18 dice and a 66.18% chance of rolling at least 1 hit in 9 dice, so there's a 43.81% chance of rolling at least 1 hit in 9 dice at the same time that at least 1 hit is rolled in 18 dice.
Then I added up all those percentages that the 18 pool has 3 or more net hits over the 9 pool.

I ended up with 2.25%.
Banaticus
QUOTE (p00ya @ Apr 12 2010, 02:29 AM) *
Say you have a DP of 18 and you figure your opponent has a DP of 9. Sure, you can guess that you'll get one hit for every 3 dice E(X)=6 and your opponent will have the same E(Y)=3. Using that logic you probably figure your chances are high that you can get 3 net hits or more. How high? Well, the answer is less than 1%.

So far, I've come to 2.25%: http://i9.photobucket.com/albums/a66/bubbajoe12345/18to9.png which I don't think is right, it seems like it should be more.
I used the formula (n!/r!(n-r)!)*p^r*(1-p)^(n-r) with n as the number of hits, r the number of rolls and p as 1/3 (1 or 2 on a 6-sided die).

I figured that getting at least one hit would be the same chance as getting at least two hits, plus the chance or rolling only one; rolling at least two was the same as rolling at least three plus two.
n=1,r=1 chance of rolling a 1, this + 2 = at least one
...
n=1,r=9
n=2,r=2 chance of rolling a 2, this + 3 = at least one two
...
n=2,r=9
n=3,r=3 chance of rolling a 3, this + 4 = at least one three
...
n=8,r=8 chance of rolling an 8, this + 9 = at least one eight
n=8,r=9
n=9,r=9 = chance of rolling at least one nine

On the top row of the table are the percentages that "at least" one hit will be rolled with 18 dice, at least two hits, etc.
On the left hand columwn are the percentages that "at least" one hit will be rolled in 9 dice, at least two hits, etc.
In the middle, I multiplied the two percentages together. For instance, there's a 66.20% chance of rolling at least 1 hit in 18 dice and a 66.18% chance of rolling at least 1 hit in 9 dice, so there's a 43.81% chance of rolling at least 1 hit in 9 dice at the same time that at least 1 hit is rolled in 18 dice.
Then I added up all those percentages that the 18 pool has 3 or more net hits over the 9 pool.

I ended up with 2.25%.
Ol' Scratch
Both of those numbers are still clearly wrong. Yeah, the samples I included early in the thread were just ten rolls of each, but I kept doing it using two different dice rollers, too. Not once was the result anywhere close to such a tiny percentage. I don't care what some spreadsheet says, either your math has to be wrong or I'm really not understanding what your numbers are supposed to represent. Because, in the real world, your chance of getting 3 or more net hits in a contest between 18d6 vs. 9d6 is not less than 1% or even 2.25%. It's well over 50%. I seriously doubt the numbers will change that much after millions or even billions of rolls. Maybe you're doing it backwards or something, and calculating the chances of the 9d6 winning? I just dunno.

Heck, feel free to try it yourself. The dice syntax is 18d6.hits(5) and 9d6.hits(5). You can roll up to 50 times each with that roller. The sample I used earlier came from a private forum I'm on, so I can't really link to that roller (you have to be a member and an active member of a game in order to use it). The spoiler below contains yet another sample using the linked roller, just to drive the fact home some more.
[ Spoiler ]
sn0mm1s
I calculate that 18 dice should get 3 or more net hits than 9 dice about 57-58% of the time
p00ya
Okay so I screwed up the layout of my tables (I've uploaded a new PDF but all that I've changed is the position of the k and the m at the top left). *curses mathematica's export formats*

So the actual value for n = 18, m = 9, k = 3 is 0.578. This seems a lot more correct because you expect the CDF to be 0.5 either side of the expected value.

Sorry for the confusion, the intuitive guess is a good one. I just saw the tables and went "wow that's surprising" when I first read them (the wrong way around).
Banaticus
I'm sorry, but I'm not in the mood to trust tables unless the method used to generate them is listed, especially when they just changed (no offense intended). wink.gif

So, how are you coming up with that answer?
Draco18s
QUOTE (Banaticus @ Apr 12 2010, 02:00 PM) *
I'm sorry, but I'm not in the mood to trust tables unless the method used to generate them is listed, especially when they just changed (no offense intended). wink.gif

So, how are you coming up with that answer?


His answer is correct, he just read 0.5 as "less than 1%" rather than the correct 50%.

See: Verizon can't tell the difference between 0.002 dollars and 0.002 cents.
sn0mm1s
QUOTE (Banaticus @ Apr 12 2010, 11:00 AM) *
I'm sorry, but I'm not in the mood to trust tables unless the method used to generate them is listed, especially when they just changed (no offense intended). wink.gif

So, how are you coming up with that answer?


Well, I can tell from your post that your numbers are off. The odds of at least 1 hit in 9 dice is equal to 1 - odds of no hits.

The odds of no hits in 9 dice is: (9!/9!0!) * [(2/3)^9] * [(1/3)^0].
The first and last parts of that equation = 1 so, the odds of no hits can be simplified to (2/3)^9 = 2.6%
So the odds of rolling at least 1 hit in 9 dice = 97.4%

p00ya seems to have corrected his numbers and his result for 18 dice vs. 9 dice match my results so I am pretty sure his table is now correct.
Draco18s
QUOTE (sn0mm1s @ Apr 12 2010, 03:52 PM) *
Well, I can tell from your post that your numbers are off. The odds of at least 1 hit in 9 dice is equal to 1 - odds of no hits.


1 or more hits is not one or more net hits.
sn0mm1s
QUOTE (Draco18s @ Apr 12 2010, 02:19 PM) *
1 or more hits is not one or more net hits.


No kidding? Read his post and look at his linked image - his math is wrong. I posted the correct number several posts up - before p00ya.

This is what he said:
QUOTE
For instance, there's a 66.20% chance of rolling at least 1 hit in 18 dice and a 66.18% chance of rolling at least 1 hit in 9 dice, so there's a 43.81% chance of rolling at least 1 hit in 9 dice at the same time that at least 1 hit is rolled in 18 dice.


Which is not correct. I was correcting that math.
There is a 97.4% chance of rolling at least 1 hit in 9 dice... not 66.18%
There is a 99.9% chance of rolling at least 1 hit in 18 dice... not 66.20%
pbangarth
QUOTE (Ascalaphus @ Apr 12 2010, 04:51 AM) *
We had a related discussion yesterday;

At what point is it better to spend edge on a roll before rolling (to get exploding 6's and make the pool bigger), or after (to re-roll failed dice)?
There's an old thread on DS in which this was calculated using three different methods, each of which led to the following conclusion:

If the dice pool is > 2.5 X Edge Attribute, then using Edge after the roll to re-roll failures will likely get you more successes. If it is < 2.5 X Edge, then the exploding sixes are likely to give more successes.

This does not obviate the fact that using Edge before to get exploding sixes could net you an infinite number of hits, nor does it negate the possibility that you get lucky with the original roll and don't need to use Edge at all.
Banaticus
QUOTE (sn0mm1s @ Apr 12 2010, 02:59 PM) *
No kidding? Read his post and look at his linked image - his math is wrong.

QUOTE (Banaticus @ Apr 12 2010, 07:10 AM) *
So far, I've come to 2.25%: http://i9.photobucket.com/albums/a66/bubbajoe12345/18to9.png which I don't think is right, it seems like it should be more.

Yes, I;m not arguing that I'm wrong, but I'd like to know where I went wrong. How should I have done the math?
Ascalaphus
QUOTE (pbangarth @ Apr 12 2010, 11:12 PM) *
There's an old thread on DS in which this was calculated using three different methods, each of which led to the following conclusion:

If the dice pool is > 2.5 X Edge Attribute, then using Edge after the roll to re-roll failures will likely get you more successes. If it is < 2.5 X Edge, then the exploding sixes are likely to give more successes.

This does not obviate the fact that using Edge before to get exploding sixes could net you an infinite number of hits, nor does it negate the possibility that you get lucky with the original roll and don't need to use Edge at all.


I'll take your word for it. This'll be helpful in decision-making smile.gif
sn0mm1s
QUOTE (Banaticus @ Apr 12 2010, 03:43 PM) *
Yes, I;m not arguing that I'm wrong, but I'd like to know where I went wrong. How should I have done the math?


Your formula for finding the odds of exactly one outcome looked correct. However your n and r definitions should be switched.

(n!/r!(n-r)!) term is correct but "n" should be the number of rolls and "r" should equal the number of desired hits

The odds of rolling exactly 0 hits in 9 dice is: (9!/9!0!) * [(2/3)^9] * [(1/3)^0]
The odds of rolling exactly 1 hit in 9 dice is: (9!/8!1!) * [(2/3)^8] * [(1/3)^1]
The odds of rolling exactly 2 hits in 9 dice is (9!/7!2!) * [(2/3)^7] * [(1/3)^2]
.
.
.
The odds of rolling exactly 9 hits in 9 dice is (9!/0!9!) * [(2/3)^0] * [(1/3)^9]

If you add up all those percentages you should get ~100% (rounding obviously will cause a little discrepancy)

The odds of rolling *at least* 1 hit would be the sum of exactly 1 hit, exactly 2 hits,exactly 3 hits.... exactly 9 hits. (or as I posted earlier 100% - odds of no hits).
The odds of rolling *at least* 2 hits would be the sum of exactly 2 hits, exactly 3 hits,exactly 4 hits.... exactly 9 hits. (or 100% - odds of no hits - odds of 1 hit).

You need to calculate the same odds for 18 dice.

Now... for determining the odds of having at least 3 net hits with 18 dice with 9 dice you would do the following
(odds of exactly 0 hits with 9 dice) * (odds of at least 3 hits with 18 dice) = odds of more than 3 net hits if 0 hits are rolled with the 9 dice
(odds of exactly 1 hits with 9 dice) * (odds of at least 4 hits with 18 dice) = odds of more than 3 net hits if 1 hits are rolled with the 9 dice
(odds of exactly 2 hits with 9 dice) * (odds of at least 5 hits with 18 dice) = odds of more than 3 net hits if 2 hits are rolled with the 9 dice
.
.
.
(odds of exactly 9 hits with 9 dice) * (odds of at least 12 hits with 18 dice) = odds of more than 3 net hits if 9 hits are rolled with the 9 dice

If you sum up all those numbers you get the odds of at least 3 more hits on 18 dice than 9 dice.

The above method is a very brute force method but it is easy to follow (and do with a spreadsheet or computer program).
sn0mm1s
QUOTE (Ascalaphus @ Apr 12 2010, 05:49 PM) *
I'll take your word for it. This'll be helpful in decision-making smile.gif


This thread shows the math behind how to use Edge. 2.5 is a little too high - but you will see that in the thread.
Draco18s
QUOTE (sn0mm1s @ Apr 12 2010, 08:02 PM) *
This thread shows the math behind how to use Edge. 2.5 is a little too high - but you will see that in the thread.


Actually, the "exactly 2.5" takes into account the probability of rolling infinite 6s. 1 hit per 2.5 is the asymptotic sum of near-infinite rerolls. It only takes 3 itterations of the probability to come up with 2.51

1/3 + (1/3 * 1/6) + (1/3 * 1/6 * 1/6)

1/3 is your first roll hits.
(1/3 * 1/6) is the hits you get from all your 6s rerolled.
(1/3 * 1/6 * 1/6) is the hits from rerolling all of those 6s.

Summing:
0.333...
0.055...
0.00925...

= 0.39814814

1 over that number (to get 1 hit per Dice instead of Dice per Hit) gives 2.511627906

Adding in (1/3 * 1/6 * 1/6 *1/6) gives 0.399949, 1/x = 2.500322

So as you add in more exploding 6s your 1 hit per N dice moves fractionally closer to 2.5

Σ, i = 0 -> ∞ of 1/3 * (1/6)^i equals 2.5
sn0mm1s
QUOTE (Draco18s @ Apr 12 2010, 06:08 PM) *
Actually, the "exactly 2.5" takes into account the probability of rolling infinite 6s. 1 hit per 2.5 is the asymptotic sum of near-infinite rerolls. It only takes 3 itterations of the probability to come up with 2.51

1/3 + (1/3 * 1/6) + (1/3 * 1/6 * 1/6)

1/3 is your first roll hits.
(1/3 * 1/6) is the hits you get from all your 6s rerolled.
(1/3 * 1/6 * 1/6) is the hits from rerolling all of those 6s.

Summing:
0.333...
0.055...
0.00925...

= 0.39814814

1 over that number (to get 1 hit per Dice instead of Dice per Hit) gives 2.511627906

Adding in (1/3 * 1/6 * 1/6 *1/6) gives 0.399949, 1/x = 2.500322

So as you add in more exploding 6s your 1 hit per N dice moves fractionally closer to 2.5

Σ, i = 0 -> ∞ of 1/3 * (1/6)^i equals 2.5


My bad, I scrolled to the end of the thread (since there are usually several posts of math correction) and I didn't realize that what was being calculated wasn't RAW.
p00ya
QUOTE (Banaticus @ Apr 13 2010, 02:00 AM) *
I'm sorry, but I'm not in the mood to trust tables unless the method used to generate them is listed, especially when they just changed (no offense intended). wink.gif

So, how are you coming up with that answer?


None of the numbers changed, just the way you have to read them. Mathematica transposed the output so I mislabelled the axes. Murphy's law I guess; the math is pretty robust:

CODE
Unprotect[PDF, CDF];
NetHitPDF[n_, m_, k_] :=
  Sum[PDF[BinomialDistribution[m, 1/3], x - k]*
    PDF[BinomialDistribution[n, 1/3], x], {x, 0, n}];
PDF[NetHits[n_, m_], k_] := NetHitPDF[n, m, k];
CDF[NetHits[n_, m_], k_] := Sum[PDF[NetHits[n, m], i], {i, -m, k}];
Protect[PDF, CDF];

1 - CDF[NetHits[18, 9], 2] => 4407079910843/7625597484987
N[%] => 0.577932


Note that k is "2" here because CDF[NetHits[18, 9], 2] actually measures the probability there will be 2 *or less* net hits, which is the complement of 3 or more.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Dumpshock Forums © 2001-2012