Solving a difference equation for coin toss sequence probabilities












1












$begingroup$


I want to solve the following difference equation:



$$b_n-b_{n-1} = frac{1}{8}(1-b_{n-3})$$



I tried to solve it similar to the solution of Fibonacci sequence here, but when I try to assume the solution will be of the form $l^n$, I end up with the following polynomial:



$$l^{n-3}(l^3-l^2+frac{1}{8}) = frac{1}{8}$$



Unlike in the Fibonacci sequence, we don't get a polynomial equation that can be easily solved and independent of $n$.



Any other strategy to solve this?





The reason I care about this difference equation is that it describes the probability I will get two consecutive heads on the $n$th toss of a fair coin.



Let $a_n$ be the probability that I'll reach two consecutive heads on the $n$th toss.



We know that at the time when I reach my goal on the $n$th toss, the last two tosses I saw would have both been heads.



Also, the third-from-final toss would have had to be a tails (otherwise, I would have won one toss earlier). The probability of this sequence
of THH is $frac{1}{2}times frac{1}{2} times frac{1}{2} = frac{1}{8}$.



Before these three tosses, my probability of winning would have been by definition, $a_{n-3}$. But if I am to win in the $n$th toss,
I need to exclude that event. And similarly $a_{n-4}$ and so on. This means:



$$a_n=frac{1}{8}left(1-sum_{i=1}^{n-3} a_iright)$$



Now let's define:



$$b_n = sum_{i=1}^{n} a_i$$



which represents the probability you would have won by the $n$th toss.



Plugging this equation into the previous one we get:



$$b_n-b_{n-1} = frac{1}{8}(1-b_{n-3})$$










share|cite|improve this question









$endgroup$








  • 1




    $begingroup$
    This thing is done exactly like 2nd order linear differential equations. First, find the solution for the homogeneous part then take an ansatz for the inhomogeneous part. The sum of the homogeneous and particular solution is the general one
    $endgroup$
    – mm-crj
    Dec 8 '18 at 22:55






  • 1




    $begingroup$
    Actually no, I just remember reading it somewhere.. I will try to sketch a rough answer.
    $endgroup$
    – mm-crj
    Dec 8 '18 at 22:59






  • 2




    $begingroup$
    $$ b_n = 1 + Aleft(frac{1 - sqrt{5}}{4} right)^n + Bleft(frac{1 + sqrt{5}}{4} right)^n + C 2^{-n} $$
    $endgroup$
    – caverac
    Dec 8 '18 at 23:02






  • 2




    $begingroup$
    It is fairly simple by using a Z-transformation. I can post the full solution if you are interested
    $endgroup$
    – caverac
    Dec 8 '18 at 23:20








  • 1




    $begingroup$
    Yeah even me, I don't know about the z-transform way.
    $endgroup$
    – mm-crj
    Dec 8 '18 at 23:34
















1












$begingroup$


I want to solve the following difference equation:



$$b_n-b_{n-1} = frac{1}{8}(1-b_{n-3})$$



I tried to solve it similar to the solution of Fibonacci sequence here, but when I try to assume the solution will be of the form $l^n$, I end up with the following polynomial:



$$l^{n-3}(l^3-l^2+frac{1}{8}) = frac{1}{8}$$



Unlike in the Fibonacci sequence, we don't get a polynomial equation that can be easily solved and independent of $n$.



Any other strategy to solve this?





The reason I care about this difference equation is that it describes the probability I will get two consecutive heads on the $n$th toss of a fair coin.



Let $a_n$ be the probability that I'll reach two consecutive heads on the $n$th toss.



We know that at the time when I reach my goal on the $n$th toss, the last two tosses I saw would have both been heads.



Also, the third-from-final toss would have had to be a tails (otherwise, I would have won one toss earlier). The probability of this sequence
of THH is $frac{1}{2}times frac{1}{2} times frac{1}{2} = frac{1}{8}$.



Before these three tosses, my probability of winning would have been by definition, $a_{n-3}$. But if I am to win in the $n$th toss,
I need to exclude that event. And similarly $a_{n-4}$ and so on. This means:



$$a_n=frac{1}{8}left(1-sum_{i=1}^{n-3} a_iright)$$



Now let's define:



$$b_n = sum_{i=1}^{n} a_i$$



which represents the probability you would have won by the $n$th toss.



Plugging this equation into the previous one we get:



$$b_n-b_{n-1} = frac{1}{8}(1-b_{n-3})$$










share|cite|improve this question









$endgroup$








  • 1




    $begingroup$
    This thing is done exactly like 2nd order linear differential equations. First, find the solution for the homogeneous part then take an ansatz for the inhomogeneous part. The sum of the homogeneous and particular solution is the general one
    $endgroup$
    – mm-crj
    Dec 8 '18 at 22:55






  • 1




    $begingroup$
    Actually no, I just remember reading it somewhere.. I will try to sketch a rough answer.
    $endgroup$
    – mm-crj
    Dec 8 '18 at 22:59






  • 2




    $begingroup$
    $$ b_n = 1 + Aleft(frac{1 - sqrt{5}}{4} right)^n + Bleft(frac{1 + sqrt{5}}{4} right)^n + C 2^{-n} $$
    $endgroup$
    – caverac
    Dec 8 '18 at 23:02






  • 2




    $begingroup$
    It is fairly simple by using a Z-transformation. I can post the full solution if you are interested
    $endgroup$
    – caverac
    Dec 8 '18 at 23:20








  • 1




    $begingroup$
    Yeah even me, I don't know about the z-transform way.
    $endgroup$
    – mm-crj
    Dec 8 '18 at 23:34














1












1








1


1



$begingroup$


I want to solve the following difference equation:



$$b_n-b_{n-1} = frac{1}{8}(1-b_{n-3})$$



I tried to solve it similar to the solution of Fibonacci sequence here, but when I try to assume the solution will be of the form $l^n$, I end up with the following polynomial:



$$l^{n-3}(l^3-l^2+frac{1}{8}) = frac{1}{8}$$



Unlike in the Fibonacci sequence, we don't get a polynomial equation that can be easily solved and independent of $n$.



Any other strategy to solve this?





The reason I care about this difference equation is that it describes the probability I will get two consecutive heads on the $n$th toss of a fair coin.



Let $a_n$ be the probability that I'll reach two consecutive heads on the $n$th toss.



We know that at the time when I reach my goal on the $n$th toss, the last two tosses I saw would have both been heads.



Also, the third-from-final toss would have had to be a tails (otherwise, I would have won one toss earlier). The probability of this sequence
of THH is $frac{1}{2}times frac{1}{2} times frac{1}{2} = frac{1}{8}$.



Before these three tosses, my probability of winning would have been by definition, $a_{n-3}$. But if I am to win in the $n$th toss,
I need to exclude that event. And similarly $a_{n-4}$ and so on. This means:



$$a_n=frac{1}{8}left(1-sum_{i=1}^{n-3} a_iright)$$



Now let's define:



$$b_n = sum_{i=1}^{n} a_i$$



which represents the probability you would have won by the $n$th toss.



Plugging this equation into the previous one we get:



$$b_n-b_{n-1} = frac{1}{8}(1-b_{n-3})$$










share|cite|improve this question









$endgroup$




I want to solve the following difference equation:



$$b_n-b_{n-1} = frac{1}{8}(1-b_{n-3})$$



I tried to solve it similar to the solution of Fibonacci sequence here, but when I try to assume the solution will be of the form $l^n$, I end up with the following polynomial:



$$l^{n-3}(l^3-l^2+frac{1}{8}) = frac{1}{8}$$



Unlike in the Fibonacci sequence, we don't get a polynomial equation that can be easily solved and independent of $n$.



Any other strategy to solve this?





The reason I care about this difference equation is that it describes the probability I will get two consecutive heads on the $n$th toss of a fair coin.



Let $a_n$ be the probability that I'll reach two consecutive heads on the $n$th toss.



We know that at the time when I reach my goal on the $n$th toss, the last two tosses I saw would have both been heads.



Also, the third-from-final toss would have had to be a tails (otherwise, I would have won one toss earlier). The probability of this sequence
of THH is $frac{1}{2}times frac{1}{2} times frac{1}{2} = frac{1}{8}$.



Before these three tosses, my probability of winning would have been by definition, $a_{n-3}$. But if I am to win in the $n$th toss,
I need to exclude that event. And similarly $a_{n-4}$ and so on. This means:



$$a_n=frac{1}{8}left(1-sum_{i=1}^{n-3} a_iright)$$



Now let's define:



$$b_n = sum_{i=1}^{n} a_i$$



which represents the probability you would have won by the $n$th toss.



Plugging this equation into the previous one we get:



$$b_n-b_{n-1} = frac{1}{8}(1-b_{n-3})$$







sequences-and-series recurrence-relations






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Dec 8 '18 at 22:31









Rohit PandeyRohit Pandey

1,2871022




1,2871022








  • 1




    $begingroup$
    This thing is done exactly like 2nd order linear differential equations. First, find the solution for the homogeneous part then take an ansatz for the inhomogeneous part. The sum of the homogeneous and particular solution is the general one
    $endgroup$
    – mm-crj
    Dec 8 '18 at 22:55






  • 1




    $begingroup$
    Actually no, I just remember reading it somewhere.. I will try to sketch a rough answer.
    $endgroup$
    – mm-crj
    Dec 8 '18 at 22:59






  • 2




    $begingroup$
    $$ b_n = 1 + Aleft(frac{1 - sqrt{5}}{4} right)^n + Bleft(frac{1 + sqrt{5}}{4} right)^n + C 2^{-n} $$
    $endgroup$
    – caverac
    Dec 8 '18 at 23:02






  • 2




    $begingroup$
    It is fairly simple by using a Z-transformation. I can post the full solution if you are interested
    $endgroup$
    – caverac
    Dec 8 '18 at 23:20








  • 1




    $begingroup$
    Yeah even me, I don't know about the z-transform way.
    $endgroup$
    – mm-crj
    Dec 8 '18 at 23:34














  • 1




    $begingroup$
    This thing is done exactly like 2nd order linear differential equations. First, find the solution for the homogeneous part then take an ansatz for the inhomogeneous part. The sum of the homogeneous and particular solution is the general one
    $endgroup$
    – mm-crj
    Dec 8 '18 at 22:55






  • 1




    $begingroup$
    Actually no, I just remember reading it somewhere.. I will try to sketch a rough answer.
    $endgroup$
    – mm-crj
    Dec 8 '18 at 22:59






  • 2




    $begingroup$
    $$ b_n = 1 + Aleft(frac{1 - sqrt{5}}{4} right)^n + Bleft(frac{1 + sqrt{5}}{4} right)^n + C 2^{-n} $$
    $endgroup$
    – caverac
    Dec 8 '18 at 23:02






  • 2




    $begingroup$
    It is fairly simple by using a Z-transformation. I can post the full solution if you are interested
    $endgroup$
    – caverac
    Dec 8 '18 at 23:20








  • 1




    $begingroup$
    Yeah even me, I don't know about the z-transform way.
    $endgroup$
    – mm-crj
    Dec 8 '18 at 23:34








1




1




$begingroup$
This thing is done exactly like 2nd order linear differential equations. First, find the solution for the homogeneous part then take an ansatz for the inhomogeneous part. The sum of the homogeneous and particular solution is the general one
$endgroup$
– mm-crj
Dec 8 '18 at 22:55




$begingroup$
This thing is done exactly like 2nd order linear differential equations. First, find the solution for the homogeneous part then take an ansatz for the inhomogeneous part. The sum of the homogeneous and particular solution is the general one
$endgroup$
– mm-crj
Dec 8 '18 at 22:55




1




1




$begingroup$
Actually no, I just remember reading it somewhere.. I will try to sketch a rough answer.
$endgroup$
– mm-crj
Dec 8 '18 at 22:59




$begingroup$
Actually no, I just remember reading it somewhere.. I will try to sketch a rough answer.
$endgroup$
– mm-crj
Dec 8 '18 at 22:59




2




2




$begingroup$
$$ b_n = 1 + Aleft(frac{1 - sqrt{5}}{4} right)^n + Bleft(frac{1 + sqrt{5}}{4} right)^n + C 2^{-n} $$
$endgroup$
– caverac
Dec 8 '18 at 23:02




$begingroup$
$$ b_n = 1 + Aleft(frac{1 - sqrt{5}}{4} right)^n + Bleft(frac{1 + sqrt{5}}{4} right)^n + C 2^{-n} $$
$endgroup$
– caverac
Dec 8 '18 at 23:02




2




2




$begingroup$
It is fairly simple by using a Z-transformation. I can post the full solution if you are interested
$endgroup$
– caverac
Dec 8 '18 at 23:20






$begingroup$
It is fairly simple by using a Z-transformation. I can post the full solution if you are interested
$endgroup$
– caverac
Dec 8 '18 at 23:20






1




1




$begingroup$
Yeah even me, I don't know about the z-transform way.
$endgroup$
– mm-crj
Dec 8 '18 at 23:34




$begingroup$
Yeah even me, I don't know about the z-transform way.
$endgroup$
– mm-crj
Dec 8 '18 at 23:34










2 Answers
2






active

oldest

votes


















1












$begingroup$

The homogeneous part of $b_{n}−b_{n−1}=frac{1}{8}(1−b_{n−3})$ is given by:
$$8b_{n}-8b_{n-1}+b_{n-3}=0$$



So the characteristic equation is given by:



$$8l^3-8l^2+1=0$$



The roots are given by $l=frac{1-sqrt{5}}{4}, frac{1+sqrt{5}}{4},frac{1}{2}$



And the answer can be taken as a constant: $b_n=c$. Substituting in
$$8b_n+8b_{n-1}-b_{n-3}=1$$
We have $c=frac{1}{15}$



Therefore the general solution can be written as:



$$b_n=sigma_1left(frac{sqrt{5}+1}{4}right)^n+ sigma_2left(frac{1-sqrt{5}}{4}right)^n+sigma_3left(frac{1}{2}right)^n+frac{sigma_4}{15}.$$



And for the two consecutive heads problem, we can use the first few values in the sequence $b_n$ in particular, $b_0=0$, $b_1=0$, $b_2=0.25$ and $b_3=0.375$ to get $sigma_1 = -1.1708$, $sigma_2=1.708$, $sigma_3=0$, $sigma_4=15$






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Thanks! Not clear about this part - And the ansatz can be taken as $b_n=c$. What is $c$ here?
    $endgroup$
    – Rohit Pandey
    Dec 8 '18 at 23:30










  • $begingroup$
    Ah I see now, just a constant. Thanks!
    $endgroup$
    – Rohit Pandey
    Dec 8 '18 at 23:32






  • 1




    $begingroup$
    It's a guess solution an ansatz for the inhomogeneous case. You may use $b_n =c2^{-n}$ and see whats the solution. It's just a guess.
    $endgroup$
    – mm-crj
    Dec 8 '18 at 23:33



















1












$begingroup$

I have another approach to this I just worked out. Here, we try to use express the recurrence as a system of linear equations. Then, we leverage the eigen values of the matrix associated with the matrix of this linear system.



So far, we have only one equation. This is:



$$b_n -b_{n-1} + frac{1}{8}b_{n-3} = frac{1}{8}$$
To form a linear system, we need two more equations. Let's take some dummy equations.
$$b_{n-1}=b_{n-1}$$



$$b_{n-2}=b_{n-2}$$



Now, we can express this system in matrix form.



$$left( begin{array}{c}
b_n \
b_{n-1}\
b_{n-2}\
end{array} right) = left( begin{array}{ccc}
1 & 0 & -frac{1}{8} & \
1 & 0 & 0\
0 & 1 & 0\
end{array} right) left( begin{array}{c}
b_{n-1} \
b_{n-2}\
b_{n-3}\
end{array} right) + left( begin{array}{c}
frac{1}{8} \
0\
0\
end{array} right)$$



Now let:
$beta_n = left(begin{array}{c}
b_n \
b_{n-1}\
b_{n-2}\
end{array} right)$
, $gamma = left(begin{array}{c}
frac{1}{8} \
0\
0\
end{array} right)$
and $M = left( begin{array}{ccc}
1 & 0 & -frac{1}{8} & \
1 & 0 & 0\
0 & 1 & 0\
end{array} right)$
.



We then get:



$$beta_n = M beta_{n-1} + gamma$$
$$=M(M beta_{n-2}+gamma) + gamma$$



$$=M^2 beta_{n-2} + (I+M)gamma$$



Extending this all the way we get:



$$beta_n = M^{n-2}beta_{2} + (I+M+M^2+ dots + M^{n-3})gamma$$



Now, assuming $M$ is diagonalizable (which it is) we can say:



$$M=ELambda E^{-1}$$
And this would imply:
$$M^n = E Lambda^n E^{-1}$$



So we get:
$$beta^n = ELambda^{n-2}E^{-1}beta_2 + E(I+Lambda+Lambda^2+dots+Lambda^{n-3})E^{-1}gamma$$



Now, if $lambda_1$, $lambda_2$ and $lambda_3$ happen to be the eigen values of $M$ then,
$$Lambda = left( begin{array}{ccc}
lambda_1 & 0 & 0 & \
0 & lambda_2 & 0\
0 & 0 & lambda_3\
end{array} right)$$



and,



$$(I+Lambda+Lambda^2 + dots + Lambda^{n-3}) = left( begin{array}{ccc}
frac{1-lambda_1^{n-2}}{1-lambda_1} & 0 & 0 & \
0 & frac{1-lambda_2^{n-2}}{1-lambda_2} & 0\
0 & 0 & frac{1-lambda_3^{n-2}}{1-lambda_3}\
end{array} right)$$



Using these, it is easy to see that:



$$beta_n = c_0 + c_1 lambda_1^{n-2} + c_2 lambda_2^{n-2} + c_3 lambda_3^{n-2}$$



And the eigen values happen to be: $lambda_1, lambda_2, lambda_3 = frac{phi}{2}$, $frac{1-phi}{2}$, $0.5$.






share|cite|improve this answer











$endgroup$













    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%2f3031728%2fsolving-a-difference-equation-for-coin-toss-sequence-probabilities%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









    1












    $begingroup$

    The homogeneous part of $b_{n}−b_{n−1}=frac{1}{8}(1−b_{n−3})$ is given by:
    $$8b_{n}-8b_{n-1}+b_{n-3}=0$$



    So the characteristic equation is given by:



    $$8l^3-8l^2+1=0$$



    The roots are given by $l=frac{1-sqrt{5}}{4}, frac{1+sqrt{5}}{4},frac{1}{2}$



    And the answer can be taken as a constant: $b_n=c$. Substituting in
    $$8b_n+8b_{n-1}-b_{n-3}=1$$
    We have $c=frac{1}{15}$



    Therefore the general solution can be written as:



    $$b_n=sigma_1left(frac{sqrt{5}+1}{4}right)^n+ sigma_2left(frac{1-sqrt{5}}{4}right)^n+sigma_3left(frac{1}{2}right)^n+frac{sigma_4}{15}.$$



    And for the two consecutive heads problem, we can use the first few values in the sequence $b_n$ in particular, $b_0=0$, $b_1=0$, $b_2=0.25$ and $b_3=0.375$ to get $sigma_1 = -1.1708$, $sigma_2=1.708$, $sigma_3=0$, $sigma_4=15$






    share|cite|improve this answer











    $endgroup$













    • $begingroup$
      Thanks! Not clear about this part - And the ansatz can be taken as $b_n=c$. What is $c$ here?
      $endgroup$
      – Rohit Pandey
      Dec 8 '18 at 23:30










    • $begingroup$
      Ah I see now, just a constant. Thanks!
      $endgroup$
      – Rohit Pandey
      Dec 8 '18 at 23:32






    • 1




      $begingroup$
      It's a guess solution an ansatz for the inhomogeneous case. You may use $b_n =c2^{-n}$ and see whats the solution. It's just a guess.
      $endgroup$
      – mm-crj
      Dec 8 '18 at 23:33
















    1












    $begingroup$

    The homogeneous part of $b_{n}−b_{n−1}=frac{1}{8}(1−b_{n−3})$ is given by:
    $$8b_{n}-8b_{n-1}+b_{n-3}=0$$



    So the characteristic equation is given by:



    $$8l^3-8l^2+1=0$$



    The roots are given by $l=frac{1-sqrt{5}}{4}, frac{1+sqrt{5}}{4},frac{1}{2}$



    And the answer can be taken as a constant: $b_n=c$. Substituting in
    $$8b_n+8b_{n-1}-b_{n-3}=1$$
    We have $c=frac{1}{15}$



    Therefore the general solution can be written as:



    $$b_n=sigma_1left(frac{sqrt{5}+1}{4}right)^n+ sigma_2left(frac{1-sqrt{5}}{4}right)^n+sigma_3left(frac{1}{2}right)^n+frac{sigma_4}{15}.$$



    And for the two consecutive heads problem, we can use the first few values in the sequence $b_n$ in particular, $b_0=0$, $b_1=0$, $b_2=0.25$ and $b_3=0.375$ to get $sigma_1 = -1.1708$, $sigma_2=1.708$, $sigma_3=0$, $sigma_4=15$






    share|cite|improve this answer











    $endgroup$













    • $begingroup$
      Thanks! Not clear about this part - And the ansatz can be taken as $b_n=c$. What is $c$ here?
      $endgroup$
      – Rohit Pandey
      Dec 8 '18 at 23:30










    • $begingroup$
      Ah I see now, just a constant. Thanks!
      $endgroup$
      – Rohit Pandey
      Dec 8 '18 at 23:32






    • 1




      $begingroup$
      It's a guess solution an ansatz for the inhomogeneous case. You may use $b_n =c2^{-n}$ and see whats the solution. It's just a guess.
      $endgroup$
      – mm-crj
      Dec 8 '18 at 23:33














    1












    1








    1





    $begingroup$

    The homogeneous part of $b_{n}−b_{n−1}=frac{1}{8}(1−b_{n−3})$ is given by:
    $$8b_{n}-8b_{n-1}+b_{n-3}=0$$



    So the characteristic equation is given by:



    $$8l^3-8l^2+1=0$$



    The roots are given by $l=frac{1-sqrt{5}}{4}, frac{1+sqrt{5}}{4},frac{1}{2}$



    And the answer can be taken as a constant: $b_n=c$. Substituting in
    $$8b_n+8b_{n-1}-b_{n-3}=1$$
    We have $c=frac{1}{15}$



    Therefore the general solution can be written as:



    $$b_n=sigma_1left(frac{sqrt{5}+1}{4}right)^n+ sigma_2left(frac{1-sqrt{5}}{4}right)^n+sigma_3left(frac{1}{2}right)^n+frac{sigma_4}{15}.$$



    And for the two consecutive heads problem, we can use the first few values in the sequence $b_n$ in particular, $b_0=0$, $b_1=0$, $b_2=0.25$ and $b_3=0.375$ to get $sigma_1 = -1.1708$, $sigma_2=1.708$, $sigma_3=0$, $sigma_4=15$






    share|cite|improve this answer











    $endgroup$



    The homogeneous part of $b_{n}−b_{n−1}=frac{1}{8}(1−b_{n−3})$ is given by:
    $$8b_{n}-8b_{n-1}+b_{n-3}=0$$



    So the characteristic equation is given by:



    $$8l^3-8l^2+1=0$$



    The roots are given by $l=frac{1-sqrt{5}}{4}, frac{1+sqrt{5}}{4},frac{1}{2}$



    And the answer can be taken as a constant: $b_n=c$. Substituting in
    $$8b_n+8b_{n-1}-b_{n-3}=1$$
    We have $c=frac{1}{15}$



    Therefore the general solution can be written as:



    $$b_n=sigma_1left(frac{sqrt{5}+1}{4}right)^n+ sigma_2left(frac{1-sqrt{5}}{4}right)^n+sigma_3left(frac{1}{2}right)^n+frac{sigma_4}{15}.$$



    And for the two consecutive heads problem, we can use the first few values in the sequence $b_n$ in particular, $b_0=0$, $b_1=0$, $b_2=0.25$ and $b_3=0.375$ to get $sigma_1 = -1.1708$, $sigma_2=1.708$, $sigma_3=0$, $sigma_4=15$







    share|cite|improve this answer














    share|cite|improve this answer



    share|cite|improve this answer








    edited Dec 10 '18 at 7:12









    Rohit Pandey

    1,2871022




    1,2871022










    answered Dec 8 '18 at 23:25









    mm-crjmm-crj

    425213




    425213












    • $begingroup$
      Thanks! Not clear about this part - And the ansatz can be taken as $b_n=c$. What is $c$ here?
      $endgroup$
      – Rohit Pandey
      Dec 8 '18 at 23:30










    • $begingroup$
      Ah I see now, just a constant. Thanks!
      $endgroup$
      – Rohit Pandey
      Dec 8 '18 at 23:32






    • 1




      $begingroup$
      It's a guess solution an ansatz for the inhomogeneous case. You may use $b_n =c2^{-n}$ and see whats the solution. It's just a guess.
      $endgroup$
      – mm-crj
      Dec 8 '18 at 23:33


















    • $begingroup$
      Thanks! Not clear about this part - And the ansatz can be taken as $b_n=c$. What is $c$ here?
      $endgroup$
      – Rohit Pandey
      Dec 8 '18 at 23:30










    • $begingroup$
      Ah I see now, just a constant. Thanks!
      $endgroup$
      – Rohit Pandey
      Dec 8 '18 at 23:32






    • 1




      $begingroup$
      It's a guess solution an ansatz for the inhomogeneous case. You may use $b_n =c2^{-n}$ and see whats the solution. It's just a guess.
      $endgroup$
      – mm-crj
      Dec 8 '18 at 23:33
















    $begingroup$
    Thanks! Not clear about this part - And the ansatz can be taken as $b_n=c$. What is $c$ here?
    $endgroup$
    – Rohit Pandey
    Dec 8 '18 at 23:30




    $begingroup$
    Thanks! Not clear about this part - And the ansatz can be taken as $b_n=c$. What is $c$ here?
    $endgroup$
    – Rohit Pandey
    Dec 8 '18 at 23:30












    $begingroup$
    Ah I see now, just a constant. Thanks!
    $endgroup$
    – Rohit Pandey
    Dec 8 '18 at 23:32




    $begingroup$
    Ah I see now, just a constant. Thanks!
    $endgroup$
    – Rohit Pandey
    Dec 8 '18 at 23:32




    1




    1




    $begingroup$
    It's a guess solution an ansatz for the inhomogeneous case. You may use $b_n =c2^{-n}$ and see whats the solution. It's just a guess.
    $endgroup$
    – mm-crj
    Dec 8 '18 at 23:33




    $begingroup$
    It's a guess solution an ansatz for the inhomogeneous case. You may use $b_n =c2^{-n}$ and see whats the solution. It's just a guess.
    $endgroup$
    – mm-crj
    Dec 8 '18 at 23:33











    1












    $begingroup$

    I have another approach to this I just worked out. Here, we try to use express the recurrence as a system of linear equations. Then, we leverage the eigen values of the matrix associated with the matrix of this linear system.



    So far, we have only one equation. This is:



    $$b_n -b_{n-1} + frac{1}{8}b_{n-3} = frac{1}{8}$$
    To form a linear system, we need two more equations. Let's take some dummy equations.
    $$b_{n-1}=b_{n-1}$$



    $$b_{n-2}=b_{n-2}$$



    Now, we can express this system in matrix form.



    $$left( begin{array}{c}
    b_n \
    b_{n-1}\
    b_{n-2}\
    end{array} right) = left( begin{array}{ccc}
    1 & 0 & -frac{1}{8} & \
    1 & 0 & 0\
    0 & 1 & 0\
    end{array} right) left( begin{array}{c}
    b_{n-1} \
    b_{n-2}\
    b_{n-3}\
    end{array} right) + left( begin{array}{c}
    frac{1}{8} \
    0\
    0\
    end{array} right)$$



    Now let:
    $beta_n = left(begin{array}{c}
    b_n \
    b_{n-1}\
    b_{n-2}\
    end{array} right)$
    , $gamma = left(begin{array}{c}
    frac{1}{8} \
    0\
    0\
    end{array} right)$
    and $M = left( begin{array}{ccc}
    1 & 0 & -frac{1}{8} & \
    1 & 0 & 0\
    0 & 1 & 0\
    end{array} right)$
    .



    We then get:



    $$beta_n = M beta_{n-1} + gamma$$
    $$=M(M beta_{n-2}+gamma) + gamma$$



    $$=M^2 beta_{n-2} + (I+M)gamma$$



    Extending this all the way we get:



    $$beta_n = M^{n-2}beta_{2} + (I+M+M^2+ dots + M^{n-3})gamma$$



    Now, assuming $M$ is diagonalizable (which it is) we can say:



    $$M=ELambda E^{-1}$$
    And this would imply:
    $$M^n = E Lambda^n E^{-1}$$



    So we get:
    $$beta^n = ELambda^{n-2}E^{-1}beta_2 + E(I+Lambda+Lambda^2+dots+Lambda^{n-3})E^{-1}gamma$$



    Now, if $lambda_1$, $lambda_2$ and $lambda_3$ happen to be the eigen values of $M$ then,
    $$Lambda = left( begin{array}{ccc}
    lambda_1 & 0 & 0 & \
    0 & lambda_2 & 0\
    0 & 0 & lambda_3\
    end{array} right)$$



    and,



    $$(I+Lambda+Lambda^2 + dots + Lambda^{n-3}) = left( begin{array}{ccc}
    frac{1-lambda_1^{n-2}}{1-lambda_1} & 0 & 0 & \
    0 & frac{1-lambda_2^{n-2}}{1-lambda_2} & 0\
    0 & 0 & frac{1-lambda_3^{n-2}}{1-lambda_3}\
    end{array} right)$$



    Using these, it is easy to see that:



    $$beta_n = c_0 + c_1 lambda_1^{n-2} + c_2 lambda_2^{n-2} + c_3 lambda_3^{n-2}$$



    And the eigen values happen to be: $lambda_1, lambda_2, lambda_3 = frac{phi}{2}$, $frac{1-phi}{2}$, $0.5$.






    share|cite|improve this answer











    $endgroup$


















      1












      $begingroup$

      I have another approach to this I just worked out. Here, we try to use express the recurrence as a system of linear equations. Then, we leverage the eigen values of the matrix associated with the matrix of this linear system.



      So far, we have only one equation. This is:



      $$b_n -b_{n-1} + frac{1}{8}b_{n-3} = frac{1}{8}$$
      To form a linear system, we need two more equations. Let's take some dummy equations.
      $$b_{n-1}=b_{n-1}$$



      $$b_{n-2}=b_{n-2}$$



      Now, we can express this system in matrix form.



      $$left( begin{array}{c}
      b_n \
      b_{n-1}\
      b_{n-2}\
      end{array} right) = left( begin{array}{ccc}
      1 & 0 & -frac{1}{8} & \
      1 & 0 & 0\
      0 & 1 & 0\
      end{array} right) left( begin{array}{c}
      b_{n-1} \
      b_{n-2}\
      b_{n-3}\
      end{array} right) + left( begin{array}{c}
      frac{1}{8} \
      0\
      0\
      end{array} right)$$



      Now let:
      $beta_n = left(begin{array}{c}
      b_n \
      b_{n-1}\
      b_{n-2}\
      end{array} right)$
      , $gamma = left(begin{array}{c}
      frac{1}{8} \
      0\
      0\
      end{array} right)$
      and $M = left( begin{array}{ccc}
      1 & 0 & -frac{1}{8} & \
      1 & 0 & 0\
      0 & 1 & 0\
      end{array} right)$
      .



      We then get:



      $$beta_n = M beta_{n-1} + gamma$$
      $$=M(M beta_{n-2}+gamma) + gamma$$



      $$=M^2 beta_{n-2} + (I+M)gamma$$



      Extending this all the way we get:



      $$beta_n = M^{n-2}beta_{2} + (I+M+M^2+ dots + M^{n-3})gamma$$



      Now, assuming $M$ is diagonalizable (which it is) we can say:



      $$M=ELambda E^{-1}$$
      And this would imply:
      $$M^n = E Lambda^n E^{-1}$$



      So we get:
      $$beta^n = ELambda^{n-2}E^{-1}beta_2 + E(I+Lambda+Lambda^2+dots+Lambda^{n-3})E^{-1}gamma$$



      Now, if $lambda_1$, $lambda_2$ and $lambda_3$ happen to be the eigen values of $M$ then,
      $$Lambda = left( begin{array}{ccc}
      lambda_1 & 0 & 0 & \
      0 & lambda_2 & 0\
      0 & 0 & lambda_3\
      end{array} right)$$



      and,



      $$(I+Lambda+Lambda^2 + dots + Lambda^{n-3}) = left( begin{array}{ccc}
      frac{1-lambda_1^{n-2}}{1-lambda_1} & 0 & 0 & \
      0 & frac{1-lambda_2^{n-2}}{1-lambda_2} & 0\
      0 & 0 & frac{1-lambda_3^{n-2}}{1-lambda_3}\
      end{array} right)$$



      Using these, it is easy to see that:



      $$beta_n = c_0 + c_1 lambda_1^{n-2} + c_2 lambda_2^{n-2} + c_3 lambda_3^{n-2}$$



      And the eigen values happen to be: $lambda_1, lambda_2, lambda_3 = frac{phi}{2}$, $frac{1-phi}{2}$, $0.5$.






      share|cite|improve this answer











      $endgroup$
















        1












        1








        1





        $begingroup$

        I have another approach to this I just worked out. Here, we try to use express the recurrence as a system of linear equations. Then, we leverage the eigen values of the matrix associated with the matrix of this linear system.



        So far, we have only one equation. This is:



        $$b_n -b_{n-1} + frac{1}{8}b_{n-3} = frac{1}{8}$$
        To form a linear system, we need two more equations. Let's take some dummy equations.
        $$b_{n-1}=b_{n-1}$$



        $$b_{n-2}=b_{n-2}$$



        Now, we can express this system in matrix form.



        $$left( begin{array}{c}
        b_n \
        b_{n-1}\
        b_{n-2}\
        end{array} right) = left( begin{array}{ccc}
        1 & 0 & -frac{1}{8} & \
        1 & 0 & 0\
        0 & 1 & 0\
        end{array} right) left( begin{array}{c}
        b_{n-1} \
        b_{n-2}\
        b_{n-3}\
        end{array} right) + left( begin{array}{c}
        frac{1}{8} \
        0\
        0\
        end{array} right)$$



        Now let:
        $beta_n = left(begin{array}{c}
        b_n \
        b_{n-1}\
        b_{n-2}\
        end{array} right)$
        , $gamma = left(begin{array}{c}
        frac{1}{8} \
        0\
        0\
        end{array} right)$
        and $M = left( begin{array}{ccc}
        1 & 0 & -frac{1}{8} & \
        1 & 0 & 0\
        0 & 1 & 0\
        end{array} right)$
        .



        We then get:



        $$beta_n = M beta_{n-1} + gamma$$
        $$=M(M beta_{n-2}+gamma) + gamma$$



        $$=M^2 beta_{n-2} + (I+M)gamma$$



        Extending this all the way we get:



        $$beta_n = M^{n-2}beta_{2} + (I+M+M^2+ dots + M^{n-3})gamma$$



        Now, assuming $M$ is diagonalizable (which it is) we can say:



        $$M=ELambda E^{-1}$$
        And this would imply:
        $$M^n = E Lambda^n E^{-1}$$



        So we get:
        $$beta^n = ELambda^{n-2}E^{-1}beta_2 + E(I+Lambda+Lambda^2+dots+Lambda^{n-3})E^{-1}gamma$$



        Now, if $lambda_1$, $lambda_2$ and $lambda_3$ happen to be the eigen values of $M$ then,
        $$Lambda = left( begin{array}{ccc}
        lambda_1 & 0 & 0 & \
        0 & lambda_2 & 0\
        0 & 0 & lambda_3\
        end{array} right)$$



        and,



        $$(I+Lambda+Lambda^2 + dots + Lambda^{n-3}) = left( begin{array}{ccc}
        frac{1-lambda_1^{n-2}}{1-lambda_1} & 0 & 0 & \
        0 & frac{1-lambda_2^{n-2}}{1-lambda_2} & 0\
        0 & 0 & frac{1-lambda_3^{n-2}}{1-lambda_3}\
        end{array} right)$$



        Using these, it is easy to see that:



        $$beta_n = c_0 + c_1 lambda_1^{n-2} + c_2 lambda_2^{n-2} + c_3 lambda_3^{n-2}$$



        And the eigen values happen to be: $lambda_1, lambda_2, lambda_3 = frac{phi}{2}$, $frac{1-phi}{2}$, $0.5$.






        share|cite|improve this answer











        $endgroup$



        I have another approach to this I just worked out. Here, we try to use express the recurrence as a system of linear equations. Then, we leverage the eigen values of the matrix associated with the matrix of this linear system.



        So far, we have only one equation. This is:



        $$b_n -b_{n-1} + frac{1}{8}b_{n-3} = frac{1}{8}$$
        To form a linear system, we need two more equations. Let's take some dummy equations.
        $$b_{n-1}=b_{n-1}$$



        $$b_{n-2}=b_{n-2}$$



        Now, we can express this system in matrix form.



        $$left( begin{array}{c}
        b_n \
        b_{n-1}\
        b_{n-2}\
        end{array} right) = left( begin{array}{ccc}
        1 & 0 & -frac{1}{8} & \
        1 & 0 & 0\
        0 & 1 & 0\
        end{array} right) left( begin{array}{c}
        b_{n-1} \
        b_{n-2}\
        b_{n-3}\
        end{array} right) + left( begin{array}{c}
        frac{1}{8} \
        0\
        0\
        end{array} right)$$



        Now let:
        $beta_n = left(begin{array}{c}
        b_n \
        b_{n-1}\
        b_{n-2}\
        end{array} right)$
        , $gamma = left(begin{array}{c}
        frac{1}{8} \
        0\
        0\
        end{array} right)$
        and $M = left( begin{array}{ccc}
        1 & 0 & -frac{1}{8} & \
        1 & 0 & 0\
        0 & 1 & 0\
        end{array} right)$
        .



        We then get:



        $$beta_n = M beta_{n-1} + gamma$$
        $$=M(M beta_{n-2}+gamma) + gamma$$



        $$=M^2 beta_{n-2} + (I+M)gamma$$



        Extending this all the way we get:



        $$beta_n = M^{n-2}beta_{2} + (I+M+M^2+ dots + M^{n-3})gamma$$



        Now, assuming $M$ is diagonalizable (which it is) we can say:



        $$M=ELambda E^{-1}$$
        And this would imply:
        $$M^n = E Lambda^n E^{-1}$$



        So we get:
        $$beta^n = ELambda^{n-2}E^{-1}beta_2 + E(I+Lambda+Lambda^2+dots+Lambda^{n-3})E^{-1}gamma$$



        Now, if $lambda_1$, $lambda_2$ and $lambda_3$ happen to be the eigen values of $M$ then,
        $$Lambda = left( begin{array}{ccc}
        lambda_1 & 0 & 0 & \
        0 & lambda_2 & 0\
        0 & 0 & lambda_3\
        end{array} right)$$



        and,



        $$(I+Lambda+Lambda^2 + dots + Lambda^{n-3}) = left( begin{array}{ccc}
        frac{1-lambda_1^{n-2}}{1-lambda_1} & 0 & 0 & \
        0 & frac{1-lambda_2^{n-2}}{1-lambda_2} & 0\
        0 & 0 & frac{1-lambda_3^{n-2}}{1-lambda_3}\
        end{array} right)$$



        Using these, it is easy to see that:



        $$beta_n = c_0 + c_1 lambda_1^{n-2} + c_2 lambda_2^{n-2} + c_3 lambda_3^{n-2}$$



        And the eigen values happen to be: $lambda_1, lambda_2, lambda_3 = frac{phi}{2}$, $frac{1-phi}{2}$, $0.5$.







        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited Dec 10 '18 at 1:22

























        answered Dec 9 '18 at 0:15









        Rohit PandeyRohit Pandey

        1,2871022




        1,2871022






























            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%2f3031728%2fsolving-a-difference-equation-for-coin-toss-sequence-probabilities%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

            Plaza Victoria

            In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

            How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...