Question

Question 6: Let n 2 1 be an integer and let A[1...n] be an array that stores a permutation of the set { 1, 2, . .. , n). If the array A s sorted. then Ak] = k for k = 1.2. .., n and, thus. TL k-1 If the array A is not sorted and Ak-i, where iメk, then Ak-서 is equal to the distance that the valuei must move in order to make the array sorted. Thus, the summation in (1) is a measure for the sortedness of the array A: If the summation is small, then A is close to being sorted. On the other hand, if the summation is large, then A is far away from being sorted. In this exercise, you will determine the expected value of the summation in (1) Assume that the array stores a uniformly random permutation of the set 1,2,..., n) For each k = 1, 2, , n, define the random variable Xs = 1시서 _ 서. and let k-1 ·Assume that n = 1, Determine the expected value E(X) . Assume that n 2. Is the sequence X1, X2, ..., Xn of random variables pairwise independent? . Assume that n 2 1. Let k be an integer with 1 < k< n. Prove that E(%) = n+1 + 2 Hint: Assume Ak] = i. If 1-i < k, then Ak)- I AIk]-서 = i-k. For any integer m 1, = k-i. If k + 1-i-n, then m(m 1) 1+2+3+。..+m= Assume that n1. Prove that Ex)1 3 Hint: 1+2+3+D(2n+1)

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
Question 6: Let n 2 1 be an integer and let A[1...n] be an array that...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question 6: Let n 2 2 be an integer and let ai,a2,...,an be a permutation of...

    Question 6: Let n 2 2 be an integer and let ai,a2,...,an be a permutation of the set (1, 2, . . . ,n). Define ao = 0 and an+1 = 0, and consider the sequence do, 1, d2, l3, . . . , Un, Un+1 A position i with 1 i n is called auesome, if ai > ai-1 and ai > ai+1. In words, i is awesome if the value at position i is larger than both its...

  • Exercise 3. [10 pts Let n 2 1 be an integer. Prove that there exists an...

    Exercise 3. [10 pts Let n 2 1 be an integer. Prove that there exists an integer k 2 1 and a sequence of positive integers al , a2, . . . , ak such that ai+1 2 + ai for all i-1, 2, . . . , k-1 and The numbers Fo 0, F1 1, F2 1, F3 2 etc. are the Fibonacci numbers

  • Ok = (6) Let n be a positive integer. For every integer k, define the 2...

    Ok = (6) Let n be a positive integer. For every integer k, define the 2 x 2 matrix cos(27k/n) - sin(2nk/n) sin(2tk/n) cos(27 k/n) (a) Prove that go = I, that ok + oe for 0 < k < l< n - 1, and that Ok = Okun for all integers k. (b) Let o = 01. Prove that ok ok for all integers k. (c) Prove that {1,0,0%,...,ON-1} is a finite abelian group of order n.

  • 1, and let σ be a permutation of {1, , n). Recall that for each integer m a) Let n 1, we denote ơ...

    1, and let σ be a permutation of {1, , n). Recall that for each integer m a) Let n 1, we denote ơm--σ ο . . . o σ. Show that n times b) Let 21, and let be a permutation of..,n consisting of a unique cycle of length n. Deduce from the previous question that there exists i e (1,..., n) such that i +c() )+22(n1). 1, and let σ be a permutation of {1, , n). Recall...

  • OTO (7) (a) Let T = (a1, ..., ak) be a k-cycle in Sn, and let...

    OTO (7) (a) Let T = (a1, ..., ak) be a k-cycle in Sn, and let o E Sn. Prove that is the k-cycle (o(a), o(az),..., 0(ak)) (b) Let o,t e Sn. Prove that if t is a product of r pairwise disjoint cycles of lengths k1,..., kr, respectively, where kit..., +kr = n, then oto-1 is also a product of r pairwise disjoint cycles of lengths k1,..., kr. (c) Let T1 and T2 be permutations in Sn. Prove that...

  • (1) Let f : [n] [n] be a permutation. A fixed point of f is an element x e [n] such that f(x) - x...

    (1) Let f : [n] [n] be a permutation. A fixed point of f is an element x e [n] such that f(x) - x. Now consider random permutations of [n] and let X be the random variable which represents the number of fixed points of a given permutation. (a) What is the probability that X 0? (b) What is the probability that X-n -2? (c) What is the probability that X-n-1? (d) What is the expectation of X? (Hint:...

  • Please answer by mathematical language: An array of n elements is almost sorted if and only...

    Please answer by mathematical language: An array of n elements is almost sorted if and only if every element is at most k spots away from its actual location. Assuming that you can only perform pairwise comparisons, formally prove that any algorithm which can sort almost sorted arrays must have running time Ω(n log k), You may assume that n is a multiple of k.

  • Let f [n]n] be a permutation. A fixed point of f is an element x e [n] such that f(x)-x. Now cons...

    Let f [n]n] be a permutation. A fixed point of f is an element x e [n] such that f(x)-x. Now consider random permutations of [n] and let X be the random variable which represents the number of fixed points of a given permutation. (a) What is the probability that X 0? (b) What is the probability that X 2? (c) What is the probability that X--1? (d) What is the expectation of X? (Hint: As usual, express X as...

  • Question 8: For any integer n 20 and any real number x with 0

    Question 8: For any integer n 20 and any real number x with 0<<1, define the function (Using the ratio test from calculus, it can be shown that this infinite series converges for any fixed integer n.) Determine a closed form expression for Fo(x). (You may use any result that was proven in class.) Let n 21 be an integer and let r be a real number with 0<< 1. Prove that 'n-1(2), n where 1 denotes the derivative of...

  • 2 6. Let n E N and z E C with |c| 1 and z2nメ-1. Prove that 122n

    2 6. Let n E N and z E C with |c| 1 and z2nメ-1. Prove that 122n 2 6. Let n E N and z E C with |c| 1 and z2nメ-1. Prove that 122n

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT