Probability that random walk will reach state $k$ for the first time on step $n$












1












$begingroup$


We have a random walk which starts in state $0$. At each step, a coin is tossed with probability of heads: $P(H)=p$. If we get a heads, we go to the next higher integer state and on tails, we go to the next lower integer state (so state $n$ would go to $n+1$ on heads and $n-1$ on tails).



Now, I want to know the probability that we will reach state $k$ for the first time after exactly $n$ tosses of the coin. Turning out to be surprisingly hard for me.





Here is my attempt:



I define $a_n^{k}$ as the probability described above and $c_n^k$ as the probability that the random walk will be in state $k$ at toss $n$ (regardless of if it was there in a previous toss).



It's clear that we need $left(frac{n-k}{2}right)$ tails and $left(frac{n+k}{2}right)$ heads. So if $n-k$ is not even, the sequences for those $n$'s become $0$.



To get $a_n^k$, we need to identify all sequences where the cumulative number of heads stays less than $k$ + the cumulative number of tails for all tosses leading upto $n$. This is not so easy to solve.



On the other hand, I got an expression for $c_n^k$ and hoped I could use it to get $a_n^k$. I reasoned that the probability the walk reaches $k$ for the first time on toss $n$ is the probability it is in state $k$ on toss $n$ subtracted by the probabilities that it was in state $k$ in any previous toss. So,



$$a_n^k = c_n^k - sum_{i=1}^{n-1} c_i^k$$



But this can't be right since this expression will become negative for many values of $n$.










share|cite|improve this question











$endgroup$








  • 1




    $begingroup$
    Still working on the solution to the question, but I do know why the reasoning at the end is wrong; the probabilities are not independent, so you can not simply subtract them from each other.
    $endgroup$
    – SmileyCraft
    Dec 16 '18 at 19:07










  • $begingroup$
    Appreciate it. Yeah, I suspected as much. That's almost always the reason when you add/subtract probabilities and get something not between 0 and 1. Thought I'd mention it anyway in case it inspired someone to formulate a correct approach based on the idea.
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 19:09










  • $begingroup$
    If you reverse time and flip the y axis, you are counting paths which reach k after n steps without ever returning to 0. This is Bertrand’s ballot problem.
    $endgroup$
    – Mike Earnest
    Dec 16 '18 at 20:24










  • $begingroup$
    Don't completely follow. If I reverse time, I start off at $k$, correct? So, doesn't it become paths that reach 0?
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 20:33










  • $begingroup$
    @RohitPandey Sorry, when I said "flip the y-axis,", I meant that you interchange $0$ with $k$.
    $endgroup$
    – Mike Earnest
    Dec 17 '18 at 12:49
















1












$begingroup$


We have a random walk which starts in state $0$. At each step, a coin is tossed with probability of heads: $P(H)=p$. If we get a heads, we go to the next higher integer state and on tails, we go to the next lower integer state (so state $n$ would go to $n+1$ on heads and $n-1$ on tails).



Now, I want to know the probability that we will reach state $k$ for the first time after exactly $n$ tosses of the coin. Turning out to be surprisingly hard for me.





Here is my attempt:



I define $a_n^{k}$ as the probability described above and $c_n^k$ as the probability that the random walk will be in state $k$ at toss $n$ (regardless of if it was there in a previous toss).



It's clear that we need $left(frac{n-k}{2}right)$ tails and $left(frac{n+k}{2}right)$ heads. So if $n-k$ is not even, the sequences for those $n$'s become $0$.



To get $a_n^k$, we need to identify all sequences where the cumulative number of heads stays less than $k$ + the cumulative number of tails for all tosses leading upto $n$. This is not so easy to solve.



On the other hand, I got an expression for $c_n^k$ and hoped I could use it to get $a_n^k$. I reasoned that the probability the walk reaches $k$ for the first time on toss $n$ is the probability it is in state $k$ on toss $n$ subtracted by the probabilities that it was in state $k$ in any previous toss. So,



$$a_n^k = c_n^k - sum_{i=1}^{n-1} c_i^k$$



But this can't be right since this expression will become negative for many values of $n$.










share|cite|improve this question











$endgroup$








  • 1




    $begingroup$
    Still working on the solution to the question, but I do know why the reasoning at the end is wrong; the probabilities are not independent, so you can not simply subtract them from each other.
    $endgroup$
    – SmileyCraft
    Dec 16 '18 at 19:07










  • $begingroup$
    Appreciate it. Yeah, I suspected as much. That's almost always the reason when you add/subtract probabilities and get something not between 0 and 1. Thought I'd mention it anyway in case it inspired someone to formulate a correct approach based on the idea.
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 19:09










  • $begingroup$
    If you reverse time and flip the y axis, you are counting paths which reach k after n steps without ever returning to 0. This is Bertrand’s ballot problem.
    $endgroup$
    – Mike Earnest
    Dec 16 '18 at 20:24










  • $begingroup$
    Don't completely follow. If I reverse time, I start off at $k$, correct? So, doesn't it become paths that reach 0?
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 20:33










  • $begingroup$
    @RohitPandey Sorry, when I said "flip the y-axis,", I meant that you interchange $0$ with $k$.
    $endgroup$
    – Mike Earnest
    Dec 17 '18 at 12:49














1












1








1


1



$begingroup$


We have a random walk which starts in state $0$. At each step, a coin is tossed with probability of heads: $P(H)=p$. If we get a heads, we go to the next higher integer state and on tails, we go to the next lower integer state (so state $n$ would go to $n+1$ on heads and $n-1$ on tails).



Now, I want to know the probability that we will reach state $k$ for the first time after exactly $n$ tosses of the coin. Turning out to be surprisingly hard for me.





Here is my attempt:



I define $a_n^{k}$ as the probability described above and $c_n^k$ as the probability that the random walk will be in state $k$ at toss $n$ (regardless of if it was there in a previous toss).



It's clear that we need $left(frac{n-k}{2}right)$ tails and $left(frac{n+k}{2}right)$ heads. So if $n-k$ is not even, the sequences for those $n$'s become $0$.



To get $a_n^k$, we need to identify all sequences where the cumulative number of heads stays less than $k$ + the cumulative number of tails for all tosses leading upto $n$. This is not so easy to solve.



On the other hand, I got an expression for $c_n^k$ and hoped I could use it to get $a_n^k$. I reasoned that the probability the walk reaches $k$ for the first time on toss $n$ is the probability it is in state $k$ on toss $n$ subtracted by the probabilities that it was in state $k$ in any previous toss. So,



$$a_n^k = c_n^k - sum_{i=1}^{n-1} c_i^k$$



But this can't be right since this expression will become negative for many values of $n$.










share|cite|improve this question











$endgroup$




We have a random walk which starts in state $0$. At each step, a coin is tossed with probability of heads: $P(H)=p$. If we get a heads, we go to the next higher integer state and on tails, we go to the next lower integer state (so state $n$ would go to $n+1$ on heads and $n-1$ on tails).



Now, I want to know the probability that we will reach state $k$ for the first time after exactly $n$ tosses of the coin. Turning out to be surprisingly hard for me.





Here is my attempt:



I define $a_n^{k}$ as the probability described above and $c_n^k$ as the probability that the random walk will be in state $k$ at toss $n$ (regardless of if it was there in a previous toss).



It's clear that we need $left(frac{n-k}{2}right)$ tails and $left(frac{n+k}{2}right)$ heads. So if $n-k$ is not even, the sequences for those $n$'s become $0$.



To get $a_n^k$, we need to identify all sequences where the cumulative number of heads stays less than $k$ + the cumulative number of tails for all tosses leading upto $n$. This is not so easy to solve.



On the other hand, I got an expression for $c_n^k$ and hoped I could use it to get $a_n^k$. I reasoned that the probability the walk reaches $k$ for the first time on toss $n$ is the probability it is in state $k$ on toss $n$ subtracted by the probabilities that it was in state $k$ in any previous toss. So,



$$a_n^k = c_n^k - sum_{i=1}^{n-1} c_i^k$$



But this can't be right since this expression will become negative for many values of $n$.







probability combinatorics markov-chains random-walk






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Dec 18 '18 at 2:28







Rohit Pandey

















asked Dec 16 '18 at 19:00









Rohit PandeyRohit Pandey

1,2201021




1,2201021








  • 1




    $begingroup$
    Still working on the solution to the question, but I do know why the reasoning at the end is wrong; the probabilities are not independent, so you can not simply subtract them from each other.
    $endgroup$
    – SmileyCraft
    Dec 16 '18 at 19:07










  • $begingroup$
    Appreciate it. Yeah, I suspected as much. That's almost always the reason when you add/subtract probabilities and get something not between 0 and 1. Thought I'd mention it anyway in case it inspired someone to formulate a correct approach based on the idea.
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 19:09










  • $begingroup$
    If you reverse time and flip the y axis, you are counting paths which reach k after n steps without ever returning to 0. This is Bertrand’s ballot problem.
    $endgroup$
    – Mike Earnest
    Dec 16 '18 at 20:24










  • $begingroup$
    Don't completely follow. If I reverse time, I start off at $k$, correct? So, doesn't it become paths that reach 0?
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 20:33










  • $begingroup$
    @RohitPandey Sorry, when I said "flip the y-axis,", I meant that you interchange $0$ with $k$.
    $endgroup$
    – Mike Earnest
    Dec 17 '18 at 12:49














  • 1




    $begingroup$
    Still working on the solution to the question, but I do know why the reasoning at the end is wrong; the probabilities are not independent, so you can not simply subtract them from each other.
    $endgroup$
    – SmileyCraft
    Dec 16 '18 at 19:07










  • $begingroup$
    Appreciate it. Yeah, I suspected as much. That's almost always the reason when you add/subtract probabilities and get something not between 0 and 1. Thought I'd mention it anyway in case it inspired someone to formulate a correct approach based on the idea.
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 19:09










  • $begingroup$
    If you reverse time and flip the y axis, you are counting paths which reach k after n steps without ever returning to 0. This is Bertrand’s ballot problem.
    $endgroup$
    – Mike Earnest
    Dec 16 '18 at 20:24










  • $begingroup$
    Don't completely follow. If I reverse time, I start off at $k$, correct? So, doesn't it become paths that reach 0?
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 20:33










  • $begingroup$
    @RohitPandey Sorry, when I said "flip the y-axis,", I meant that you interchange $0$ with $k$.
    $endgroup$
    – Mike Earnest
    Dec 17 '18 at 12:49








1




1




$begingroup$
Still working on the solution to the question, but I do know why the reasoning at the end is wrong; the probabilities are not independent, so you can not simply subtract them from each other.
$endgroup$
– SmileyCraft
Dec 16 '18 at 19:07




$begingroup$
Still working on the solution to the question, but I do know why the reasoning at the end is wrong; the probabilities are not independent, so you can not simply subtract them from each other.
$endgroup$
– SmileyCraft
Dec 16 '18 at 19:07












$begingroup$
Appreciate it. Yeah, I suspected as much. That's almost always the reason when you add/subtract probabilities and get something not between 0 and 1. Thought I'd mention it anyway in case it inspired someone to formulate a correct approach based on the idea.
$endgroup$
– Rohit Pandey
Dec 16 '18 at 19:09




$begingroup$
Appreciate it. Yeah, I suspected as much. That's almost always the reason when you add/subtract probabilities and get something not between 0 and 1. Thought I'd mention it anyway in case it inspired someone to formulate a correct approach based on the idea.
$endgroup$
– Rohit Pandey
Dec 16 '18 at 19:09












$begingroup$
If you reverse time and flip the y axis, you are counting paths which reach k after n steps without ever returning to 0. This is Bertrand’s ballot problem.
$endgroup$
– Mike Earnest
Dec 16 '18 at 20:24




$begingroup$
If you reverse time and flip the y axis, you are counting paths which reach k after n steps without ever returning to 0. This is Bertrand’s ballot problem.
$endgroup$
– Mike Earnest
Dec 16 '18 at 20:24












$begingroup$
Don't completely follow. If I reverse time, I start off at $k$, correct? So, doesn't it become paths that reach 0?
$endgroup$
– Rohit Pandey
Dec 16 '18 at 20:33




$begingroup$
Don't completely follow. If I reverse time, I start off at $k$, correct? So, doesn't it become paths that reach 0?
$endgroup$
– Rohit Pandey
Dec 16 '18 at 20:33












$begingroup$
@RohitPandey Sorry, when I said "flip the y-axis,", I meant that you interchange $0$ with $k$.
$endgroup$
– Mike Earnest
Dec 17 '18 at 12:49




$begingroup$
@RohitPandey Sorry, when I said "flip the y-axis,", I meant that you interchange $0$ with $k$.
$endgroup$
– Mike Earnest
Dec 17 '18 at 12:49










2 Answers
2






active

oldest

votes


















3












$begingroup$

After some investigation, it seems to be the case that there are $$f(k,ell)=frac{k+1}{k+1+ell}{k+2ellchooseell}$$ paths to state $kgeq0$ in $k+2ell$ steps that never pass the $k$'th state. This is equivalent to the amount of ways to move to state $k+1$ for the first time after $k+1+2ell$ steps. By substitution and simple probability, we get a $$frac{k}{k+ell}{k-1+2ellchooseell}p^{k+ell}q^{ell}$$ probability of reaching state $k$ for the first time after $k+2ell$ steps.



We can prove our formula for $f$ by induction. For $ell=0$ the answer is obviously $1$, which coincides with the given formula. For $k=-1$ the answer is obviously $0$, which also coincides with the given formula. For $ell>0$ and $kgeq0$ we have two options for the first move: right or left. If we go left, there are $f(k+1,ell-1)$ options, and if we go right there are $f(k-1,ell)$ options. Hence, in total we have
begin{align}
f(k+1,ell-1)+f(k-1,ell)
&=frac{k+2}{k+2+ell-1}{k+1+2(ell-1)chooseell-1}+frac{k}{k+ell}{k-1+2ellchooseell}
\&=frac{(k+2)(k+2ell-1)!}{(k+ell+1)(ell-1)!(k+ell)!}+frac{k(k+2ell-1)!}{(k+ell)ell!(k+ell-1)!}
\&=frac{(k+2)(k+2ell-1)!}{(ell-1)!(k+ell+1)!}+frac{k(k+2ell-1)!}{ell!(k+ell)!}
\&=frac{ell(k+2)(k+2ell-1)!}{ell!(k+ell+1)!}+frac{(k+ell+1)k(k+2ell-1)!}{ell!(k+ell+1)!}
\&=frac{(ell(k+2)+(k+ell+1)k)(k+2ell-1)!}{ell!(k+ell+1)!}
\&=frac{(2ell k+2ell+k^2+k)(k+2ell-1)!}{ell!(k+ell+1)!}
\&=frac{(2ell+k)(k+1)(k+2ell-1)!}{ell!(k+ell+1)!}
\&=frac{(k+1)(k+2ell)!}{ell!(k+ell+1)!}
\&=f(k,ell)
end{align}

options. By principle of induction, this proves the correctness of the formula for $f$.



Now admittedly, even though this solves the problem, it is not a nice solution. I found the formula by simply experimenting for half an hour, and the proof is very algebraic and not very nice to look at. If someone comes up with a combinatorical proof, that would be much better! I am certainly going to think about it now.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    I see, thanks. Can you briefly explain how you came up with this formula via experimentation? What was your approach to first discover it?
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 21:11






  • 2




    $begingroup$
    I took a fixed $ell$ and I expected the formula would be a polynomial of degree $ell-1$, so simply finding $ell$ terms determines the polynomial. The first few polynomials were $1$; $k+1$; $(k+1)(k+4)/2$; $(k+1)(k+5)(k+6)/6$; $(k+1)(k+6)(k+7)(k+8)/24$. At this point I found the pattern and I got the formula.
    $endgroup$
    – SmileyCraft
    Dec 16 '18 at 21:14










  • $begingroup$
    Sorry, one last thing I haven't understood - why didn't you just call the probability $f(k,l) p^{k+l}q^l$? Instead, you wrote it as $f(k-1,l) p^{k+l} q^l$.
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 21:52






  • 1




    $begingroup$
    To go to state $k$ for the first time after $k+2ell$ steps means to go to state $k-1$ after $k-1+2ell$ steps without going past state $k-1$ and then going right.
    $endgroup$
    – SmileyCraft
    Dec 16 '18 at 22:09










  • $begingroup$
    Ahh, without going past being they key. Got it, thanks again! Impressive solution.
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 22:12



















2












$begingroup$

This answer is an extension to the one by @SmileyCraft. As he says in his answer, it would be nice to have a combinatorial proof. I might have found one. The problem seems similar in spirit to the one where you have a square grid, start at the bottom left corner and need to get to the top-right corner and find the number of paths where you don't cross the main diagonal of the grid (ok to touch it). In that instance, the number of such paths is the catalan numbers.



$$C_n = frac{2n choose n}{n+1} = {2n choose n} - {2n choose n-1}$$



Now, taking a cue from this, the formula @SmileyCraft has above can also be written as:



$$f(k,l) = frac{k+1}{k+1+l} {k+2l choose l} = {k+2l choose l} - {k+2l choose l-1} tag{1}$$



Now, the problem here for the random walk not crossing $k$ can be converted to a grid problem. We basically have (per @SmileyCraft's convention) $l$ tails and $l+k$ heads and need to arrange them in such a way as to never cross the $k$. This is completely equivalent to saying we'll go right if we get a tails and up if we get a heads on a grid which has $l+k$ rows and $l$ columns.



Another way to see this is to plot on the x-axis the toss number and on the y-axis the score of the random walk. Now, imagine any path going from $(0,0)$ to $(k+2l,k)$. Now, simply rotate the whole picture by 45 degrees and you'll get the grid.



So the formula for $f(k,l)$ above is simply the number of ways to go from the bottom left to top right of a grid with $l$ rows and $l+k$ columns in such a way that the path never crosses the line $y=x+k$.



But how do we show that is equivalent to equation (1) above? I cheated and used the same reasoning as the answer by @Marcus M here. It goes like this:



We know the total paths in our grid are $k+2l choose l$.
The good paths are ones that never cross the line $y=x+k$. Then,



# good paths = # paths - # bad paths



Now, any bad path does cross the line $y=x+k$. So, it must touch the line $y=x+k+1$ (the diagonal just above it).



Divide any such path into two portions. The portion from the origin to when it touches the $y=x+k+1$ line and the portion after that. The first portion can be reflected about the $y=x+k+1$. And this leads to a bijection to a path from $(-(k+1),(k+1))$ to $(l,k+l)$. So, the bad paths can be mapped to paths from the bottom left to top-right of another grid whose height is $(k+l)-(k+1)=l-1$. But we didn't change the total path length, so the total length of the bad paths is still $k+2l$. Hence, the number of bad paths is $k+2l choose l-1$.



Putting all of this together, we get equation (1) above.






share|cite|improve this answer











$endgroup$









  • 1




    $begingroup$
    I believe you are confusing your lefts and rights somewhere, but I get the proof and it is very satisfying :)
    $endgroup$
    – SmileyCraft
    Dec 18 '18 at 16:55










  • $begingroup$
    Yes, I did have left and right mixed up in one place. Fixed that - thanks!
    $endgroup$
    – Rohit Pandey
    Dec 18 '18 at 20:47











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: "69"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3043013%2fprobability-that-random-walk-will-reach-state-k-for-the-first-time-on-step-n%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









3












$begingroup$

After some investigation, it seems to be the case that there are $$f(k,ell)=frac{k+1}{k+1+ell}{k+2ellchooseell}$$ paths to state $kgeq0$ in $k+2ell$ steps that never pass the $k$'th state. This is equivalent to the amount of ways to move to state $k+1$ for the first time after $k+1+2ell$ steps. By substitution and simple probability, we get a $$frac{k}{k+ell}{k-1+2ellchooseell}p^{k+ell}q^{ell}$$ probability of reaching state $k$ for the first time after $k+2ell$ steps.



We can prove our formula for $f$ by induction. For $ell=0$ the answer is obviously $1$, which coincides with the given formula. For $k=-1$ the answer is obviously $0$, which also coincides with the given formula. For $ell>0$ and $kgeq0$ we have two options for the first move: right or left. If we go left, there are $f(k+1,ell-1)$ options, and if we go right there are $f(k-1,ell)$ options. Hence, in total we have
begin{align}
f(k+1,ell-1)+f(k-1,ell)
&=frac{k+2}{k+2+ell-1}{k+1+2(ell-1)chooseell-1}+frac{k}{k+ell}{k-1+2ellchooseell}
\&=frac{(k+2)(k+2ell-1)!}{(k+ell+1)(ell-1)!(k+ell)!}+frac{k(k+2ell-1)!}{(k+ell)ell!(k+ell-1)!}
\&=frac{(k+2)(k+2ell-1)!}{(ell-1)!(k+ell+1)!}+frac{k(k+2ell-1)!}{ell!(k+ell)!}
\&=frac{ell(k+2)(k+2ell-1)!}{ell!(k+ell+1)!}+frac{(k+ell+1)k(k+2ell-1)!}{ell!(k+ell+1)!}
\&=frac{(ell(k+2)+(k+ell+1)k)(k+2ell-1)!}{ell!(k+ell+1)!}
\&=frac{(2ell k+2ell+k^2+k)(k+2ell-1)!}{ell!(k+ell+1)!}
\&=frac{(2ell+k)(k+1)(k+2ell-1)!}{ell!(k+ell+1)!}
\&=frac{(k+1)(k+2ell)!}{ell!(k+ell+1)!}
\&=f(k,ell)
end{align}

options. By principle of induction, this proves the correctness of the formula for $f$.



Now admittedly, even though this solves the problem, it is not a nice solution. I found the formula by simply experimenting for half an hour, and the proof is very algebraic and not very nice to look at. If someone comes up with a combinatorical proof, that would be much better! I am certainly going to think about it now.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    I see, thanks. Can you briefly explain how you came up with this formula via experimentation? What was your approach to first discover it?
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 21:11






  • 2




    $begingroup$
    I took a fixed $ell$ and I expected the formula would be a polynomial of degree $ell-1$, so simply finding $ell$ terms determines the polynomial. The first few polynomials were $1$; $k+1$; $(k+1)(k+4)/2$; $(k+1)(k+5)(k+6)/6$; $(k+1)(k+6)(k+7)(k+8)/24$. At this point I found the pattern and I got the formula.
    $endgroup$
    – SmileyCraft
    Dec 16 '18 at 21:14










  • $begingroup$
    Sorry, one last thing I haven't understood - why didn't you just call the probability $f(k,l) p^{k+l}q^l$? Instead, you wrote it as $f(k-1,l) p^{k+l} q^l$.
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 21:52






  • 1




    $begingroup$
    To go to state $k$ for the first time after $k+2ell$ steps means to go to state $k-1$ after $k-1+2ell$ steps without going past state $k-1$ and then going right.
    $endgroup$
    – SmileyCraft
    Dec 16 '18 at 22:09










  • $begingroup$
    Ahh, without going past being they key. Got it, thanks again! Impressive solution.
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 22:12
















3












$begingroup$

After some investigation, it seems to be the case that there are $$f(k,ell)=frac{k+1}{k+1+ell}{k+2ellchooseell}$$ paths to state $kgeq0$ in $k+2ell$ steps that never pass the $k$'th state. This is equivalent to the amount of ways to move to state $k+1$ for the first time after $k+1+2ell$ steps. By substitution and simple probability, we get a $$frac{k}{k+ell}{k-1+2ellchooseell}p^{k+ell}q^{ell}$$ probability of reaching state $k$ for the first time after $k+2ell$ steps.



We can prove our formula for $f$ by induction. For $ell=0$ the answer is obviously $1$, which coincides with the given formula. For $k=-1$ the answer is obviously $0$, which also coincides with the given formula. For $ell>0$ and $kgeq0$ we have two options for the first move: right or left. If we go left, there are $f(k+1,ell-1)$ options, and if we go right there are $f(k-1,ell)$ options. Hence, in total we have
begin{align}
f(k+1,ell-1)+f(k-1,ell)
&=frac{k+2}{k+2+ell-1}{k+1+2(ell-1)chooseell-1}+frac{k}{k+ell}{k-1+2ellchooseell}
\&=frac{(k+2)(k+2ell-1)!}{(k+ell+1)(ell-1)!(k+ell)!}+frac{k(k+2ell-1)!}{(k+ell)ell!(k+ell-1)!}
\&=frac{(k+2)(k+2ell-1)!}{(ell-1)!(k+ell+1)!}+frac{k(k+2ell-1)!}{ell!(k+ell)!}
\&=frac{ell(k+2)(k+2ell-1)!}{ell!(k+ell+1)!}+frac{(k+ell+1)k(k+2ell-1)!}{ell!(k+ell+1)!}
\&=frac{(ell(k+2)+(k+ell+1)k)(k+2ell-1)!}{ell!(k+ell+1)!}
\&=frac{(2ell k+2ell+k^2+k)(k+2ell-1)!}{ell!(k+ell+1)!}
\&=frac{(2ell+k)(k+1)(k+2ell-1)!}{ell!(k+ell+1)!}
\&=frac{(k+1)(k+2ell)!}{ell!(k+ell+1)!}
\&=f(k,ell)
end{align}

options. By principle of induction, this proves the correctness of the formula for $f$.



Now admittedly, even though this solves the problem, it is not a nice solution. I found the formula by simply experimenting for half an hour, and the proof is very algebraic and not very nice to look at. If someone comes up with a combinatorical proof, that would be much better! I am certainly going to think about it now.






share|cite|improve this answer









$endgroup$













  • $begingroup$
    I see, thanks. Can you briefly explain how you came up with this formula via experimentation? What was your approach to first discover it?
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 21:11






  • 2




    $begingroup$
    I took a fixed $ell$ and I expected the formula would be a polynomial of degree $ell-1$, so simply finding $ell$ terms determines the polynomial. The first few polynomials were $1$; $k+1$; $(k+1)(k+4)/2$; $(k+1)(k+5)(k+6)/6$; $(k+1)(k+6)(k+7)(k+8)/24$. At this point I found the pattern and I got the formula.
    $endgroup$
    – SmileyCraft
    Dec 16 '18 at 21:14










  • $begingroup$
    Sorry, one last thing I haven't understood - why didn't you just call the probability $f(k,l) p^{k+l}q^l$? Instead, you wrote it as $f(k-1,l) p^{k+l} q^l$.
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 21:52






  • 1




    $begingroup$
    To go to state $k$ for the first time after $k+2ell$ steps means to go to state $k-1$ after $k-1+2ell$ steps without going past state $k-1$ and then going right.
    $endgroup$
    – SmileyCraft
    Dec 16 '18 at 22:09










  • $begingroup$
    Ahh, without going past being they key. Got it, thanks again! Impressive solution.
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 22:12














3












3








3





$begingroup$

After some investigation, it seems to be the case that there are $$f(k,ell)=frac{k+1}{k+1+ell}{k+2ellchooseell}$$ paths to state $kgeq0$ in $k+2ell$ steps that never pass the $k$'th state. This is equivalent to the amount of ways to move to state $k+1$ for the first time after $k+1+2ell$ steps. By substitution and simple probability, we get a $$frac{k}{k+ell}{k-1+2ellchooseell}p^{k+ell}q^{ell}$$ probability of reaching state $k$ for the first time after $k+2ell$ steps.



We can prove our formula for $f$ by induction. For $ell=0$ the answer is obviously $1$, which coincides with the given formula. For $k=-1$ the answer is obviously $0$, which also coincides with the given formula. For $ell>0$ and $kgeq0$ we have two options for the first move: right or left. If we go left, there are $f(k+1,ell-1)$ options, and if we go right there are $f(k-1,ell)$ options. Hence, in total we have
begin{align}
f(k+1,ell-1)+f(k-1,ell)
&=frac{k+2}{k+2+ell-1}{k+1+2(ell-1)chooseell-1}+frac{k}{k+ell}{k-1+2ellchooseell}
\&=frac{(k+2)(k+2ell-1)!}{(k+ell+1)(ell-1)!(k+ell)!}+frac{k(k+2ell-1)!}{(k+ell)ell!(k+ell-1)!}
\&=frac{(k+2)(k+2ell-1)!}{(ell-1)!(k+ell+1)!}+frac{k(k+2ell-1)!}{ell!(k+ell)!}
\&=frac{ell(k+2)(k+2ell-1)!}{ell!(k+ell+1)!}+frac{(k+ell+1)k(k+2ell-1)!}{ell!(k+ell+1)!}
\&=frac{(ell(k+2)+(k+ell+1)k)(k+2ell-1)!}{ell!(k+ell+1)!}
\&=frac{(2ell k+2ell+k^2+k)(k+2ell-1)!}{ell!(k+ell+1)!}
\&=frac{(2ell+k)(k+1)(k+2ell-1)!}{ell!(k+ell+1)!}
\&=frac{(k+1)(k+2ell)!}{ell!(k+ell+1)!}
\&=f(k,ell)
end{align}

options. By principle of induction, this proves the correctness of the formula for $f$.



Now admittedly, even though this solves the problem, it is not a nice solution. I found the formula by simply experimenting for half an hour, and the proof is very algebraic and not very nice to look at. If someone comes up with a combinatorical proof, that would be much better! I am certainly going to think about it now.






share|cite|improve this answer









$endgroup$



After some investigation, it seems to be the case that there are $$f(k,ell)=frac{k+1}{k+1+ell}{k+2ellchooseell}$$ paths to state $kgeq0$ in $k+2ell$ steps that never pass the $k$'th state. This is equivalent to the amount of ways to move to state $k+1$ for the first time after $k+1+2ell$ steps. By substitution and simple probability, we get a $$frac{k}{k+ell}{k-1+2ellchooseell}p^{k+ell}q^{ell}$$ probability of reaching state $k$ for the first time after $k+2ell$ steps.



We can prove our formula for $f$ by induction. For $ell=0$ the answer is obviously $1$, which coincides with the given formula. For $k=-1$ the answer is obviously $0$, which also coincides with the given formula. For $ell>0$ and $kgeq0$ we have two options for the first move: right or left. If we go left, there are $f(k+1,ell-1)$ options, and if we go right there are $f(k-1,ell)$ options. Hence, in total we have
begin{align}
f(k+1,ell-1)+f(k-1,ell)
&=frac{k+2}{k+2+ell-1}{k+1+2(ell-1)chooseell-1}+frac{k}{k+ell}{k-1+2ellchooseell}
\&=frac{(k+2)(k+2ell-1)!}{(k+ell+1)(ell-1)!(k+ell)!}+frac{k(k+2ell-1)!}{(k+ell)ell!(k+ell-1)!}
\&=frac{(k+2)(k+2ell-1)!}{(ell-1)!(k+ell+1)!}+frac{k(k+2ell-1)!}{ell!(k+ell)!}
\&=frac{ell(k+2)(k+2ell-1)!}{ell!(k+ell+1)!}+frac{(k+ell+1)k(k+2ell-1)!}{ell!(k+ell+1)!}
\&=frac{(ell(k+2)+(k+ell+1)k)(k+2ell-1)!}{ell!(k+ell+1)!}
\&=frac{(2ell k+2ell+k^2+k)(k+2ell-1)!}{ell!(k+ell+1)!}
\&=frac{(2ell+k)(k+1)(k+2ell-1)!}{ell!(k+ell+1)!}
\&=frac{(k+1)(k+2ell)!}{ell!(k+ell+1)!}
\&=f(k,ell)
end{align}

options. By principle of induction, this proves the correctness of the formula for $f$.



Now admittedly, even though this solves the problem, it is not a nice solution. I found the formula by simply experimenting for half an hour, and the proof is very algebraic and not very nice to look at. If someone comes up with a combinatorical proof, that would be much better! I am certainly going to think about it now.







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered Dec 16 '18 at 20:40









SmileyCraftSmileyCraft

3,456516




3,456516












  • $begingroup$
    I see, thanks. Can you briefly explain how you came up with this formula via experimentation? What was your approach to first discover it?
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 21:11






  • 2




    $begingroup$
    I took a fixed $ell$ and I expected the formula would be a polynomial of degree $ell-1$, so simply finding $ell$ terms determines the polynomial. The first few polynomials were $1$; $k+1$; $(k+1)(k+4)/2$; $(k+1)(k+5)(k+6)/6$; $(k+1)(k+6)(k+7)(k+8)/24$. At this point I found the pattern and I got the formula.
    $endgroup$
    – SmileyCraft
    Dec 16 '18 at 21:14










  • $begingroup$
    Sorry, one last thing I haven't understood - why didn't you just call the probability $f(k,l) p^{k+l}q^l$? Instead, you wrote it as $f(k-1,l) p^{k+l} q^l$.
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 21:52






  • 1




    $begingroup$
    To go to state $k$ for the first time after $k+2ell$ steps means to go to state $k-1$ after $k-1+2ell$ steps without going past state $k-1$ and then going right.
    $endgroup$
    – SmileyCraft
    Dec 16 '18 at 22:09










  • $begingroup$
    Ahh, without going past being they key. Got it, thanks again! Impressive solution.
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 22:12


















  • $begingroup$
    I see, thanks. Can you briefly explain how you came up with this formula via experimentation? What was your approach to first discover it?
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 21:11






  • 2




    $begingroup$
    I took a fixed $ell$ and I expected the formula would be a polynomial of degree $ell-1$, so simply finding $ell$ terms determines the polynomial. The first few polynomials were $1$; $k+1$; $(k+1)(k+4)/2$; $(k+1)(k+5)(k+6)/6$; $(k+1)(k+6)(k+7)(k+8)/24$. At this point I found the pattern and I got the formula.
    $endgroup$
    – SmileyCraft
    Dec 16 '18 at 21:14










  • $begingroup$
    Sorry, one last thing I haven't understood - why didn't you just call the probability $f(k,l) p^{k+l}q^l$? Instead, you wrote it as $f(k-1,l) p^{k+l} q^l$.
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 21:52






  • 1




    $begingroup$
    To go to state $k$ for the first time after $k+2ell$ steps means to go to state $k-1$ after $k-1+2ell$ steps without going past state $k-1$ and then going right.
    $endgroup$
    – SmileyCraft
    Dec 16 '18 at 22:09










  • $begingroup$
    Ahh, without going past being they key. Got it, thanks again! Impressive solution.
    $endgroup$
    – Rohit Pandey
    Dec 16 '18 at 22:12
















$begingroup$
I see, thanks. Can you briefly explain how you came up with this formula via experimentation? What was your approach to first discover it?
$endgroup$
– Rohit Pandey
Dec 16 '18 at 21:11




$begingroup$
I see, thanks. Can you briefly explain how you came up with this formula via experimentation? What was your approach to first discover it?
$endgroup$
– Rohit Pandey
Dec 16 '18 at 21:11




2




2




$begingroup$
I took a fixed $ell$ and I expected the formula would be a polynomial of degree $ell-1$, so simply finding $ell$ terms determines the polynomial. The first few polynomials were $1$; $k+1$; $(k+1)(k+4)/2$; $(k+1)(k+5)(k+6)/6$; $(k+1)(k+6)(k+7)(k+8)/24$. At this point I found the pattern and I got the formula.
$endgroup$
– SmileyCraft
Dec 16 '18 at 21:14




$begingroup$
I took a fixed $ell$ and I expected the formula would be a polynomial of degree $ell-1$, so simply finding $ell$ terms determines the polynomial. The first few polynomials were $1$; $k+1$; $(k+1)(k+4)/2$; $(k+1)(k+5)(k+6)/6$; $(k+1)(k+6)(k+7)(k+8)/24$. At this point I found the pattern and I got the formula.
$endgroup$
– SmileyCraft
Dec 16 '18 at 21:14












$begingroup$
Sorry, one last thing I haven't understood - why didn't you just call the probability $f(k,l) p^{k+l}q^l$? Instead, you wrote it as $f(k-1,l) p^{k+l} q^l$.
$endgroup$
– Rohit Pandey
Dec 16 '18 at 21:52




$begingroup$
Sorry, one last thing I haven't understood - why didn't you just call the probability $f(k,l) p^{k+l}q^l$? Instead, you wrote it as $f(k-1,l) p^{k+l} q^l$.
$endgroup$
– Rohit Pandey
Dec 16 '18 at 21:52




1




1




$begingroup$
To go to state $k$ for the first time after $k+2ell$ steps means to go to state $k-1$ after $k-1+2ell$ steps without going past state $k-1$ and then going right.
$endgroup$
– SmileyCraft
Dec 16 '18 at 22:09




$begingroup$
To go to state $k$ for the first time after $k+2ell$ steps means to go to state $k-1$ after $k-1+2ell$ steps without going past state $k-1$ and then going right.
$endgroup$
– SmileyCraft
Dec 16 '18 at 22:09












$begingroup$
Ahh, without going past being they key. Got it, thanks again! Impressive solution.
$endgroup$
– Rohit Pandey
Dec 16 '18 at 22:12




$begingroup$
Ahh, without going past being they key. Got it, thanks again! Impressive solution.
$endgroup$
– Rohit Pandey
Dec 16 '18 at 22:12











2












$begingroup$

This answer is an extension to the one by @SmileyCraft. As he says in his answer, it would be nice to have a combinatorial proof. I might have found one. The problem seems similar in spirit to the one where you have a square grid, start at the bottom left corner and need to get to the top-right corner and find the number of paths where you don't cross the main diagonal of the grid (ok to touch it). In that instance, the number of such paths is the catalan numbers.



$$C_n = frac{2n choose n}{n+1} = {2n choose n} - {2n choose n-1}$$



Now, taking a cue from this, the formula @SmileyCraft has above can also be written as:



$$f(k,l) = frac{k+1}{k+1+l} {k+2l choose l} = {k+2l choose l} - {k+2l choose l-1} tag{1}$$



Now, the problem here for the random walk not crossing $k$ can be converted to a grid problem. We basically have (per @SmileyCraft's convention) $l$ tails and $l+k$ heads and need to arrange them in such a way as to never cross the $k$. This is completely equivalent to saying we'll go right if we get a tails and up if we get a heads on a grid which has $l+k$ rows and $l$ columns.



Another way to see this is to plot on the x-axis the toss number and on the y-axis the score of the random walk. Now, imagine any path going from $(0,0)$ to $(k+2l,k)$. Now, simply rotate the whole picture by 45 degrees and you'll get the grid.



So the formula for $f(k,l)$ above is simply the number of ways to go from the bottom left to top right of a grid with $l$ rows and $l+k$ columns in such a way that the path never crosses the line $y=x+k$.



But how do we show that is equivalent to equation (1) above? I cheated and used the same reasoning as the answer by @Marcus M here. It goes like this:



We know the total paths in our grid are $k+2l choose l$.
The good paths are ones that never cross the line $y=x+k$. Then,



# good paths = # paths - # bad paths



Now, any bad path does cross the line $y=x+k$. So, it must touch the line $y=x+k+1$ (the diagonal just above it).



Divide any such path into two portions. The portion from the origin to when it touches the $y=x+k+1$ line and the portion after that. The first portion can be reflected about the $y=x+k+1$. And this leads to a bijection to a path from $(-(k+1),(k+1))$ to $(l,k+l)$. So, the bad paths can be mapped to paths from the bottom left to top-right of another grid whose height is $(k+l)-(k+1)=l-1$. But we didn't change the total path length, so the total length of the bad paths is still $k+2l$. Hence, the number of bad paths is $k+2l choose l-1$.



Putting all of this together, we get equation (1) above.






share|cite|improve this answer











$endgroup$









  • 1




    $begingroup$
    I believe you are confusing your lefts and rights somewhere, but I get the proof and it is very satisfying :)
    $endgroup$
    – SmileyCraft
    Dec 18 '18 at 16:55










  • $begingroup$
    Yes, I did have left and right mixed up in one place. Fixed that - thanks!
    $endgroup$
    – Rohit Pandey
    Dec 18 '18 at 20:47
















2












$begingroup$

This answer is an extension to the one by @SmileyCraft. As he says in his answer, it would be nice to have a combinatorial proof. I might have found one. The problem seems similar in spirit to the one where you have a square grid, start at the bottom left corner and need to get to the top-right corner and find the number of paths where you don't cross the main diagonal of the grid (ok to touch it). In that instance, the number of such paths is the catalan numbers.



$$C_n = frac{2n choose n}{n+1} = {2n choose n} - {2n choose n-1}$$



Now, taking a cue from this, the formula @SmileyCraft has above can also be written as:



$$f(k,l) = frac{k+1}{k+1+l} {k+2l choose l} = {k+2l choose l} - {k+2l choose l-1} tag{1}$$



Now, the problem here for the random walk not crossing $k$ can be converted to a grid problem. We basically have (per @SmileyCraft's convention) $l$ tails and $l+k$ heads and need to arrange them in such a way as to never cross the $k$. This is completely equivalent to saying we'll go right if we get a tails and up if we get a heads on a grid which has $l+k$ rows and $l$ columns.



Another way to see this is to plot on the x-axis the toss number and on the y-axis the score of the random walk. Now, imagine any path going from $(0,0)$ to $(k+2l,k)$. Now, simply rotate the whole picture by 45 degrees and you'll get the grid.



So the formula for $f(k,l)$ above is simply the number of ways to go from the bottom left to top right of a grid with $l$ rows and $l+k$ columns in such a way that the path never crosses the line $y=x+k$.



But how do we show that is equivalent to equation (1) above? I cheated and used the same reasoning as the answer by @Marcus M here. It goes like this:



We know the total paths in our grid are $k+2l choose l$.
The good paths are ones that never cross the line $y=x+k$. Then,



# good paths = # paths - # bad paths



Now, any bad path does cross the line $y=x+k$. So, it must touch the line $y=x+k+1$ (the diagonal just above it).



Divide any such path into two portions. The portion from the origin to when it touches the $y=x+k+1$ line and the portion after that. The first portion can be reflected about the $y=x+k+1$. And this leads to a bijection to a path from $(-(k+1),(k+1))$ to $(l,k+l)$. So, the bad paths can be mapped to paths from the bottom left to top-right of another grid whose height is $(k+l)-(k+1)=l-1$. But we didn't change the total path length, so the total length of the bad paths is still $k+2l$. Hence, the number of bad paths is $k+2l choose l-1$.



Putting all of this together, we get equation (1) above.






share|cite|improve this answer











$endgroup$









  • 1




    $begingroup$
    I believe you are confusing your lefts and rights somewhere, but I get the proof and it is very satisfying :)
    $endgroup$
    – SmileyCraft
    Dec 18 '18 at 16:55










  • $begingroup$
    Yes, I did have left and right mixed up in one place. Fixed that - thanks!
    $endgroup$
    – Rohit Pandey
    Dec 18 '18 at 20:47














2












2








2





$begingroup$

This answer is an extension to the one by @SmileyCraft. As he says in his answer, it would be nice to have a combinatorial proof. I might have found one. The problem seems similar in spirit to the one where you have a square grid, start at the bottom left corner and need to get to the top-right corner and find the number of paths where you don't cross the main diagonal of the grid (ok to touch it). In that instance, the number of such paths is the catalan numbers.



$$C_n = frac{2n choose n}{n+1} = {2n choose n} - {2n choose n-1}$$



Now, taking a cue from this, the formula @SmileyCraft has above can also be written as:



$$f(k,l) = frac{k+1}{k+1+l} {k+2l choose l} = {k+2l choose l} - {k+2l choose l-1} tag{1}$$



Now, the problem here for the random walk not crossing $k$ can be converted to a grid problem. We basically have (per @SmileyCraft's convention) $l$ tails and $l+k$ heads and need to arrange them in such a way as to never cross the $k$. This is completely equivalent to saying we'll go right if we get a tails and up if we get a heads on a grid which has $l+k$ rows and $l$ columns.



Another way to see this is to plot on the x-axis the toss number and on the y-axis the score of the random walk. Now, imagine any path going from $(0,0)$ to $(k+2l,k)$. Now, simply rotate the whole picture by 45 degrees and you'll get the grid.



So the formula for $f(k,l)$ above is simply the number of ways to go from the bottom left to top right of a grid with $l$ rows and $l+k$ columns in such a way that the path never crosses the line $y=x+k$.



But how do we show that is equivalent to equation (1) above? I cheated and used the same reasoning as the answer by @Marcus M here. It goes like this:



We know the total paths in our grid are $k+2l choose l$.
The good paths are ones that never cross the line $y=x+k$. Then,



# good paths = # paths - # bad paths



Now, any bad path does cross the line $y=x+k$. So, it must touch the line $y=x+k+1$ (the diagonal just above it).



Divide any such path into two portions. The portion from the origin to when it touches the $y=x+k+1$ line and the portion after that. The first portion can be reflected about the $y=x+k+1$. And this leads to a bijection to a path from $(-(k+1),(k+1))$ to $(l,k+l)$. So, the bad paths can be mapped to paths from the bottom left to top-right of another grid whose height is $(k+l)-(k+1)=l-1$. But we didn't change the total path length, so the total length of the bad paths is still $k+2l$. Hence, the number of bad paths is $k+2l choose l-1$.



Putting all of this together, we get equation (1) above.






share|cite|improve this answer











$endgroup$



This answer is an extension to the one by @SmileyCraft. As he says in his answer, it would be nice to have a combinatorial proof. I might have found one. The problem seems similar in spirit to the one where you have a square grid, start at the bottom left corner and need to get to the top-right corner and find the number of paths where you don't cross the main diagonal of the grid (ok to touch it). In that instance, the number of such paths is the catalan numbers.



$$C_n = frac{2n choose n}{n+1} = {2n choose n} - {2n choose n-1}$$



Now, taking a cue from this, the formula @SmileyCraft has above can also be written as:



$$f(k,l) = frac{k+1}{k+1+l} {k+2l choose l} = {k+2l choose l} - {k+2l choose l-1} tag{1}$$



Now, the problem here for the random walk not crossing $k$ can be converted to a grid problem. We basically have (per @SmileyCraft's convention) $l$ tails and $l+k$ heads and need to arrange them in such a way as to never cross the $k$. This is completely equivalent to saying we'll go right if we get a tails and up if we get a heads on a grid which has $l+k$ rows and $l$ columns.



Another way to see this is to plot on the x-axis the toss number and on the y-axis the score of the random walk. Now, imagine any path going from $(0,0)$ to $(k+2l,k)$. Now, simply rotate the whole picture by 45 degrees and you'll get the grid.



So the formula for $f(k,l)$ above is simply the number of ways to go from the bottom left to top right of a grid with $l$ rows and $l+k$ columns in such a way that the path never crosses the line $y=x+k$.



But how do we show that is equivalent to equation (1) above? I cheated and used the same reasoning as the answer by @Marcus M here. It goes like this:



We know the total paths in our grid are $k+2l choose l$.
The good paths are ones that never cross the line $y=x+k$. Then,



# good paths = # paths - # bad paths



Now, any bad path does cross the line $y=x+k$. So, it must touch the line $y=x+k+1$ (the diagonal just above it).



Divide any such path into two portions. The portion from the origin to when it touches the $y=x+k+1$ line and the portion after that. The first portion can be reflected about the $y=x+k+1$. And this leads to a bijection to a path from $(-(k+1),(k+1))$ to $(l,k+l)$. So, the bad paths can be mapped to paths from the bottom left to top-right of another grid whose height is $(k+l)-(k+1)=l-1$. But we didn't change the total path length, so the total length of the bad paths is still $k+2l$. Hence, the number of bad paths is $k+2l choose l-1$.



Putting all of this together, we get equation (1) above.







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited Dec 19 '18 at 19:11

























answered Dec 18 '18 at 2:27









Rohit PandeyRohit Pandey

1,2201021




1,2201021








  • 1




    $begingroup$
    I believe you are confusing your lefts and rights somewhere, but I get the proof and it is very satisfying :)
    $endgroup$
    – SmileyCraft
    Dec 18 '18 at 16:55










  • $begingroup$
    Yes, I did have left and right mixed up in one place. Fixed that - thanks!
    $endgroup$
    – Rohit Pandey
    Dec 18 '18 at 20:47














  • 1




    $begingroup$
    I believe you are confusing your lefts and rights somewhere, but I get the proof and it is very satisfying :)
    $endgroup$
    – SmileyCraft
    Dec 18 '18 at 16:55










  • $begingroup$
    Yes, I did have left and right mixed up in one place. Fixed that - thanks!
    $endgroup$
    – Rohit Pandey
    Dec 18 '18 at 20:47








1




1




$begingroup$
I believe you are confusing your lefts and rights somewhere, but I get the proof and it is very satisfying :)
$endgroup$
– SmileyCraft
Dec 18 '18 at 16:55




$begingroup$
I believe you are confusing your lefts and rights somewhere, but I get the proof and it is very satisfying :)
$endgroup$
– SmileyCraft
Dec 18 '18 at 16:55












$begingroup$
Yes, I did have left and right mixed up in one place. Fixed that - thanks!
$endgroup$
– Rohit Pandey
Dec 18 '18 at 20:47




$begingroup$
Yes, I did have left and right mixed up in one place. Fixed that - thanks!
$endgroup$
– Rohit Pandey
Dec 18 '18 at 20:47


















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics 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%2fmath.stackexchange.com%2fquestions%2f3043013%2fprobability-that-random-walk-will-reach-state-k-for-the-first-time-on-step-n%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

Bressuire

Cabo Verde

Gyllenstierna