Intereting Posts

Is duality an exact functor on Banach spaces or Hilbert spaces?
How is the notion of adjunction of two functors usefull?
Direct proof that $\pi$ is not constructible
Two-valued measure is a Dirac measure
Minimal polynomial of the operator $T:V\oplus W\to V\oplus W$
Is a linear factor more likely than a quadratic factor?
Can we extend the definition of a homomorphism to binary relations?
Global sections of $\mathcal{O}(-1)$ and $\mathcal{O}(1)$, understanding structure sheaves and twisting.
IMO 2016 P3, number theory with the area of a polygon
About the branch-cut in the complex logarithm
Jigsaw-style proofs of the Pythagorean theorem with non-square squares
extending a vector field defined on a closed submanifold
Is mathematics one big tautology?
Introductory book for Riemannian geometry
How many ways can 70 planes be allocated into 4 runways?

A coin with heads probability $p$ is flipped $n$ times. A “run” is a maximal sequence of consecutive flips that are all the same. For example, the sequence HTHHHTTH with $n=8$ has five runs, namely H, T, HHH, TT,H. Show that the expected number of runs is

$$1+2(n-1)p(1-p).$$

I have tried to use some generating function on this but calculus got pretty messy and didn’t work.

- Prove with induction that $11$ divides $10^{2n}-1$ for all natural numbers.
- How would you prove $\sum_{i=1}^{n} (3/4^i) < 1$ by induction?
- Can a collection of points be recovered from its multiset of distances?
- Show that for any subset $C\subseteq Y$, one has $f^{-1}(Y\setminus C) = X \setminus f^{-1}(C)$
- Proof of clockwise towers of Hanoi variant recursive solution
- Solve $x^2$ $mod$ $23 = 7^2$

- Change of measure of conditional expectation
- The prime numbers do not satisfies Benford's law
- How to prove Poisson Distribution is the approximation of Binomial Distribution?
- Stirling numbers with $k=n-2$
- Upper bound for the strict partition on K summands
- combinatorics circular arrangement problem
- Probability of tossing a fair coin with at least $k$ consecutive heads
- Proof of the identity $2^n = \sum\limits_{k=0}^n 2^{-k} \binom{n+k}{k}$
- how to solve $min\{x \in \mathbb N_0 \quad |x \cdot 714\quad mod \quad 1972 \quad = \quad 1292 \quad mod \quad 1972 \} $ (modulo equation)
- $k$ balls into $n$ bins — Number of occupied bins

I’d use indicator random variables. For $1\leq j\leq n-1$, let $Z_j$ take the value $1$ if the $j$th and $j+1$st coin tosses are different, and take the value $0$ otherwise. Then the number of runs is $R=1+\sum_{j=1}^{n-1}Z_j$ and its expected value is

$$\mathbb{E}(R)=1+ \sum_{j=1}^{n-1}\, \mathbb{E}(Z_j)=1+(n-1) 2p(1-p).$$

I will leave the calculation $\mathbb{E}(Z_j)=2p(1-p)$ as an exercise!

Using indicator random variable is a good way to solve this question (see the solution above). What’s more, we can calculate the **variance** of the number of runs:$$Var\left( R \right) =Var\left( \sum _{ j=1 }^{ n-1 }{ { Z }_{ j } } \right) =E\left\{ { \left( \sum _{ j=1 }^{ n-1 }{ { Z }_{ j } } \right) }^{ 2 } \right\} -{ E\left( \sum _{ j=1 }^{ n-1 }{ { Z }_{ j } } \right) }^{ 2 } $$

$Z_j$ is a Bernoulli distribution, $Z_j$ and $Z_k$ are independent if $\left| j-k \right| \ge 2$(notice that $Z_j$ and $Z_{j+1}$ are dependent).

We can get $Var\left( R \right)=2pq\left( 2n-3-2pq\left( 3n-5 \right) \right) $.

We already have 2 good solutions here, but wanted to answer using the conventional approach.

Let $\mathbb E(k)$ be expected number of runs in a series of $k$ coin tosses. It is important to remember that the coin tosses are memoryless. Therefore, $\mathbb E(k+1)$ depends only on the value of coin toss $k$ and $k+1$. The value of $\mathbb E(k+1)$ will increase by 1 if $k^{th}$ and $k+1^{th}$ tosses are different.

Keeping this in mind, we translate these into equations

$$

\mathbb E(k+1) = p(p\mathbb E(k) + (1-p)(1+ \mathbb E(k)) + (1-p)((1-p)\mathbb E(k) + p(1+ \mathbb E(k)))

$$

Rearranging this a bit gives us

$$

\mathbb E(k+1) = 2p(1-p) + \mathbb E(k)

$$

Our $ \mathbb E(k) $ is of the form $ \mathbb E(k) = Ck +D $ for some constant $C$ and $D$. The result follows after finding these constants from the previous equation and the initial condition.

- Fundamental solution of the Laplacian on the surface of a cylinder
- If square waves are square integrable, why doesn't fourier expanding work?
- Fast square roots
- In a principal ideal ring, is every nonzero prime ideal maximal?
- Why can't you square both sides of an equation?
- Show that the Lie algebra generated by x, y with relations $ad(x)^2(y) = ad(y)^5(x) = 0$ is infinite dimensional and construct a basis
- Height of Cylinder inscribed in Sphere
- What shape do we get when we shear an ellipse? And more generally, do affine transformations always map conic sections to conic sections?
- What is the connectivity between Boltzmann's entropy expression and Shannon's entropy expression?
- Complexity classes and number of problems
- Why in an inconsistent axiom system every statement is true? (For Dummies)
- Why are continuous functions the “right” morphisms between topological spaces?
- A non-increasing particular sequence
- Determine the remainder when $f(x) = 3x^5 – 5x^2 + 4x + 1$ is divided by $(x-1)(x+2)$
- In NBG set theory how could you state the axiom of limitation of size in first-order logic?