# The expected value of $n$ dependent coins?

Say there are $n$ dependent coins

$$c_1, c_2, c_3, \dots, c_n,$$

when $c_1$ is head then $c_n$ must be tail, but each coin has a probability distribution $1/2$ as if they're fair. So apparently the probability $P(\text{all heads})$ and $P(\text{all tails})$ are zero. But the expected value of $X$, which represents the number of heads appear after toss all $n$ coins, can be decomposed into $X_1+X_2+\dots+X_n$, which each $X_i$ represents the number of heads appear on i-th coin.

So

$$E(X) = E(\sum_{i=1}^{n}X_i)=\sum_{i=1}^{n}E(X_i)=n\cdot1/2,$$

but this value is exactly the same as these coins are independent.

Is the description above correct and possible?

• You are correct, by the linear independence of expectation . – lulu Jun 25 '18 at 14:03
• @lulu: yes I'm trying to trust the idea, I'm fighting it with my intuition. – Postal Model Jun 25 '18 at 14:05
• One thing is for sure: $\mathbb E\sum_{i=1}^nX_i=\sum_{i=1}^n\mathbb EX_i$ (if the expectations exist of course). – drhab Jun 25 '18 at 14:05
• Convince yourself that your assumptions require than the $n^{th}$ coin is always the opposite of the first. – lulu Jun 25 '18 at 14:09
• Yes. If you change the distribution for that coin, or any of the coins, the answer will change. – lulu Jun 25 '18 at 14:18

You need to take into account the dependance between $c_1$ and $c_n$:

$\mathbb{E}[X_n]=\mathbb{E}[X_n|X_1=1]\mathbb{P}[X_1=1]+\mathbb{E}[X_n|X_1=0]\mathbb{P}[X_1=0]=1\cdot\frac{1}{2}+\frac{1}{2}\cdot \frac{1}{2}=\frac{3}{4} \neq \frac{1}{2}$

where I used the law of total probability

• So my description is incorrect, but if I change the statement into $c_1=1\implies c_n=0$ and $c_1=0 \implies c_n=1$ then it will be correct? – Postal Model Jun 25 '18 at 13:56
• In that case, have a look at @drhab's answer, and yes – asdf Jun 25 '18 at 13:57
• Since the marginal probability for the coins is as if unbiased, yet the last coin must show tails when the first does, therefore the last coin must show heads when the first shows tails. $${\tfrac 12~{=\Bbb P(X_n=1) \\ = \Bbb P(X_n=1\mid X_1=0)\Bbb P(X_1=0)+\Bbb P(X_n=1\mid X_1=1)\Bbb P(X_1=1)\\ = \tfrac 12\Bbb P(X_n=1\mid X_1=0)+0\cdot \tfrac 12}\\1~=\Bbb P(X_n=1\mid X_1=0)}$$ – Graham Kemp Jun 25 '18 at 13:57
• No? $X_1=1 \implies X_n=0$. That doesn't mean that $X_n=1 \implies X_1=0$, you can have $X_1=X_n=0$ – asdf Jun 25 '18 at 14:00
• Your posted solution is incorrect. In order for the $n^{th}$ coin to have a $\frac 12$ chance of coming up $H$ or $T$ then it must be the case that it is always the opposite of the first coin. The coin you describe has a $\frac 34$ chance of coming up $T$. – lulu Jun 25 '18 at 14:05

Yes if also $c_n$ must be head if $c_1$ is tail.

If that is not the case then coin $c_n$ does not have probability $\frac12$ to be head.

If so then in this situation $X_1+X_n=1$.

• You can have $X_1=X_n=0$? – asdf Jun 25 '18 at 13:56
• @asdf What I am saying is that the description is only okay if $X_1=1\iff X_n=0$. Not if only $X_1=1\implies X_n=0$. – drhab Jun 25 '18 at 14:00
• Yeah, saw that, that's why I pointed OP to your answer when the condition is iff – asdf Jun 25 '18 at 14:01

Simplify the problem. Consider just two coins which each behave as if unbiased (when looked at individually), yet the second is dependent on the first such that it always shows tails when the first shows heads.

Let $X_1,X_2$ indicate when they show heads.   Then we have been told that: $$\mathsf P(X_1{=}1)=\tfrac 12\\ \mathsf P(X_2{=}1)=\tfrac 12\\ \mathsf P(X_2{=}0\mid X_1{=}1)=1$$

Now, by the Law of Total Probability we can show $\mathsf P(X_2{=}1\mid X_1{=}0)=1$ $$\begin{split}\mathsf P(X_2{=}1) &= \mathsf P(X_1{=}1, X_2{=}1)+\mathsf P(X_1{=}0, X_2{=}1) \\&=\mathsf P(X_1{=}1)\mathsf P(X_2{=}1\mid X_1{=}1)+\mathsf P(X_1{=}0)\mathsf P(X_2{=}1\mid X_1{=}0)\\\tfrac 12&= \tfrac 12\cdot 0+\tfrac 12\cdot\mathsf P(X_2{=}1\mid X_1{=}0)\end{split}$$

Therefore the expectation shall be:

\begin{align}\mathsf E(X_1+X_2) &= (0{+}0)\mathsf P(X_1{=}0,X_2{=}0)+(0{+}1)\mathsf P(X_1{=}0,X_2{=}1)+(1{+}0)\mathsf P(X_1{=}1,X_2{=}0)+(1{+}1)\mathsf P(X_1{=}1,X_2{=}1)\\&=0\cdot 0+1\cdot\tfrac 12+1\cdot\tfrac 12+2\cdot 0\\ & = 1\end{align}

You should be able to see why that is equal to $\mathsf E(X_1)+\mathsf E(X_2)$

• Because $X_1$ and $X_2$ share the same probability distribution? and thanks for detailed explanation. – Postal Model Jun 25 '18 at 14:57
• No, @Niing , because: $\mathsf E(X_1)~{=0\mathsf P(X_1{=}0)+1\mathsf P(X_1{=}1)\\=0\mathsf P(X_1{=}0,X_2{=}0)+0\mathsf P(X_1{=}0,X_2{=}1)+1\mathsf P(X_1{=}1,X_2{=}0)+1\mathsf P(X_1{=}1,X_2{=}1)}$ – Graham Kemp Jun 25 '18 at 17:25