data streams random order multiple passes
play

Data Streams: Random Order & Multiple Passes 2009 Barbados - PowerPoint PPT Presentation

Data Streams: Random Order & Multiple Passes 2009 Barbados Workshop on Computational Complexity Andrew McGregor Introduction Random Order Streams: Average case analysis: data is worst-case but order is random. Lower bounds are more


  1. Data Streams: Random Order & Multiple Passes 2009 Barbados Workshop on Computational Complexity Andrew McGregor

  2. Introduction Random Order Streams: ◮ Average case analysis: data is worst-case but order is random. ◮ Lower bounds are more useful than in the adversarial case. ◮ Streams ordered randomly: e.g., space-efficient sampling

  3. Introduction Random Order Streams: ◮ Average case analysis: data is worst-case but order is random. ◮ Lower bounds are more useful than in the adversarial case. ◮ Streams ordered randomly: e.g., space-efficient sampling Multiple Pass Streams: ◮ How much extra power do you get with a few extra passes? ◮ With external data, it’s easier to access data sequentially.

  4. Pass-Space Trade-Offs Problem Given a stream of n values from [ n ] , what’s smallest value that doesn’t appear in stream? You have p passes over the data.

  5. Pass-Space Trade-Offs Problem Given a stream of n values from [ n ] , what’s smallest value that doesn’t appear in stream? You have p passes over the data. ◮ Version 1: All values appear exactly once except for the missing value. ˜ Θ(1)

  6. Pass-Space Trade-Offs Problem Given a stream of n values from [ n ] , what’s smallest value that doesn’t appear in stream? You have p passes over the data. ◮ Version 1: All values appear exactly once except for the missing value. ˜ Θ(1) ◮ Version 2: All values less than smallest missing value appear exactly once Θ( n 1 / p ) ˜

  7. Pass-Space Trade-Offs Problem Given a stream of n values from [ n ] , what’s smallest value that doesn’t appear in stream? You have p passes over the data. ◮ Version 1: All values appear exactly once except for the missing value. ˜ Θ(1) ◮ Version 2: All values less than smallest missing value appear exactly once Θ( n 1 / p ) ˜ ◮ Version 3: General problem, ˜ Θ( n / p )

  8. Pass-Space Trade-Offs Problem Given a stream of n values from [ n ] , what’s smallest value that doesn’t appear in stream? You have p passes over the data. ◮ Version 1: All values appear exactly once except for the missing value. ˜ Θ(1) ◮ Version 2: All values less than smallest missing value appear exactly once Θ( n 1 / p ) ˜ ◮ Version 3: General problem, ˜ Θ( n / p ) Other trade-offs: Find length k increasing sequence given it exists: Θ( k 1+1 / (2 p − 1) ) [Liben-Nowell et al. ’06, Guha, McGregor ’08] ˜

  9. Random Order Streams Problem Given m values from [ n ] , find median in polylog( m , n ) space.

  10. Random Order Streams Problem Given m values from [ n ] , find median in polylog( m , n ) space. Approximate Median (i.e., one with rank m / 2 ± t ) in One Pass: ◮ Adversarial: ˜ Θ( m )-approx [Greenwald, Khanna ’01] ◮ Random: ˜ O ( m 1 / 2 )-approx [Guha, McGregor ’06]

  11. Random Order Streams Problem Given m values from [ n ] , find median in polylog( m , n ) space. Approximate Median (i.e., one with rank m / 2 ± t ) in One Pass: ◮ Adversarial: ˜ Θ( m )-approx [Greenwald, Khanna ’01] ◮ Random: ˜ O ( m 1 / 2 )-approx [Guha, McGregor ’06] Exact Median in Multiple Passes ◮ Adversarial: Θ(log m / log log m ) pass [Munro, Paterson ’78, Guha, McGregor ’07] ◮ Random: Θ(log log m ) pass [Guha, McGregor ’06, Chakrabarti, Jayram, Patrascu ’08, Chakrabarti, Cormode, McGregor ’08]

  12. Selection Adversarial Order Random Order Frequency Moments Hamming Distance

  13. Outline Selection Adversarial Order Random Order Frequency Moments Hamming Distance

  14. Outline Selection Adversarial Order Random Order Frequency Moments Hamming Distance

  15. Algorithms for Median in Adversarial-Order Stream Theorem (Adversarial Order) Can find element of rank m / 2 ± ǫ m in one pass and ˜ O ( ǫ − 1 ) space. Can find median in O (log m / log log m ) passes and ˜ O (1) space.

  16. Algorithms for Median in Adversarial-Order Stream Theorem (Adversarial Order) Can find element of rank m / 2 ± ǫ m in one pass and ˜ O ( ǫ − 1 ) space. Can find median in O (log m / log log m ) passes and ˜ O (1) space. ◮ Already seen one pass result: ◮ Can find elements with rank i ǫ m ± ǫ m for i ∈ [ ǫ − 1 ]

  17. Algorithms for Median in Adversarial-Order Stream Theorem (Adversarial Order) Can find element of rank m / 2 ± ǫ m in one pass and ˜ O ( ǫ − 1 ) space. Can find median in O (log m / log log m ) passes and ˜ O (1) space. ◮ Already seen one pass result: ◮ Can find elements with rank i ǫ m ± ǫ m for i ∈ [ ǫ − 1 ] ◮ For multiple-pass result:

  18. Algorithms for Median in Adversarial-Order Stream Theorem (Adversarial Order) Can find element of rank m / 2 ± ǫ m in one pass and ˜ O ( ǫ − 1 ) space. Can find median in O (log m / log log m ) passes and ˜ O (1) space. ◮ Already seen one pass result: ◮ Can find elements with rank i ǫ m ± ǫ m for i ∈ [ ǫ − 1 ] ◮ For multiple-pass result: ◮ In pass 1, use one pass alg. with ǫ = 1 log m to find a and b s.t. 2 − 2 m 2 + 2 m rank( a ) = m log m and rank( b ) = m m m log m ± log m ± log m

  19. Algorithms for Median in Adversarial-Order Stream Theorem (Adversarial Order) Can find element of rank m / 2 ± ǫ m in one pass and ˜ O ( ǫ − 1 ) space. Can find median in O (log m / log log m ) passes and ˜ O (1) space. ◮ Already seen one pass result: ◮ Can find elements with rank i ǫ m ± ǫ m for i ∈ [ ǫ − 1 ] ◮ For multiple-pass result: ◮ In pass 1, use one pass alg. with ǫ = 1 log m to find a and b s.t. 2 − 2 m 2 + 2 m rank( a ) = m log m and rank( b ) = m m m log m ± log m ± log m ◮ In pass 2, compute rank( a ) and rank( b )

  20. Algorithms for Median in Adversarial-Order Stream Theorem (Adversarial Order) Can find element of rank m / 2 ± ǫ m in one pass and ˜ O ( ǫ − 1 ) space. Can find median in O (log m / log log m ) passes and ˜ O (1) space. ◮ Already seen one pass result: ◮ Can find elements with rank i ǫ m ± ǫ m for i ∈ [ ǫ − 1 ] ◮ For multiple-pass result: ◮ In pass 1, use one pass alg. with ǫ = 1 log m to find a and b s.t. 2 − 2 m 2 + 2 m rank( a ) = m log m and rank( b ) = m m m log m ± log m ± log m ◮ In pass 2, compute rank( a ) and rank( b ) ◮ Recurse on elements in the range ( a , b ).

  21. One Pass Lower Bound Theorem Finding m / 2 ± m δ rank element in 1 pass requires Ω( m 1 − δ ) space.

  22. One Pass Lower Bound Theorem Finding m / 2 ± m δ rank element in 1 pass requires Ω( m 1 − δ ) space. ◮ index Reduction: Alice has x ∈ { 0 , 1 } t , Bob has j ∈ [ t ]

  23. One Pass Lower Bound Theorem Finding m / 2 ± m δ rank element in 1 pass requires Ω( m 1 − δ ) space. ◮ index Reduction: Alice has x ∈ { 0 , 1 } t , Bob has j ∈ [ t ] ◮ Alice constructs A = { 2 i + x i : i ∈ [ t ] }

  24. One Pass Lower Bound Theorem Finding m / 2 ± m δ rank element in 1 pass requires Ω( m 1 − δ ) space. ◮ index Reduction: Alice has x ∈ { 0 , 1 } t , Bob has j ∈ [ t ] ◮ Alice constructs A = { 2 i + x i : i ∈ [ t ] } ◮ Bob constructs B = { t − j copies of 0 , j − 1 copies of 2 t + 2 }

  25. One Pass Lower Bound Theorem Finding m / 2 ± m δ rank element in 1 pass requires Ω( m 1 − δ ) space. ◮ index Reduction: Alice has x ∈ { 0 , 1 } t , Bob has j ∈ [ t ] ◮ Alice constructs A = { 2 i + x i : i ∈ [ t ] } ◮ Bob constructs B = { t − j copies of 0 , j − 1 copies of 2 t + 2 } ◮ Median of the 2 t − 1 values is 2 j + x j

  26. One Pass Lower Bound Theorem Finding m / 2 ± m δ rank element in 1 pass requires Ω( m 1 − δ ) space. ◮ index Reduction: Alice has x ∈ { 0 , 1 } t , Bob has j ∈ [ t ] ◮ Alice constructs A = { 2 i + x i : i ∈ [ t ] } ◮ Bob constructs B = { t − j copies of 0 , j − 1 copies of 2 t + 2 } ◮ Median of the 2 t − 1 values is 2 j + x j ◮ ∴ Exact median requires Ω( t ) = Ω( m ) space.

  27. One Pass Lower Bound Theorem Finding m / 2 ± m δ rank element in 1 pass requires Ω( m 1 − δ ) space. ◮ index Reduction: Alice has x ∈ { 0 , 1 } t , Bob has j ∈ [ t ] ◮ Alice constructs A = { 2 i + x i : i ∈ [ t ] } ◮ Bob constructs B = { t − j copies of 0 , j − 1 copies of 2 t + 2 } ◮ Median of the 2 t − 1 values is 2 j + x j ◮ ∴ Exact median requires Ω( t ) = Ω( m ) space. ◮ For approximate result, duplicate each element 2 m δ + 1 times.

  28. One Pass Lower Bound Theorem Finding m / 2 ± m δ rank element in 1 pass requires Ω( m 1 − δ ) space. ◮ index Reduction: Alice has x ∈ { 0 , 1 } t , Bob has j ∈ [ t ] ◮ Alice constructs A = { 2 i + x i : i ∈ [ t ] } ◮ Bob constructs B = { t − j copies of 0 , j − 1 copies of 2 t + 2 } ◮ Median of the 2 t − 1 values is 2 j + x j ◮ ∴ Exact median requires Ω( t ) = Ω( m ) space. ◮ For approximate result, duplicate each element 2 m δ + 1 times. ◮ ∴ Approx median requires Ω( t ) = Ω( m / m δ ) space.

  29. One Pass Lower Bound Theorem Finding m / 2 ± m δ rank element in 1 pass requires Ω( m 1 − δ ) space. ◮ index Reduction: Alice has x ∈ { 0 , 1 } t , Bob has j ∈ [ t ] ◮ Alice constructs A = { 2 i + x i : i ∈ [ t ] } ◮ Bob constructs B = { t − j copies of 0 , j − 1 copies of 2 t + 2 } ◮ Median of the 2 t − 1 values is 2 j + x j ◮ ∴ Exact median requires Ω( t ) = Ω( m ) space. ◮ For approximate result, duplicate each element 2 m δ + 1 times. ◮ ∴ Approx median requires Ω( t ) = Ω( m / m δ ) space. Exercise Prove an algorithm that doesn’t know m in advance requires Ω( m ) space to find median even when the data comes in sorted order.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend