Results 1 to 5 of 5

Math Help - Expected value of Bernouilli Distribution

  1. #1
    Senior Member
    Joined
    Jan 2008
    From
    Montreal
    Posts
    311
    Awards
    1

    Expected value of Bernouilli Distribution

    A set of binary data can have either a 1 with probability p or a 0 with probability 1-p. A set of outcomes that have to same values is referred to as a run (i.e the set 1,1,0,1,1,1,1 where the first run with have 2 values, the second run would have 1, the third of length 4, and so on).

    A) Find the expected length of the 1st run
    B) Find the expected length of the 2nd run

    Y = \left\{ \begin{array}{rcl}<br />
1 & \mbox{if} & \mbox{if the first number is a 1} \\ 0 & \mbox{if} & \mbox{if the first number is a 0} \end{array}\right.

    A) E[N] = E[N|Y=1]P \left( Y=1 \right)+E[N|Y=0]P \left(Y=0\right)

    E[N] = E[N|Y=1]p+E[N|Y=0](1-p)

    E[N] = (1)p+1+E[N](1-p)

    E[N] = \frac{1}{p}

    B) I would think it would be an identical to part A), but I'm unsure of that.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Senior Member
    Joined
    Jan 2008
    From
    Montreal
    Posts
    311
    Awards
    1
    I would think this problem to be a geometric distribution. so the expected run of the first outcome would be

    \frac{1}{p} if it was a 1 and \frac{1-p}{p} if it was a zero.

    it would be similar for the second run. But I still have no clue on how to merge them together, considering that either a 1 or a 0 can occur.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor

    Joined
    Aug 2008
    From
    Paris, France
    Posts
    1,174
    You're almost right about the geometric distribution. In fact, because the first bit is either 0 or 1, this is rather a mix (a convex combination) of the two geometric distributions you give. To find the expected value, condition on the first bit X_1: E[N]=E[N|X_1=1]P(X_1=1)+E[N|X_1=0]P(X_1=0)=\frac{1}{1-p}p+\frac{1}{p}(1-p).
    Indeed, under the conditional distribution P(\cdot|X_1=1), the situation is that of the usual geometric distribution of parameter 1-p: position of the first 0 among the next bits ( X_2,\ldots). And conversely when X_1=0.

    As for the second question, if the first run was a 1 (probability p), then the second is a 0, and conversely, so that the probabilities aren't the same. Let's condition on the values of N_1 and X_1 so that we can use the independence: P(N_2=n_2, N_1=n_1, X_1=1)=p^{n_1}(1-p)^{n_2}p ( n_1 "1", n_2 "0" and 1 "1"), so that P(N_2=n_2|N_1=n_1,X_1=1)=\frac{p^{n_1}(1-p)^{n_2}p}{p^{n_1}(1-p)}=(1-p)^{n_2-1}p (geometric distribution of parameter p). The same way, P(N_2=n_2|N_1=n_1,X_1=0)=p^{n_2-1}(1-p) (parameter 1-p). Notice that N_2 is independent of N_1 since n_1 doesn't appear in the conditional distribution. Finally, E[N_2]=E[N_2|X_1=1]P(X_1=1)+E[N_2|X_1=0]P(X_1=0)=\frac{1}{p}p+\frac{1}{1-p}(1-p)=2.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Senior Member
    Joined
    Jan 2008
    From
    Montreal
    Posts
    311
    Awards
    1
    for the first part why wouldn't it be :

    \frac{1}{p}(p) + \frac{1-p}{p}(1-p) = \frac{1-p+p^2}{p}?
    Follow Math Help Forum on Facebook and Google+

  5. #5
    MHF Contributor

    Joined
    Aug 2008
    From
    Paris, France
    Posts
    1,174
    Quote Originally Posted by lllll View Post
    for the first part why wouldn't it be :

    \frac{1}{p}(p) + \frac{1-p}{p}(1-p) = \frac{1-p+p^2}{p}?
    Because of what I wrote: if the first is 1 (prob p), you wait for the first 0 (so geom. with parameter 1-p), and conversely. And the expected value of a geometric random variable of parameter 1-p is \frac{1}{1-p}. And indeed, there was a mistake in your previous post, I didn't notice.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. probability distribution and expected value
    Posted in the Statistics Forum
    Replies: 3
    Last Post: May 4th 2010, 03:13 PM
  2. Normal Distribution Expected Value
    Posted in the Advanced Statistics Forum
    Replies: 4
    Last Post: December 3rd 2009, 07:18 PM
  3. Replies: 1
    Last Post: October 5th 2009, 02:45 PM
  4. Expected value of Bivariate distribution
    Posted in the Advanced Statistics Forum
    Replies: 1
    Last Post: September 16th 2008, 12:14 AM
  5. Distribution to density to expected
    Posted in the Advanced Statistics Forum
    Replies: 4
    Last Post: April 24th 2008, 12:07 AM

Search Tags


/mathhelpforum @mathhelpforum