Thinking (as I often do to understand Probability) about coin flipping, I'm looking for someone to explain how - and I've tried to make this as arbitrary as possible - for a coin with probability $p$ of flipping a heads, we can investigate some of its probabilistic properties. We can restrict p to $0
I've found the expected number of heads in $n$ flips to be $np$ and the variance for the number of heads to be $p(n-p)$ - if these are wrong, I'd appreciate some correction, though intuitively the former seems right at least.
Suppose then we have $Y$ heads in total. If we look at the flips individually, so say we define a function $X_i$, which takes value $1$ if the $i^\text{th}$ flip is heads, and $0$ if it's tails, how can we determine $\mathbb{E}[X_i|Y]$ (which I imagine we can re-write as $\mathbb{E}[X_1|Y]$) and how can we also determine$\mathbb{E}[Y|X_i]$?
Can we also find the expected numbers of flips before the first head?
I'm quite interested in seeing where these answers come from, so any help would be really useful. Thanks, MM.
EDIT 1
Variance for first case is $np(1-p)$ rather than $p(n-p)$.