Maths!

Mundane & Pointless Stuff I Must Share: The Off Topic Forum

Moderator: Moderators

Post Reply
User avatar
codeGlaze
Duke
Posts: 1083
Joined: Wed Oct 05, 2011 9:38 pm

Maths!

Post by codeGlaze »

Just a quick question, more or less to educate myself.

Each side of a d20 has a 5% chance of landing up.
So if you land a 1 or 20, would a SECOND (confirmation) roll aiming for a 17-20 (or 1-4) effectively bring the chance of a "crit" to 1%?

Or does that second roll skew the probability completely?

edit: grammar
Last edited by codeGlaze on Wed Oct 24, 2012 11:27 pm, edited 1 time in total.
ishy
Duke
Posts: 2404
Joined: Fri Aug 05, 2011 2:59 pm

Re: Maths!

Post by ishy »

codeGlaze wrote:Each side of a d20 has a 5% chance of landing up.
So if you land a 1 or 20, would a SECOND (confirmation) roll aiming for a 17-20 (or 1-4) effectively bring the chance of a "crit" to 1%?

Or does that second roll skew the probability completely?

edit: grammar
17-20 is 20%, [5% * 20% = 1%]
Gary Gygax wrote:The player’s path to role-playing mastery begins with a thorough understanding of the rules of the game
Bigode wrote:I wouldn't normally make that blanket of a suggestion, but you seem to deserve it: scroll through the entire forum, read anything that looks interesting in term of design experience, then come back.
User avatar
Ancient History
Serious Badass
Posts: 12708
Joined: Wed Aug 18, 2010 12:57 pm

Post by Ancient History »

Here's how you look at it: if the rolls are independent of each other, the probabilities are added. If the rolls are dependent on each other, the probabilities are multiplied.

The probability to roll a 20 on a d20 is 1/20 = 0.05

If you roll two d20s, the chance that one of them will roll a 20 is 1/20 + 1/20 = 0.1

If you roll two d20s, the chance that both of them will roll 20 is 1/20 * 1/20 = 0.0025

The probability to roll a 17, 18, 19, or 20 on a d20 is 4/20 = 0.2

So if you roll two d20s, the chance that one will roll 20 (0.1) and one will roll 17-20 (0.2) is 0.05 * 0.2 = 0.01

So you have a 1% chance to roll a crit.

Of course, not all dice are made very well, so the odds of rolling a 20 or a 1 are actually usually less than 5% on average.
Last edited by Ancient History on Wed Oct 24, 2012 11:36 pm, edited 1 time in total.
User avatar
codeGlaze
Duke
Posts: 1083
Joined: Wed Oct 05, 2011 9:38 pm

Post by codeGlaze »

Thank you very much, Ancient. :D

Probability was one of the areas of math that has always blurred together in my mind's eye. (Always seeming more complex than it is.

So thank you, again. Especially for running it out like that. :)
Koumei
Serious Badass
Posts: 13970
Joined: Fri Mar 07, 2008 7:54 pm
Location: South Ausfailia

Post by Koumei »

Ancient History wrote:If you roll two d20s, the chance that one of them will roll a 20 is 1/20 + 1/20 = 0.1
Not quite. The chance is actually 100%, minus "the chance of you rolling 1-19 on the first, multiplied by the chance of you rolling 1-19 on the second". Otherwise you'd be guaranteed, rather than likely, to roll a natural 20 on 20d20.

So it's 100%-(95%^2)
=100%-90.25%
=9.75%

Which is almost 0.1 but not quite.
Count Arioch the 28th wrote:There is NOTHING better than lesbians. Lesbians make everything better.
Whatever
Prince
Posts: 2549
Joined: Tue Jun 28, 2011 2:05 am

Post by Whatever »

An even more nitpicky nitpick. Koumei has the odds of rolling at least one 20 when you roll two d20s. The odds of rolling exactly one 20 on two dice is 9.5%.
User avatar
Ancient History
Serious Badass
Posts: 12708
Joined: Wed Aug 18, 2010 12:57 pm

Post by Ancient History »

You are right, in my haste I neglected my maths. Serves me right for being a boob.

Naturally of course, you can see how some of the crit-modifiers affect this - opening up the threat range, allowing re-rolls, etc. can significantly improve the odds of a crit. But "significantly" is still often less than, say, 10%.
User avatar
codeGlaze
Duke
Posts: 1083
Joined: Wed Oct 05, 2011 9:38 pm

Post by codeGlaze »

Koumei wrote:
Ancient History wrote:If you roll two d20s, the chance that one of them will roll a 20 is 1/20 + 1/20 = 0.1
Not quite. The chance is actually 100%, minus "the chance of you rolling 1-19 on the first, multiplied by the chance of you rolling 1-19 on the second". Otherwise you'd be guaranteed, rather than likely, to roll a natural 20 on 20d20.

So it's 100%-(95%^2)
=100%-90.25%
=9.75%

Which is almost 0.1 but not quite.
Wait... does this cover only rolling the second die if the first die meets a criteria? (Such as rolling a 20 or a 1)

The initial thought process was to parse down a 5% chance to a 1% chance. While still keeping d20s (so basically a spin on crit confirm). Stemming from a thought experiment to reward a person for actually scoring in that 1% range.

And are you using 0.1 (in your final sentence) on a 100.0, 10.0: 100, or 1.0 : 100 scale?
Last edited by codeGlaze on Thu Oct 25, 2012 1:35 am, edited 3 times in total.
Koumei
Serious Badass
Posts: 13970
Joined: Fri Mar 07, 2008 7:54 pm
Location: South Ausfailia

Post by Koumei »

The chance of you rolling a 20 on 1d20 is 5%.
Therefore the chance of you not doing so is 95%.

So, having rolled a 20, your chance of rolling another twenty is 5% - for a total chance of 5%*5% = 0.25%

On the other hand, if the first die comes up as not twenty, you still have a 5% chance of rolling a twenty on the second, and a 95% chance of rolling "anything else". So your total chance of rolling "not twenty" (for both dice) is 95%*95% = 90.25%, and your total chance of rolling "One or more twenties" (for both dice, not caring which comes up 20) is 9.75%

Now if you only care about their second roll if the first roll is a twenty, you can ignore the above paragraph because it assumes you rolled a 1-19. In that case, just look at the one above, where a 20 is 5%, and if you wanted 1% you'd basically go "You need a 20, then a 17+" (20%*5% = 1%).

By 0.1 I meant "where 1.0 is 100%" so "almost 0.1" meant "almost 10%". I should have been clearer, given I was switching between percentages and decimals.
Count Arioch the 28th wrote:There is NOTHING better than lesbians. Lesbians make everything better.
User avatar
codeGlaze
Duke
Posts: 1083
Joined: Wed Oct 05, 2011 9:38 pm

Post by codeGlaze »

Okay, so then my initial math was right.

With the second die only being cast if the first result is a natural 20 as long as the second d20 roll is a range (17-20), which I posited earlier, would allow for a 1% "filter" so to speak.

Thanks a bunch, guys. :)
Last edited by codeGlaze on Thu Oct 25, 2012 3:08 am, edited 1 time in total.
Koumei
Serious Badass
Posts: 13970
Joined: Fri Mar 07, 2008 7:54 pm
Location: South Ausfailia

Post by Koumei »

Here's my math question: who the fuck decided that x^0 = 1, and why did everyone go along with this? How does it work? For the main part is seems entirely theoretical anyway, and the only thing it works nicely for is 10^x, where it's 1, followed by x zeroes.
Count Arioch the 28th wrote:There is NOTHING better than lesbians. Lesbians make everything better.
TarkisFlux
Duke
Posts: 1147
Joined: Sun Jun 22, 2008 9:44 pm
Location: Magic Mountain, CA
Contact:

Post by TarkisFlux »

Koumei wrote:Here's my math question: who the fuck decided that x^0 = 1, and why did everyone go along with this? How does it work? For the main part is seems entirely theoretical anyway, and the only thing it works nicely for is 10^x, where it's 1, followed by x zeroes.
I'm pretty sure it's a limit thing. X^(1/Y) is the Yth root of X (so X^(1/2) == SqRt(X) ). Do some limit magic and send Y -> infinity, and you can see that 1/Y -> 0 and the Yth root of X -> 1. Thus X^0 = 1.

There may be another reason why this is the case, but it's not coming to me off hand.

[Edit] Since negative exponents basically throw the thing into the denominator (i.e. X^(-12) == 1/(X^12) ), setting X^0 = 1 also patches the function nicely for X^Y, where you hold X constant and vary Y from positive infinity to negative infinity. Which is probably a side effect of the definition and not a reason for it, but still.
Last edited by TarkisFlux on Thu Oct 25, 2012 6:24 am, edited 3 times in total.
The wiki you should be linking to when you need a wiki link - http://www.dnd-wiki.org

Fectin: "Ant, what is best in life?"
Ant: "Ethically, a task well-completed for the good of the colony. Experientially, endorphins."
name_here
Prince
Posts: 3346
Joined: Fri Mar 07, 2008 7:55 pm

Post by name_here »

Probably because X^n * X^-n = X*(1/X) = 1 and X^(n + (-n))

Multiplicative reciprocals equal one, and multiplying powers of a number gets you that number to the sum of the powers.
Last edited by name_here on Thu Oct 25, 2012 6:30 am, edited 1 time in total.
DSMatticus wrote:It's not just that everything you say is stupid, but that they are Gordian knots of stupid that leave me completely bewildered as to where to even begin. After hearing you speak Alexander the Great would stab you and triumphantly declare the puzzle solved.
Username17
Serious Badass
Posts: 29894
Joined: Fri Mar 07, 2008 7:54 pm

Post by Username17 »

Koumei wrote:Here's my math question: who the fuck decided that x^0 = 1, and why did everyone go along with this? How does it work? For the main part is seems entirely theoretical anyway, and the only thing it works nicely for is 10^x, where it's 1, followed by x zeroes.
Let's say you have X^Y. That's some number with X multiplied by itself Y times. And now let's say you have X^(Y-1). That is some number with X multiplied by itself (Y-1) times. But it's also the previous number divided by X. So it would be fair to say that for any X and Y, X^(Y-1) is simply X^Y/X, right?

Now let's consider the case where Y is 1. X^1 is of course X itself. And X^(Y-1) is now X^0. And so we can now show that X^0 = X/X, which is 1 for any X that doesn't have stupid properties.

-Username17
User avatar
Ancient History
Serious Badass
Posts: 12708
Joined: Wed Aug 18, 2010 12:57 pm

Post by Ancient History »

Technically, 10^X is only 1 with X zeroes because we use base ten. If you used base two, for example, then 2^X would be 1 with X zeroes as well. Of course, you would still write it as 10^X.
User avatar
tussock
Prince
Posts: 2949
Joined: Sat Nov 07, 2009 4:28 am
Location: Online
Contact:

Post by tussock »

It works "nicely" for everything X > 0. X^n is ...

(5) ..., 1/125, 1/25, 1/5, 1, 5, 25, 125, ....
(4) ..., 1/64, 1/16, 1/4, 1, 4, 16, 64, ....
(3) ..., 1/27, 1/9, 1/3, 1, 3, 9, 27, ....
(2) ..., 1/8, 1/4, 1/2, 1, 2, 4, 8, ....
(1) ..., 1, 1, 1, 1, 1, 1, 1, ....
(1/2) ..., 8, 4, 2, 1, 1/2, 1/4, 1/8, ....

X^0 = 1 because you have to multiply something by X to get X in the first place. Note that 0^0 is undefined, and negative bases involve imaginary numbers under the hood.
PC, SJW, anti-fascist, not being a dick, or working on it, he/him.
Koumei
Serious Badass
Posts: 13970
Joined: Fri Mar 07, 2008 7:54 pm
Location: South Ausfailia

Post by Koumei »

Thanks, that really cleared that up.
Count Arioch the 28th wrote:There is NOTHING better than lesbians. Lesbians make everything better.
User avatar
codeGlaze
Duke
Posts: 1083
Joined: Wed Oct 05, 2011 9:38 pm

Post by codeGlaze »

What's the name of the equation that goes something like this...
y = 2;
X = ( 1*y )+( 2*y )+( 3*y )+( 4*y );

The equation solves for x.
Last edited by codeGlaze on Mon Jan 21, 2013 3:06 pm, edited 1 time in total.
User avatar
Juton
Duke
Posts: 1415
Joined: Mon Jan 04, 2010 3:08 pm
Location: Ontario, Canada

Post by Juton »

Isn't that equation just X=10y? Do the number of terms change dependent on y?
Oh thank God, finally a thread about how Fighters in D&D suck. This was a long time coming. - Schwarzkopf
John Magnum
Knight-Baron
Posts: 826
Joined: Tue Feb 14, 2012 12:49 am

Post by John Magnum »

He probably means the formula for the sum of some finite arithmetic sequence.

If your sum is i=1..k of (b + ai), then the total is equal to [b + (k + 1)a] * [k * (k + 1)]/2.

The way of getting that is that you look at 1y + 2y + 3y + 4y. You note that 1y + 4y = 2y + 3y = 5y, and there are two pairs of value 5y each, so the sum is 10y. This works for an arithmetic series of any length. Taking pairs from opposite ends of the sequence and counting inward is a nice way of summing it up.
Last edited by John Magnum on Mon Jan 21, 2013 4:47 pm, edited 1 time in total.
-JM
Username17
Serious Badass
Posts: 29894
Joined: Fri Mar 07, 2008 7:54 pm

Post by Username17 »

You're taking triangular numbers and then multiplying them by the scalar value Y. So it's just triangular progression.

1, 3, 6, 10, 15, 21, 28...

For the Nth value, the value is: N*(N+1)/2. To scale it by Y, you'd just have it be: N*(N+1)/2*Y

-Username17
User avatar
codeGlaze
Duke
Posts: 1083
Joined: Wed Oct 05, 2011 9:38 pm

Post by codeGlaze »

:D Thanks guys!
Post Reply