Run a computer simulation for flipping 1,000 virtual fair coins. Flip each coin independently 10 times. Focus on 3 coins as follows:
Let ν1, νrand, and νmin be the fraction of heads obtained for the 3 respective coins out of the 10 tosses. Run the experiment 100,000 times in order to reduce variability in your results (note that crand and cmin will change from run to run) and compute average values for the ν's.
1. νmin is closed to:
import numpy as np
def experiment(times, coins=1000, flip_count=10):
nu = np.zeros(3, dtype=float)
for i in xrange(times):
flips = np.random.binomial(flip_count, 0.5, coins)
nu += [flips[0], np.min(flips), np.random.choice(flips)]
return nu / times / flip_count
np.abs(experiment(100000)[1] - [0, 0.01, 0.1, 0.5, 0.67])
array([ 0.037523, 0.027523, 0.062477, 0.462477, 0.632477])
Answer: [b] second difference is the smallest
2. Which coin or coins satisfy Hoeffding's Inequality?
Hoeffding's Inequality:
P[|ν−μ|>ϵ]≤2e−2ϵ2N
Answer: [d] c_min is not a random draw from a single "bin" and as such is bounded by the union rule and not Hoeffding
Consider the bin model for a hypothesis h that makes an error with probability μ in approximating a deterministic target function f (both h and f are binary functions). if we use same h to approximate a noisy version of f given by:
P(y|x)={λy=f(x)1−λy≠f(x)
3. What is the probability of error that h makes in approximating y? Hint: Two wrongs can make a right!
4. At what value of λ will the performance of h be independent of μ?