CSCI 328 Midterm Example 2
CSCI 381/780 Midterm
Section titled “CSCI 381/780 Midterm”No calculators allowed (if I feel that you have used a calculator, you get minus 20 points). The exam has 5 questions, adding up to 110 points. Max score is 100. Please do the problems in order.
Chernoff Bound: Let be i.i.d. Bernoulli random variables and . Let . Then for any :
Here
- (9 points) We roll two standard six-sided dice. Find the probability of the following events, assuming the outcomes of the dice are independent.
- Two dice show the same number
- The sum of the dice is even
- The product of the dice is a perfect square
- (11 points) Define a random variable that takes the values with probabilities , respectively. For what value of is well-defined? Calculate the expectation and variance of with this value of .
-
(30 points) Alice and her younger brother Bob play chess. Alice is the better player, and wins any match with probability 0.7. They play a tournament of 80 matches, with ice-cream as the prize. However, unlike a regular tournament, Bob has negotiated a deal with their mom where he only needs to win at least 36 matches in order to win the tournament. Show that Bob still has a less than one-in-seven chance of getting the ice cream. [Hint: At the last step, use the numerical value of given above.]
Solution
Let’s set up the problem carefully. Bob needs to win at least 36 matches, and we want to find the probability that he succeeds.
Setting up the model:
Let denote the number of matches Bob wins. Since:
- Alice wins each match with probability 0.7
- Bob wins each match with probability
- They play 80 independent matches
We can write as a sum of i.i.d. Bernoulli(0.3) random variables:
The expected number of matches Bob wins is:
Notice that Bob’s target (36 matches) is significantly higher than the expected value (24 matches). This suggests the probability is quite small.
Applying the Chernoff bound:
The Chernoff bound allows us to bound exponentially. We need to express 36 in the standard form :
Solving for :
By the Chernoff bound:
Computing the final answer:
Now we use the numerical value given in the problem:
Since , we have .
Therefore, Bob has less than a one-in-seven chance of winning the tournament.
-
(30 points) A certain component is critical to the operation of an electrical system and must be replaced immediately upon failure. If the mean lifetime of this type of component is 100 hours and its standard deviation is 30 hours, how many of these components must be in stock so that the probability that the system is in continual operation for the next 2000 hours is at least 0.95? [Hint: Let be the number of components required. Define random variables denoting how long component lasts, and use Chebyshev]
Solution
Setting up the Model
Let’s think about what we’re trying to achieve. We have components with lifetimes that vary, and we need enough of them so that with probability at least 0.95, they can run the system continuously for 2000 hours.
Let denote the lifetime of component . We’re given:
- hours (average component lifetime)
- hours (variability in lifetime)
If we keep components on hand, the total operating time is . We want:
Equivalently, we need .
Computing the Mean and Variance
Assuming the component lifetimes are independent:
Notice that if is large enough such that , then it’s unlikely we’ll fall short. The question is: how large must be?
Applying Chebyshev's Inequality
The event "" means we fall short of our target. This happens when deviates below its mean by more than hours. By Chebyshev’s inequality:
For this to be at most 0.05, we need:
Rearranging:
Solving the Quadratic
Using the quadratic formula:
This gives us or .
Since the parabola opens upward, the inequality is satisfied when . But wait—that’s not what we want! We need , so or .
Since we also need (i.e., ) just to have a positive expected total, we must have . Rounding up to the nearest integer: .
Verification
Let’s verify with :
- hours
- The deviation from 2000 is: hours
By Chebyshev:
Therefore, we need at least 27 components in stock to ensure 95% probability of 2000-hour operation.
-
(20 points) What is the main advantage of Cuckoo Hashing over Hashing with Chaining? What is the main advantage of Hashing with Chaining over FKS hashing?