expected number of change points A change point is defined as a term in a sequence of zeros and ones when a change happens. For example, in a sequence 1110110011 we have the following change points: $n_4,n_5,n_7,n_9$.
Defining an indicator variable $X_i$ by $X_i=1$ if $n_i\neq n_j$ and 0 otherwise, find the expected number of change points in a random sequence of length $a+b$ where $a$ is the number of zeros and $b$ is the number of ones.
I am not sure how to think about this question. I know I have to compare every term starting with the second with the previous, so I have $a+b-1$ comparisons which means I will have half a possibilities that the next term will change. Any help is appreciated.
 A: You are probably supposed to assume that all possible strings are equally likely to occur--but you should make that assumption explicitly, because other distributions of the strings are possible.
The phrasing of the question provides a strong hint about a simple and elegant solution: exploit properties of expectation.  The useful one here is that the expected number of change points is the sum over all $a+b-1$ locations of the expectation of the number of changepoints at that location.
Each of these locations is surrounded by two characters in the string; only these matter for determining whether a changepoint occurs at that location.  There are only four possibilities:
Event    Number of changepoints
-------- ----------------------
...00... (0 changepoints)
...01... (1 changepoint)
...10... (1 changepoint)
...11... (0 changepoints)

Because this analysis is independent of where the location is, you don't have to perform $a+b-1$ calculations--you only need to find this one expectation and multiply it by $a+b-1$.  As always, it will come down to the definition of expectation: you multiply the values of the indicator ($0$ or $1$) by the probabilities.  Since the $0$ values won't contribute anything, that reduces your work to computing the probabilities of the $1$ values: that is, of the events ...01... and ...10....
Because location does not matter, you might as well focus on the first location (between the first and second characters).  So: what is the chance that a random string begins 01...?  What is the chance it begins 10...?  That's all you need to find in order to write down the answer immediately.
