Question: Implement the following question in Python: Our goal is to implement the uniformity test and apply it in two scenarios. Unfortunately, the known theoretical upper

 Implement the following question in Python: Our goal is to implement

Implement the following question in Python: Our goal is to implement the uniformity test and apply it in two scenarios. Unfortunately, the known theoretical upper bounds on the number of samples make it relatively prohibitive. Hence our plan is to use experiments to determine bounds that are likely to be useful to detect the divergence from the uniform distribution in practice. In particular, we want to use experiments to determine the number of samples needed to distinguish the uniform distribution from a distribution that is c-far from uniform, but minimizes the expected number of collisions. Implement two subroutines for generating random samples: (a) A subroutine generating samples from the uniform distribution on [n]. Denote this distribution H (b) A subroutine generating samples from some distribution on [n] that is c-far from uniform in total variation distance and minimizes the expected number of collisions. Use your knowledge of this kind of distribution and explain why this distribution minimizes the expected number of collisions. Denote this distribution DIM. INote: For simplicity, you can assume that n. is even.| (c) Now, given n and r. as above and an error parameter 6, write a subroutine for nding a suicient number .5- of samples and threshold 1', that work with probability 1 6. More specically, if you collect .5- samples from U, the number of collisions should be at most 1, with probability (approximately) at least 1 5, and if you collect .5- samples from D, m, the number of collisions should be more than I, with probability (approximately) at least 1 6. Your subroutine does not have to be very eicient, but it should run in reasonable time for, say, n = 10, (100, r = [1.2, and (i = 0.1. It is sufcient to use it just once-for each setting of n, c, and 6 of interest - to determine parameters that can be used in the rest of this programming assignment. IHint: You can use the following approach. For a given candidate 3 and each of L! and 13;\

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 Mathematics Questions!