CS300-08_Selection_and_Adversary_arguments - Selection and...

Info icon This preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
Selection and Adversary arguments Sung Yong Shin CS Dept., KAIST
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Avg. 66.1 Std. 30.1 100 ↑ A+ 91~99 A0 88~90 A- 86~87 B+ 80~85 B0 78~79 B- 76~77 C+ 70~75 C0 60~69 C- 50~59 D0 40~49 D- 0~39 F Midterm Result
Image of page 2
Contents 1. Introduction 2. Finding max. and min. 3. Finding the 2th largest key 4. The Selection Problem 5. A lower bound for finding the median
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
1. Introduction SP : (Selection Problem) Given a set of n real numbers, find the k th smallest one, 1 k n . How can you solve it? well, … (1) Sort the numbers. (2) Pick the k th smallest one. O( n log n ) Any better way?
Image of page 4
What is a trivial lower bound in time complexity for solving SP ? T L ( n ) = ( n ) Why? What if only considering comparisons? well, ...
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
P : Given a set S of n real numbers, find the largest one. | W | | L | W = {(?, ?, x 1 ), (?, ?, x 2 ), ···, (?, ?, x n )} | W | = n T L ( n ) = log 2 | W | = log 2 n However, this is not tight !!! Why? n = 3 S = { x 1 , x 2 , x 3 } 1 : 2 L = {1 1 , 1 2 , 1 3 , 1 4 } < > 2 : 3 1 : 3 < > < > 1 1 1 2 1 3 1 4 x 3 x 2 x 3 x 1 ( x 1 , x 2 , x 3 ) (?, ?, x 2 ) ( x 2 , x 1 , x 3 ) (?, ?, x 1 )
Image of page 6
Adversary Arguments Z 1000 = {0, 1, …… , 999} Guess the number in Z 1000 that I have in mind? A Guessing Game !!! You can change your mind as long as your answers(responses) are consistent !!! Maximize the number of leaves in a decision tree.
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2. Finding Max. and Min. MM : Given a set of n real numbers, find max and min. max = the largest number min = the smallest number How can you solve MM ? x 1 x 2 x 3 x 4 …… x 2 n -1 x 2 m n = 2 m W { x 1 1 , x 2 1 , x 3 1 ,……, x m 1 } max L { x 1 2 , x 2 2 , x 3 2 ,……, x m 2 } min How many comparisons? m …… dividing m -1 …… finding max m -1 …… finding min Any better way? 2 2 3 2 3 - = - n m
Image of page 8
What information is needed for finding max and min? Finding max : All numbers except max itself must lose at least once in some comparisons. (n-1 losses) Finding min : All numbers except min itself must win at least once in some comparisons. (n-1 wins) 1 unit of information (1 win) or (1 loss) (2n - 2) units of information are needed !!! max min x 1 x 2 x 3 x 4 x 5 x 6 L L L L L W W W W W
Image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Status of a number ( x i , s i ) Status W at least one win, no lost L at least one lost, no win WL wins and losts N no comparisons Status of keys x and y Units of new compared by an algorithm Adversary response New Status information N,N
Image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern