# Thread: Expectation of random variable

1. ## Expectation of random variable

Hey guys,

I have stumbled upon this problem, and I've tried solving it by looking at it as a Binomial distribution, but i just don't see the right connection.

Is my initial impression wrong or not ? I would appreciate any pointers on the given tasks. Thanks

Code:
There are 2*N computers. On them a program A or B is installed.
We check the computers till we have N computers with version A or version B(this number of checks is denoted with K). But from those K
computers we don't remember which of them have version A or B appropriately. So we check again.

Let X be the random variable which will denote the number of computers I have to check in order to find N suitable ones(of version A or version B).

Find the expected value of X, E(X) = ?

Example:

n = 3 k = 4

In this case we have eiher 3 computers with A & 1 computer with B, or
1 computer with A & 3 computers with B.

First we have to check the first two computers, and checking this will give us:

- 2(A) + 0(B) 25%
- 2(B) + 0(A) 25%
- 1(A) + 1(B) 50% In this case we have to check the third computer also, so we are certain of the version.

2     3
X:  (               )
0.5   0.5

EX = 2*0.5 + 3*0.5 = 1+1.5 = 2.5

2. ## Re: Expectation of random variable

This question looks interesting.

Note that from the specification we have , since we have and of computers of the two different versions, and once we sampled there are computers of 1 version, we will stop. So we must have (pigeonhole principle) and hence the bound.

In order to make sure which version of computer is more, you will need to check that there are more than computer of that version. So we have and similarly, by pigeonhole principle, . i.e. The support of is

If you are able to determine the version on the -th check, it means that you have checked computers of a certain version in the previous checks, and have that version again on the -th check. So the probability mass function of is given by

where as stated earlier.

 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