CS395T/CAM383M Computational Statistics > HW 5 John Woods HW5
 Register FAQ Calendar Search Today's Posts Mark Forums Read

#1
03-04-2010, 03:42 PM
 johnwoods Member Join Date: Jan 2010 Posts: 30
John Woods HW5

Compute the expected value of V.

I like thinking of this in terms of the code I wrote in Octave (Matlab). Here it is:

Code:
N = 25
X = randsample(N,N,true)

Yi = @(i) (sum(X == i));

Y = zeros(1,N);
for i=1:N
Y(i) = Yi(i);
end

V = @() ( sum(Y > 0) );
U = @() ( sum(Y == 0) );

Yi(5)
V()
U()
As you can see, U is the sum of the indicator variables Ij (as defined in the homework assignment). Thus, $\Large E[U]=\sum_{j}{E[I_j]}$.

What is the expectation of that indicator variable? It's a boolean, so the expression is $\Large 1 P[A] + 0 P[A^c]=P[A]$. Thus we define $\Large E[I_j]=P[A_j]$.

What is the value for this probability of Aj? The probability of some value i not showing up in a set of 1...N is $\Large \frac{N-1}{N}$, so the probability of Aj is that to the Nth power.

Thus, we get $\Large E[U] = \sum_{j}{P[A_j]} = N\left(\frac{N-1}{N}\right)^N$.

Since U+V=N, E[U+V]=E[N]=N, and from that, E[U]+E[V]=N. This leaves us with E[V]=N-E[U], which we can write out in its entirety as: $\Large E[V] = N\left(1-\left(1-\frac{1}{N}\right)^N\right)$

Compute var[V]
First of all, we know from before that $\Large E[I_j] =P[A_j] = \left(\frac{N-1}{N}\right)^N$. It should also be clear that $\Large P[A_j\cupA_i] = \left(\frac{N-2}{N}\right)^N$, unless i=j, in which case it's just P[Aj].

We note that $\Large var[V]=var[U]$.

Further, we know U, so we can figure out that $\Large U^2 = \sum_{j}{I_j^2} + \sum_{i\ne j}{I_i I_j}$.

From that, let's get an expectation, and note that $\Large E[{I_i}^2] = E[I_i]$.

$\Large E[U^2] = \sum_{i}{E[{I_i}^2]}+\sum_{i\ne j}{\left(1-\frac{2}{N}\right)^N} = N\left(1-\frac{1}{N}\right)^N + N\left(1-\frac{2}{N}\right)^N$

$\Large E[V]^2$ is trivial to calculate. We can now give an expression for the variance of V:

$\Large var[V] = N\left(\left(1-\frac{1}{N}\right)^N + \left(1-\frac{2}{N}\right)^N\right) - N^2\left(1-\left(1-\frac{1}{N}\right)^N\right)^2$

Bonus
This is the easy part. First of all, 1/N times E[V] is $\Large \left(1-\left(1-\frac{1}{N}\right)^N\right)$. As N approaches infinity, the $\Large 1-\frac{1}{N}$ term approaches 1 (approach is made more rapid by the exponent). Thus, the limit of the entire expression will be 0.

Last edited by johnwoods; 03-04-2010 at 03:45 PM. Reason: Wanted to save before I added bonus answer.
#2
05-10-2010, 11:37 AM
 jhussmann TA Join Date: Jan 2009 Posts: 76

You should reconsider your reasoning for the bonus question.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home CS395T/CAM383M (Spring 2011) Course Administration     Announcements (click here and read!)     Basic Course Information     Supplementary Materials CS395T/CAM383M (Spring 2011) Lectures and Student Participation     Lecture Slides     Other Topics and Student Contributions     Homework Assignments and Student Postings         HW 1         HW 2         HW 3         HW 4         HW 5         HW 6     Student Term Projects Previous year: Spring, 2010     Announcements     Basic Course Information     Supplementary Materials     Lecture Slides     Other Topics and Student Contributions     Homework Assignments and Student Postings         HW 1         HW 2         HW 3         HW 4         HW 5         HW 6     Student Term Projects Previous year: Spring, 2009     Basic Course Information     Supplementary Materials     Lecture Slides     Student Term Projects

All times are GMT -6. The time now is 02:58 AM.

 www.wpressutexas.net - Archive - Top