# Thread: Find E(X) and VAR (X)

1. ## Find E(X) and VAR (X)

Question is:
There is one error in one of five blocks of program. To find the error, we test three randomly selected blocks. Let X be the number of error in these three blocks. Compute E(X) and VAR(X)

My solution:
P(X=0)=4/5
P(X=1)=1/5

There is possible no error will be found, or one error will be find in three possible ways
X= 0 -> 4/5*4/5*4/5
X = 1 -> 3*(4/5*4/5*1/5)
by my calculation I would get E(X) = 0.384,

however in book result is said to be E(x) = 0.6

where I make mistake, please folks help me

2. ## Re: Find E(X) and VAR (X)

probability(error in one block)= 1/5
probability(error in 3 blocks)= 3*(1/5)= 0.6

Let 0= N0 error
1= error

3. ## Re: Find E(X) and VAR (X)

By assuming independent and identical probability of having error in the blocks, the number of blocks have error in any 3 randomly selected blocks have a Binomial distribution.

4. ## Re: Find E(X) and VAR (X)

Ok, then E(X) = n*p , the answer is correct,
however, when I calculate VAR(X) = n*p*q (using the same Binomial distribution) = 0.48, when in book is said it have to be 0.24, what is wrong in this time?

5. ## Re: Find E(X) and VAR (X)

n is the number of trials (how many observations were collected). In your case it's 1. You can also think of n as the maximum value the binomial observation could take. n isn't the number of distinct values the outcome can take (which is what I think you thought it should be).

6. ## Re: Find E(X) and VAR (X)

now i really get lost, if n= 1, then previously calculated E(X) is wrong, also having n=1 , the VAR(X) = 0.16, what is also wrong.....
i will try to write what i know for sure:
I have to use Binomial distribution,
so my data is: p = 1/5, q = 4/5, n= ? E(X) = np and VAR(X)=npq, question is is n = 1 or 3, and how to get correct answers?

7. ## Re: Find E(X) and VAR (X)

There are a lot of numbers flying around and none of this really seems consistent. I'm partially to blame because I skimmed over the first post and thought the values we were working with were the ones ledzep posted (p = .6, n = 1). So I was working with that situation.

So in that situation (the numbers ledzep posted) if we had a sample size of 1 with success probability of .6 then:
p = .6
n = 1
E(X) = n*p = 1*.6 = .6
Var(X) = n*p*q = 1*.6*.4 = .24

If we were using n = 2 with success probability of .6 we would have:
P(X = 0) = .16
P(X = 1) = .48
P(X = 2) = .36

p = .6
n = 2
E(X) = 2*.6 = 1.2
Var(X) = 2*.6*.4 = .48

8. ## Re: Find E(X) and VAR (X)

sorry with that number mess, but I have 5 systems, I check only 3 of them, possibility find error is 0.2, don't find 0.8
E(X) = 3* 0.2 = 0.6 - it is correct
VAR(X)= 3*0.2*0.8= 0.48 (and should be 0.24, what's that a question ))
So why I am asking to help me, because I don't understand where is problem

9. ## Re: Find E(X) and VAR (X)

Ah. I really should have read more carefully. The reason is that we were working with the binomial distribution when this is NOT a problem for the binomial distribution. (When the sample size is 1 it doesn't matter though).

We're working with the hypergeometric distribution:
http://en.wikipedia.org/wiki/Hyperge...c_distribution

With N = 5, n = 3, m = 1.

10. ## The Following 2 Users Say Thank You to Dason For This Useful Post:

ledzep (01-15-2012), smske (01-15-2012)

11. ## Re: Find E(X) and VAR (X)

hi
here we have three trial that are not independent.the answer 0.6 is correct but not in that way other people looking at it.here this three trial are disjoint from each other not independent because if one of the blocks out of three has an error we could definitely that the others doesn't so here .the probability that we have an error in out three chosen blocks is 1/5+1/5+1/5 =3/5
and because of that e[x]=0*2/5+1*3/5=3/5=0.6
and with this expectation we obtain
var[x]=e[x^2]-(e[x])^2=3/5-9/25=6/25=.24

12. ## Re: Find E(X) and VAR (X)

hi,
a maybe simpler way to look at the problem is by turning ito an urn model: we have 5 urns, 4 of which have white balls and one has a black ball.If you pick 3 urns at random, what is the probability that the black ball is not picked ?

P= (combinations of 3 out of 4)/(combinations of 3 out of 5)
P= (4!/3!)/(5!/3!2!)=4!2!/5!=2/5 which is our P(0).
P(1) is 1-P(0)=3/5.

regards

 Tweet

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts