13. Probabilistic Analysis
• To use Probabilistic Analysis, we need to understand the data and make certain
assumptions about the distribution of inputs in the data.
• We need to proceed with analysis and computation of average case running time but we
also need to manage the cost of hiring
• So let's start by giving certain priority or rank to the candidate
• We need to assume that candidates might appear in a random manner, which will lead to
uniform random permutation.
• So how many permutations we can have (n!)
• And each permutation have an equal probability to appear as a sequence for the interview.
• So, probabilistic analysis just works on the assumption that the candidates appear in a
random order of their rank or priority, but what if they are not.
• We can proceed with randomized algorithm to bring about more control.
13
14. Randomized Algorithm
• In average-case analysis, we often assume that all inputs are equally
likely
• Actuality, some inputs might be much more likely
• If we're really unlucky, the most likely inputs can be the most costly (as in
some implementations of quicksort)
• What can we do?
• Force all inputs to be equally likely, by randomizing the input
RCPIT 14
15. Randomization for Hiring Problem
• In the hire-assistant problem, we can first randomly permute the lists of
candidates, and then run the algorithm
• Then, for any input, we'd be guaranteed that the expected number of hires
would be in n + O(1)
• How can we randomly permute a list, so that every permutation is equally
as likely?
• That is, how can we shuffle a list, so that every permutation is equally
likely? Assume that we have a good random number generator.
• When the input is random, we refer to the running time as expected running
time
15
16. Indicator Random Variable
• It is method to convert between probabilities and expectation
• Indicator variable associated with event A:
• I{A} = 1, if A occurs
• I{A} = 0, if A does not occur
Example: Flip a coin: Y is a random variable representing the coin flip
• X = I{Y = H} = 1, if Y = Head
• X = I{Y = T} = 0, if Y = Tail
RCPIT 16
17. What is Expected Value? (IRV)
RCPIT 17
• Expected value E[] of a random variable
• Value you "expect" a random variable to have
• Average (mean) value of the variable over many trials
• Does not have to equal the value of any particular trial
37. Game theoretic randomized algorithm techniques (Min-Max) Technique
• It Follows the Backtracking Algo.
• Best Move Strategy is used.
• Max will try to Maximize its Utility (Best Move)
• Min will try to Minimize its Utility (Worst Move)
RCPIT 37