问题陈述
Yt=log10(Mt)Mtt
q
Y0=1YL=−2YWYW→∞
随机漫步
Yt
Yt=Y0+∑i=1tXi
哪里
P[Xi=aw=log(1+2q)]=P[Xi=al=log(1−q)]=12
破产的可能性
鞅
表达方式
Zt=cYt
c
caw+cal=2
c<1q<0.5
E[Zt+1]=E[Zt]12caw+E[Zt]12cal=E[Zt]
破产的可能性
Yt<YLYt>YWYW−YLaw
E[Zτ]τE[Z0]
从而
cY0=E[Z0]=E[Zτ]≈P[Yτ<L]cYL+(1−P[Yτ<L])cYW
和
P[Yτ<YL]≈cY0−cYWcYL−cYW
YW→∞
P[Yτ<YL]≈cY0−YL
结论
是否可以提供不浪费全部现金的最佳百分比?
最佳百分比中的哪一个取决于您如何评估不同的利润。但是,我们可以说一下全部丢失的可能性。
只有当赌徒押注零钱时,他肯定不会破产。
qqgambler's ruinqgambler's ruin=1−1/b
cawal
b=2
随着时间的流逝,失去所有金钱的几率会减少还是增加?
q<qgambler's ruin
使用凯利准则时的破产概率。
q=0.5(1−1/b)bbc0.10.1S−L
b
模拟
Yt=−2
时间后的利润分配t
Yt
玛丽安五世(Marian V. Smoluchowski)。Annalen der Physik 353.24(1916):1103-1112。(可通过以下网址在线访问:https : //www.physik.uni-augsburg.de/theo1/hanggi/History/BM-History.html)
公式8:
W(x0,x,t)=e−c(x−x0)2D−c2t4D2πDt−−−−√[e−(x−x0)24Dt−e−(x+x0)24Dt]
cE[Yt]DVar(Xt)x0t
下面的图像和代码演示了等式:
代号
#
## Simulations of random walks and bankruptcy:
#
# functions to compute c
cx = function(c,x) {
c^log(1-x,10)+c^log(1+2*x,10) - 2
}
findc = function(x) {
r <- uniroot(cx, c(0,1-0.1^10),x=x,tol=10^-130)
r$root
}
# settings
set.seed(1)
n <- 100000
n2 <- 1000
q <- 0.45
# repeating different betting strategies
for (q in c(0.35,0.4,0.45)) {
# plot empty canvas
plot(1,-1000,
xlim=c(0,n2),ylim=c(-2,50),
type="l",
xlab = "time step", ylab = expression(log[10](M[t])) )
# steps in the logarithm of the money
steps <- c(log(1+2*q,10),log(1-q,10))
# counter for number of bankrupts
bank <- 0
# computing 1000 times
for (i in 1:1000) {
# sampling wins or looses
X_t <- sample(steps, n, replace = TRUE)
# compute log of money
Y_t <- 1+cumsum(X_t)
# compute money
M_t <- 10^Y_t
# optional stopping (bankruptcy)
tau <- min(c(n,which(-2 > Y_t)))
if (tau<n) {
bank <- bank+1
}
# plot only 100 to prevent clutter
if (i<=100) {
col=rgb(tau<n,0,0,0.5)
lines(1:tau,Y_t[1:tau],col=col)
}
}
text(0,45,paste0(bank, " bankruptcies out of 1000 \n", "theoretic bankruptcy rate is ", round(findc(q)^3,4)),cex=1,pos=4)
title(paste0("betting a fraction ", round(q,2)))
}
#
## Simulation of histogram of profits/results
#
# settings
set.seed(1)
rep <- 10000 # repetitions for histogram
n <- 5000 # time steps
q <- 0.45 # betting fraction
b <- 2 # betting ratio loss/profit
x0 <- 3 # starting money
# steps in the logarithm of the money
steps <- c(log(1+b*q,10),log(1-q,10))
# to prevent Moiré pattern in
# set binsize to discrete differences in results
binsize <- 2*(steps[1]-steps[2])
for (n in c(200,500,1000)) {
# computing several trials
pays <- rep(0,rep)
for (i in 1:rep) {
# sampling wins or looses
X_t <- sample(steps, n, replace = TRUE)
# you could also make steps according to a normal distribution
# this will give a smoother histogram
# to do this uncomment the line below
# X_t <- rnorm(n,mean(steps),sqrt(0.25*(steps[1]-steps[2])^2))
# compute log of money
Y_t <- x0+cumsum(X_t)
# compute money
M_t <- 10^Y_t
# optional stopping (bankruptcy)
tau <- min(c(n,which(Y_t < 0)))
if (tau<n) {
Y_t[n] <- 0
M_t[n] <- 0
}
pays[i] <- Y_t[n]
}
# histogram
h <- hist(pays[pays>0],
breaks = seq(0,round(2+max(pays)),binsize),
col=rgb(0,0,0,0.5),
ylim=c(0,1200),
xlab = "log(result)", ylab = "counts",
main = "")
title(paste0("after ", n ," steps"),line = 0)
# regular diffusion in a force field (shifted normal distribution)
x <- h$mids
mu <- x0+n*mean(steps)
sig <- sqrt(n*0.25*(steps[1]-steps[2])^2)
lines(x,rep*binsize*(dnorm(x,mu,sig)), lty=2)
# diffusion using the solution by Smoluchowski
# which accounts for absorption
lines(x,rep*binsize*Smoluchowski(x,x0,0.25*(steps[1]-steps[2])^2,mean(steps),n))
}