Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 154, Lecture 6: Communication Complexity

Similar presentations


Presentation on theme: "CS 154, Lecture 6: Communication Complexity"โ€” Presentation transcript:

1 CS 154, Lecture 6: Communication Complexity
TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA

2 Communication Complexity
A model capturing one aspect of distributed computing. Here focus on two parties: Alice and Bob Function f : {0,1}* ๏‚ด {0,1}* ๏‚ฎ {0,1} Two inputs, ๐‘ฅ โˆˆ {0,1}* and ๐‘ฆ โˆˆ {0,1}* We assume |๐‘ฅ|=|๐‘ฆ|=๐‘›, Think of ๐‘› as HUGE Alice only knows ๐‘ฅ, Bob only knows ๐‘ฆ Goal: Compute f(๐‘ฅ, ๐‘ฆ) by communicating as few bits as possible between Alice and Bob We do not count computation cost. We only care about the number of bits communicated.

3 Alice and Bob Have a Conversation
f(x,y)=0 f(x,y)=0 A(x,ฮต) = 0 B(y,0) = 1 A(x,01) = 1 B(y,011) = 0 A(x,0110) = STOP x y In every step: A bit is sent, which is a function of the partyโ€™s input and all the bits communicated so far. Communication cost = number of bits communicated = 4 (in the example) We assume Alice and Bob alternate in communicating, and the last bit sent is ๐‘“(x,y) More sophisticated models: separate number of rounds from number of bits

4 Def. A protocol for a function f is a pair of functions A, B : {0,1}
Def. A protocol for a function f is a pair of functions A, B : {0,1}* ร— {0,1}* ๏ƒ  {0, 1, STOP} with the semantics: On input (๐‘ฅ, ๐‘ฆ), let ๐‘Ÿ := 0, ๐‘ 0 = ฮต While ( ๐‘ ๐‘Ÿ โ‰  STOP), ๐‘Ÿ++ If ๐‘Ÿ is odd, Alice sends ๐‘ ๐‘Ÿ = ๐ด ๐‘ฅ, ๐‘ 1 โ‹ฏ ๐‘ ๐‘Ÿโˆ’1 else Bob sends ๐‘ ๐‘Ÿ =๐ต ๐‘ฆ, ๐‘ 1 โ‹ฏ ๐‘ ๐‘Ÿโˆ’1 Output ๐‘ ๐‘Ÿโˆ’1 . Number of rounds = ๐‘Ÿโˆ’1

5 Def. The cost of a protocol P for f on ๐‘›-bit strings is ๐‘š๐‘Ž๐‘ฅ ๐‘ฅ, ๐‘ฆ โˆˆ 0,1 ๐‘› [number of rounds in P to compute f(๐‘ฅ,๐‘ฆ)] The communication complexity of f on ๐‘›-bit strings is the minimum cost over all protocols for f on ๐‘›-bit strings = the minimum number of rounds used by any protocol that computes f(๐‘ฅ,๐‘ฆ), over all ๐‘›-bit ๐‘ฅ,๐‘ฆ

6 Example. Let f : {0,1}* ร— {0,1}* ๏ƒ  {0,1} be arbitrary
There is always a โ€œtrivialโ€ protocol: Alice sends the bits of her ๐‘ฅ in odd rounds Bob sends the bits of his ๐‘ฆ in even rounds After 2๐‘› rounds, they both know each otherโ€™s input! The communication complexity of every f is at most 2๐‘›

7 Example: PARITY(๐‘ฅ,๐‘ฆ) = ๐‘– ๐‘ฅ ๐‘– + ๐‘– ๐‘ฆ ๐‘– mod 2.
Whatโ€™s a good protocol for computing PARITY? Alice sends ๐‘ 1 = ( ๐‘– ๐‘ฅ ๐‘– mod 2) Bob sends ๐‘ 2 = ( ๐‘ ๐‘– ๐‘ฆ ๐‘– mod 2). Alice stops. The communication complexity of PARITY is 2

8 Example: MAJORITY(๐‘ฅ,๐‘ฆ) = most frequent bit in ๐‘ฅ๐‘ฆ
Whatโ€™s a good protocol for computing MAJORITY? Alice sends ๐‘ ๐‘ฅ = number of 1s in ๐‘ฅ Bob computes ๐‘ ๐‘ฆ = number of 1s in ๐‘ฆ, sends 1 iff ๐‘ ๐‘ฅ + ๐‘ ๐‘ฆ is greater than (|x|+|y|)/2 = ๐‘› Communication complexity of MAJORITY is O(log ๐‘›)

9 Example: EQUALS(๐‘ฅ,๐‘ฆ) = 1 โ‡” ๐‘ฅ = ๐‘ฆ
Whatโ€™s a good protocol for computing EQUALS ??? Communication complexity of EQUALS is at most 2๐‘›

10 Connection to Streaming and DFAs
Let ๐ฟ โŠ† {0,1}* Def. ๐‘“ ๐ฟ : {0,1}*ร—{0,1}*๏ƒ  {0,1} for ๐‘ฅ,๐‘ฆ with |๐‘ฅ|=|๐‘ฆ| as: ๐‘“ ๐ฟ ๐‘ฅ,๐‘ฆ =1โ‡” ๐‘ฅ๐‘ฆโˆˆ๐ฟ x y Examples: ๐ฟ = { x | x has an odd number of 1s} โ‡’ ๐‘“ ๐ฟ ๐‘ฅ,๐‘ฆ = PARITY(x,y) = ๐‘– ๐‘ฅ ๐‘– ๐‘– ๐‘ฆ ๐‘– mod 2 ๐ฟ = { x | x has more 1s than 0s} โ‡’ ๐‘“ ๐ฟ ๐‘ฅ,๐‘ฆ = MAJORITY(x,y) ๐ฟ = { xx | x โˆˆ {0,1}*} โ‡’ ๐‘“ ๐ฟ ๐‘ฅ,๐‘ฆ = EQUALS(x,y)

11 Connection to Streaming and DFAs
Let ๐ฟ โŠ† {0,1}* Def. ๐‘“ ๐ฟ : {0,1}*ร—{0,1}*๏ƒ  {0,1} for ๐‘ฅ,๐‘ฆ with |๐‘ฅ|=|๐‘ฆ| as: ๐‘“ ๐ฟ ๐‘ฅ,๐‘ฆ =1โ‡” ๐‘ฅ๐‘ฆโˆˆ๐ฟ x y Theorem: If ๐ฟ has a streaming algorithm using โ‰ค ๐‘  space, then the comm. complexity of ๐‘“ ๐ฟ is at most O(๐‘ ). Proof: Alice runs streaming algorithm A on ๐‘ฅ Sends the memory content of A: this is ๐‘  bits of space Bob starts up A with that memory content, runs A on ๐‘ฆ. Gets an output bit, sends to Alice.

12 Connection to Streaming and DFAs
Let ๐ฟ โŠ† {0,1}* Def. ๐‘“ ๐ฟ ๐‘ฅ,๐‘ฆ =1โ‡” ๐‘ฅ๐‘ฆโˆˆ๐ฟ Theorem: If ๐ฟ has a streaming algorithm using โ‰ค ๐‘  space, then the comm. complexity of ๐‘“ ๐ฟ is at most O(๐‘ ). Corollary: For every regular language ๐ฟ, the comm. complexity of ๐‘“ ๐ฟ is O(1). Example: Comm. Complexity of PARITY is O(1) Corollary: Comm. Complexity of MAJORITY is O(log n), because thereโ€™s a streaming algorithm for {x : x has more 1โ€™s than 0โ€™s} with O(log n) space What about the Comm. Complexity of EQUALS?

13 Communication Complexity of EQUALS
Theorem: The comm. complexity of EQUALS is ฮ˜(๐‘›). In particular, every protocol for EQUALS needs โ‰ฅ๐‘› bits of communication. No communication protocol can do much better than โ€œsend your whole inputโ€! Corollary: ๐ฟ = {ww | w in {0,1}*} is not regular. Moreover, every streaming algorithm for ๐ฟ needs ๐‘ ๐‘› bits of memory, for some constant ๐‘ > 0

14 Communication Complexity of EQUALS
Theorem: The comm. complexity of EQUALS is ฮ˜(๐‘›). In particular, every protocol for EQUALS needs โ‰ฅ๐‘› bits of communication. Idea: Consider all possible ways A & B can communicate. Definition: The communication pattern of a protocol on inputs (๐‘ฅ,๐‘ฆ) is the sequence of bits that Alice & Bob send. Pattern: 0110

15 Communication Complexity of EQUALS
Theorem: The communication complexity of EQUALS is ฮ˜(๐‘›). In particular, every protocol for EQUALS needs โ‰ฅ๐‘› bits of communication. Proof: By contradiction. Suppose CC of EQUALS is โ‰ค๐‘›โˆ’1. Then there are โ‰ค 2 ๐‘›โˆ’1 possible communication patterns of that protocol, over all pairs of inputs (๐‘ฅ,๐‘ฆ) with n bits each. Claim: There are ๐‘ฅ โ‰ ๐‘ฆ such that on (๐‘ฅ,๐‘ฅ) and on (๐‘ฆ,๐‘ฆ), the protocol uses the same pattern ๐‘ƒ. Now, what is the communication pattern on (๐‘ฅ,๐‘ฆ)? This pattern is also ๐‘ƒ (WHY?) So Alice & Bob output the same bit on (๐‘ฅ,๐‘ฆ) and (๐‘ฅ,๐‘ฅ). But EQUALS(๐‘ฅ,๐‘ฆ) = 0 and EQUALS(๐‘ฅ,๐‘ฅ) = 1. Contradiction!

16 Randomized Protocols Help!
EQUALS needs ๐‘ ๐‘› bits of communication, butโ€ฆ Theorem: For all ๐‘ฅ,๐‘ฆ of ๐‘› bits each, there is a randomized protocol for EQUALS ๐‘ฅ,๐‘ฆ using only O(log ๐‘›) bits of communication, which works with probability 99.9%! Use Error Correcting Codes โ€ฆ E.g: Alice picks a random prime number p between 2 and n^2. She sends p and her string x modulo p. This is a number between 0 and n^2, takes O(log n) bits to send. Bob checks whether y = x modulo p. Sends output bit. Why does it work (with high probability)?

17 Randomness โ€“ could be a useful resource of computation (II) Questions?
Communication Complexity: Powerful Tool (we seen just a tiny demonstration). Communication Complexity, Streaming Algorithms and Regular languages โ€“ connected. Randomness โ€“ could be a useful resource of computation (II) Questions? TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA


Download ppt "CS 154, Lecture 6: Communication Complexity"

Similar presentations


Ads by Google