Question

In: Statistics and Probability

Theorem 5.1 Let n measure the size of the input for a certain task, and suppose...

Theorem 5.1 Let n measure the size of the input for a certain task, and suppose that any algorithm that solves this task must distinguish between f (n) different pos- sibilities. If an algorithm is based on an operation X that has m different outcomes, then the worst-case number of X operations this algorithm performs must be at least logm(f(n)).

Consider the task of selecting a person at random from a group of n people by repeatedly rolling a single six-sided die.
a) Use Theorem 5.1 to find a lower bound on the worst-case number of rolls needed to select a person from a group of n = 72 people. 
b) Describe an optimal algorithm for selecting a person from a group of n = 72 people.
c) What is the greatest value of n for which a person can be selected at random using five rolls?

Solutions

Expert Solution

Part(a)

Number of people, n = 72

Since we are using a six-sided die, m = 6

Since we need to distinguish between n people, f(n) = n

Thus, by theorem 5.1, lower bound on the worst-case number of rolls = log6(f(72)) = log6(72) = 2.38685

Thus, we need atleast 3 rolls.

Part(b)

The algorithm is as follows:

1) Divide the group into 6 smaller groups of 12 people each and map each group to a number on the die.

2) Roll the die and select the group with the number that appears on the die.

3)Now, divide that group of 12 people into six smaller groups of 2 people each. Map each group to a number on the die.

4) Roll the die again and select the group with the number that appears on the die.

5) Roll the die again. If the number is odd then select the first person, if it is even then select the second person from the group of 2 people.

Doing so we will select a random person from a group of 72 people using 3 rolls of the die. Thus, this is an optimal algorithm.

Part (c)

Let the number of die rolls be r in the worst case.

Then from Theorem 5.1,

Thus,

Thus, the maximum value of n for 5 rolls of a die is 7776.


Related Solutions

Incorrect Theorem. Let H be a finite set of n horses. Suppose that, for every subset...
Incorrect Theorem. Let H be a finite set of n horses. Suppose that, for every subset S ⊂ H with |S| < n, the horses in S are all the same color. Then every horse in H is the same color. i) Prove the theorem assuming n ≥ 3. ii) Why aren’t all horses the same color? That is, why doesn’t your proof work for n = 2?
The runtime of a program is proportional to n1.5 where n is the input size.  For input...
The runtime of a program is proportional to n1.5 where n is the input size.  For input size 100 the runtime is 51 ms.  What is the new runtime when the input size is quadrupled?
Let Y1, Y2, . . . , Y20 be a random sample of size n =...
Let Y1, Y2, . . . , Y20 be a random sample of size n = 20 from a normal distribution with unknown mean µ and known variance σ 2 = 5. We want to test H0; µ = 7 vs. Ha : µ > 7. (a) Find the uniformly most powerful test with significance level 0.05. (b) For the test in (a), find the power at each of the following alternative values of µ: µa = 7.5, 8.0, 8.5,...
Theorem 3.4. Let a and b be integers, not both zero, and suppose that b =...
Theorem 3.4. Let a and b be integers, not both zero, and suppose that b = aq + r for some integers q and r. Then gcd(b, a) = gcd(a, r). a) Suppose that for some integer k > d, k | a and k | r. Show that k | b also. Deduce that k is a common divisor of b and a. b) Explain how part (a) contradicts the assumption that d = gcd(b, a).
Suppose the runtime of a computer program is proportional to 2^n where n is the input...
Suppose the runtime of a computer program is proportional to 2^n where n is the input size. When given an input of size 1024, suppose the runtime is 256ms. For what input size would the program have runtime of 1ms? A program takes time proportional to the input size. If the program takes 36 milliseconds for input size 30, how  many milliseconds does it take for input size 10? A program takes time T(n) = k2n  where k is some constant and...
Let X be the mean of a random sample of size n from a N(μ,9) distribution....
Let X be the mean of a random sample of size n from a N(μ,9) distribution. a. Find n so that X −1< μ < X +1 is a confidence interval estimate of μ with a confidence level of at least 90%. b.Find n so that X−e < μ < X+e is a confidence interval estimate of μ withaconfidence levelofatleast (1−α)⋅100%.
Let X1, X2, . . . , Xn be a random sample of size n from...
Let X1, X2, . . . , Xn be a random sample of size n from a Poisson distribution with unknown mean µ. It is desired to test the following hypotheses H0 : µ = µ0         versus     H1 : µ not equal to µ0 where µ0 > 0 is a given constant. Derive the likelihood ratio test statistic
Suppose for a population, ? = 45, ? = 8. A sample of size n =...
Suppose for a population, ? = 45, ? = 8. A sample of size n = 31 is selected. a) What is the standard deviation of sample mean? i.e. ?([?(x)]) = b) What is the z-score of [?(x)] = 41.5? c)If the sample standard deviation is s = 9, what is the standard error of sample mean? i.e. s.e.([?(x)]) = d)If the sample standard deviation is s = 9, what is the t-score of [?(x)] = 41.5?
Let X1, ..., Xn be a random sample of size n from an exponential ditribution with...
Let X1, ..., Xn be a random sample of size n from an exponential ditribution with parameter lambda . Let Di=(n-i+1)[X(i)-X(i-1)] i=1,.... n , where X(0)=0 be the normalized spacings. Using Jacobians, derive the joint distribution of D1,....., Dn.
Suppose we find that, the average engine size in our sample of size n = 30...
Suppose we find that, the average engine size in our sample of size n = 30 is 192 cubic inches, with a standard deviation of 104 cubic inches. Use these statistics to compute a 90% confidence interval of population mean, that is, the average engine size for all.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT