CS300-08_Selection_and_Adversary_arguments - Selection and...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

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

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

View Full DocumentRight 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
Background 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
Background image of page 3

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

View Full DocumentRight 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?
Background 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, . ..
Background image of page 5

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

View Full DocumentRight 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 )
Background 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.
Background image of page 7

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

View Full DocumentRight 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
Background image of page 8
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 !!!
Background image of page 9

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

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/04/2010 for the course COMPUTER S cs300 taught by Professor Unkown during the Spring '08 term at Korea Advanced Institute of Science and Technology.

Page1 / 32

CS300-08_Selection_and_Adversary_arguments - Selection and...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online