ปัญหาต้นไม้เงินวิเศษ


19

ฉันคิดว่าปัญหานี้ในห้องอาบน้ำมันเป็นแรงบันดาลใจจากกลยุทธ์การลงทุน

สมมติว่ามีต้นไม้เงินวิเศษ ทุกวันคุณสามารถเสนอเงินจำนวนหนึ่งให้กับต้นไม้เงินและมันจะเพิ่มขึ้นเป็นสามเท่าหรือทำลายมันด้วยความน่าจะเป็น 50/50 คุณสังเกตเห็นทันทีว่าโดยเฉลี่ยคุณจะได้รับเงินจากการทำเช่นนี้และกระตือรือร้นที่จะใช้ประโยชน์จากต้นไม้เงิน อย่างไรก็ตามหากคุณเสนอเงินทั้งหมดในครั้งเดียวคุณจะได้ 50% ของการสูญเสียเงินทั้งหมด ยอมรับไม่ได้! คุณเป็นคนที่ไม่ชอบความเสี่ยงดังนั้นคุณตัดสินใจที่จะคิดกลยุทธ์ คุณต้องการลดอัตราต่อรองของการสูญเสียทุกสิ่งทุกอย่าง แต่คุณต้องการทำเงินให้ได้มากที่สุด! คุณคิดสิ่งต่อไปนี้ทุกวันคุณเสนอ 20% ของเงินทุนปัจจุบันให้กับต้นไม้เงิน สมมติว่าราคาต่ำสุดที่คุณสามารถเสนอได้คือ 1 เซ็นต์, มันจะใช้เวลาขาดทุน 31 ครั้งในการสูญเสียเงินทั้งหมดของคุณถ้าคุณเริ่มต้นด้วย 10 ดอลลาร์ มีอะไรอีก, ยิ่งคุณมีรายได้มากเท่าไหร่การสูญเสียทุกอย่างก็จะยิ่งมากขึ้นเท่านั้น คุณเริ่มต้นรับเงินสดจำนวนมากอย่างรวดเร็ว แต่ความคิดปรากฏขึ้นในหัวของคุณ: คุณสามารถเสนอ 30% ในแต่ละวันและหารายได้เพิ่ม! แต่เดี๋ยวก่อนทำไมไม่เสนอ 35% 50%? อยู่มาวันหนึ่งด้วยสัญลักษณ์ดอลลาร์ขนาดใหญ่ในดวงตาของคุณคุณวิ่งไปที่ต้นไม้เงินกับเงินล้านของคุณและเสนอเงินสด 100% ซึ่งต้นไม้เงินจะเผาไหม้ทันที วันรุ่งขึ้นคุณจะได้งานที่ McDonalds ซึ่งต้นไม้เงินเผาไหม้ทันที วันรุ่งขึ้นคุณจะได้งานที่ McDonalds ซึ่งต้นไม้เงินเผาไหม้ทันที วันรุ่งขึ้นคุณจะได้งานที่ McDonalds

มีเปอร์เซ็นต์ที่เหมาะสมของเงินสดที่คุณสามารถเสนอได้โดยไม่สูญเสียทั้งหมดหรือไม่?

(ย่อย) คำถาม:

หากมีอัตราร้อยละที่เหมาะสมที่คุณควรเสนอให้คงที่นี้ (เช่น 20% ทุกวัน) หรือร้อยละควรเติบโตตามการเพิ่มทุนของคุณหรือไม่

โดยเสนอ 20% ทุกวันโอกาสในการสูญเสียเงินทั้งหมดของคุณลดลงหรือเพิ่มขึ้นเมื่อเวลาผ่านไป? มีอัตราร้อยละของอัตราการสูญเสียเงินทั้งหมดที่เพิ่มขึ้นเมื่อเวลาผ่านไปหรือไม่?


7
ดูเหมือนว่าจะเป็นการเปลี่ยนแปลงในความพินาศของนักพนัน
Robert Long

2
คำถามนี้ขึ้นอยู่กับว่าจะมีการเซ็นต์บางส่วนหรือไม่ นอกจากนี้ยังมีเป้าหมายที่เป็นไปได้มากมายที่ใครบางคนอาจมีในสถานการณ์นี้ เป้าหมายที่แตกต่างกันจะมีกลยุทธ์ที่ดีที่สุดที่แตกต่างกัน
Buge

คำตอบ:


19

นี่เป็นปัญหาที่รู้จักกันดี มันเรียกว่าเดิมพันเคลลี่ คำตอบโดยวิธีคือ 1 ใน 3 มันเทียบเท่ากับการเพิ่มยูทิลิตี้การบันทึกความมั่งคั่งให้สูงสุด

เคลลี่เริ่มต้นด้วยการใช้เวลาไม่มีที่สิ้นสุดและจากนั้นก็แก้ปัญหาถอยหลัง เนื่องจากคุณสามารถแสดงผลตอบแทนในแง่ของการทบต้นอย่างต่อเนื่องดังนั้นคุณจึงสามารถย้อนกลับกระบวนการและแสดงในบันทึกได้ ฉันจะใช้คำอธิบายยูทิลิตี้บันทึก แต่ยูทิลิตี้บันทึกเป็นความสะดวกสบาย หากคุณเพิ่มความมั่งคั่งให้สูงสุดเท่ากับnคุณจะพบกับฟังก์ชั่นที่ใช้งานได้เหมือนกับยูทิลิตี้บันทึก หากbคืออัตราต่อรองการจ่ายเงินและpคือความน่าจะเป็นที่จะชนะและXคืออัตราร้อยละของความมั่งคั่งที่ลงทุน

สำหรับการเดิมพันไบนารีE(log(X))=plog(1+bX)+(1p)log(1X)เป็นระยะเวลาเดียวและความมั่งคั่งหน่วย

ddXE[log(x)]=ddX[plog(1+bX)+(1p)log(1X)]
=pb1+bX1p1X

การตั้งค่าอนุพันธ์เป็นศูนย์เพื่อค้นหา extrema

pb1+bX1p1X=0

ข้ามการคูณคุณท้ายด้วย

pb(1X)(1p)(1+bX)=0
pbpbX1bX+p+pbX=0
bX=pb1+p
X=bp(1p)b

ในกรณีของคุณ

X=3×12(112)3=13.

คุณสามารถขยายสิ่งนี้ไปสู่ผลลัพธ์ที่หลากหลายหรือต่อเนื่องโดยการแก้ปัญหาความมั่งคั่งที่คาดหวังไว้เหนือการกระจายความน่าจะเป็นร่วมการเลือกการจัดสรรและขึ้นอยู่กับข้อ จำกัด ใด ๆ ที่น่าสนใจหากคุณดำเนินการในลักษณะนี้โดยรวมถึงข้อ จำกัด เช่นความสามารถในการชำระเงินจำนองและอื่น ๆ คุณจะต้องคำนึงถึงความเสี่ยงทั้งหมดและคุณมีการปรับความเสี่ยงหรือควบคุมความเสี่ยงอย่างน้อย วิธีการแก้.

Desiderata จุดประสงค์ที่แท้จริงของการวิจัยเริ่มแรกนั้นเกี่ยวข้องกับการเดิมพันที่ขึ้นอยู่กับสัญญาณรบกวน ในกรณีที่เฉพาะเจาะจงเท่าไหร่ที่จะเล่นการพนันในสัญญาณอิเล็กทรอนิกส์ที่มีเสียงดังซึ่งมันแสดงให้เห็นการเปิดตัวของอาวุธนิวเคลียร์โดยสหภาพโซเวียต มีการเปิดตัวใกล้หลายครั้งทั้งสหรัฐอเมริกาและรัสเซียซึ่งเห็นได้ชัดว่ามีข้อผิดพลาด คุณเล่นพนันกับสัญญาณมากแค่ไหน?


กลยุทธ์นี้จะให้ความเสี่ยงสูงขึ้นต่อการแตกฉันคิดว่าเมื่อเทียบกับเศษส่วนที่น้อยลง
ความน่าจะเป็นทาง

@probabilityislogic เฉพาะในกรณีที่มีเพนนีอยู่เท่านั้น ในกรณีที่ไม่ต่อเนื่องมันจะกลายเป็นจริงเพราะคุณสามารถเดิมพันเงินครั้งสุดท้ายของคุณ คุณไม่สามารถเดิมพันหนึ่งในสามของเงิน ในโลกที่แยกจากกันมันเป็นความจริงอย่างแท้จริงว่าความน่าจะเป็นของการล้มละลายจะต้องเพิ่มขึ้นในขนาดการจัดสรรโดยไม่ขึ้นกับกรณีผลตอบแทน การจัดสรร 2% มีความน่าจะเป็นที่จะล้มละลายมากกว่า 1% ในโลกที่ไม่ต่อเนื่อง
Dave Harris

@probabilityislogic ถ้าคุณเริ่มต้นด้วย 3 เซนต์แล้วมันมีความเสี่ยง หากคุณเริ่มต้นด้วย $ 550 มีโอกาสน้อยกว่าหนึ่งใน 1024 ที่จะล้มละลาย สำหรับขนาดหม้อที่เหมาะสมความเสี่ยงของการยุบตัวที่ไม่ต่อเนื่องนั้นจะมีขนาดเล็กเว้นแต่ว่าคุณจะไปถึงอนันต์จริงๆ
Dave Harris

ฉันคาดหวังว่านี่จะเป็นปัญหาที่ทราบกันแล้ว แต่ฉันไม่รู้ว่าจะหามันได้อย่างไร ขอบคุณสำหรับการกล่าวถึงของเคลลี่ แต่คำถาม: วิกิพีเดียในเกณฑ์เคลลี่กล่าวถึงสูตรต่อไปนี้เพื่อคำนวณเปอร์เซ็นต์ที่เหมาะสม: (bp-q) / b ที่ b คือ # ดอลลาร์ที่คุณได้รับจากการเดิมพัน 1 $, p ความน่าจะเป็นที่จะชนะและ q โอกาสเสีย ถ้าฉันกรอกสิ่งนี้ในสถานการณ์ของฉันฉันจะได้รับ: (2 * 0.5-0.5) /2=0.25 ความหมายเปอร์เซ็นต์การเดิมพันที่เหมาะสมที่สุดคือ 25% อะไรเป็นสาเหตุของความแตกต่างนี้กับคำตอบของคุณใน 1 ใน 3?
ElectronicToothpick

3
@ ElectronicToothpick หากคุณกรอก b = 3 คุณจะได้รับ 1/3 ความแตกต่างคือวิธีพิจารณาการจ่ายเงินสามครั้ง สมมติว่าคุณเริ่มต้นด้วย 1 ดอลลาร์และคุณเดิมพัน 50 เซ็นต์จากนั้นคุณจะพิจารณาการจ่ายเงินสามเท่าเมื่อสิ้นสุดด้วย 50 เซ็นต์ 50 เซ็นต์หรือ 2 ดอลลาร์ (b = 2 คือลบ 50 เซ็นต์หรือบวก 2 คูณ 50 เซ็นต์) เทียบกับห้าสิบห้าสิบ 50 เซ็นต์หรือ 2.50 ดอลลาร์ (b = 3 คือลบ 50 เซ็นต์หรือบวก 3 ครั้ง 50 เซ็นต์)
Sextus Empiricus

5

ฉันชอบคำตอบที่เดฟแฮร์ริสให้ไว้ แม้ว่าฉันจะมาที่ปัญหาจากมุมมอง "ความเสี่ยงต่ำ" มากกว่าการเพิ่มผลกำไรสูงสุด

การเดินแบบสุ่มที่คุณกำลังทำสมมติว่าการเดิมพันเศษส่วนของคุณคือqและความน่าจะเป็นในการชนะp=0.5ได้รับเป็น

Yt|Yt1=(1q+3qXt)Yt1
ที่XtBernoulli(p) ) โดยเฉลี่ยคุณมี
E(Yt|Yt1)=(1q+3pq)Yt1
คุณสามารถใช้มันซ้ำ ๆ เพื่อรับ
Yt|Y0=Y0j=1t(1q+3qXt)
ด้วยค่าที่คาดหวัง
E(Yt|Y0)=(1q+3pq)tY0
คุณยังสามารถแสดงจำนวนเงินในเวลาtเป็นฟังก์ชั่นของตัวแปรสุ่มเดี่ยวZt=j=1tXtBinomial(t,p)แต่ สังเกตว่าZtไม่ได้เป็นอิสระจากZt1
Yt|Y0=Y0(1+2q)Zt(1q)tZt

กลยุทธ์ที่เป็นไปได้

คุณสามารถใช้สูตรนี้ในการกำหนด "ความเสี่ยงต่ำ" ความคุ้มค่าต่อคิวqบอกว่าสมมติว่าคุณต้องการที่จะให้แน่ใจว่าหลังจากkขาดทุนต่อเนื่องคุณยังคงมีความมั่งคั่งครึ่งเดิมของคุณ จากนั้นคุณตั้งค่าq=12k1

การยกตัวอย่างเช่นk=5หมายความว่าเราชุดq=0.129หรือk=15เราชุดq=0.045 0.045

Also, due to the recursive nature of the strategy, this risk is what you are taking every at every single bet. That is, at time s, by continuing to play you are ensuring that at time k+s your wealth will be at least 0.5Ys

discussion

the above strategy does not depend on the pay off from winning, but rather about setting a boundary on losing. We can get the expected winnings by substituting in the value for q we calculated, and at the time k that was used with the risk in mind.

however, it is interesting to look at the median rather than expected pay off at time t, which can be found by assuming median(Zt)tp.

Yk|Y0=Y0(1+2q)tp(1q)t(1p)
when p=0.5 the we have the ratio equal to (1+q2q2)0.5t. This is maximised when q=0.25 and greater than 1 when q<0.5

it is also interesting to calculate the chance you will be ahead at time t. to do this we need to determine the value z such that

(1+2q)z(1q)tz>1
doing some rearranging we find that the proportion of wins should satisfy
zt>log(1q)log(1q)log(1+2q)
This can be plugged into a normal approximation (note: mean of 0.5 and standard error of 0.5t) as
Pr(ahead at time t)Φ(tlog(1+2q)+log(1q)[log(1+2q)log(1q)])

which clearly shows the game has very good odds. the factor multiplying t is minimised when q=0 (maximised value of 13) and is monotonically decreasing as a function of q. so the "low risk" strategy is to bet a very small fraction of your wealth, and play a large number of times.

suppose we compare this with q=13 and q=1100. the factor for each case is 0.11 and 0.32. This means after 38 games you would have around a 95% chance to be ahead with the small bet, compared to a 75% chance with the larger bet. Additionally, you also have a chance of going broke with the larger bet, assuming you had to round your stake to the nearest 5 cents or dollar. Starting with 20 this could go 13.35,8.90,5.95,3.95,2.65,1.75,1.15,0.75,0.50,0.35,0.25,0.15,0.1,0.05,0. This is a sequence of 14 losses out of 38, and given the game would expect 19 losses, if you get unlucky with the first few bets, then even winning may not make up for a bad streak (e.g., if most of your wins occur once most of the wealth is gone). going broke with the smaller 1% stake is not possible in 38 games. The flip side is that the smaller stake will result in a much smaller profit on average, something like a 350 fold increase with the large bet compared to 1.2 increase with the small bet (i.e. you expect to have 24 dollars after 38 rounds with the small bet and 7000 dollars with the large bet).


it is if you consider that q is chosen in a low risk manner and we aren't calculating it for t>>k, this isn't too bad an approximation. So it is probably overstating the profit from the large betting strategy.
probabilityislogic

Your approach to maximize the median of Zt is actually the same as the approach from Dave Harris which is maximizing the mean of Zt (which is the same as the median of Zt). It would be different when one is maximizing the mean of Yt which is lognormal distributed and for which the mean and median are not the same.
Sextus Empiricus

5

I don't think this is much different from the Martingale. In your case, there are no doubling bets, but the winning payout is 3x.

I coded a "living replica" of your tree. I run 10 simulations. In each simulation (trace), you start with 200 coins and try with the tree, 1 coin each time for 20,000 times.

The only conditions that stop the simulation are bankruptcy or having "survived" 20k attempts

enter image description here

I think that whatever the odds, sooner or later bankruptcy awaits you.


The code is improvised javascript but dependency-free: https://repl.it/@cilofrapez/MagicTree-Roulette

It shows you the results straight away. The code is simple to tweak: to run however many simulations, bet amount, however many attempts... Feel free to play!

At the bottom of the code, each simulation's (by default 10) results are saved into a CSV file with two columns: spin number and money. I made that so it could be fed it to an online plotter for the graphs.

It'd be effortless to have it all automated locally using the Google Charts library for example. If you only want to see the results on the screen, you can comment that last part out as I mentioned in the file.

EDIT

Source code:

/**
 * License: MIT
 * Author: Carles Alcolea, 2019
 * Usage: I recommend using an online solution like repl.it to run this code.
 * Nonetheless, having node installed, it's as easy as running `node magicTree.js`.
 *
 * The code will run `simulations` number of scenarios, each scenario is equal in settings
 * which are self-descriptive: `betAmount`,`timesWinPayout`, `spinsPerSimulation`, `startingBankRoll`
 * and `winningOdds`.
 *
 * At the end of the code there's a part that will generate a *.csv file for each simulation run.
 * This is useful for ploting the resulting data using any such service or graphing library. If you
 * wish the code to generate the files for you, just set `saveResultsCSV` to true. All files will
 * have two columns: number of spin and current bankroll.
 */

const fs = require('fs'); // Only necessary if `saveResultsCSV` is true

/**
 * ==================================
 * You can play with the numbers of the following variables all you want:
 */
const betAmount          = 0.4,   // Percentage of bankroll that is offered to the tree
      winningOdds        = 0.5,
      startingBankRoll   = 200,
      timesWinPayout     = 2,
      simulations        = 5,
      spinsPerSimulation = 20000,
      saveResultsCSV     = false;
/**
 * ==================================
 */

const simWins = [];
let currentSim = 1;

//* Each simulation:
while (currentSim <= simulations) {
  let currentBankRoll = startingBankRoll,
      spin            = 0;
  const resultsArr  = [],
        progressArr = [];

  //* Each spin/bet:
  while (currentBankRoll > 0 && spin < spinsPerSimulation) {
    if (currentBankRoll === Infinity) break; // Can't hold more cash!
    let currentBet = Math.ceil(betAmount * currentBankRoll);
    if (currentBet > currentBankRoll) break;  // Can't afford more bets... bankrupt!

    const treeDecision = Math.random() < winningOdds;
    resultsArr.push(treeDecision);
    if (treeDecision) currentBankRoll += currentBet * timesWinPayout; else currentBankRoll -= currentBet;
    progressArr.push(currentBankRoll);
    spin++;
  }

  const wins = resultsArr.filter(el => el === true).length;
  const losses = resultsArr.filter(el => el === false).length;
  const didTheBankRollHold = (resultsArr.length === spinsPerSimulation) || currentBankRoll === Infinity;

  const progressPercent = didTheBankRollHold ? `(100%)` : `(Bankrupt at aprox ${((resultsArr.length / parseFloat(spinsPerSimulation)) * 100).toPrecision(4)}% progress)`;

  // Current simulation summary
  console.log(`
  - Simulation ${currentSim}: ${progressPercent === '(100%)' ? '✔' : '✘︎'}
    Total:      ${spin} spins out of ${spinsPerSimulation} ${progressPercent}
    Wins:       ${wins} (aprox ${((wins / parseFloat(resultsArr.length)) * 100).toPrecision(4)}%)
    Losses:     ${losses} (aprox ${((losses / parseFloat(resultsArr.length)) * 100).toPrecision(4)}%)
    Bankroll:   ${currentBankRoll}
  `);

  if (didTheBankRollHold) simWins.push(1);

  /**
   * ==================================
   * Saving data?
   */
  if (saveResultsCSV) {
    let data = `spinNumber, bankRoll`;
    if (!fs.existsSync('CSVresults')) fs.mkdirSync('CSVresults');
    progressArr.forEach((el, i) => {
      data += `\n${i + 1}, ${el}`;
    });
    fs.writeFileSync(`./CSVresults/results${currentSim}.csv`, data);
  }
  /**
   * ==================================
   */

  currentSim++;
}

// Total summary
console.log(`We ran ${simulations} simulations, with the goal of ${spinsPerSimulation} spins in each one.
Our bankroll (${startingBankRoll}) has survived ${simWins.length} out of ${simulations} simulations, with ${(1 - winningOdds) * 100}% chance of winning.`);
```

1
Are you able to post the code that you wrote for this as well please?
baxx

1
This is betting with a constant stake - but betting a fixed proportion of your wealth, such as 14 here, each time would produce a different result. You may need to adapt this to avoid fractional coins (e.g. round down unless this produces a value less than 1 coin, in which cases bet 1 coin)
Henry

@baxx Sure, I just updated the post. Henry, I'm not sure I understood you. I can adapt the code to fit different needs if you want.
Carles Alcolea

@CarlesAlcolea I was just saying that it would be nice if the code you used for the post was contained within the post itself. I'm not sure if the link to repl you've posted will die at some point or not
baxx

1
@baxx Sure! After writing this improvised program, I thought I should make a small online app, to be able to explore almost any situation of this kind easily. I didn't find any. Now I'm drowned in work so for the moment I leave the code in the post and the app on my to-do list
Carles Alcolea

4

Problem statement

Let Yt=log10(Mt) be the logarithm of the amount of money Mt the gambler has at time t.

Let q be the fraction of money that the gambler is betting.

Let Y0=1 be the amount of money that the gambler starts with (ten dollars). Let YL=2 be the amount of money where the gambler goes bankrupt (below 1 cent). For simplicity we add a rule that the gambler stops gambling when he has passed some amount of money YW (we can later lift this rule by taking the limit YW).

Random walk

You can see the growth and decline of the money as an asymmetric random walk. That is you can describe Yt as:

Yt=Y0+i=1tXi

where

P[Xi=aw=log(1+2q)]=P[Xi=al=log(1q)]=12

Probability of bankruptcy

Martingale

The expression

Zt=cYt

is a martingale when we choose c such that.

caw+cal=2
(where c<1 if q<0.5). Since in that case

E[Zt+1]=E[Zt]12caw+E[Zt]12cal=E[Zt]

Probability to end up bankrupt

The stopping time (losing/bankruptcy Yt<YL or winning Yt>YW) is almost surely finite since it requires in the worst case a winning streak (or losing streak) of a certain finite length, YWYLaw, which is almost surely gonna happen.

Then, we can use the optional stopping theorem to say E[Zτ] at the stopping time τ equals the expected value E[Z0] at time zero.

Thus

cY0=E[Z0]=E[Zτ]P[Yτ<L]cYL+(1P[Yτ<L])cYW

and

P[Yτ<YL]cY0cYWcYLcYW

and the limit YW

P[Yτ<YL]cY0YL

Conclusions

Is there an optimal percentage of your cash you can offer without losing it all?

Whichever is the optimal percentage will depend on how you value different profits. However, we can say something about the probability to lose it all.

Only when the gambler is betting zero fraction of his money then he will certainly not go bankrupt.

With increasing q the probability to go bankrupt will increase up to some point where the gambler will almost surely go bankrupt within a finite time (the gambler's ruin mentioned by Robert Long in the comments). This point, qgambler's ruin, is at

qgambler's ruin=11/b
This is the point where there is no solution for c below one. This is also the point where the increasing steps aw are smaller than the decreasing steps al.

Thus, for b=2, as long as the gambler bets less than half the money then the gambler will not certainly go bankrupt.

do the odds of losing all your money decrease or increase over time?

The probability to go bankrupt is dependent on the distance from the amount of money where the gambler goes bankrupt. When q<qgambler's ruin the gambler's money will, on average increase, and the probability to go bankrupt will, on average, decrease.

Bankruptcy probability when using the Kelly criterion.

When you use the Kelly criterion mentioned in Dave Harris answer, q=0.5(11/b), for b being the ratio between loss and profit in a single bet, then independent from b the value of c will be equal to 0.1 and the probability to go bankrupt will be 0.1SL.

That is, independent from the assymetry parameter b of the magic tree, the probability to go bankrupt, when using the Kelly criterion, is equal to the ratio of the amount of money where the gambler goes bankrupt and the amount of money that the gambler starts with. For ten dollars and 1 cent this is a 1:1000 probability to go bankrupt, when using the Kelly criterion.

Simulations

The simulations below show different simulated trajectories for different gambling strategies. The red trajectories are ones that ended up bankrupt (hit the line Yt=2).

simulations

Distribution of profits after time t

To further illustrate the possible outcomes of gambling with the money tree, you can model the distribution of Yt as a one dimensional diffusion process in a homogeneous force field and with an absorbing boundary (where the gambler get's bankrupt). The solution for this situation has been given by Smoluchowski

Smoluchowski, Marian V. "Über Brownsche Molekularbewegung unter Einwirkung äußerer Kräfte und deren Zusammenhang mit der verallgemeinerten Diffusionsgleichung." Annalen der Physik 353.24 (1916): 1103-1112. (online available via: https://www.physik.uni-augsburg.de/theo1/hanggi/History/BM-History.html)

Equation 8:

W(x0,x,t)=ec(xx0)2Dc2t4D2πDt[e(xx0)24Dte(x+x0)24Dt]

This diffusion equation relates to the tree problem when we set the speed c equal to the expected increase E[Yt], we set D equal to the variance of the change in a single steps Var(Xt), x0 is the initial amount of money, and t is the number of steps.

The image and code below demonstrate the equation:

  • The histogram shows the result from a simulation.

  • The dotted line shows a model when we use a naive normal distribution to approximate the distribution (this corresponds to the absence of the absorbing 'bankruptcy' barrier). This is wrong because some of the results above the bankruptcy level involve trajectories that have passed the bankruptcy level at an earlier time.

  • The continuous line is the approximation using the formula by Smoluchowski.

illustration as diffusion in force field

Codes

#
## 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))

}

"That is, independent from the assymetry parameter b of the magic tree, the probability to go bankrupt, when using the Kelly criterion, is equal to the ratio of the amount of money where the gambler goes bankrupt and the amount of money that the gambler starts with. For ten dollars and 1 cent this is a 1:1000 probability to go bankrupt" Im a bit surprised about this. So this means the probability to go bankrupt will be 1:1000 even if the payout is 10 times the offered money per round? How is this possible when the odds of going bankrupt decrease as your money grows?
ElectronicToothpick

1
@ElectronicToothpick If the payout is larger, and if you do not change the fraction that you gamble, then the probability to go bankrupt will be smaller. However, when you increase the fraction that you gamble, then this may not be true anymore. With the Kelly criterion, you will increase the fraction to gamble when the payout is higher. This will increase the expected value of the logarithm of the money, but as a consequence, the probability to go bankrupt will remain the same.
Sextus Empiricus

1
Actually, when the gambler is not using the Kelly criterion, which optimizes E[logMt], but instead chooses to optimize E[Mt], then the consequence is that a higher fraction of the amount of money is being gambled. Possibly this might lead to an increase in the risk of bankruptcy when the payout is made larger. I could add an analysis of this, but I am afraid that my answer is already too long and/or complex.
Sextus Empiricus
โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.