Question: Designing Statistical Tests. For any statistical test A , its C . I. advantage in distinguishing two distributions D 0 and D 1 is denoted

Designing Statistical Tests. For any statistical test A, its C.I.
advantage in distinguishing two distributions D0 and D1 is denoted as AdvC.I.
D0,D1(A) and equals
AdvC.I.
D0,D1(A)=| Pr[A(x)=1 : x D0] Pr[A(x)=1 : x D1]|.
Let D0 and D1 be the uniform distributions over the sets Z9 and Z
21 respectively, where
Z9={0,1,2,3,4,5,6,7,8} ; Z
21={1,2,4,5,8,10,11,13,16,17,19,20}.
1.(3 points) Compute the C.I. advantage of the following test distA:
1 def distA ( x ) : # x is a sample from either $D_0$ or $D_1$
2 if is_prime ( x )=1: return 1
3 else : return 0
2.(3 points) Compute the C.I. advantage of the following test distB:
1 def distB ( x ) : # x is a sample from either $D_0$ or $D_1$
2 if x <=10: return 1
3 else : return 0
3.(1 points) Which of distA or distB does a better job of distinguishing the two distributions
and why?
4.(3 point) Empirically estimate the quantities computed in (a) and (b) using your favorite
programming language. Report the estimated probabilities and C.I. advantages over 1000
trials. For full credit, include the code you wrote.
4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!