Alternative analysis of RANDOMIZED-SELECT using indicator variables.
Analyze the alternative analysis of randomized-select using indicator variables..
Examples
Input: "test_input_1"
Output: "output_1"
Input: "test_input_2"
Output: "output_2"
Hints
Recall that indicator random variables are used to model the occurrence of events in probability theory, where each variable is 1 if the event occurs and 0 otherwise. How can you define an indicator variable for the event that the ith smallest element is selected in a given iteration of randomized-select?
Consider the probability that the ith smallest element is selected in a particular iteration. How does this probability relate to the rank of the pivot chosen in that iteration? Can you express this probability in terms of the rank of the pivot?
To analyze the expected running time, you need to compute the expected value of the sum of indicator variables over all iterations. How does the linearity of expectation help in simplifying this computation? Can you derive an expression for the expected number of times the ith smallest element is selected across all iterations?
Alternative analysis of RANDOMIZED-SELECT using indicator variables.
Analyze the alternative analysis of randomized-select using indicator variables..