Sisyphus Random Walk












13












$begingroup$


A Sisyphus Random Walk evolves as follows: With probability (r) you advance the position of the walker by +1. With probability (1-r) the walker resets at x0 = 0.



To simulate the probability of reset I use a Bernoulli Distribution:



t =  Prepend[RandomVariate[BernoulliDistribution[0.7], 9],0]
{0, 1, 1, 0, 1, 0, 1, 1, 1, 1}


According to this distribution the walk should evolve as follows:



srw = {0,1,2,0,1,0,1,2,3,4}


I am unsure what functions I should use to get the desired output.










share|improve this question









$endgroup$

















    13












    $begingroup$


    A Sisyphus Random Walk evolves as follows: With probability (r) you advance the position of the walker by +1. With probability (1-r) the walker resets at x0 = 0.



    To simulate the probability of reset I use a Bernoulli Distribution:



    t =  Prepend[RandomVariate[BernoulliDistribution[0.7], 9],0]
    {0, 1, 1, 0, 1, 0, 1, 1, 1, 1}


    According to this distribution the walk should evolve as follows:



    srw = {0,1,2,0,1,0,1,2,3,4}


    I am unsure what functions I should use to get the desired output.










    share|improve this question









    $endgroup$















      13












      13








      13


      1



      $begingroup$


      A Sisyphus Random Walk evolves as follows: With probability (r) you advance the position of the walker by +1. With probability (1-r) the walker resets at x0 = 0.



      To simulate the probability of reset I use a Bernoulli Distribution:



      t =  Prepend[RandomVariate[BernoulliDistribution[0.7], 9],0]
      {0, 1, 1, 0, 1, 0, 1, 1, 1, 1}


      According to this distribution the walk should evolve as follows:



      srw = {0,1,2,0,1,0,1,2,3,4}


      I am unsure what functions I should use to get the desired output.










      share|improve this question









      $endgroup$




      A Sisyphus Random Walk evolves as follows: With probability (r) you advance the position of the walker by +1. With probability (1-r) the walker resets at x0 = 0.



      To simulate the probability of reset I use a Bernoulli Distribution:



      t =  Prepend[RandomVariate[BernoulliDistribution[0.7], 9],0]
      {0, 1, 1, 0, 1, 0, 1, 1, 1, 1}


      According to this distribution the walk should evolve as follows:



      srw = {0,1,2,0,1,0,1,2,3,4}


      I am unsure what functions I should use to get the desired output.







      functions programming probability-or-statistics random distributions






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 10 hours ago









      WillWill

      1775




      1775






















          2 Answers
          2






          active

          oldest

          votes


















          15












          $begingroup$

          We can iterate with FoldList:



          data = {0, 1, 1, 0, 1, 0, 1, 1, 1, 1};

          FoldList[#2 * (#1 + #2)&, data]



          {0, 1, 2, 0, 1, 0, 1, 2, 3, 4}



          Another approach is to accumulate consecutive runs of 1:



          Join @@ Accumulate /@ Split[data]



          {0, 1, 2, 0, 1, 0, 1, 2, 3, 4}






          share|improve this answer









          $endgroup$





















            5












            $begingroup$

            WARNING sorry, an error in this solution was just pointed out to me by another user. I am busy doing the necessary corrections.





            A nice problem. Why not solve it analytically?



            Let us use Latex to formulate the problem and write down the solution, and then move to Mathematica. Finally we discuss the results and generalizations.



            Part 1: mathematical formulation of the problem



            Let $w(t,k)$ be the probability that at time t(>=0) the walker is at position k.



            Then let us derive the evolution equations



            For $k>0$ we have the balance



            $$w(t+1,k) = w(t,k) text{(old value)} - r w(t,k) text{(loss to k+1)}+ r w(t,k-1) text{(gain from k-1)}-(1-r)w(t,k) text{(loss to 0)}$$



            this gives the equation



            $$w(t+1,k) = r; w(t,k-1), ;;;;;tge0, kgt0tag{1}$$



            For $k=0$ we have



            $$w(t+1,0) = w(t,0)text{(old value)}- r w(t,0)text{(loss to 1)} + (1-r) left(w(t,1)+w(t,2)+...right)text{(gain from all others)}$$



            This gives



            $$w(t+1,0) = (1-r) sum_{k=0}^infty w(t,k)$$



            which greatly simplifies to the simple equation



            $$w(t+1,0) = (1-r)tag{2}$$



            Indeed, since at any time $tge0$ the walker must be at one of the locations $kge 0$ with certainty we must have
            $sum_{k=0}^infty w(t,k)=1$.



            In order to finalize the formulation of the problem we need initial conditions.



            We assume that the walker at $t=0$ is in location $k=nge0$, i.e.



            $$w(0,k)=delta_{k,n}tag{3}$$



            where $delta_{k,n}$ is the Kronecker symbol defined as unity if $k=n$ and $0$ otherwise.



            Part 2: solution with Mathematica



            First we calculate w[t,0].



            Considering two cases: the walker starts at k=0 or not.



            From (4) we have



            Case 1: Walker starts at k=0



            sol01 = RSolve[w[t + 1, 0] == (1 - r) (1 - w[t, 0]) && w[0, 0] == 1, w[t, 0], 
            t]

            Out[11]= {{w[t, 0] -> (-1 - (-1 + r)^t + r)/(-2 + r)}}

            Simplify[(-1 - (-1 + r)^t + r)/(-2 + r) == (1 - r)/(
            2 - r) (1 + (-1)^t (1 - r)^(t - 1)), t [Element] Integers]

            Out[19]= True


            Hence the probability in the origin if the walker starts there is



            w01[t_, r_] = (1 - r)/(2 - r) (1 + (-1)^t (1 - r)^(t - 1));


            In Latex



            $$w_{01}(t,r) = frac{1-r}{2-r}left(1+(-1)^t (1-r)^{t-1}right)tag{6}$$



            The first few values are for r=1/2



            t01 = Table[w01[t, 1/2], {t, 0, 10}]

            (* Out[41]= {1, 0, 1/2, 1/4, 3/8, 5/16, 11/32, 21/64, 43/128, 85/256, 171/512} *)

            ListPlot[t01,
            PlotLabel ->
            "Sysiphos random walknProbability w(t,0) at origin as a function
            of timencase 1: walker starts at the origin",
            AxesLabel -> {"t", "w(t,0)"}]


            enter image description here



            Notice that at t=1 the probability is zero.



            The numerators are the so called Jacobsthal numbers (see https://oeis.org/A001045), the denominators are powers of 2.



            Case 2: Walker does not start at k=0



            sol00 = RSolve[w[t + 1, 0] == (1 - r) (1 - w[t, 0]) && w[0, 0] == 0, w[t, 0], 
            t]

            (* Out[31]= {{w[t, 0] -> -(((-1 + (-1 + r)^t) (-1 + r))/(-2 + r))}} *)

            Simplify[-(((-1 + (-1 + r)^t) (-1 + r))/(-2 + r)) == (1 - r)/(
            2 - r) (1 - (-1)^t (1 - r)^t), t [Element] Integers]

            (* Out[35]= True *)


            Hence the probability in the origin if the walker starts not there (but somewhere at k>0) is



            w00[t_, r_] = (1 - r)/(2 - r) (1 - (-1)^t (1 - r)^t);


            In Latex



            $$w_{00}(t,r) = frac{1-r}{2-r}left(1-(-1)^t (1-r)^tright)tag{7}$$



            The first few values for r=1/2 are



            t00 = Table[w00[t, 1/2], {t, 0, 10}]

            (* Out[40]= {0, 1/2, 1/4, 3/8, 5/16, 11/32, 21/64, 43/128, 85/256, 171/512, 341/1024} *)

            ListPlot[t00,
            PlotLabel ->
            "Sysiphos random walknProbability w(t,0) at origin as a function
            of timencase 2: walker starts not at the origin",
            AxesLabel -> {"t", "w(t,0)"}, PlotRange -> {-0.1, 1}]


            enter image description here



            Comparison



            t01

            (* Out[42]= {1, 0, 1/2, 1/4, 3/8, 5/16, 11/32, 21/64, 43/128, 85/256, 171/512} *)


            And in general we have the following relation between the probabilities of the two cases:



            w01[t, r] + w00[t, r]/(1 - r)==1 // Simplify

            (* True * )


            Or in Latex



            $$w_{01}(t,r) + frac{w_{00}(t,r)}{1-r}=1tag{8}$$



            Now we turn to positions k>0.



            From (1) we have



            sol = RSolve[w[t + 1, k] == r w[t, k - 1], w[t, k], {t, k}]

            (* Out[43]= {{w[t, k] -> r^(-1 + t) C[1][k - t]}} *)


            Don't worry about the strange looking expression of the constant C[1] with an argument. This is exactly what we need to apply the initial condition (5).



            Defining the auxiliary function



            vc[t_, k_] = w[t, k] /. sol[[1]] t_, k]

            (* Out[41]= r^(-1 + t) C[1][k - t] *)


            condition (5) reads



            sol1 = Solve[vc[0, k] == KroneckerDelta[k, n], C[1][k]]

            (* Out[43]= {{C[1][k] -> r KroneckerDelta[k, n]}} *)


            Hence the probability for the walker to be at location k at time t if he started at location n>0 (with the basic probability r of jumping one step to the the right) is given by



            w[t_, k_, r_, n_] = r^t KroneckerDelta[k - t, n]

            (* Out[50]= r^t KroneckerDelta[n, k - t] *)


            Example 1:



            n=1, r=1/2, w(t,k) is only different from 0 if k=t+1.



            The first few values of these non vanishing Terms are



            With[{n = 1, r = 1/2}, Table[w[t, t + 1, r, n], {t, 0, 10}]]

            (* Out[58]= {1, 1/2, 1/4, 1/8, 1/16, 1/32, 1/64, 1/128, 1/256, 1/512, 1/1024} *)


            The complete probabilities form a two dimensional array, which might start like this



            With[{n = 3, r = 1/2}, 
            tt = Table[w[t, k, r, n], {t, 0, 5}, {k, 1, 10}]]

            (* Out[133]= {{0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1/2, 0, 0, 0, 0,
            0, 0}, {0, 0, 0, 0, 1/4, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1/8, 0, 0,
            0, 0}, {0, 0, 0, 0, 0, 0, 1/16, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1/
            32, 0, 0}} *)


            Visualization



            ListPlot3D[tt, 
            PlotLabel ->
            "Sysiphos random walk for r=1/2 starting at k=3nProbability w(t,k)
            for k>0 as a function of time", PlotRange -> {-0.1, 1},
            AxesLabel -> {"k", "t", "w(t,k)"}]


            enter image description here



            Part 3: discussion



            Asymptotic behaviour for large times



            The probabilities (6) and (7) at the origin approache a common value



            $$w(ttoinfty,0) = frac{1-r}{2-r}tag{9}$$



            As the walker must be initially either at the origin or not ("at home or out") the asymptotic value (9) holds for any initial state.



            This means that the walker has asymptotically "gone out" with probability



            $$w'(ttoinfty,0) = 1- w(ttoinfty,0) = frac{1}{2-r}$$



            If the jump probability $r$ is small, it becomes equally probable that the walker is at home or out.



            If $rto 1$ the walker is almost certainly out.



            Next question: what is the asymptotic shape of the spatial profile? That is what is $w(ttoinfty,k)$ as a function of $k$?



            My feeling tells me that is should be exponential ... like the pressure in the atmosphere.



            Let's look at it qualitatively: if there were no jumping back, the walker would move away to $ktoinfty$ indefinitely. The jumping back leads to renewed filling from below of, in principle, any position.



            What about $w(t,1)$? Let us try to calculate it exactly.






            share|improve this answer











            $endgroup$













            • $begingroup$
              Something seems wrong to me. After one time step, the probability to be at the origin (k=0) is 1/2. After a second time step, half of that amount (0.25) is at k=1. That large a probability should be visible on the graph. What am I missing? And could you include k=0 in the above plot?
              $endgroup$
              – Kieran Mullen
              3 hours ago










            • $begingroup$
              @Kieran Mullen Ooops, I'll check it.
              $endgroup$
              – Dr. Wolfgang Hintze
              2 hours ago










            • $begingroup$
              @Kieran Mullen: you are right, I was wrong. Thanks a lot for pointing this out. Thinking more thouroughly I find for a walker starting at $k=0$ that $w(t<k)=0$, $w(t=k) = 1/2^k$, and $w(t>k)=1/2^{k+1}$. Hence the asymptotic profile is indeed exponential. Need to revise my work, not sure which part of it I can save.
              $endgroup$
              – Dr. Wolfgang Hintze
              1 hour ago













            Your Answer





            StackExchange.ifUsing("editor", function () {
            return StackExchange.using("mathjaxEditing", function () {
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
            });
            });
            }, "mathjax-editing");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "387"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f189764%2fsisyphus-random-walk%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            15












            $begingroup$

            We can iterate with FoldList:



            data = {0, 1, 1, 0, 1, 0, 1, 1, 1, 1};

            FoldList[#2 * (#1 + #2)&, data]



            {0, 1, 2, 0, 1, 0, 1, 2, 3, 4}



            Another approach is to accumulate consecutive runs of 1:



            Join @@ Accumulate /@ Split[data]



            {0, 1, 2, 0, 1, 0, 1, 2, 3, 4}






            share|improve this answer









            $endgroup$


















              15












              $begingroup$

              We can iterate with FoldList:



              data = {0, 1, 1, 0, 1, 0, 1, 1, 1, 1};

              FoldList[#2 * (#1 + #2)&, data]



              {0, 1, 2, 0, 1, 0, 1, 2, 3, 4}



              Another approach is to accumulate consecutive runs of 1:



              Join @@ Accumulate /@ Split[data]



              {0, 1, 2, 0, 1, 0, 1, 2, 3, 4}






              share|improve this answer









              $endgroup$
















                15












                15








                15





                $begingroup$

                We can iterate with FoldList:



                data = {0, 1, 1, 0, 1, 0, 1, 1, 1, 1};

                FoldList[#2 * (#1 + #2)&, data]



                {0, 1, 2, 0, 1, 0, 1, 2, 3, 4}



                Another approach is to accumulate consecutive runs of 1:



                Join @@ Accumulate /@ Split[data]



                {0, 1, 2, 0, 1, 0, 1, 2, 3, 4}






                share|improve this answer









                $endgroup$



                We can iterate with FoldList:



                data = {0, 1, 1, 0, 1, 0, 1, 1, 1, 1};

                FoldList[#2 * (#1 + #2)&, data]



                {0, 1, 2, 0, 1, 0, 1, 2, 3, 4}



                Another approach is to accumulate consecutive runs of 1:



                Join @@ Accumulate /@ Split[data]



                {0, 1, 2, 0, 1, 0, 1, 2, 3, 4}







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 9 hours ago









                Chip HurstChip Hurst

                20.5k15787




                20.5k15787























                    5












                    $begingroup$

                    WARNING sorry, an error in this solution was just pointed out to me by another user. I am busy doing the necessary corrections.





                    A nice problem. Why not solve it analytically?



                    Let us use Latex to formulate the problem and write down the solution, and then move to Mathematica. Finally we discuss the results and generalizations.



                    Part 1: mathematical formulation of the problem



                    Let $w(t,k)$ be the probability that at time t(>=0) the walker is at position k.



                    Then let us derive the evolution equations



                    For $k>0$ we have the balance



                    $$w(t+1,k) = w(t,k) text{(old value)} - r w(t,k) text{(loss to k+1)}+ r w(t,k-1) text{(gain from k-1)}-(1-r)w(t,k) text{(loss to 0)}$$



                    this gives the equation



                    $$w(t+1,k) = r; w(t,k-1), ;;;;;tge0, kgt0tag{1}$$



                    For $k=0$ we have



                    $$w(t+1,0) = w(t,0)text{(old value)}- r w(t,0)text{(loss to 1)} + (1-r) left(w(t,1)+w(t,2)+...right)text{(gain from all others)}$$



                    This gives



                    $$w(t+1,0) = (1-r) sum_{k=0}^infty w(t,k)$$



                    which greatly simplifies to the simple equation



                    $$w(t+1,0) = (1-r)tag{2}$$



                    Indeed, since at any time $tge0$ the walker must be at one of the locations $kge 0$ with certainty we must have
                    $sum_{k=0}^infty w(t,k)=1$.



                    In order to finalize the formulation of the problem we need initial conditions.



                    We assume that the walker at $t=0$ is in location $k=nge0$, i.e.



                    $$w(0,k)=delta_{k,n}tag{3}$$



                    where $delta_{k,n}$ is the Kronecker symbol defined as unity if $k=n$ and $0$ otherwise.



                    Part 2: solution with Mathematica



                    First we calculate w[t,0].



                    Considering two cases: the walker starts at k=0 or not.



                    From (4) we have



                    Case 1: Walker starts at k=0



                    sol01 = RSolve[w[t + 1, 0] == (1 - r) (1 - w[t, 0]) && w[0, 0] == 1, w[t, 0], 
                    t]

                    Out[11]= {{w[t, 0] -> (-1 - (-1 + r)^t + r)/(-2 + r)}}

                    Simplify[(-1 - (-1 + r)^t + r)/(-2 + r) == (1 - r)/(
                    2 - r) (1 + (-1)^t (1 - r)^(t - 1)), t [Element] Integers]

                    Out[19]= True


                    Hence the probability in the origin if the walker starts there is



                    w01[t_, r_] = (1 - r)/(2 - r) (1 + (-1)^t (1 - r)^(t - 1));


                    In Latex



                    $$w_{01}(t,r) = frac{1-r}{2-r}left(1+(-1)^t (1-r)^{t-1}right)tag{6}$$



                    The first few values are for r=1/2



                    t01 = Table[w01[t, 1/2], {t, 0, 10}]

                    (* Out[41]= {1, 0, 1/2, 1/4, 3/8, 5/16, 11/32, 21/64, 43/128, 85/256, 171/512} *)

                    ListPlot[t01,
                    PlotLabel ->
                    "Sysiphos random walknProbability w(t,0) at origin as a function
                    of timencase 1: walker starts at the origin",
                    AxesLabel -> {"t", "w(t,0)"}]


                    enter image description here



                    Notice that at t=1 the probability is zero.



                    The numerators are the so called Jacobsthal numbers (see https://oeis.org/A001045), the denominators are powers of 2.



                    Case 2: Walker does not start at k=0



                    sol00 = RSolve[w[t + 1, 0] == (1 - r) (1 - w[t, 0]) && w[0, 0] == 0, w[t, 0], 
                    t]

                    (* Out[31]= {{w[t, 0] -> -(((-1 + (-1 + r)^t) (-1 + r))/(-2 + r))}} *)

                    Simplify[-(((-1 + (-1 + r)^t) (-1 + r))/(-2 + r)) == (1 - r)/(
                    2 - r) (1 - (-1)^t (1 - r)^t), t [Element] Integers]

                    (* Out[35]= True *)


                    Hence the probability in the origin if the walker starts not there (but somewhere at k>0) is



                    w00[t_, r_] = (1 - r)/(2 - r) (1 - (-1)^t (1 - r)^t);


                    In Latex



                    $$w_{00}(t,r) = frac{1-r}{2-r}left(1-(-1)^t (1-r)^tright)tag{7}$$



                    The first few values for r=1/2 are



                    t00 = Table[w00[t, 1/2], {t, 0, 10}]

                    (* Out[40]= {0, 1/2, 1/4, 3/8, 5/16, 11/32, 21/64, 43/128, 85/256, 171/512, 341/1024} *)

                    ListPlot[t00,
                    PlotLabel ->
                    "Sysiphos random walknProbability w(t,0) at origin as a function
                    of timencase 2: walker starts not at the origin",
                    AxesLabel -> {"t", "w(t,0)"}, PlotRange -> {-0.1, 1}]


                    enter image description here



                    Comparison



                    t01

                    (* Out[42]= {1, 0, 1/2, 1/4, 3/8, 5/16, 11/32, 21/64, 43/128, 85/256, 171/512} *)


                    And in general we have the following relation between the probabilities of the two cases:



                    w01[t, r] + w00[t, r]/(1 - r)==1 // Simplify

                    (* True * )


                    Or in Latex



                    $$w_{01}(t,r) + frac{w_{00}(t,r)}{1-r}=1tag{8}$$



                    Now we turn to positions k>0.



                    From (1) we have



                    sol = RSolve[w[t + 1, k] == r w[t, k - 1], w[t, k], {t, k}]

                    (* Out[43]= {{w[t, k] -> r^(-1 + t) C[1][k - t]}} *)


                    Don't worry about the strange looking expression of the constant C[1] with an argument. This is exactly what we need to apply the initial condition (5).



                    Defining the auxiliary function



                    vc[t_, k_] = w[t, k] /. sol[[1]] t_, k]

                    (* Out[41]= r^(-1 + t) C[1][k - t] *)


                    condition (5) reads



                    sol1 = Solve[vc[0, k] == KroneckerDelta[k, n], C[1][k]]

                    (* Out[43]= {{C[1][k] -> r KroneckerDelta[k, n]}} *)


                    Hence the probability for the walker to be at location k at time t if he started at location n>0 (with the basic probability r of jumping one step to the the right) is given by



                    w[t_, k_, r_, n_] = r^t KroneckerDelta[k - t, n]

                    (* Out[50]= r^t KroneckerDelta[n, k - t] *)


                    Example 1:



                    n=1, r=1/2, w(t,k) is only different from 0 if k=t+1.



                    The first few values of these non vanishing Terms are



                    With[{n = 1, r = 1/2}, Table[w[t, t + 1, r, n], {t, 0, 10}]]

                    (* Out[58]= {1, 1/2, 1/4, 1/8, 1/16, 1/32, 1/64, 1/128, 1/256, 1/512, 1/1024} *)


                    The complete probabilities form a two dimensional array, which might start like this



                    With[{n = 3, r = 1/2}, 
                    tt = Table[w[t, k, r, n], {t, 0, 5}, {k, 1, 10}]]

                    (* Out[133]= {{0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1/2, 0, 0, 0, 0,
                    0, 0}, {0, 0, 0, 0, 1/4, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1/8, 0, 0,
                    0, 0}, {0, 0, 0, 0, 0, 0, 1/16, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1/
                    32, 0, 0}} *)


                    Visualization



                    ListPlot3D[tt, 
                    PlotLabel ->
                    "Sysiphos random walk for r=1/2 starting at k=3nProbability w(t,k)
                    for k>0 as a function of time", PlotRange -> {-0.1, 1},
                    AxesLabel -> {"k", "t", "w(t,k)"}]


                    enter image description here



                    Part 3: discussion



                    Asymptotic behaviour for large times



                    The probabilities (6) and (7) at the origin approache a common value



                    $$w(ttoinfty,0) = frac{1-r}{2-r}tag{9}$$



                    As the walker must be initially either at the origin or not ("at home or out") the asymptotic value (9) holds for any initial state.



                    This means that the walker has asymptotically "gone out" with probability



                    $$w'(ttoinfty,0) = 1- w(ttoinfty,0) = frac{1}{2-r}$$



                    If the jump probability $r$ is small, it becomes equally probable that the walker is at home or out.



                    If $rto 1$ the walker is almost certainly out.



                    Next question: what is the asymptotic shape of the spatial profile? That is what is $w(ttoinfty,k)$ as a function of $k$?



                    My feeling tells me that is should be exponential ... like the pressure in the atmosphere.



                    Let's look at it qualitatively: if there were no jumping back, the walker would move away to $ktoinfty$ indefinitely. The jumping back leads to renewed filling from below of, in principle, any position.



                    What about $w(t,1)$? Let us try to calculate it exactly.






                    share|improve this answer











                    $endgroup$













                    • $begingroup$
                      Something seems wrong to me. After one time step, the probability to be at the origin (k=0) is 1/2. After a second time step, half of that amount (0.25) is at k=1. That large a probability should be visible on the graph. What am I missing? And could you include k=0 in the above plot?
                      $endgroup$
                      – Kieran Mullen
                      3 hours ago










                    • $begingroup$
                      @Kieran Mullen Ooops, I'll check it.
                      $endgroup$
                      – Dr. Wolfgang Hintze
                      2 hours ago










                    • $begingroup$
                      @Kieran Mullen: you are right, I was wrong. Thanks a lot for pointing this out. Thinking more thouroughly I find for a walker starting at $k=0$ that $w(t<k)=0$, $w(t=k) = 1/2^k$, and $w(t>k)=1/2^{k+1}$. Hence the asymptotic profile is indeed exponential. Need to revise my work, not sure which part of it I can save.
                      $endgroup$
                      – Dr. Wolfgang Hintze
                      1 hour ago


















                    5












                    $begingroup$

                    WARNING sorry, an error in this solution was just pointed out to me by another user. I am busy doing the necessary corrections.





                    A nice problem. Why not solve it analytically?



                    Let us use Latex to formulate the problem and write down the solution, and then move to Mathematica. Finally we discuss the results and generalizations.



                    Part 1: mathematical formulation of the problem



                    Let $w(t,k)$ be the probability that at time t(>=0) the walker is at position k.



                    Then let us derive the evolution equations



                    For $k>0$ we have the balance



                    $$w(t+1,k) = w(t,k) text{(old value)} - r w(t,k) text{(loss to k+1)}+ r w(t,k-1) text{(gain from k-1)}-(1-r)w(t,k) text{(loss to 0)}$$



                    this gives the equation



                    $$w(t+1,k) = r; w(t,k-1), ;;;;;tge0, kgt0tag{1}$$



                    For $k=0$ we have



                    $$w(t+1,0) = w(t,0)text{(old value)}- r w(t,0)text{(loss to 1)} + (1-r) left(w(t,1)+w(t,2)+...right)text{(gain from all others)}$$



                    This gives



                    $$w(t+1,0) = (1-r) sum_{k=0}^infty w(t,k)$$



                    which greatly simplifies to the simple equation



                    $$w(t+1,0) = (1-r)tag{2}$$



                    Indeed, since at any time $tge0$ the walker must be at one of the locations $kge 0$ with certainty we must have
                    $sum_{k=0}^infty w(t,k)=1$.



                    In order to finalize the formulation of the problem we need initial conditions.



                    We assume that the walker at $t=0$ is in location $k=nge0$, i.e.



                    $$w(0,k)=delta_{k,n}tag{3}$$



                    where $delta_{k,n}$ is the Kronecker symbol defined as unity if $k=n$ and $0$ otherwise.



                    Part 2: solution with Mathematica



                    First we calculate w[t,0].



                    Considering two cases: the walker starts at k=0 or not.



                    From (4) we have



                    Case 1: Walker starts at k=0



                    sol01 = RSolve[w[t + 1, 0] == (1 - r) (1 - w[t, 0]) && w[0, 0] == 1, w[t, 0], 
                    t]

                    Out[11]= {{w[t, 0] -> (-1 - (-1 + r)^t + r)/(-2 + r)}}

                    Simplify[(-1 - (-1 + r)^t + r)/(-2 + r) == (1 - r)/(
                    2 - r) (1 + (-1)^t (1 - r)^(t - 1)), t [Element] Integers]

                    Out[19]= True


                    Hence the probability in the origin if the walker starts there is



                    w01[t_, r_] = (1 - r)/(2 - r) (1 + (-1)^t (1 - r)^(t - 1));


                    In Latex



                    $$w_{01}(t,r) = frac{1-r}{2-r}left(1+(-1)^t (1-r)^{t-1}right)tag{6}$$



                    The first few values are for r=1/2



                    t01 = Table[w01[t, 1/2], {t, 0, 10}]

                    (* Out[41]= {1, 0, 1/2, 1/4, 3/8, 5/16, 11/32, 21/64, 43/128, 85/256, 171/512} *)

                    ListPlot[t01,
                    PlotLabel ->
                    "Sysiphos random walknProbability w(t,0) at origin as a function
                    of timencase 1: walker starts at the origin",
                    AxesLabel -> {"t", "w(t,0)"}]


                    enter image description here



                    Notice that at t=1 the probability is zero.



                    The numerators are the so called Jacobsthal numbers (see https://oeis.org/A001045), the denominators are powers of 2.



                    Case 2: Walker does not start at k=0



                    sol00 = RSolve[w[t + 1, 0] == (1 - r) (1 - w[t, 0]) && w[0, 0] == 0, w[t, 0], 
                    t]

                    (* Out[31]= {{w[t, 0] -> -(((-1 + (-1 + r)^t) (-1 + r))/(-2 + r))}} *)

                    Simplify[-(((-1 + (-1 + r)^t) (-1 + r))/(-2 + r)) == (1 - r)/(
                    2 - r) (1 - (-1)^t (1 - r)^t), t [Element] Integers]

                    (* Out[35]= True *)


                    Hence the probability in the origin if the walker starts not there (but somewhere at k>0) is



                    w00[t_, r_] = (1 - r)/(2 - r) (1 - (-1)^t (1 - r)^t);


                    In Latex



                    $$w_{00}(t,r) = frac{1-r}{2-r}left(1-(-1)^t (1-r)^tright)tag{7}$$



                    The first few values for r=1/2 are



                    t00 = Table[w00[t, 1/2], {t, 0, 10}]

                    (* Out[40]= {0, 1/2, 1/4, 3/8, 5/16, 11/32, 21/64, 43/128, 85/256, 171/512, 341/1024} *)

                    ListPlot[t00,
                    PlotLabel ->
                    "Sysiphos random walknProbability w(t,0) at origin as a function
                    of timencase 2: walker starts not at the origin",
                    AxesLabel -> {"t", "w(t,0)"}, PlotRange -> {-0.1, 1}]


                    enter image description here



                    Comparison



                    t01

                    (* Out[42]= {1, 0, 1/2, 1/4, 3/8, 5/16, 11/32, 21/64, 43/128, 85/256, 171/512} *)


                    And in general we have the following relation between the probabilities of the two cases:



                    w01[t, r] + w00[t, r]/(1 - r)==1 // Simplify

                    (* True * )


                    Or in Latex



                    $$w_{01}(t,r) + frac{w_{00}(t,r)}{1-r}=1tag{8}$$



                    Now we turn to positions k>0.



                    From (1) we have



                    sol = RSolve[w[t + 1, k] == r w[t, k - 1], w[t, k], {t, k}]

                    (* Out[43]= {{w[t, k] -> r^(-1 + t) C[1][k - t]}} *)


                    Don't worry about the strange looking expression of the constant C[1] with an argument. This is exactly what we need to apply the initial condition (5).



                    Defining the auxiliary function



                    vc[t_, k_] = w[t, k] /. sol[[1]] t_, k]

                    (* Out[41]= r^(-1 + t) C[1][k - t] *)


                    condition (5) reads



                    sol1 = Solve[vc[0, k] == KroneckerDelta[k, n], C[1][k]]

                    (* Out[43]= {{C[1][k] -> r KroneckerDelta[k, n]}} *)


                    Hence the probability for the walker to be at location k at time t if he started at location n>0 (with the basic probability r of jumping one step to the the right) is given by



                    w[t_, k_, r_, n_] = r^t KroneckerDelta[k - t, n]

                    (* Out[50]= r^t KroneckerDelta[n, k - t] *)


                    Example 1:



                    n=1, r=1/2, w(t,k) is only different from 0 if k=t+1.



                    The first few values of these non vanishing Terms are



                    With[{n = 1, r = 1/2}, Table[w[t, t + 1, r, n], {t, 0, 10}]]

                    (* Out[58]= {1, 1/2, 1/4, 1/8, 1/16, 1/32, 1/64, 1/128, 1/256, 1/512, 1/1024} *)


                    The complete probabilities form a two dimensional array, which might start like this



                    With[{n = 3, r = 1/2}, 
                    tt = Table[w[t, k, r, n], {t, 0, 5}, {k, 1, 10}]]

                    (* Out[133]= {{0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1/2, 0, 0, 0, 0,
                    0, 0}, {0, 0, 0, 0, 1/4, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1/8, 0, 0,
                    0, 0}, {0, 0, 0, 0, 0, 0, 1/16, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1/
                    32, 0, 0}} *)


                    Visualization



                    ListPlot3D[tt, 
                    PlotLabel ->
                    "Sysiphos random walk for r=1/2 starting at k=3nProbability w(t,k)
                    for k>0 as a function of time", PlotRange -> {-0.1, 1},
                    AxesLabel -> {"k", "t", "w(t,k)"}]


                    enter image description here



                    Part 3: discussion



                    Asymptotic behaviour for large times



                    The probabilities (6) and (7) at the origin approache a common value



                    $$w(ttoinfty,0) = frac{1-r}{2-r}tag{9}$$



                    As the walker must be initially either at the origin or not ("at home or out") the asymptotic value (9) holds for any initial state.



                    This means that the walker has asymptotically "gone out" with probability



                    $$w'(ttoinfty,0) = 1- w(ttoinfty,0) = frac{1}{2-r}$$



                    If the jump probability $r$ is small, it becomes equally probable that the walker is at home or out.



                    If $rto 1$ the walker is almost certainly out.



                    Next question: what is the asymptotic shape of the spatial profile? That is what is $w(ttoinfty,k)$ as a function of $k$?



                    My feeling tells me that is should be exponential ... like the pressure in the atmosphere.



                    Let's look at it qualitatively: if there were no jumping back, the walker would move away to $ktoinfty$ indefinitely. The jumping back leads to renewed filling from below of, in principle, any position.



                    What about $w(t,1)$? Let us try to calculate it exactly.






                    share|improve this answer











                    $endgroup$













                    • $begingroup$
                      Something seems wrong to me. After one time step, the probability to be at the origin (k=0) is 1/2. After a second time step, half of that amount (0.25) is at k=1. That large a probability should be visible on the graph. What am I missing? And could you include k=0 in the above plot?
                      $endgroup$
                      – Kieran Mullen
                      3 hours ago










                    • $begingroup$
                      @Kieran Mullen Ooops, I'll check it.
                      $endgroup$
                      – Dr. Wolfgang Hintze
                      2 hours ago










                    • $begingroup$
                      @Kieran Mullen: you are right, I was wrong. Thanks a lot for pointing this out. Thinking more thouroughly I find for a walker starting at $k=0$ that $w(t<k)=0$, $w(t=k) = 1/2^k$, and $w(t>k)=1/2^{k+1}$. Hence the asymptotic profile is indeed exponential. Need to revise my work, not sure which part of it I can save.
                      $endgroup$
                      – Dr. Wolfgang Hintze
                      1 hour ago
















                    5












                    5








                    5





                    $begingroup$

                    WARNING sorry, an error in this solution was just pointed out to me by another user. I am busy doing the necessary corrections.





                    A nice problem. Why not solve it analytically?



                    Let us use Latex to formulate the problem and write down the solution, and then move to Mathematica. Finally we discuss the results and generalizations.



                    Part 1: mathematical formulation of the problem



                    Let $w(t,k)$ be the probability that at time t(>=0) the walker is at position k.



                    Then let us derive the evolution equations



                    For $k>0$ we have the balance



                    $$w(t+1,k) = w(t,k) text{(old value)} - r w(t,k) text{(loss to k+1)}+ r w(t,k-1) text{(gain from k-1)}-(1-r)w(t,k) text{(loss to 0)}$$



                    this gives the equation



                    $$w(t+1,k) = r; w(t,k-1), ;;;;;tge0, kgt0tag{1}$$



                    For $k=0$ we have



                    $$w(t+1,0) = w(t,0)text{(old value)}- r w(t,0)text{(loss to 1)} + (1-r) left(w(t,1)+w(t,2)+...right)text{(gain from all others)}$$



                    This gives



                    $$w(t+1,0) = (1-r) sum_{k=0}^infty w(t,k)$$



                    which greatly simplifies to the simple equation



                    $$w(t+1,0) = (1-r)tag{2}$$



                    Indeed, since at any time $tge0$ the walker must be at one of the locations $kge 0$ with certainty we must have
                    $sum_{k=0}^infty w(t,k)=1$.



                    In order to finalize the formulation of the problem we need initial conditions.



                    We assume that the walker at $t=0$ is in location $k=nge0$, i.e.



                    $$w(0,k)=delta_{k,n}tag{3}$$



                    where $delta_{k,n}$ is the Kronecker symbol defined as unity if $k=n$ and $0$ otherwise.



                    Part 2: solution with Mathematica



                    First we calculate w[t,0].



                    Considering two cases: the walker starts at k=0 or not.



                    From (4) we have



                    Case 1: Walker starts at k=0



                    sol01 = RSolve[w[t + 1, 0] == (1 - r) (1 - w[t, 0]) && w[0, 0] == 1, w[t, 0], 
                    t]

                    Out[11]= {{w[t, 0] -> (-1 - (-1 + r)^t + r)/(-2 + r)}}

                    Simplify[(-1 - (-1 + r)^t + r)/(-2 + r) == (1 - r)/(
                    2 - r) (1 + (-1)^t (1 - r)^(t - 1)), t [Element] Integers]

                    Out[19]= True


                    Hence the probability in the origin if the walker starts there is



                    w01[t_, r_] = (1 - r)/(2 - r) (1 + (-1)^t (1 - r)^(t - 1));


                    In Latex



                    $$w_{01}(t,r) = frac{1-r}{2-r}left(1+(-1)^t (1-r)^{t-1}right)tag{6}$$



                    The first few values are for r=1/2



                    t01 = Table[w01[t, 1/2], {t, 0, 10}]

                    (* Out[41]= {1, 0, 1/2, 1/4, 3/8, 5/16, 11/32, 21/64, 43/128, 85/256, 171/512} *)

                    ListPlot[t01,
                    PlotLabel ->
                    "Sysiphos random walknProbability w(t,0) at origin as a function
                    of timencase 1: walker starts at the origin",
                    AxesLabel -> {"t", "w(t,0)"}]


                    enter image description here



                    Notice that at t=1 the probability is zero.



                    The numerators are the so called Jacobsthal numbers (see https://oeis.org/A001045), the denominators are powers of 2.



                    Case 2: Walker does not start at k=0



                    sol00 = RSolve[w[t + 1, 0] == (1 - r) (1 - w[t, 0]) && w[0, 0] == 0, w[t, 0], 
                    t]

                    (* Out[31]= {{w[t, 0] -> -(((-1 + (-1 + r)^t) (-1 + r))/(-2 + r))}} *)

                    Simplify[-(((-1 + (-1 + r)^t) (-1 + r))/(-2 + r)) == (1 - r)/(
                    2 - r) (1 - (-1)^t (1 - r)^t), t [Element] Integers]

                    (* Out[35]= True *)


                    Hence the probability in the origin if the walker starts not there (but somewhere at k>0) is



                    w00[t_, r_] = (1 - r)/(2 - r) (1 - (-1)^t (1 - r)^t);


                    In Latex



                    $$w_{00}(t,r) = frac{1-r}{2-r}left(1-(-1)^t (1-r)^tright)tag{7}$$



                    The first few values for r=1/2 are



                    t00 = Table[w00[t, 1/2], {t, 0, 10}]

                    (* Out[40]= {0, 1/2, 1/4, 3/8, 5/16, 11/32, 21/64, 43/128, 85/256, 171/512, 341/1024} *)

                    ListPlot[t00,
                    PlotLabel ->
                    "Sysiphos random walknProbability w(t,0) at origin as a function
                    of timencase 2: walker starts not at the origin",
                    AxesLabel -> {"t", "w(t,0)"}, PlotRange -> {-0.1, 1}]


                    enter image description here



                    Comparison



                    t01

                    (* Out[42]= {1, 0, 1/2, 1/4, 3/8, 5/16, 11/32, 21/64, 43/128, 85/256, 171/512} *)


                    And in general we have the following relation between the probabilities of the two cases:



                    w01[t, r] + w00[t, r]/(1 - r)==1 // Simplify

                    (* True * )


                    Or in Latex



                    $$w_{01}(t,r) + frac{w_{00}(t,r)}{1-r}=1tag{8}$$



                    Now we turn to positions k>0.



                    From (1) we have



                    sol = RSolve[w[t + 1, k] == r w[t, k - 1], w[t, k], {t, k}]

                    (* Out[43]= {{w[t, k] -> r^(-1 + t) C[1][k - t]}} *)


                    Don't worry about the strange looking expression of the constant C[1] with an argument. This is exactly what we need to apply the initial condition (5).



                    Defining the auxiliary function



                    vc[t_, k_] = w[t, k] /. sol[[1]] t_, k]

                    (* Out[41]= r^(-1 + t) C[1][k - t] *)


                    condition (5) reads



                    sol1 = Solve[vc[0, k] == KroneckerDelta[k, n], C[1][k]]

                    (* Out[43]= {{C[1][k] -> r KroneckerDelta[k, n]}} *)


                    Hence the probability for the walker to be at location k at time t if he started at location n>0 (with the basic probability r of jumping one step to the the right) is given by



                    w[t_, k_, r_, n_] = r^t KroneckerDelta[k - t, n]

                    (* Out[50]= r^t KroneckerDelta[n, k - t] *)


                    Example 1:



                    n=1, r=1/2, w(t,k) is only different from 0 if k=t+1.



                    The first few values of these non vanishing Terms are



                    With[{n = 1, r = 1/2}, Table[w[t, t + 1, r, n], {t, 0, 10}]]

                    (* Out[58]= {1, 1/2, 1/4, 1/8, 1/16, 1/32, 1/64, 1/128, 1/256, 1/512, 1/1024} *)


                    The complete probabilities form a two dimensional array, which might start like this



                    With[{n = 3, r = 1/2}, 
                    tt = Table[w[t, k, r, n], {t, 0, 5}, {k, 1, 10}]]

                    (* Out[133]= {{0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1/2, 0, 0, 0, 0,
                    0, 0}, {0, 0, 0, 0, 1/4, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1/8, 0, 0,
                    0, 0}, {0, 0, 0, 0, 0, 0, 1/16, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1/
                    32, 0, 0}} *)


                    Visualization



                    ListPlot3D[tt, 
                    PlotLabel ->
                    "Sysiphos random walk for r=1/2 starting at k=3nProbability w(t,k)
                    for k>0 as a function of time", PlotRange -> {-0.1, 1},
                    AxesLabel -> {"k", "t", "w(t,k)"}]


                    enter image description here



                    Part 3: discussion



                    Asymptotic behaviour for large times



                    The probabilities (6) and (7) at the origin approache a common value



                    $$w(ttoinfty,0) = frac{1-r}{2-r}tag{9}$$



                    As the walker must be initially either at the origin or not ("at home or out") the asymptotic value (9) holds for any initial state.



                    This means that the walker has asymptotically "gone out" with probability



                    $$w'(ttoinfty,0) = 1- w(ttoinfty,0) = frac{1}{2-r}$$



                    If the jump probability $r$ is small, it becomes equally probable that the walker is at home or out.



                    If $rto 1$ the walker is almost certainly out.



                    Next question: what is the asymptotic shape of the spatial profile? That is what is $w(ttoinfty,k)$ as a function of $k$?



                    My feeling tells me that is should be exponential ... like the pressure in the atmosphere.



                    Let's look at it qualitatively: if there were no jumping back, the walker would move away to $ktoinfty$ indefinitely. The jumping back leads to renewed filling from below of, in principle, any position.



                    What about $w(t,1)$? Let us try to calculate it exactly.






                    share|improve this answer











                    $endgroup$



                    WARNING sorry, an error in this solution was just pointed out to me by another user. I am busy doing the necessary corrections.





                    A nice problem. Why not solve it analytically?



                    Let us use Latex to formulate the problem and write down the solution, and then move to Mathematica. Finally we discuss the results and generalizations.



                    Part 1: mathematical formulation of the problem



                    Let $w(t,k)$ be the probability that at time t(>=0) the walker is at position k.



                    Then let us derive the evolution equations



                    For $k>0$ we have the balance



                    $$w(t+1,k) = w(t,k) text{(old value)} - r w(t,k) text{(loss to k+1)}+ r w(t,k-1) text{(gain from k-1)}-(1-r)w(t,k) text{(loss to 0)}$$



                    this gives the equation



                    $$w(t+1,k) = r; w(t,k-1), ;;;;;tge0, kgt0tag{1}$$



                    For $k=0$ we have



                    $$w(t+1,0) = w(t,0)text{(old value)}- r w(t,0)text{(loss to 1)} + (1-r) left(w(t,1)+w(t,2)+...right)text{(gain from all others)}$$



                    This gives



                    $$w(t+1,0) = (1-r) sum_{k=0}^infty w(t,k)$$



                    which greatly simplifies to the simple equation



                    $$w(t+1,0) = (1-r)tag{2}$$



                    Indeed, since at any time $tge0$ the walker must be at one of the locations $kge 0$ with certainty we must have
                    $sum_{k=0}^infty w(t,k)=1$.



                    In order to finalize the formulation of the problem we need initial conditions.



                    We assume that the walker at $t=0$ is in location $k=nge0$, i.e.



                    $$w(0,k)=delta_{k,n}tag{3}$$



                    where $delta_{k,n}$ is the Kronecker symbol defined as unity if $k=n$ and $0$ otherwise.



                    Part 2: solution with Mathematica



                    First we calculate w[t,0].



                    Considering two cases: the walker starts at k=0 or not.



                    From (4) we have



                    Case 1: Walker starts at k=0



                    sol01 = RSolve[w[t + 1, 0] == (1 - r) (1 - w[t, 0]) && w[0, 0] == 1, w[t, 0], 
                    t]

                    Out[11]= {{w[t, 0] -> (-1 - (-1 + r)^t + r)/(-2 + r)}}

                    Simplify[(-1 - (-1 + r)^t + r)/(-2 + r) == (1 - r)/(
                    2 - r) (1 + (-1)^t (1 - r)^(t - 1)), t [Element] Integers]

                    Out[19]= True


                    Hence the probability in the origin if the walker starts there is



                    w01[t_, r_] = (1 - r)/(2 - r) (1 + (-1)^t (1 - r)^(t - 1));


                    In Latex



                    $$w_{01}(t,r) = frac{1-r}{2-r}left(1+(-1)^t (1-r)^{t-1}right)tag{6}$$



                    The first few values are for r=1/2



                    t01 = Table[w01[t, 1/2], {t, 0, 10}]

                    (* Out[41]= {1, 0, 1/2, 1/4, 3/8, 5/16, 11/32, 21/64, 43/128, 85/256, 171/512} *)

                    ListPlot[t01,
                    PlotLabel ->
                    "Sysiphos random walknProbability w(t,0) at origin as a function
                    of timencase 1: walker starts at the origin",
                    AxesLabel -> {"t", "w(t,0)"}]


                    enter image description here



                    Notice that at t=1 the probability is zero.



                    The numerators are the so called Jacobsthal numbers (see https://oeis.org/A001045), the denominators are powers of 2.



                    Case 2: Walker does not start at k=0



                    sol00 = RSolve[w[t + 1, 0] == (1 - r) (1 - w[t, 0]) && w[0, 0] == 0, w[t, 0], 
                    t]

                    (* Out[31]= {{w[t, 0] -> -(((-1 + (-1 + r)^t) (-1 + r))/(-2 + r))}} *)

                    Simplify[-(((-1 + (-1 + r)^t) (-1 + r))/(-2 + r)) == (1 - r)/(
                    2 - r) (1 - (-1)^t (1 - r)^t), t [Element] Integers]

                    (* Out[35]= True *)


                    Hence the probability in the origin if the walker starts not there (but somewhere at k>0) is



                    w00[t_, r_] = (1 - r)/(2 - r) (1 - (-1)^t (1 - r)^t);


                    In Latex



                    $$w_{00}(t,r) = frac{1-r}{2-r}left(1-(-1)^t (1-r)^tright)tag{7}$$



                    The first few values for r=1/2 are



                    t00 = Table[w00[t, 1/2], {t, 0, 10}]

                    (* Out[40]= {0, 1/2, 1/4, 3/8, 5/16, 11/32, 21/64, 43/128, 85/256, 171/512, 341/1024} *)

                    ListPlot[t00,
                    PlotLabel ->
                    "Sysiphos random walknProbability w(t,0) at origin as a function
                    of timencase 2: walker starts not at the origin",
                    AxesLabel -> {"t", "w(t,0)"}, PlotRange -> {-0.1, 1}]


                    enter image description here



                    Comparison



                    t01

                    (* Out[42]= {1, 0, 1/2, 1/4, 3/8, 5/16, 11/32, 21/64, 43/128, 85/256, 171/512} *)


                    And in general we have the following relation between the probabilities of the two cases:



                    w01[t, r] + w00[t, r]/(1 - r)==1 // Simplify

                    (* True * )


                    Or in Latex



                    $$w_{01}(t,r) + frac{w_{00}(t,r)}{1-r}=1tag{8}$$



                    Now we turn to positions k>0.



                    From (1) we have



                    sol = RSolve[w[t + 1, k] == r w[t, k - 1], w[t, k], {t, k}]

                    (* Out[43]= {{w[t, k] -> r^(-1 + t) C[1][k - t]}} *)


                    Don't worry about the strange looking expression of the constant C[1] with an argument. This is exactly what we need to apply the initial condition (5).



                    Defining the auxiliary function



                    vc[t_, k_] = w[t, k] /. sol[[1]] t_, k]

                    (* Out[41]= r^(-1 + t) C[1][k - t] *)


                    condition (5) reads



                    sol1 = Solve[vc[0, k] == KroneckerDelta[k, n], C[1][k]]

                    (* Out[43]= {{C[1][k] -> r KroneckerDelta[k, n]}} *)


                    Hence the probability for the walker to be at location k at time t if he started at location n>0 (with the basic probability r of jumping one step to the the right) is given by



                    w[t_, k_, r_, n_] = r^t KroneckerDelta[k - t, n]

                    (* Out[50]= r^t KroneckerDelta[n, k - t] *)


                    Example 1:



                    n=1, r=1/2, w(t,k) is only different from 0 if k=t+1.



                    The first few values of these non vanishing Terms are



                    With[{n = 1, r = 1/2}, Table[w[t, t + 1, r, n], {t, 0, 10}]]

                    (* Out[58]= {1, 1/2, 1/4, 1/8, 1/16, 1/32, 1/64, 1/128, 1/256, 1/512, 1/1024} *)


                    The complete probabilities form a two dimensional array, which might start like this



                    With[{n = 3, r = 1/2}, 
                    tt = Table[w[t, k, r, n], {t, 0, 5}, {k, 1, 10}]]

                    (* Out[133]= {{0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1/2, 0, 0, 0, 0,
                    0, 0}, {0, 0, 0, 0, 1/4, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1/8, 0, 0,
                    0, 0}, {0, 0, 0, 0, 0, 0, 1/16, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1/
                    32, 0, 0}} *)


                    Visualization



                    ListPlot3D[tt, 
                    PlotLabel ->
                    "Sysiphos random walk for r=1/2 starting at k=3nProbability w(t,k)
                    for k>0 as a function of time", PlotRange -> {-0.1, 1},
                    AxesLabel -> {"k", "t", "w(t,k)"}]


                    enter image description here



                    Part 3: discussion



                    Asymptotic behaviour for large times



                    The probabilities (6) and (7) at the origin approache a common value



                    $$w(ttoinfty,0) = frac{1-r}{2-r}tag{9}$$



                    As the walker must be initially either at the origin or not ("at home or out") the asymptotic value (9) holds for any initial state.



                    This means that the walker has asymptotically "gone out" with probability



                    $$w'(ttoinfty,0) = 1- w(ttoinfty,0) = frac{1}{2-r}$$



                    If the jump probability $r$ is small, it becomes equally probable that the walker is at home or out.



                    If $rto 1$ the walker is almost certainly out.



                    Next question: what is the asymptotic shape of the spatial profile? That is what is $w(ttoinfty,k)$ as a function of $k$?



                    My feeling tells me that is should be exponential ... like the pressure in the atmosphere.



                    Let's look at it qualitatively: if there were no jumping back, the walker would move away to $ktoinfty$ indefinitely. The jumping back leads to renewed filling from below of, in principle, any position.



                    What about $w(t,1)$? Let us try to calculate it exactly.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited 14 mins ago

























                    answered 5 hours ago









                    Dr. Wolfgang HintzeDr. Wolfgang Hintze

                    10.6k839




                    10.6k839












                    • $begingroup$
                      Something seems wrong to me. After one time step, the probability to be at the origin (k=0) is 1/2. After a second time step, half of that amount (0.25) is at k=1. That large a probability should be visible on the graph. What am I missing? And could you include k=0 in the above plot?
                      $endgroup$
                      – Kieran Mullen
                      3 hours ago










                    • $begingroup$
                      @Kieran Mullen Ooops, I'll check it.
                      $endgroup$
                      – Dr. Wolfgang Hintze
                      2 hours ago










                    • $begingroup$
                      @Kieran Mullen: you are right, I was wrong. Thanks a lot for pointing this out. Thinking more thouroughly I find for a walker starting at $k=0$ that $w(t<k)=0$, $w(t=k) = 1/2^k$, and $w(t>k)=1/2^{k+1}$. Hence the asymptotic profile is indeed exponential. Need to revise my work, not sure which part of it I can save.
                      $endgroup$
                      – Dr. Wolfgang Hintze
                      1 hour ago




















                    • $begingroup$
                      Something seems wrong to me. After one time step, the probability to be at the origin (k=0) is 1/2. After a second time step, half of that amount (0.25) is at k=1. That large a probability should be visible on the graph. What am I missing? And could you include k=0 in the above plot?
                      $endgroup$
                      – Kieran Mullen
                      3 hours ago










                    • $begingroup$
                      @Kieran Mullen Ooops, I'll check it.
                      $endgroup$
                      – Dr. Wolfgang Hintze
                      2 hours ago










                    • $begingroup$
                      @Kieran Mullen: you are right, I was wrong. Thanks a lot for pointing this out. Thinking more thouroughly I find for a walker starting at $k=0$ that $w(t<k)=0$, $w(t=k) = 1/2^k$, and $w(t>k)=1/2^{k+1}$. Hence the asymptotic profile is indeed exponential. Need to revise my work, not sure which part of it I can save.
                      $endgroup$
                      – Dr. Wolfgang Hintze
                      1 hour ago


















                    $begingroup$
                    Something seems wrong to me. After one time step, the probability to be at the origin (k=0) is 1/2. After a second time step, half of that amount (0.25) is at k=1. That large a probability should be visible on the graph. What am I missing? And could you include k=0 in the above plot?
                    $endgroup$
                    – Kieran Mullen
                    3 hours ago




                    $begingroup$
                    Something seems wrong to me. After one time step, the probability to be at the origin (k=0) is 1/2. After a second time step, half of that amount (0.25) is at k=1. That large a probability should be visible on the graph. What am I missing? And could you include k=0 in the above plot?
                    $endgroup$
                    – Kieran Mullen
                    3 hours ago












                    $begingroup$
                    @Kieran Mullen Ooops, I'll check it.
                    $endgroup$
                    – Dr. Wolfgang Hintze
                    2 hours ago




                    $begingroup$
                    @Kieran Mullen Ooops, I'll check it.
                    $endgroup$
                    – Dr. Wolfgang Hintze
                    2 hours ago












                    $begingroup$
                    @Kieran Mullen: you are right, I was wrong. Thanks a lot for pointing this out. Thinking more thouroughly I find for a walker starting at $k=0$ that $w(t<k)=0$, $w(t=k) = 1/2^k$, and $w(t>k)=1/2^{k+1}$. Hence the asymptotic profile is indeed exponential. Need to revise my work, not sure which part of it I can save.
                    $endgroup$
                    – Dr. Wolfgang Hintze
                    1 hour ago






                    $begingroup$
                    @Kieran Mullen: you are right, I was wrong. Thanks a lot for pointing this out. Thinking more thouroughly I find for a walker starting at $k=0$ that $w(t<k)=0$, $w(t=k) = 1/2^k$, and $w(t>k)=1/2^{k+1}$. Hence the asymptotic profile is indeed exponential. Need to revise my work, not sure which part of it I can save.
                    $endgroup$
                    – Dr. Wolfgang Hintze
                    1 hour ago




















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Mathematica Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    Use MathJax to format equations. MathJax reference.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f189764%2fsisyphus-random-walk%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Loup dans la culture

                    How to solve the problem of ntp “Unable to contact time server” from KDE?

                    ASUS Zenbook UX433/UX333 — Configure Touchpad-embedded numpad on Linux