6 replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/ edited Apr 13 '17 at 12:56 I have been playing with some stochastic questions and specially the problem herehere.It seems no matter for the first time in bet, gambler is going to lose the first bet.Am I right?How can we correct the algorithm here? timstep = 5; win = BinomialProcess[.99]; samplepaths = 1; process = RandomFunction[Evaluate[win], {0, timstep - 1}, samplepaths]; ListLinePlot[process, Frame -> False, AxesLabel -> {Style["Time Step", Bold], Style["Number", Bold]}, PlotStyle -> {{Dashed, Black, Opacity[.9]}}, ImageSize -> 600] x1 = 100; alpha = 0.5;(*assume some value for alpha*)WinEvents = process["States"]; ST[WinEvents_?ListQ, x1_, alpha_, SimTime_] := Module[{}, FoldList[Max[If[#2 == 1, (1 + alpha) #1, (1 - alpha) #1], 0.] &, x1, Prepend[Differences@WinEvents, First@WinEvents]]]; simdat = ST[#, x1, alpha, timstep] & /@ WinEvents; Show[ ListLinePlot[Legended[Mean[simdat], ""], PlotRange -> All, PlotStyle -> {{AbsoluteThickness[3.5], Opacity[.9], Red}}, ImageSize -> 600], ListLinePlot[simdat, PlotRange -> All, PlotStyle -> {{Dashed, Black, Opacity[.7]}}], ListPlot[simdat, PlotRange -> All], Frame -> True]  I have been playing with some stochastic questions and specially the problem here.It seems no matter for the first time in bet, gambler is going to lose the first bet.Am I right?How can we correct the algorithm here? timstep = 5; win = BinomialProcess[.99]; samplepaths = 1; process = RandomFunction[Evaluate[win], {0, timstep - 1}, samplepaths]; ListLinePlot[process, Frame -> False, AxesLabel -> {Style["Time Step", Bold], Style["Number", Bold]}, PlotStyle -> {{Dashed, Black, Opacity[.9]}}, ImageSize -> 600] x1 = 100; alpha = 0.5;(*assume some value for alpha*)WinEvents = process["States"]; ST[WinEvents_?ListQ, x1_, alpha_, SimTime_] := Module[{}, FoldList[Max[If[#2 == 1, (1 + alpha) #1, (1 - alpha) #1], 0.] &, x1, Prepend[Differences@WinEvents, First@WinEvents]]]; simdat = ST[#, x1, alpha, timstep] & /@ WinEvents; Show[ ListLinePlot[Legended[Mean[simdat], ""], PlotRange -> All, PlotStyle -> {{AbsoluteThickness[3.5], Opacity[.9], Red}}, ImageSize -> 600], ListLinePlot[simdat, PlotRange -> All, PlotStyle -> {{Dashed, Black, Opacity[.7]}}], ListPlot[simdat, PlotRange -> All], Frame -> True]  I have been playing with some stochastic questions and specially the problem here.It seems no matter for the first time in bet, gambler is going to lose the first bet.Am I right?How can we correct the algorithm here? timstep = 5; win = BinomialProcess[.99]; samplepaths = 1; process = RandomFunction[Evaluate[win], {0, timstep - 1}, samplepaths]; ListLinePlot[process, Frame -> False, AxesLabel -> {Style["Time Step", Bold], Style["Number", Bold]}, PlotStyle -> {{Dashed, Black, Opacity[.9]}}, ImageSize -> 600] x1 = 100; alpha = 0.5;(*assume some value for alpha*)WinEvents = process["States"]; ST[WinEvents_?ListQ, x1_, alpha_, SimTime_] := Module[{}, FoldList[Max[If[#2 == 1, (1 + alpha) #1, (1 - alpha) #1], 0.] &, x1, Prepend[Differences@WinEvents, First@WinEvents]]]; simdat = ST[#, x1, alpha, timstep] & /@ WinEvents; Show[ ListLinePlot[Legended[Mean[simdat], ""], PlotRange -> All, PlotStyle -> {{AbsoluteThickness[3.5], Opacity[.9], Red}}, ImageSize -> 600], ListLinePlot[simdat, PlotRange -> All, PlotStyle -> {{Dashed, Black, Opacity[.7]}}], ListPlot[simdat, PlotRange -> All], Frame -> True]  5 deleted 41 characters in body edited Jul 2 '13 at 18:15 Alex 60044 silver badges2222 bronze badges I have been playing with some stochastic questions and specially the problem here.It seems no matter for the first time in bet, gambler is going to lose the first bet.Am I right?Followings, please test it for two paths.How can we correct the algorithm here? timstep = 5; win = BinomialProcess[.99]; samplepaths = 1; process = RandomFunction[Evaluate[win], {0, timstep - 1}, samplepaths]; ListLinePlot[process, Frame -> False, AxesLabel -> {Style["Time Step", Bold], Style["Number", Bold]}, PlotStyle -> {{Dashed, Black, Opacity[.9]}}, ImageSize -> 600] x1 = 100; alpha = 0.5;(*assume some value for alpha*)WinEvents = process["States"]; ST[WinEvents_?ListQ, x1_, alpha_, SimTime_] := Module[{}, FoldList[Max[If[#2 == 1, (1 + alpha) #1, (1 - alpha) #1], 0.] &, x1, Prepend[Differences@WinEvents, First@WinEvents]]]; simdat = ST[#, x1, alpha, timstep] & /@ WinEvents; Show[ ListLinePlot[Legended[Mean[simdat], ""], PlotRange -> All, PlotStyle -> {{AbsoluteThickness[3.5], Opacity[.9], Red}}, ImageSize -> 600], ListLinePlot[simdat, PlotRange -> All, PlotStyle -> {{Dashed, Black, Opacity[.7]}}], ListPlot[simdat, PlotRange -> All], Frame -> True]  I have been playing with some stochastic questions and specially the problem here.It seems no matter for the first time in bet, gambler is going to lose the first bet.Am I right?Followings, please test it for two paths.How can we correct the algorithm here? timstep = 5; win = BinomialProcess[.99]; samplepaths = 1; process = RandomFunction[Evaluate[win], {0, timstep - 1}, samplepaths]; ListLinePlot[process, Frame -> False, AxesLabel -> {Style["Time Step", Bold], Style["Number", Bold]}, PlotStyle -> {{Dashed, Black, Opacity[.9]}}, ImageSize -> 600] x1 = 100; alpha = 0.5;(*assume some value for alpha*)WinEvents = process["States"]; ST[WinEvents_?ListQ, x1_, alpha_, SimTime_] := Module[{}, FoldList[Max[If[#2 == 1, (1 + alpha) #1, (1 - alpha) #1], 0.] &, x1, Prepend[Differences@WinEvents, First@WinEvents]]]; simdat = ST[#, x1, alpha, timstep] & /@ WinEvents; Show[ ListLinePlot[Legended[Mean[simdat], ""], PlotRange -> All, PlotStyle -> {{AbsoluteThickness[3.5], Opacity[.9], Red}}, ImageSize -> 600], ListLinePlot[simdat, PlotRange -> All, PlotStyle -> {{Dashed, Black, Opacity[.7]}}], ListPlot[simdat, PlotRange -> All], Frame -> True]  I have been playing with some stochastic questions and specially the problem here.It seems no matter for the first time in bet, gambler is going to lose the first bet.Am I right?How can we correct the algorithm here? timstep = 5; win = BinomialProcess[.99]; samplepaths = 1; process = RandomFunction[Evaluate[win], {0, timstep - 1}, samplepaths]; ListLinePlot[process, Frame -> False, AxesLabel -> {Style["Time Step", Bold], Style["Number", Bold]}, PlotStyle -> {{Dashed, Black, Opacity[.9]}}, ImageSize -> 600] x1 = 100; alpha = 0.5;(*assume some value for alpha*)WinEvents = process["States"]; ST[WinEvents_?ListQ, x1_, alpha_, SimTime_] := Module[{}, FoldList[Max[If[#2 == 1, (1 + alpha) #1, (1 - alpha) #1], 0.] &, x1, Prepend[Differences@WinEvents, First@WinEvents]]]; simdat = ST[#, x1, alpha, timstep] & /@ WinEvents; Show[ ListLinePlot[Legended[Mean[simdat], ""], PlotRange -> All, PlotStyle -> {{AbsoluteThickness[3.5], Opacity[.9], Red}}, ImageSize -> 600], ListLinePlot[simdat, PlotRange -> All, PlotStyle -> {{Dashed, Black, Opacity[.7]}}], ListPlot[simdat, PlotRange -> All], Frame -> True]  4 added 747 characters in body edited Jul 2 '13 at 1:49 Alex 60044 silver badges2222 bronze badges I have been playing with some stochastic questions and specially the problem here.It seems no matter for the first time in bet, gambler is going to lose the first bet.Am I right?Followings, please test it for two paths.How can we correct the algorithm here? timstep = 20;5; win = BinomialProcess[.5];99]; samplepaths=2;samplepaths = 1; process = RandomFunction[Evaluate[win], {0, timstep - 1}, samplepaths]; ListLinePlot[process, InterpolationOrderFrame -> 0False, Frame AxesLabel -> True{Style["Time Step", Bold], Style["Number", Bold]}, PlotStyle -> {{Dashed, Black, Opacity[.9]}}, ImageSize -> 600] x1 = 100; alpha = 0.5;(*assume some value for alpha*)WinEvents = process["States"]; ST[WinEvents_?ListQ, x1_, alpha_, SimTime_] := Module[{}, FoldList[Max[If[#2 == 1, (1 + alpha) #1, (1 - alpha) #1], 0.] &, x1, Prepend[Differences@WinEvents, First@WinEvents]]]; simdat = ST[#, x1, alpha, timstep] & /@ WinEvents; Show[ ListLinePlot[Legended[Mean[simdat], ""], PlotRange -> All, PlotStyle -> {{AbsoluteThickness[3.5], Opacity[.9], Red}}, ImageSize -> 600], ListLinePlot[simdat, PlotRange -> All, PlotStyle -> {{Dashed, Black, Opacity[.7]}}], ListPlot[simdat, PlotRange -> All], Frame -> True]  I have been playing with some stochastic questions and specially the problem here.It seems no matter for the first time in bet, gambler is going to lose the first bet.Am I right?Followings, please test it for two paths.How can we correct the algorithm here? timstep = 20; win = BinomialProcess[.5]; samplepaths=2; process = RandomFunction[Evaluate[win], {0, timstep - 1}, samplepaths]; ListLinePlot[process, InterpolationOrder -> 0, Frame -> True, PlotStyle -> {{Dashed, Opacity[.9]}}]  I have been playing with some stochastic questions and specially the problem here.It seems no matter for the first time in bet, gambler is going to lose the first bet.Am I right?Followings, please test it for two paths.How can we correct the algorithm here? timstep = 5; win = BinomialProcess[.99]; samplepaths = 1; process = RandomFunction[Evaluate[win], {0, timstep - 1}, samplepaths]; ListLinePlot[process, Frame -> False, AxesLabel -> {Style["Time Step", Bold], Style["Number", Bold]}, PlotStyle -> {{Dashed, Black, Opacity[.9]}}, ImageSize -> 600] x1 = 100; alpha = 0.5;(*assume some value for alpha*)WinEvents = process["States"]; ST[WinEvents_?ListQ, x1_, alpha_, SimTime_] := Module[{}, FoldList[Max[If[#2 == 1, (1 + alpha) #1, (1 - alpha) #1], 0.] &, x1, Prepend[Differences@WinEvents, First@WinEvents]]]; simdat = ST[#, x1, alpha, timstep] & /@ WinEvents; Show[ ListLinePlot[Legended[Mean[simdat], ""], PlotRange -> All, PlotStyle -> {{AbsoluteThickness[3.5], Opacity[.9], Red}}, ImageSize -> 600], ListLinePlot[simdat, PlotRange -> All, PlotStyle -> {{Dashed, Black, Opacity[.7]}}], ListPlot[simdat, PlotRange -> All], Frame -> True]  3 added 188 characters in body edited Jul 2 '13 at 1:17 Alex 60044 silver badges2222 bronze badges 2 added 11 characters in body; edited title edited Jul 2 '13 at 0:19 Alex 60044 silver badges2222 bronze badges 1 asked Jul 2 '13 at 0:06 Alex 60044 silver badges2222 bronze badges