Editing
Probability
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==The Basics== Relevant for: Everything ===Notation/How do I write this stuff?=== I'm assuming you know that a [[d4]] is a four-sided-die, and 2d4 is two four-sided-dice. If you're confused regarding dice notation, see [[dice]]. In order to preserve the most information when writing anything, it's good practice to write your probabilities as (number of desired events)/(number of total possible events). The probability of rolling a 4, 5 or 6 is written as 3/6. While 3/6 is numerically equivalent to 1/2, 50%, 0.5, or just .5, you do lose information regarding the total possible outcomes in simplifying fractions. However, it can be more informative to say 20% when saying "rolling a 17+ on a d20," though. Unless you're in a probability class, the way you present your answer won't matter. The probability of an event E happening is written as [[File:Probability Eq0.png|x30px]]. This is always a number between 0 and 1 (including 1 and 0). If you get something other than a number between 0 and 1, you're doing something wrong. ===Inverse/What are the odds of something not happening?=== If you're looking at a situation where something will either happen or not happen, then the odds of something not happening are equal to '''one minus the odds of it happening'''. So, the odds of rolling a 6 on a d6 is 1/6. The odds of not rolling one is 5/6. Add those together, you get 6/6, or 1. A lot of the time it's easier to work out the odds of something not happening and take the Inverse than to work out the odds of something happening. ===Compound/What are the odds of several things happening?=== The probability of any mutually exclusive events happening is the sum of the probabilities of each event. That is, since you cannot simultaneously roll a 1, 2, or 3 on a [[d6]], they are mutually exclusive events. The probability of rolling a 1, 2 or 3 on a [[d6]] is [[File:Probability Eq1.png|frameless|upright=1.25]]. For multiple events happening in a specific order over multiple trials, (for instance, the odds of rolling a d20 and getting four natural twenties in a row) take all the odds and multiply them together. So, the odds of rolling one natural twenty is 1/20. Two in a row? That's 1*1 / 20*20, or 1/400. Three in a row? 1/8000. Four? 1/160000. Getting a 9 on a d10 and then getting a 75 or higher on a d100 is 1/10*25/100 or 25/1000 or 1/40. What does that mean for your chances of rolling a nat 20 if you just rolled one? Absolutely fucking nothing. Your dice don't remember what you just rolled, and if they did they wouldn't care. This is known as the Lack of Memory property, and is obvious from each event (roll) being independent. In notation, it would be [[File:Probability Eq2.png|frameless|upright=0.35]], or "the probability of rolling a 20, given that a 20 has already been rolled." Keep in mind that this is NOT the same as saying "rolling a d20 two times and getting at least one natural 20." The probability of this happening is actually 9.75%. Why? See below. ===Combination of Two/What are the odds of at least one thing happening in a set of two?=== You're trying out DnD 5e, and you learn about its fancy new Advantage mechanic, where you can roll two d20s and take the higher of the two. If your rogue has advantage and needs a 9+ on a d20 to hit, what is the chance you're going to need to test out your new boots of frantically running away? Calculating this rogue's chances is a matter of combining the rules we've looked at above. To get the expected number of hits we can just add the chances from each d20: <nowiki> P({rolling 9+ on a d20})=.6</nowiki>, so we would expect <nowiki> 2*.6=1.2 </nowiki> successes, and if we wanted expected damage we could stop there. However, this is clearly bullshit, because the rogue can't hit twice on one attack. To compensate for this, we subtract the chance of getting 9+ on ''both'' rolls. This, known as the inclusion-exclusion principle, gives us the real formula we want: [[File:Probability Eq3.png|x30px]]. This rogue, then, is looking at a .6+.6-.36='''.84 chance to hit''', or only a 16% chance to miss that crucial backstab. We can get to this probability in a number of other ways, too. The simplest might be one minus the chance that neither attack hits. We know that's the product of the two miss rates, so this works out to [[File:Probability Eq4.png|x30px]], or 1-(.4*.4)=.84. Convenient. To check, we could alternatively look at the three mutually exclusive ways we could succeed this attack. The rogue could A: hit on both dice, B: hit on the first but miss the second, or C: hit on the second but miss the first. For the numbers: [[File:Probability Eq5.png|x60px]] We're now pretty sure we know the rogue's success rate, and are ready with the fleeing boots for that 16% failure chance. ===Complex combinations/What are the odds of a specific number of things happening?=== Having saved the rogue, we now go to 40k. We have a squad of ten tactical marines firing bolters into 3 plague zombies that we really need cleared off a victory point. For those that stumbled in here without knowing 40k (welcome to /tg/!), each marine needs to roll several d6s to take out a zombie. First, they need 3+ on a d6 to hit, then 3+ on a d6 to wound, then the zombie needs to fail a 5+ Feel No Pain roll. What are the chances those tac marines will wipe out the zombies? Should we point a valuable squad of assault marines at them for support? This is going to have an easy part and a hard one. The easy part is the chance of ''one'' marine killing ''one'' zombie. A d6 has a 4/6 chance of getting a 3+, and also a 4/6 chance of missing a 5+. This marine, then, has a 4/6 * 4/6 * 4/6 = 64/216 = 8/27 = '''29% chance''' to clip a zombie from the group. We've got ten marines, so our 'expected' number of dead zombies is 10*.29, or 2.9, just a little under the three we want. That suggests we should probably call up the assault marines, as there's a good chance we won't clear that whole group out. Now, the tricky part. This is a really close game, and those assault marines are desperately needed elsewhere. We want the ''exact'' possibility the plague zombies won't survive. Open up [http://www.wolframalpha.com Wolfram Alpha], and buckle up. '''Skip to the TL;DR if you just want a highly useful formula for mathhammering.''' We have ten marines and we're looking to put at least three unsaved wounds downrange, so we're looking for the number of ways to score precisely 3 successes in 10 tests. To make matters a little worse, we actually also need the number of ways to score 4 successes, or 5, or 6, or more, up to ten. Inflicting more wounds is not a problem for us. To work this out, we'll need the probability for a given scenario of hits, and the number of ways that scenario can occur. Let's look at inflicting exactly one wound. This requires one marine to succeed and all the others to fail. If we said that marine were the first guy in the squad we could tell how likely that is by multiplying everything together. We know the first marine succeeds and '''all''' the others fail, so this is [[File:Probability Eq6.png|x30px]] one success and nine fails, in that order. P(failure) is just 1-P(success), so we've got .29 and .71. The probability of any scenario like this, then, is just [[File:Probability Eq7.png|x30px]], or in this case, <nowiki>.29*.71*.71*.71*.71*.71*.71*.71*.71*.71 = .29*.71^9 = </nowiki> .29*.0458 = '''.0133'''. Wow, it sure got tedious in here. So, this 1.3% chance is the chance of scoring exactly one kill in exactly this way. We know there ten scenarios exactly like this one, differing only in which marine got the kill. We don't care about the difference, so those ten scenarios with 1.33% each give us 10*.0133 = .133, or a '''13.3% chance to kill exactly one zombie'''. Now we can compute the possibility of any given scenario, but to inflict two wounds we would need to know how many ways you can organize two successes out of ten tests. Same thing for three, or four, or whatever else. For one success in ten tests, that was easy. For two or more, it's really annoying. Fortunately, we have this function on our calculators fittingly called a 'Combination': Simply put, a Combination is the number of ways an event can occur in a set, ignoring order. This is important to us because we don't care what order these wounds are inflicted in and we don't want to spend all day multiplying numbers (only most of the day). A Combination combines two numbers, the number of tests and the number of successes. I'm going to call the number of tests T and the number of successes S. The Combination of T and S is written 'T choose S', or TcS. For the curious, the internal math on a Combination: <div class="toccolours mw-collapsible mw-collapsed" style="width:800px"> Know what a factorial is? In math, the exclamation point pulls double duty both as a point of excitement and also as notation for 'multiply this number by everything below it'. 5!, for example, is 5*4*3*2*1. Everyone learns about them in middle school, then nobody ever uses them. ...until now. [[File:Probability Eq7a.png|x90px]] So, 10C3 = 10! / (3! * 7!) = (10*9*8*7*6*5*4*3*2*1)/((3*2*1)*(7*6*5*4*3*2*1)). Cool thing is, the sequence 7*6*5*4*3*2*1 will always show up in the numerator and the denominator. We can cross it right off. 10C3 = (10*9*8)/(3*2*1). Way better. Even by hand it's not too hard to get to 120. However, we didn't get to be the dominant species on the planet by doing things the hard way. Just make Wolfram Alpha do it: [https://www.wolframalpha.com/input/?i=combination(10,3)] </div> For the less curious, 10c3 = Make WolframAlpha do it: [https://www.wolframalpha.com/input/?i=combination(10,3) 120]. Alright, we've got our tool. Back on track. Ten marines, three zombies. The probability of any scenario that delivers '''S''' wounds from '''T''' marines with a per-marine kill rate of '''P''' is [[File:Probability Eq8.png|x30px]]. There are '''TcS''' ways for that scenario to occur. We're down to the good stuff: Probability of inflicting exactly S wounds = [[File:Probability Eq9.png|x30px]]. Exactly three wounds, ten marines, three zombies? 10c3 * (.29^3)*(.71^(10-3)). [https://www.wolframalpha.com/input/?i=combination(10,3)*(.29%5E3)*(.71%5E(10-3)) Wolfram Alpha, away!] '''26.6%''' Ever so close. That's the chance of exactly three unsaved wounds. We would be fine with four, or five, or any other number above three. So we need to either [https://www.wolframalpha.com/input/?i=sum+combination(10,j)*(.29%5Ej)*(.71%5E(10-j)),+j%3D3+to+10 add up everything above S=3], or [https://www.wolframalpha.com/input/?i=1-sum+combination(10,j)*(.29%5Ej)*(.71%5E(10-j)),+j%3D0+to+2 add the results for zero, one, and two wounds and subtract that from one]. '''59% chance.''' This game is going to be close, but the marines are more likely than not to win. '''TL;DR''' The general form of all this is that if you have a number of tries T each with a success rate of P, the chance of getting exactly S successes is [[File:Probability Eq9.png|x30px]]. If you're looking for at least S successes, add the results of this formula for everything between S and T. Or, if you're a real human with things to do, [https://www.wolframalpha.com/input/?i=sum+(combination(T,j)*(P%5Ej)*((1-P)%5E(T-j))),+j%3DS+to+T+where+P%3D.29,+S%3D3,+T%3D10 make a machine do it]. This is pretty easy to modify. Just change the inputs a little bit to try things out. [https://www.wolframalpha.com/input/?i=sum+(combination(T,j)*(P%5Ej)*((1-P)%5E(T-j))),+j%3DS+to+T+where+P%3D(2%2F3*2%2F3*2%2F3),+S%3D3,+T%3D20 Marines are rapid firing]? [https://www.wolframalpha.com/input/?i=sum+(combination(T,j)*(P%5Ej)*((1-P)%5E(T-j))),+j%3DS+to+T+where+P%3D(2%2F3*2%2F3),+S%3D3,+T%3D10 Plague zombies are normal cultists]? [https://www.wolframalpha.com/input/?i=sum+(combination(T,j)*(P%5Ej)*((1-P)%5E(T-j))),+j%3DS+to+T+where+P%3D(2%2F3*5%2F6*2%2F3),+S%3D4,+T%3D8 Eight devastators firing S8 AP3 krak missiles at a T6 3+ Carnifex with 5+ cover]? Enjoy.
Summary:
Please note that all contributions to 2d4chan may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
2d4chan:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information