Two Plus Two Publishing LLC Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > General Gambling > Probability

Notices

Probability Discussions of probability theory

Reply
 
Thread Tools Display Modes
Old 08-07-2012, 02:18 AM   #1
old hand
 
Join Date: Sep 2002
Location: Unemployed and loving it
Posts: 1,680
Looking for a Quick Bit of Help with Standard Deviation Calculation

Hey Guys,

Let's say I'm playing a game, and on my turn I'm allowed two plays. Only the better result of my plays count, and I'm not allowed to make the same play twice on the same turn. I have these two plays:

Play A averages 25 points with a standard deviation of 10.
Play B averages 15 points with a standard deviation of 8.

If on my turn I make Play A & Play B, what's my average score for the turn?

What if the game allowed 3 plays on the same turn, under the same rules (only the best play counts, can't repeat the same play) and we had a Play C with an average of 12 points with a standard deviation of 7?

I know the formula to compute how often Play B is superior to Play A, but unfortunately, I don't know how to take that any further. If anyone could even just let me know terms to Google, that would probably be enough to get me going in the right direction here. Thanks a lot.
jek187 is offline   Reply With Quote
Old 08-07-2012, 03:46 AM   #2
Carpal \'Tunnel
 
BruceZ's Avatar
 
Join Date: Sep 2002
Posts: 8,896
Re: Looking for a Quick Bit of Help with Standard Deviation Calculation

Quote:
Originally Posted by jek187 View Post
Hey Guys,

Let's say I'm playing a game, and on my turn I'm allowed two plays. Only the better result of my plays count, and I'm not allowed to make the same play twice on the same turn. I have these two plays:

Play A averages 25 points with a standard deviation of 10.
Play B averages 15 points with a standard deviation of 8.

If on my turn I make Play A & Play B, what's my average score for the turn?

What if the game allowed 3 plays on the same turn, under the same rules (only the best play counts, can't repeat the same play) and we had a Play C with an average of 12 points with a standard deviation of 7?
Not enough info. What is the distribution of points? Normal? Uniform? Binomial? Something else? Is it continuous or discrete? Can you have negative points?

If a(x) and b(x) are the density functions for A and B (or distributions if discrete), then you want the double integral (or double sum if discrete) x*a(x)*b(y) as x ranges from y to the maximum value and y ranges over all values, plus y*a(x)*b(y) as y ranges from x to the maximum value and x ranges over all values.
BruceZ is offline   Reply With Quote
Old 08-07-2012, 04:56 AM   #3
old hand
 
Join Date: Sep 2002
Location: Unemployed and loving it
Posts: 1,680
Re: Looking for a Quick Bit of Help with Standard Deviation Calculation

Quote:
Originally Posted by BruceZ View Post
Not enough info. What is the distribution of points? Normal? Uniform? Binomial? Something else? Is it continuous or discrete? Can you have negative points?

If a(x) and b(x) are the density functions for A and B (or distributions if discrete), then you want the double integral (or double sum if discrete) x*a(x)*b(y) as x ranges from y to the maximum value and y ranges over all values, plus y*a(x)*b(y) as y ranges from x to the maximum value and x ranges over all values.
Hey Bruce, good to see you still kicking around.

The distribution of the points is a normal continuous distribution. Zero is the lowest score possible, so no negative points.

I've done some Googling on density functions, so ty for that term. What I've learned so far has been...daunting. My days of doing integrals are 15 years in the past, and I remember roughly 0 of it. I'm going to keep studying and Googling on the subject, but if you (or anyone else) happens to know of an Excel formula for this, or some sort of web-based solver, I think that would be pretty awesome.

Thanks for the help Bruce.
jek187 is offline   Reply With Quote
Old 08-07-2012, 07:27 AM   #4
Carpal \'Tunnel
 
BruceZ's Avatar
 
Join Date: Sep 2002
Posts: 8,896
Re: Looking for a Quick Bit of Help with Standard Deviation Calculation

Quote:
Originally Posted by jek187 View Post
The distribution of the points is a normal continuous distribution. Zero is the lowest score possible, so no negative points.
Those statements are incompatible with each other. A normal distribution allows scores to -infinity or it isn't a normal distribution.
BruceZ is offline   Reply With Quote
Old 08-07-2012, 10:25 AM   #5
Carpal \'Tunnel
 
BruceZ's Avatar
 
Join Date: Sep 2002
Posts: 8,896
Re: Looking for a Quick Bit of Help with Standard Deviation Calculation

If we use normal distributions but throw away negative points, the average is 26.7 for the first case, and 27.1 for the second case by R simulation of 10 million games. If we were to replace negative points with zero, it would only decrease the average scores by about 0.1 in this case, but that would cause the probability density to increase discontinuously at zero. R is a free download that you can get running very quickly. I think it's possible to do the integral if you needed a formula.


Code:
sims = 10000000

a = rnorm(sims, 25, 10)
b = rnorm(sims, 15, 8)
c = rnorm(sims, 12, 7)

m = pmax(a,b)[!(a<0 | b<0)]
sum(m)/length(m)

m = pmax(a,b,c)[!(a<0 | b<0 |c<0)]
sum(m)/length(m)

Output:

> m = pmax(a,b)[!(a<0 | b<0)]
> sum(m)/length(m)
[1] 26.71047
>
> m = pmax(a,b,c)[!(a<0 | b<0 |c<0)]
> sum(m)/length(m)
[1] 27.1327

Last edited by BruceZ; 08-07-2012 at 10:48 AM.
BruceZ is offline   Reply With Quote
Old 08-07-2012, 04:59 PM   #6
old hand
 
Join Date: Sep 2002
Location: Unemployed and loving it
Posts: 1,680
Re: Looking for a Quick Bit of Help with Standard Deviation Calculation

Sorry about the terminology screw up, you're of course correct that if the values can't be negative it's no longer a normal distribution. I obviously wasn't thinking about how the second part of my answer affected the first.

Thank you very much for both turning me onto R and providing me with the code to run the sims. That will serve my purposes pretty well.

Being able to solve the integrals would be good, but really, if I didn't have a way to get it into Excel to do some the calculations in batches, it wouldn't do me too much good over and above what I can do with R.

Thanks again for your help Bruce.
jek187 is offline   Reply With Quote

Reply
      

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -4. The time now is 08:05 PM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.
Copyright © 2008-2010, Two Plus Two Interactive