Probability of getting “tails-tails” for the first time. The 2019 Stack Overflow Developer Survey Results Are InProbability Theory Question on Expected Value and Variance of Random VariableThe probability of getting more heads than tails in a coin tossfind the probability of at least two tails in $3T$ tosses, where $T$ is the expected number of tosses required to get the first Tails.Expected number of coin tossesConditional Probability for a coin to be fairThe probability that a tossed coin lands heads is p. What are the possible values of p, and which of these values is plausible for a physical coin?A fair coin is tossed $text10 times$. What is the probability that ONLY the first two tosses will yield heads?Conditional Probability- Linked ExperimentsA fair coin is tossed until the first H occurs. Compute the probability that three tosses are required.Who has more probability of winning the game?

What does ひと匙 mean in this manga and has it been used colloquially?

Are there incongruent pythagorean triangles with the same perimeter and same area?

Right tool to dig six foot holes?

Did Scotland spend $250,000 for the slogan "Welcome to Scotland"?

What to do when moving next to a bird sanctuary with a loosely-domesticated cat?

Should I use my personal e-mail address, or my workplace one, when registering to external websites for work purposes?

Origin of "cooter" meaning "vagina"

What is the motivation for a law requiring 2 parties to consent for recording a conversation

How come people say “Would of”?

How to obtain Confidence Intervals for a LASSO regression?

How to support a colleague who finds meetings extremely tiring?

What is the meaning of the verb "bear" in this context?

What did it mean to "align" a radio?

Did 3000BC Egyptians use meteoric iron weapons?

What is the meaning of Triage in Cybersec world?

Can we generate random numbers using irrational numbers like π and e?

Geography at the pixel level

Identify This Plant (Flower)

If a Druid sees an animal’s corpse, can they wild shape into that animal?

Aging parents with no investments

What is the closest word meaning "respect for time / mindful"

Time travel alters history but people keep saying nothing's changed

Deal with toxic manager when you can't quit

How technical should a Scrum Master be to effectively remove impediments?



Probability of getting “tails-tails” for the first time.



The 2019 Stack Overflow Developer Survey Results Are InProbability Theory Question on Expected Value and Variance of Random VariableThe probability of getting more heads than tails in a coin tossfind the probability of at least two tails in $3T$ tosses, where $T$ is the expected number of tosses required to get the first Tails.Expected number of coin tossesConditional Probability for a coin to be fairThe probability that a tossed coin lands heads is p. What are the possible values of p, and which of these values is plausible for a physical coin?A fair coin is tossed $text10 times$. What is the probability that ONLY the first two tosses will yield heads?Conditional Probability- Linked ExperimentsA fair coin is tossed until the first H occurs. Compute the probability that three tosses are required.Who has more probability of winning the game?










2












$begingroup$




A fair coin is tossed until the coin lands "tails-tails" (i.e. a tails followed by a tails) for the first time. Let $X$ counts the number of tosses required. Find the probability of the event $X=n.$ What will be the expectation of $X$?





I think this problem has to be solved by recursion but I find difficulty to solve this. Any suggestions regarding this will be highly appreciated.



Thank you very much for your valuable time.



EDIT $:$ If got "tails-tails" for the first time in $n$ steps. Then the first two steps will be either $HH$ or $HT$ or $TH.$ If the first two tosses will yield either $HH$ or $TH$ then we follow the previous step. If it yields $HT$ in the first two steps then the next two steps will be either $HH$ or $HT$ and we go on like that.



We know that $Bbb E(X) = Bbb E(X mid A) Bbb P(A) + Bbb E(X mid A^c) Bbb P(A^c).$
So in this case we can write $Bbb E(X) = Bbb E(X mid H) Bbb P(H) + Bbb E(X mid T) Bbb P (T).$



Now $$Bbb E(X mid H) = Bbb E(X) + 1, Bbb P(H) = frac 1 2.$$ What is $Bbb E(X mid T)$? $$Bbb E(X mid T) = Bbb E((X mid T) mid TH) Bbb P (TH mid T) + Bbb E((X mid T) mid TT) Bbb P(TT mid T).$$ Now $$Bbb E((X mid T) mid TH) = 1 + Bbb E(X mid H) = 2 + Bbb E(X).$$ and $$Bbb E((X mid T) mid TT) = 2.$$ Also $$Bbb P(TH mid T) = Bbb P(TT mid T) = frac 1 2.$$ So we get $$Bbb E (X mid T) = frac 1 2 Bbb E(X) + 2.$$ Putting all these together we get $Bbb E(X) = 6.$



Where have I done mistake? Would you please check it?










share|cite|improve this question











$endgroup$







  • 1




    $begingroup$
    Hint: let $a_n$ be the number of binary sequences on $H,T$ with no $TT$. Then any such sequence (of length at least $2$) ends in $H$ or in $HT$
    $endgroup$
    – lulu
    Mar 23 at 16:16















2












$begingroup$




A fair coin is tossed until the coin lands "tails-tails" (i.e. a tails followed by a tails) for the first time. Let $X$ counts the number of tosses required. Find the probability of the event $X=n.$ What will be the expectation of $X$?





I think this problem has to be solved by recursion but I find difficulty to solve this. Any suggestions regarding this will be highly appreciated.



Thank you very much for your valuable time.



EDIT $:$ If got "tails-tails" for the first time in $n$ steps. Then the first two steps will be either $HH$ or $HT$ or $TH.$ If the first two tosses will yield either $HH$ or $TH$ then we follow the previous step. If it yields $HT$ in the first two steps then the next two steps will be either $HH$ or $HT$ and we go on like that.



We know that $Bbb E(X) = Bbb E(X mid A) Bbb P(A) + Bbb E(X mid A^c) Bbb P(A^c).$
So in this case we can write $Bbb E(X) = Bbb E(X mid H) Bbb P(H) + Bbb E(X mid T) Bbb P (T).$



Now $$Bbb E(X mid H) = Bbb E(X) + 1, Bbb P(H) = frac 1 2.$$ What is $Bbb E(X mid T)$? $$Bbb E(X mid T) = Bbb E((X mid T) mid TH) Bbb P (TH mid T) + Bbb E((X mid T) mid TT) Bbb P(TT mid T).$$ Now $$Bbb E((X mid T) mid TH) = 1 + Bbb E(X mid H) = 2 + Bbb E(X).$$ and $$Bbb E((X mid T) mid TT) = 2.$$ Also $$Bbb P(TH mid T) = Bbb P(TT mid T) = frac 1 2.$$ So we get $$Bbb E (X mid T) = frac 1 2 Bbb E(X) + 2.$$ Putting all these together we get $Bbb E(X) = 6.$



Where have I done mistake? Would you please check it?










share|cite|improve this question











$endgroup$







  • 1




    $begingroup$
    Hint: let $a_n$ be the number of binary sequences on $H,T$ with no $TT$. Then any such sequence (of length at least $2$) ends in $H$ or in $HT$
    $endgroup$
    – lulu
    Mar 23 at 16:16













2












2








2


1



$begingroup$




A fair coin is tossed until the coin lands "tails-tails" (i.e. a tails followed by a tails) for the first time. Let $X$ counts the number of tosses required. Find the probability of the event $X=n.$ What will be the expectation of $X$?





I think this problem has to be solved by recursion but I find difficulty to solve this. Any suggestions regarding this will be highly appreciated.



Thank you very much for your valuable time.



EDIT $:$ If got "tails-tails" for the first time in $n$ steps. Then the first two steps will be either $HH$ or $HT$ or $TH.$ If the first two tosses will yield either $HH$ or $TH$ then we follow the previous step. If it yields $HT$ in the first two steps then the next two steps will be either $HH$ or $HT$ and we go on like that.



We know that $Bbb E(X) = Bbb E(X mid A) Bbb P(A) + Bbb E(X mid A^c) Bbb P(A^c).$
So in this case we can write $Bbb E(X) = Bbb E(X mid H) Bbb P(H) + Bbb E(X mid T) Bbb P (T).$



Now $$Bbb E(X mid H) = Bbb E(X) + 1, Bbb P(H) = frac 1 2.$$ What is $Bbb E(X mid T)$? $$Bbb E(X mid T) = Bbb E((X mid T) mid TH) Bbb P (TH mid T) + Bbb E((X mid T) mid TT) Bbb P(TT mid T).$$ Now $$Bbb E((X mid T) mid TH) = 1 + Bbb E(X mid H) = 2 + Bbb E(X).$$ and $$Bbb E((X mid T) mid TT) = 2.$$ Also $$Bbb P(TH mid T) = Bbb P(TT mid T) = frac 1 2.$$ So we get $$Bbb E (X mid T) = frac 1 2 Bbb E(X) + 2.$$ Putting all these together we get $Bbb E(X) = 6.$



Where have I done mistake? Would you please check it?










share|cite|improve this question











$endgroup$






A fair coin is tossed until the coin lands "tails-tails" (i.e. a tails followed by a tails) for the first time. Let $X$ counts the number of tosses required. Find the probability of the event $X=n.$ What will be the expectation of $X$?





I think this problem has to be solved by recursion but I find difficulty to solve this. Any suggestions regarding this will be highly appreciated.



Thank you very much for your valuable time.



EDIT $:$ If got "tails-tails" for the first time in $n$ steps. Then the first two steps will be either $HH$ or $HT$ or $TH.$ If the first two tosses will yield either $HH$ or $TH$ then we follow the previous step. If it yields $HT$ in the first two steps then the next two steps will be either $HH$ or $HT$ and we go on like that.



We know that $Bbb E(X) = Bbb E(X mid A) Bbb P(A) + Bbb E(X mid A^c) Bbb P(A^c).$
So in this case we can write $Bbb E(X) = Bbb E(X mid H) Bbb P(H) + Bbb E(X mid T) Bbb P (T).$



Now $$Bbb E(X mid H) = Bbb E(X) + 1, Bbb P(H) = frac 1 2.$$ What is $Bbb E(X mid T)$? $$Bbb E(X mid T) = Bbb E((X mid T) mid TH) Bbb P (TH mid T) + Bbb E((X mid T) mid TT) Bbb P(TT mid T).$$ Now $$Bbb E((X mid T) mid TH) = 1 + Bbb E(X mid H) = 2 + Bbb E(X).$$ and $$Bbb E((X mid T) mid TT) = 2.$$ Also $$Bbb P(TH mid T) = Bbb P(TT mid T) = frac 1 2.$$ So we get $$Bbb E (X mid T) = frac 1 2 Bbb E(X) + 2.$$ Putting all these together we get $Bbb E(X) = 6.$



Where have I done mistake? Would you please check it?







probability






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Mar 24 at 9:47









Dbchatto67

2,753622




2,753622










asked Mar 23 at 16:07









math maniac.math maniac.

1647




1647







  • 1




    $begingroup$
    Hint: let $a_n$ be the number of binary sequences on $H,T$ with no $TT$. Then any such sequence (of length at least $2$) ends in $H$ or in $HT$
    $endgroup$
    – lulu
    Mar 23 at 16:16












  • 1




    $begingroup$
    Hint: let $a_n$ be the number of binary sequences on $H,T$ with no $TT$. Then any such sequence (of length at least $2$) ends in $H$ or in $HT$
    $endgroup$
    – lulu
    Mar 23 at 16:16







1




1




$begingroup$
Hint: let $a_n$ be the number of binary sequences on $H,T$ with no $TT$. Then any such sequence (of length at least $2$) ends in $H$ or in $HT$
$endgroup$
– lulu
Mar 23 at 16:16




$begingroup$
Hint: let $a_n$ be the number of binary sequences on $H,T$ with no $TT$. Then any such sequence (of length at least $2$) ends in $H$ or in $HT$
$endgroup$
– lulu
Mar 23 at 16:16










2 Answers
2






active

oldest

votes


















1












$begingroup$

Hints:



Let $g_n$ be the number of sequences of length $n$ made up of $H$ and $T$ (heads and tails) that contain no two consecutive tails. Then the sequence you want is such a sequence (but of length $n - 2$) followed by $TT$. Assume you know the value of $g_n$ in general. In terms of $g_n - 3$, what is the desired probability?



Now, to compute $g_n$, consider how we can obtain a such a sequence of length $n$ from a similar sequence of smaller length. Suppose you're given a sequence of length $n - 1$ that contains no $TT$ (two consecutive tails). Then definitely we can add an $H$ to the end of this sequence to get a valid sequence of length $n$? How many such sequences are there (in terms of the unknown $g_k$)? Does this not count all valid sequences ending in $H$?



So that leaves valid sequences of length $n$ ending in $T$. How shall we get such a sequence? Well, if the last term is $T$, then certainly the term before that must be $H$ (for otherwise we would have $TT$ at the end). So what we want is a valid sequence of length $n - 1$ that ends in $H$. How many such sequences are there (again in terms of the unknown $g_k$)?



Adding the above two should give a recurrence relation for $g_n$. The base cases are $g_0 = ???$ and $g_1 = ???$.



You can also easily convert this into a recurrence relation for the desired probability itself.




Full Solution:



The recurrence relation for $g_n$, the number of $H$-$T$ sequences of length $n$ that contain no $TT$ (consecutive tails)$ is



$$g_n = g_n - 1 + g_n - 2; g_0 = 1, g_1 = 2.$$



A sequence of length $n$ that ends in $TT$ and has no two consecutive tails before that is of the form $G_n-3HTT$, where $G_n-3$ is a sequence of length $n - 3$ with no consecutive tails. The probability of a sequence of $n$ tosses ending in $TT$ at the last two tosses for the first time is therefore
beginalign*
p_n & = dfracg_n-32^n\
& = dfracg_n-4 + g_n-52^n\
& = dfrac p_n-1 2 + dfrac p_n-2 4
endalign*

with base cases $p_2 = dfrac 1 4$, $p_3 = dfrac 1 8$.



Then the expected number of tosses is $sumlimits_n = 2^infty n, p_n$. To compute this using the recurrence relation that we already have for $p_n$,



beginalign*
n p_n &= dfrac n 2 p_n - 1 + dfrac n 4 p_n - 2 \
&= dfrac 1 2 (n - 1) p_n - 1 + dfrac 1 2 p_n-1 + dfrac1 4 (n - 2)p_n - 2 + dfrac 2 4 p_n-2
endalign*



Now, we sum this up from $n = 4$ to $infty$. Note that $sum p_n = 1$. Thus,



beginalign*
mathbb E[X] - 3 p_3 - 2 p_2 &= dfrac 1 2 (mathbb E[X] - 2 p_2) + dfrac 1 2 (1 - p_2) + dfrac 1 4 mathbb E[X] + dfrac 1 2 implies\
mathbb E[X] &= 6.
endalign*






share|cite|improve this answer











$endgroup$












  • $begingroup$
    Comments are not for extended discussion; this conversation has been moved to chat.
    $endgroup$
    – Aloizio Macedo
    Mar 25 at 11:08


















1












$begingroup$

Let $h(n)$ denote the number of sequences of length $n$ that end with $H$ and don't contain $TT$. Since $h(n) = h(n-1)+h(n-2)$ and the base cases of $h(n)$ are $h(1) = 1$ and $h(2) = 2$, this is the Fibonacci sequence, $$h(n) = frac(frac1+sqrt52)^n+1-(frac1-sqrt52)^n+1sqrt5$$
On another track,
$$Bbb P(X = n) = frach(n-2)2^n$$. Plugging the explicit formula of $h(n)$ into the above probability and simplifying finds that $$Bbb P(X = n) = frac(frac1+sqrt54)^n-1-(frac1-sqrt54)^n-12sqrt5$$ Using two infinite arithmetico-geometric sums, the expected value is found to be 6. Note: the expected value could also be found by Ned's method in an earlier comment of $E = frac12*(E+1)+frac14*(E+2)+frac14*2$. Solving for $E$ finds that $E = 6$.






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%2f3159489%2fprobability-of-getting-tails-tails-for-the-first-time%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$

    Hints:



    Let $g_n$ be the number of sequences of length $n$ made up of $H$ and $T$ (heads and tails) that contain no two consecutive tails. Then the sequence you want is such a sequence (but of length $n - 2$) followed by $TT$. Assume you know the value of $g_n$ in general. In terms of $g_n - 3$, what is the desired probability?



    Now, to compute $g_n$, consider how we can obtain a such a sequence of length $n$ from a similar sequence of smaller length. Suppose you're given a sequence of length $n - 1$ that contains no $TT$ (two consecutive tails). Then definitely we can add an $H$ to the end of this sequence to get a valid sequence of length $n$? How many such sequences are there (in terms of the unknown $g_k$)? Does this not count all valid sequences ending in $H$?



    So that leaves valid sequences of length $n$ ending in $T$. How shall we get such a sequence? Well, if the last term is $T$, then certainly the term before that must be $H$ (for otherwise we would have $TT$ at the end). So what we want is a valid sequence of length $n - 1$ that ends in $H$. How many such sequences are there (again in terms of the unknown $g_k$)?



    Adding the above two should give a recurrence relation for $g_n$. The base cases are $g_0 = ???$ and $g_1 = ???$.



    You can also easily convert this into a recurrence relation for the desired probability itself.




    Full Solution:



    The recurrence relation for $g_n$, the number of $H$-$T$ sequences of length $n$ that contain no $TT$ (consecutive tails)$ is



    $$g_n = g_n - 1 + g_n - 2; g_0 = 1, g_1 = 2.$$



    A sequence of length $n$ that ends in $TT$ and has no two consecutive tails before that is of the form $G_n-3HTT$, where $G_n-3$ is a sequence of length $n - 3$ with no consecutive tails. The probability of a sequence of $n$ tosses ending in $TT$ at the last two tosses for the first time is therefore
    beginalign*
    p_n & = dfracg_n-32^n\
    & = dfracg_n-4 + g_n-52^n\
    & = dfrac p_n-1 2 + dfrac p_n-2 4
    endalign*

    with base cases $p_2 = dfrac 1 4$, $p_3 = dfrac 1 8$.



    Then the expected number of tosses is $sumlimits_n = 2^infty n, p_n$. To compute this using the recurrence relation that we already have for $p_n$,



    beginalign*
    n p_n &= dfrac n 2 p_n - 1 + dfrac n 4 p_n - 2 \
    &= dfrac 1 2 (n - 1) p_n - 1 + dfrac 1 2 p_n-1 + dfrac1 4 (n - 2)p_n - 2 + dfrac 2 4 p_n-2
    endalign*



    Now, we sum this up from $n = 4$ to $infty$. Note that $sum p_n = 1$. Thus,



    beginalign*
    mathbb E[X] - 3 p_3 - 2 p_2 &= dfrac 1 2 (mathbb E[X] - 2 p_2) + dfrac 1 2 (1 - p_2) + dfrac 1 4 mathbb E[X] + dfrac 1 2 implies\
    mathbb E[X] &= 6.
    endalign*






    share|cite|improve this answer











    $endgroup$












    • $begingroup$
      Comments are not for extended discussion; this conversation has been moved to chat.
      $endgroup$
      – Aloizio Macedo
      Mar 25 at 11:08















    1












    $begingroup$

    Hints:



    Let $g_n$ be the number of sequences of length $n$ made up of $H$ and $T$ (heads and tails) that contain no two consecutive tails. Then the sequence you want is such a sequence (but of length $n - 2$) followed by $TT$. Assume you know the value of $g_n$ in general. In terms of $g_n - 3$, what is the desired probability?



    Now, to compute $g_n$, consider how we can obtain a such a sequence of length $n$ from a similar sequence of smaller length. Suppose you're given a sequence of length $n - 1$ that contains no $TT$ (two consecutive tails). Then definitely we can add an $H$ to the end of this sequence to get a valid sequence of length $n$? How many such sequences are there (in terms of the unknown $g_k$)? Does this not count all valid sequences ending in $H$?



    So that leaves valid sequences of length $n$ ending in $T$. How shall we get such a sequence? Well, if the last term is $T$, then certainly the term before that must be $H$ (for otherwise we would have $TT$ at the end). So what we want is a valid sequence of length $n - 1$ that ends in $H$. How many such sequences are there (again in terms of the unknown $g_k$)?



    Adding the above two should give a recurrence relation for $g_n$. The base cases are $g_0 = ???$ and $g_1 = ???$.



    You can also easily convert this into a recurrence relation for the desired probability itself.




    Full Solution:



    The recurrence relation for $g_n$, the number of $H$-$T$ sequences of length $n$ that contain no $TT$ (consecutive tails)$ is



    $$g_n = g_n - 1 + g_n - 2; g_0 = 1, g_1 = 2.$$



    A sequence of length $n$ that ends in $TT$ and has no two consecutive tails before that is of the form $G_n-3HTT$, where $G_n-3$ is a sequence of length $n - 3$ with no consecutive tails. The probability of a sequence of $n$ tosses ending in $TT$ at the last two tosses for the first time is therefore
    beginalign*
    p_n & = dfracg_n-32^n\
    & = dfracg_n-4 + g_n-52^n\
    & = dfrac p_n-1 2 + dfrac p_n-2 4
    endalign*

    with base cases $p_2 = dfrac 1 4$, $p_3 = dfrac 1 8$.



    Then the expected number of tosses is $sumlimits_n = 2^infty n, p_n$. To compute this using the recurrence relation that we already have for $p_n$,



    beginalign*
    n p_n &= dfrac n 2 p_n - 1 + dfrac n 4 p_n - 2 \
    &= dfrac 1 2 (n - 1) p_n - 1 + dfrac 1 2 p_n-1 + dfrac1 4 (n - 2)p_n - 2 + dfrac 2 4 p_n-2
    endalign*



    Now, we sum this up from $n = 4$ to $infty$. Note that $sum p_n = 1$. Thus,



    beginalign*
    mathbb E[X] - 3 p_3 - 2 p_2 &= dfrac 1 2 (mathbb E[X] - 2 p_2) + dfrac 1 2 (1 - p_2) + dfrac 1 4 mathbb E[X] + dfrac 1 2 implies\
    mathbb E[X] &= 6.
    endalign*






    share|cite|improve this answer











    $endgroup$












    • $begingroup$
      Comments are not for extended discussion; this conversation has been moved to chat.
      $endgroup$
      – Aloizio Macedo
      Mar 25 at 11:08













    1












    1








    1





    $begingroup$

    Hints:



    Let $g_n$ be the number of sequences of length $n$ made up of $H$ and $T$ (heads and tails) that contain no two consecutive tails. Then the sequence you want is such a sequence (but of length $n - 2$) followed by $TT$. Assume you know the value of $g_n$ in general. In terms of $g_n - 3$, what is the desired probability?



    Now, to compute $g_n$, consider how we can obtain a such a sequence of length $n$ from a similar sequence of smaller length. Suppose you're given a sequence of length $n - 1$ that contains no $TT$ (two consecutive tails). Then definitely we can add an $H$ to the end of this sequence to get a valid sequence of length $n$? How many such sequences are there (in terms of the unknown $g_k$)? Does this not count all valid sequences ending in $H$?



    So that leaves valid sequences of length $n$ ending in $T$. How shall we get such a sequence? Well, if the last term is $T$, then certainly the term before that must be $H$ (for otherwise we would have $TT$ at the end). So what we want is a valid sequence of length $n - 1$ that ends in $H$. How many such sequences are there (again in terms of the unknown $g_k$)?



    Adding the above two should give a recurrence relation for $g_n$. The base cases are $g_0 = ???$ and $g_1 = ???$.



    You can also easily convert this into a recurrence relation for the desired probability itself.




    Full Solution:



    The recurrence relation for $g_n$, the number of $H$-$T$ sequences of length $n$ that contain no $TT$ (consecutive tails)$ is



    $$g_n = g_n - 1 + g_n - 2; g_0 = 1, g_1 = 2.$$



    A sequence of length $n$ that ends in $TT$ and has no two consecutive tails before that is of the form $G_n-3HTT$, where $G_n-3$ is a sequence of length $n - 3$ with no consecutive tails. The probability of a sequence of $n$ tosses ending in $TT$ at the last two tosses for the first time is therefore
    beginalign*
    p_n & = dfracg_n-32^n\
    & = dfracg_n-4 + g_n-52^n\
    & = dfrac p_n-1 2 + dfrac p_n-2 4
    endalign*

    with base cases $p_2 = dfrac 1 4$, $p_3 = dfrac 1 8$.



    Then the expected number of tosses is $sumlimits_n = 2^infty n, p_n$. To compute this using the recurrence relation that we already have for $p_n$,



    beginalign*
    n p_n &= dfrac n 2 p_n - 1 + dfrac n 4 p_n - 2 \
    &= dfrac 1 2 (n - 1) p_n - 1 + dfrac 1 2 p_n-1 + dfrac1 4 (n - 2)p_n - 2 + dfrac 2 4 p_n-2
    endalign*



    Now, we sum this up from $n = 4$ to $infty$. Note that $sum p_n = 1$. Thus,



    beginalign*
    mathbb E[X] - 3 p_3 - 2 p_2 &= dfrac 1 2 (mathbb E[X] - 2 p_2) + dfrac 1 2 (1 - p_2) + dfrac 1 4 mathbb E[X] + dfrac 1 2 implies\
    mathbb E[X] &= 6.
    endalign*






    share|cite|improve this answer











    $endgroup$



    Hints:



    Let $g_n$ be the number of sequences of length $n$ made up of $H$ and $T$ (heads and tails) that contain no two consecutive tails. Then the sequence you want is such a sequence (but of length $n - 2$) followed by $TT$. Assume you know the value of $g_n$ in general. In terms of $g_n - 3$, what is the desired probability?



    Now, to compute $g_n$, consider how we can obtain a such a sequence of length $n$ from a similar sequence of smaller length. Suppose you're given a sequence of length $n - 1$ that contains no $TT$ (two consecutive tails). Then definitely we can add an $H$ to the end of this sequence to get a valid sequence of length $n$? How many such sequences are there (in terms of the unknown $g_k$)? Does this not count all valid sequences ending in $H$?



    So that leaves valid sequences of length $n$ ending in $T$. How shall we get such a sequence? Well, if the last term is $T$, then certainly the term before that must be $H$ (for otherwise we would have $TT$ at the end). So what we want is a valid sequence of length $n - 1$ that ends in $H$. How many such sequences are there (again in terms of the unknown $g_k$)?



    Adding the above two should give a recurrence relation for $g_n$. The base cases are $g_0 = ???$ and $g_1 = ???$.



    You can also easily convert this into a recurrence relation for the desired probability itself.




    Full Solution:



    The recurrence relation for $g_n$, the number of $H$-$T$ sequences of length $n$ that contain no $TT$ (consecutive tails)$ is



    $$g_n = g_n - 1 + g_n - 2; g_0 = 1, g_1 = 2.$$



    A sequence of length $n$ that ends in $TT$ and has no two consecutive tails before that is of the form $G_n-3HTT$, where $G_n-3$ is a sequence of length $n - 3$ with no consecutive tails. The probability of a sequence of $n$ tosses ending in $TT$ at the last two tosses for the first time is therefore
    beginalign*
    p_n & = dfracg_n-32^n\
    & = dfracg_n-4 + g_n-52^n\
    & = dfrac p_n-1 2 + dfrac p_n-2 4
    endalign*

    with base cases $p_2 = dfrac 1 4$, $p_3 = dfrac 1 8$.



    Then the expected number of tosses is $sumlimits_n = 2^infty n, p_n$. To compute this using the recurrence relation that we already have for $p_n$,



    beginalign*
    n p_n &= dfrac n 2 p_n - 1 + dfrac n 4 p_n - 2 \
    &= dfrac 1 2 (n - 1) p_n - 1 + dfrac 1 2 p_n-1 + dfrac1 4 (n - 2)p_n - 2 + dfrac 2 4 p_n-2
    endalign*



    Now, we sum this up from $n = 4$ to $infty$. Note that $sum p_n = 1$. Thus,



    beginalign*
    mathbb E[X] - 3 p_3 - 2 p_2 &= dfrac 1 2 (mathbb E[X] - 2 p_2) + dfrac 1 2 (1 - p_2) + dfrac 1 4 mathbb E[X] + dfrac 1 2 implies\
    mathbb E[X] &= 6.
    endalign*







    share|cite|improve this answer














    share|cite|improve this answer



    share|cite|improve this answer








    edited Mar 24 at 7:12

























    answered Mar 23 at 16:18









    M. VinayM. Vinay

    7,35822136




    7,35822136











    • $begingroup$
      Comments are not for extended discussion; this conversation has been moved to chat.
      $endgroup$
      – Aloizio Macedo
      Mar 25 at 11:08
















    • $begingroup$
      Comments are not for extended discussion; this conversation has been moved to chat.
      $endgroup$
      – Aloizio Macedo
      Mar 25 at 11:08















    $begingroup$
    Comments are not for extended discussion; this conversation has been moved to chat.
    $endgroup$
    – Aloizio Macedo
    Mar 25 at 11:08




    $begingroup$
    Comments are not for extended discussion; this conversation has been moved to chat.
    $endgroup$
    – Aloizio Macedo
    Mar 25 at 11:08











    1












    $begingroup$

    Let $h(n)$ denote the number of sequences of length $n$ that end with $H$ and don't contain $TT$. Since $h(n) = h(n-1)+h(n-2)$ and the base cases of $h(n)$ are $h(1) = 1$ and $h(2) = 2$, this is the Fibonacci sequence, $$h(n) = frac(frac1+sqrt52)^n+1-(frac1-sqrt52)^n+1sqrt5$$
    On another track,
    $$Bbb P(X = n) = frach(n-2)2^n$$. Plugging the explicit formula of $h(n)$ into the above probability and simplifying finds that $$Bbb P(X = n) = frac(frac1+sqrt54)^n-1-(frac1-sqrt54)^n-12sqrt5$$ Using two infinite arithmetico-geometric sums, the expected value is found to be 6. Note: the expected value could also be found by Ned's method in an earlier comment of $E = frac12*(E+1)+frac14*(E+2)+frac14*2$. Solving for $E$ finds that $E = 6$.






    share|cite|improve this answer









    $endgroup$

















      1












      $begingroup$

      Let $h(n)$ denote the number of sequences of length $n$ that end with $H$ and don't contain $TT$. Since $h(n) = h(n-1)+h(n-2)$ and the base cases of $h(n)$ are $h(1) = 1$ and $h(2) = 2$, this is the Fibonacci sequence, $$h(n) = frac(frac1+sqrt52)^n+1-(frac1-sqrt52)^n+1sqrt5$$
      On another track,
      $$Bbb P(X = n) = frach(n-2)2^n$$. Plugging the explicit formula of $h(n)$ into the above probability and simplifying finds that $$Bbb P(X = n) = frac(frac1+sqrt54)^n-1-(frac1-sqrt54)^n-12sqrt5$$ Using two infinite arithmetico-geometric sums, the expected value is found to be 6. Note: the expected value could also be found by Ned's method in an earlier comment of $E = frac12*(E+1)+frac14*(E+2)+frac14*2$. Solving for $E$ finds that $E = 6$.






      share|cite|improve this answer









      $endgroup$















        1












        1








        1





        $begingroup$

        Let $h(n)$ denote the number of sequences of length $n$ that end with $H$ and don't contain $TT$. Since $h(n) = h(n-1)+h(n-2)$ and the base cases of $h(n)$ are $h(1) = 1$ and $h(2) = 2$, this is the Fibonacci sequence, $$h(n) = frac(frac1+sqrt52)^n+1-(frac1-sqrt52)^n+1sqrt5$$
        On another track,
        $$Bbb P(X = n) = frach(n-2)2^n$$. Plugging the explicit formula of $h(n)$ into the above probability and simplifying finds that $$Bbb P(X = n) = frac(frac1+sqrt54)^n-1-(frac1-sqrt54)^n-12sqrt5$$ Using two infinite arithmetico-geometric sums, the expected value is found to be 6. Note: the expected value could also be found by Ned's method in an earlier comment of $E = frac12*(E+1)+frac14*(E+2)+frac14*2$. Solving for $E$ finds that $E = 6$.






        share|cite|improve this answer









        $endgroup$



        Let $h(n)$ denote the number of sequences of length $n$ that end with $H$ and don't contain $TT$. Since $h(n) = h(n-1)+h(n-2)$ and the base cases of $h(n)$ are $h(1) = 1$ and $h(2) = 2$, this is the Fibonacci sequence, $$h(n) = frac(frac1+sqrt52)^n+1-(frac1-sqrt52)^n+1sqrt5$$
        On another track,
        $$Bbb P(X = n) = frach(n-2)2^n$$. Plugging the explicit formula of $h(n)$ into the above probability and simplifying finds that $$Bbb P(X = n) = frac(frac1+sqrt54)^n-1-(frac1-sqrt54)^n-12sqrt5$$ Using two infinite arithmetico-geometric sums, the expected value is found to be 6. Note: the expected value could also be found by Ned's method in an earlier comment of $E = frac12*(E+1)+frac14*(E+2)+frac14*2$. Solving for $E$ finds that $E = 6$.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Mar 23 at 19:05









        automaticallyGeneratedautomaticallyGenerated

        808




        808



























            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%2f3159489%2fprobability-of-getting-tails-tails-for-the-first-time%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

            Moe incest case Sentencing See also References Navigation menu"'Australian Josef Fritzl' fathered four children by daughter""Small town recoils in horror at 'Australian Fritzl' incest case""Victorian rape allegations echo Fritzl case - Just In (Australian Broadcasting Corporation)""Incest father jailed for 22 years""'Australian Fritzl' sentenced to 22 years in prison for abusing daughter for three decades""RSJ v The Queen"

            Who is our nearest planetary neighbor, on average?Santa Claus flies to the South PoleSeven Spheres of Unequal Mass, a weighing problem with a twistDescribe a large integerFast Mental Calculation of $7.5^7$Math in Space (without the help of celebrities)Find the value of $bigstar$: Puzzle 8 - InequalityWho drinks beer while running anyway?A Crucial DeliveryRanking And AverageHow long will my money last at roulette?

            Daza language Contents Vocabulary Phonology References External links Navigation menudaza1242Daza"Dazaga"eeee178086576