Suppose N people are in a line. Everyone's height obeys the same distribution. And are independent of each other. Assume that no two people have the same height. For any two people in the team. If the person in front is taller than the person behind. Then define this pair of people as an occlusion pair. 1) Find the expectation of the total number of occlusion pairs in the team. 2) Design an algorithm with the lowest possible complexity. Calculate how many different permutations of the queue of N people can form exactly K pairs of occlusion pairs. Give pseudo code and analyze the time/space complexity of the algorithm.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here