Let's say we are flipping a coin $n$ times. What is the probability of getting a sequence of at least $k$ heads?  So far I've come up with this:  If we assume $k=2$, and the number of events satisfying the conditions is $m$ for $N$ throws, then for $N+1$ throws the number of satisfying events is: $2m + \frac{2^N - m}{2}$.  $2m$ comes from the situation when the sequence was already there so we can get either heads or tails.$\frac{2^N - m}{2}$ Is when there was no sequence but the last result was heads, so we have to get heads again. This can be made into an equation and solved, I guess.  However, it's more difficult to do it for higher $k$. How to proceed further to get a result for higher $k$?
5830
Tossing a fair coin for $N$ times and we get a result series as $HTHTHHTT\dots~$, Here '$H$' denotes 'head'  and '$T$' denotes 'tail' for a specific tossing each time.  What is the probability that the length of the longest streak of consecutive heads is greater than or equal to $k$? (that is we have a $HHHH\dots~$, which is the substring of our tossing result, and whose length is greater than or equal to $k$)  I came up with a recursive solution (though not quite sure), but cannot find a closed form solution.  Here is my solution.  Denote $P(N,k)$ as the probability for tossing the coin $N$ times, and the longest continuous heads is greater or equal than $k$. Then (For $N&gt;k$)  $$ P(N,k)=P(N-1,k)+\Big(1-P(N-k-1,k)\Big)\left(\frac{1}{2}\right)^{k+1}   $$
86573
Suppose you ﬂip a fair coin repeatedly until you see a Heads followed by a Tails. What is the expected number of coin ﬂips you have to ﬂip?  By manipulating an equation based on the result of the first flip, shown at this link:    the answer is 6. This also makes sense intuitively since the expected value of the number flips until HH or TT is 3. But is there a way to tackle this problem by summing a series of probabilities multiplied by the values?  Thank you!
113008
Four dice are thrown, what's the probability that:  a) None of them fall higher than three?  b) None of them fall higher than four?  c) That four is the highest number thrown?  So for a, I wanna think about the denominator first. There are 6 possible outcomes for each dice, and we have four dice. So we're technically picking r out of n objects, aka picking 4 possible values out of 6. So the denominator/sample space should be $6^4$ right?  Now this is where I'm getting tripped up. Order technically shouldn't count, because we only care about the quadruplets that don't have a value higher than 3. I might be wrong, maybe I am, but could someone explain a bit more? My professor stated that typically in the sample space/denominator, we want order to count.   So I'm trying to think of the numerator now, so we want to find the probability that no values appear higher than 3, so some events that can occur are: $(1, 1, 2, 3), (1, 2, 2, 3), (1, 1, 1, 1)$ etc. Again, I can't see why order should count here, because if we only are concerned about what appears rather than how they appear, then we can say $(1, 1, 2, 3)$ is equal to $(1, 2, 1, 3)$? So if order does not count, and we have replacement, then does this lead the case where we use $$\binom{n-1+r}{r}$$to find out the probability?   I'm pretty sure if I can do a), I could prob do b), but if someone could maybe lead me in the right direction for c) I would appreciate that too!
103136
I have $3$ coins, $1$ coin has $2$ heads (HH), 1 coin has $2$ tails (TT), $1$ coin has $1$ head and $1$ tail (HT). I toss the coin, it fells on my hand, and the side i see is a tail. What's the chance that the other side is also a tail?  I got this as a teaser from a friend, possible from , as you can see he is insisting on 1/2 as not being the correct answer, I got 1/3 as my answer, am I right?
116612
I have the following sentence:  If I toss a biased coin with 2/3 chance of landing on heads, given that there was at least one head in 3 flips, what is the probability that there is only 1 head?  If we let $X$ represent the number of heads, then I can use $Baye's$ formula to find out the probability.     Which of the following would be the formula?  $$P(X=1 | X \geq 1)$$ $$P(X \geq 1 | X=1)$$  I think its the first one, but my sheet is saying the second one. I think it might have made a mistake. Which is the right probability?
9639
What is the probability of obtaining THT before HHH when a toss is tossed sequentially? Could someone solve using state diagram and law of total probability?
110990
I was asked this question with $(n, k) = (400, 220)$ in an interview.  Is there a "correct" answer?  Assume the tosses are i.i.d. and the probability of heads is $p=0.5$.  The distribution of the number of heads in 400 tosses should then be close to Normal(200, 10^2), so that 220 heads is 2 standard deviations away from the mean.  The probability of observing such an outcome (i.e. more 2 SDs away from the mean in either direction) is slightly less than 5%.  The interviewer told me, essentially, "if I observe something >= 2 SDs from the mean, I conclude that something else is going on. I would bet against the coin being fair."  That's reasonable -- after all, that's what most hypothesis tests do. But is that the end of the story?  For the interviewer that seemed to be the "correct" answer.  What I'm asking here is whether some nuance is justified.  I couldn't help but point out that deciding that the coin is not fair is a bizarre conclusion in this coin-tossing context.  Am I right to say that?  I'll try and explain below.  First of all, I -- and I would assume most people as well -- have a strong prior about coins:  they're very likely to be fair.  Of course that depends on what we mean by fair -- one possibility would be to define "fair" as "having a probability of heads 'close' to 0.5, say between 0.49 and 0.51."  (You could also define 'fair' as meaning that the probability of heads is exactly 0.50, in which case having a perfectly fair coin now seems rather unlikely.)  Your prior might depend not only on your general beliefs about coins but also on the context. If you pulled the coin out of your own pocket, you might be virtually certain that it's fair; if your magician friend pulled it out of his, your prior might put more weight on double-headed coins.  In any case, it's easy to come up with reasonable priors that (i) put a large probability on the coin being fair and (ii) lead your posterior to be quite similar, even after observing 220 heads. You'd then conclude that the coin was very likely to be fair, despite observing an outcome 2 SDs from the mean.  In fact, you could also construct examples where observing 220 heads in 400 tosses makes your posterior put more weight on the coin being fair, for example if all unfair coins have a probability of heads in $\{0, 1\}$.  Can anyone shed some light on this for me?    After writing this question I remembered that I had heard about this general situation before -- isn't it ?  Whuber put a very interesting link in the comments: .  From page 3:     It does not make sense to say that the coin has a probability p of   heads, because it can be completely determined by the manner in which   it is tossed— unless it is tossed high in the air with a rapid spin   and caught in the air with no bouncing, in which case p = 1/2.   Pretty cool!  This ties into my question in an interesting way:  suppose we know that the coin is being "tossed high in the air with a rapid spin and caught in the air with no bouncing."  Then we definitely shouldn't reject the hypothesis that the coin is fair (where "fair" now means "having p=1/2 when tossed in the way described above"), because we effectively have a prior that puts all probability on the coin being fair. Maybe that justifies to some degree why I am uncomfortable rejecting the null after 220 heads are observed.
68287
You are throwing n balls into m bins randomly.   What is the probability to be empty of the first $k$ bin? Given $k$ bins are empty. What is the probability to be empty of $(k+1)th$ bin? Forget the first 2 cases, let throw balls into $m - k$ bins. What is the probability to be empty of the first bin?   Thank you
16735
For each positive even integer $n$, set   $$P_n = \displaystyle {{n} \choose {\frac{n}{2}}}\frac{1}{2^n}.$$  Show that $\displaystyle \lim_{n \to \infty} P_n$ exists and determine its value.   Here's what I have so far: each $P_n$ can be thought of as the probability of tossing a fair coin $n$ times, and obtaining exactly $\frac{n}{2}$ heads. My expectation is that $P_n \to 1$, since in any large trial, one would expect to record just about as many heads as tails. But I'm not sure how to mathematically justify this hunch.  Hints or solutions are greatly appreciated.
5564
Given a box that contains 90% fair coins and 10% loaded coins, (a loaded coin gives heads 90% of the time), what is the probability for a randomly drawn coin to give 5 heads in a row?  P(HHHHH | random coin from box of mixed coins) = ?   I used Bayes Theorem to calculate the probability I got .219 or 21.9% probability for the random coin to give 5 heads in a row!    But I am still doubting if my answer is correct !!!  Any help appreciated :)
80808
It is possible to choose between three equally desirable outcomes by tossing a fair coin as follows:  Choose option 1 if the first head appears on an even toss  Choose option 2 if the first tail appears on an even toss  Choose option 3 if the first head and the first tail both appear on an odd toss  Note that option 1 and option 2 are mutually exclusive, because we must have a head or a tail on the first toss.  This works because the binary expansion $$\frac 13 =0.010101010101 \dots$$ has a $1$ in all the even places. Or equivalently because $$\frac 13=\frac 14+\frac1{16}+ \dots +\frac 1{4^n}+\dots$$  This is quite a simple procedure (though perhaps not as well known as it might be). I was pondering in the bath what might be the most convenient set of options if there were five or seven possibilities.  For example I can pick off two fifths using the binary expansion of $\frac 15$ with heads and tails, and use my procedure for thirds to do the remaining three fifths - so it is possible. But can one do fifths or sevenths without resort to this kind of recursive procedure?
77414
Edit 3. Fixed question to be more clear and include current solution Problem Two players player 1 and player 2 plays a game of fair coin flipping. Player 1 starts with $A$ coins and Player 2 with $B$ coins. Let $P_n$ defines the probability of player 1 winning all coins in a game when player 1 has $n$ coins. Find the recurrence relation of $P_n$ and then find its closed formula. This formula can then be used to know the probability of player 1 winning if he has, i.e. twice the coins player 2 has. Solution? I know that $P_0 = 0$, because if she has $0$ coins, then she can't win, what about $P_{A+B}?$ $$P_n = 0.5P_{n+1} + 0.5P_{n-1}$$ Which gives the characteristic equation: $$x^2-2x+1 = (x-1)^2=0 \implies x=1\ (double\ root)$$ This can then be put into the general solution for linear homogenous recurrence relations: $P_{hn} = C_1+nC_2$ and here I'm stuck once again. To find these two values I'd need two boundary points
103426
Say Bob tosses his $n+1$ fair coins and Alice tosses her $n$ fair coins. Lets assume independent coin tosses. Now after all the $2n+1$ coin tosses one wants to know the probability that Bob has gotten more heads than Alice.    The way I thought of it is this : if Bob gets $0$ heads then there is no way he can get more heads than Alice. Otherwise the number of heads Bob can get which allows him to win is anything in the set $\{1,2,\dots,n+1\}$. And if Bob gets $x$ heads then the number of heads that Alice can get is anything in the set $\{0,1,2,..,x-1\}$. So\begin{align}P(\text{Bob gets more heads than Alice})&amp;= \sum_{x=1}^{n+1} \sum_{y=0}^{x-1} P( \text{Bob gets x heads }\cap \text{Alice gets y heads }) \\[0.2cm]&amp;= \sum_{x=1}^{n+1} \sum_{y=0}^{x-1} \left(C^{n+1}_x \frac{1}{2}^{x} \frac{1}{2}^{n+1-x}\right)\left( C^n_y \frac{1}{2}^y \frac {1}{2}^{n-y}\right)\\[0.2cm]&amp; = \sum_{x=1}^{n+1} \sum_{y=0}^{x-1} \frac{C^{n+1}_x C^n_y}{2^{2n+1}}\end{align}   How does one simplify this?      Apparently the answer is $\frac{1}{2}$ by an argument which looks like this, Since Bob tosses one more coin that Alice, it is impossible that they toss both the same number of heads and the same number of tails. So Bob tosses either more heads than Alice or more tails than Alice (but not both). Since the coins are fair, these events are equally likely by symmetry, so both events have probability 1/2.
112813
I recently had this question in an interview:     You are flipping a fair coin until a sequence of four flips repeats itself. The sequences are allowed to overlap. What is the expected number of flips?   For example, if you flip HTHTHT, the sequence HTHT appears in flips 1-4 and 3-6. In this case, we are done after 6 flips. As another example, if you flip HHTTHHTT, the sequence HHTT repeats in flips 1-4 and 5-8, and we are done after 8 flips. What is the expected number of flips?  I've been thinking about this question for a few days now, and I haven't come to an answer. I've tried the simpler problem where we consider a sequence of two flips instead of four flips, but it is still rather difficult. I suspect that there is a nice recursive way to solve this problem, but I can't figure it out.  I am also interested in generalizations of this problem. For example, what is the expected number of flips for a sequence of $n$ to repeat itself? What happens if the coin isn't fair?  I have another interview in a few days, so I would very much like to see how to solve this problem in advance. Any help is appreciated.  Edit:  Based on computational evidence (assuming I didn't make a mistake in the code), it appears that the expected number of flips is about 9.81. I would like to know the exact answer, as well as an analytic solution to this problem.  Edit 2:  Another piece of information that may be of use: I had 30 seconds to answer the question. This makes me believe that there is some "easy" way to get the answer, or they were looking for an approximate answer.  Edit 3:  @r.e.s. has kindly provided exact solutions for $n=1,2,3,4,5$. For $n=6$, numerical computation seems to indicate that the answer is around $18.977$ or $18.978$. I will be updating periodically with approximations for other values of $n$.  Edit 4:  $$ \begin{array}{|c|c|} \hline n &amp; E(L_{n}) \\ \hline 1 &amp; \frac{5}{2}\\ \hline 2 &amp; \frac{35}{8}\\ \hline 3 &amp; \frac{435}{64}\\ \hline 4 &amp; \frac{2513}{256}\\ \hline 5 &amp; \frac{57922047}{4194304}\\ \hline 6 &amp; \approx 18.9775\\ \hline 7 &amp; \approx 25.928\\ \hline 8 &amp; \approx 35.288\\ \hline \end{array} $$
52181
Original simple question:  "Given a fair coin that has been tossed 100 times, each time landing heads, would it be more likely that that the next coin flip be tails or heads"  The proportion of head to tails is 1 to 1 as number of trails approach infinity (this is a fact correct?). Therefore, if this must be the case, mustn't there be an enacting "force" per say that causes this state of being to (admitted unreachable, but technically eventual) case? Hence if there exist a force pushing the number of heads and tails towards one another, shouldn't there exist a higher chance of tails than (regardless of how significant) heads? Or is this thought process just illegitimate simple because the state exist on at the infinity case?
103394
A biased coin is tossed.   Probability of Head - $\frac{1}{8}$  Probability of Tail - $\frac{7}{8}$  A liar watches the coin toss. Probability of his lying is $\frac{3}{4}$ and telling the truth is $\frac{1}{4}$. He says that that the outcome is Head. What is the probability that the coin has truly turned Head?  My Attempt:  I used the formula: $$P(A \mid B) = \frac{P(A\cap B)}{P(B)}$$  $\ \ \ \ \ \ $P(it is head GIVEN liar said it's head) = P(it's head AND liar said it's head) / P(liar said it's head)  or, P(it is head GIVEN liar said it's head) = $\frac{ \frac{1}{8} \frac{1}{4} }{ \frac{7}{8}\frac{3}{4} + \frac{1}{8}\frac{1}{4} }$ [using a probability tree will be helpful here]  or, P(it is head GIVEN liar said it's head) = $\frac{1}{22}$  The Question: Is the method I used wrong in any way? Some others I have talked to are saying the answer will be $\frac{1}{4}$. Their reasoning is this: since the liar lies 3 times out of 4 and he said it is head, then the probability of it being head is 1/4. So who is right? What will be the answer?
98520
I need some assistance in solving the following problem:  We are given a bag containing n unbiased coins. We are told that n − 1 of these coins are normal, that is, they have a head on one side and a tail in the other. The remaining one is fake and has heads on both sides. We are picking a coin from the bag uniformly at random.  We can devise the following method to determine if the coin is fake or not. We flip it k times, afer which we conclude that it is the fake one if all k flips have resulted in heads, else we conclude that it is normal. What is the probability that using this method we arrive at a wrong conclusion?   I declare the following events :   F : the coin we picked is the fake one N : the coin we picked is normal (simply F complement) Hi : outcome of the i'th toss is a head   I though of simply solving this problem by calculating P[N | H1, ... , Hk] but it turns out we need to solve this problem using unconditional probability, and this is where I am stuck.