Log In
0 votes
Let $X$ be a random variable that is equal to the number of heads in two flips of a fair coin. What is $E[X^2]$? What is $E^2[X]$?
in Algorithms 81 views

1 Answer

2 votes
Sampling out the scenario we get

${HH,HT,TH,TT}$ each with probability $\frac{1}{4}$


$P(X=no. of heads)$

$E[X]\Rightarrow 2*\frac{1}{4} + 1*\frac{1}{4}+1*\frac{1}{4}+0*\frac{1}{4}$

$\Rightarrow \frac{2}{4}+\frac{2}{4}\Rightarrow 1$

 $E[X]=1$;  $E^{2}[X]\Rightarrow 1$


Now calculating for $E[X^{2}]$

$E[X^{2}]\Rightarrow 2^{2}*\frac{1}{4}+1^{2}*\frac{1}{4}+1^{2}*\frac{1}{4}+0^{2}*\frac{1}{4}$

$\Rightarrow 1+\frac{1}{2}\Rightarrow 1.5$

so $E[X^{2}]$$=1.5$

edited by

Related questions

0 votes
0 answers
A probability distribution function $P(x)$ for a random variable $X$ is defined by $P(x) =Pr\{X\leq x\}$.Suppose that we draw a list of $n$ random variables $X_1,X_2,…,X_n$ from a continuous probability distribution function $P$ that is computable in $O(1)$ time. Give an algorithm that sorts these numbers in linear averagecase time.
asked Jun 28, 2019 in Algorithms akash.dinkar12 132 views
0 votes
0 answers
We are given $n$ points in the unit circle, $P_i=(x_i,y_i)$, such that $0<x_i^2+y_i^2<1$ for $i=1,2, .,n$.Suppose that the points are uniformly distributed; that is, the probability of finding a point in any region of the circle is proportional to the ... from the origin. (Hint: Design the bucket sizes in BUCKET-SORT to reflect the uniform distribution of the points in the unit circle.)
asked Jun 28, 2019 in Algorithms akash.dinkar12 97 views
1 vote
1 answer
Explain why the worst-case running time for bucket sort is $\Theta(n^2)$. What simple change to the algorithm preserves its linear average-case running time and makes its worst-case running time $O(n\ lg\ n)$?
asked Jun 28, 2019 in Algorithms akash.dinkar12 64 views
0 votes
1 answer
BUCKET-SORT(A) 1 let B[0...n-1] be a new array 2 n = A.length 3 for i – 0 to n – 1 4 make B[i] an empty list 5 for i = 1 to n 6 insert A[i] into list B[nA[i]] 7 for i = 0 to n – 1 8 sort list B[i] with insertion sort 9 concatenate the lists B[0] , B[1] , ….,B[n-1] together in order illustrate the operation of BUCKET-SORT on the array $A=\langle .79,.13,.16,.64,.39,.20,.89,.53,.71,.42\rangle$
asked Jun 28, 2019 in Algorithms akash.dinkar12 71 views