View Single Post
  #14  
Old 11-01-2007, 04:26 PM
ncray ncray is offline
Senior Member
 
Join Date: Apr 2005
Location: Palo Alto, CA
Posts: 386
Default Re: A tough variance problem (at least for me)

I just ran some simulations, but they were a 5 minute hack job, so let me know if you spot any mistakes. Still, I hope they shed some light on the problem.
#Let's just say you win a $3.22 with probability .1
#and the times you don't win the pot, you lose $.18 with probability .9.
#Then for a given hand your expectation is .1*3.22-.9*.18 = .16
#Your standard deviation is (.1*(3.22-.16)^2+.9*(-.18-.16)^2)^(1/2)=1.02

There are an infinite number of choices of p, the amount you win when u win a pot, and the amount you lose when you lose a pot, but I just took this one particular vector to run simulations on. My question(s) were "what is the prob. of a downswing of $q at any point during a 1000 hand run?" I let q vary in increments of $2 to $2...$30. My code in R is at the bottom.

[1] 2 (q = $2)
[1] 1 (the prob. of a downswing of $2 over 1k hands is 1 (not exactly, but rounded internally in R to I think around 15 sig fig accuracy))
[1] 4 (for q = $4)
[1] 1 (the prob. is still 1)
[1] 6 (for q = $6)
[1] 0.877 (the prob is .877...)
[1] 8
[1] 0.475
[1] 10
[1] 0.196
[1] 12
[1] 0.05
[1] 14
[1] 0.02
[1] 16
[1] 0.005
[1] 18
[1] 0.003
[1] 20
[1] 0
[1] 22
[1] 0
[1] 24
[1] 0
[1] 26
[1] 0
[1] 28
[1] 0
[1] 30
[1] 0

What to take away from this? It is extremely unlikely with the above choices of variables to encounter a downswing of more than $20 over a 1000 hand run.


for(q in 2*1:15)
{
data = matrix(ncol=1,nrow=1000)
for(j in 1:1000)
{
max = 0
cur = 0
flag = 0
for (i in 1:1000)
{
cur = cur + sample(c(3.22,-.16),1, prob = c(.1,.9))
if (cur > max) max = cur
if (cur < max - q) flag = 1
}
data[j]=flag
}
print(q)
print(mean(data))
}
Reply With Quote