Download presentation
Presentation is loading. Please wait.
Published byฮฮฝฯ ฯ ฮฯฮฟฯฯฮฟฮปฮฏฮดฮทฯ Modified over 6 years ago
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.