HW2 comments, questions, or difficulties yet? Questions on past reading or lectures? Review the rushed weird algorithms Introduction to ``lower bounds'': A main general issue in c.s. is to determine just what it takes (what's enough, and what's not) to solve a problem. When we have a hard time improving an algorithm or removing requirements, we also ask whether an *im*possibility can be proved. We may even *oscillate* between work on algorithms and work on rigorous impossibility proofs. Lower bounds on leader election in a ring (incl. one we already did): Anonymous: Can't do it at all, even synchronously, even if know n. Asynchronous, without knowing n: Every such algorithm has rings with executions involving many msgs. Convenient temporary restrictions: Highest uid wins (text's version only) All know winning uid (text's version only) n power of 2 Synchronous, nonuniform, but ``comparison based'': There are rings that are bad for every such algorithm. (Harder for n not power of 2, so omit it.) Synchronous, nonuniform, but time bounded *in terms of just n*: For every algorithm, there are rings that are bad. (Corollary of previous, so omit n not power of 2.) Setting for the asynchronous lower bound: Have an unlimited (say countable) supply of bidirectional, oriented processes such that any asynchronous execution of any correctly oriented, buffered ring of distinct ones elects a unique leader. (``Oriented'': One side labeled ``this side clockwise.'' Distinct: Otherwise, how break symmetry?) Remarks: 1. This *includes* the case of a ``single protocol'' parameterized by uid from an infinite supply. 2. ``Counterexercise'' (Lynch 15.12): Line instead of ring. Theorem: Exists c, forall such setting, forall n, exists ring of size n that has an execution involving at least cn log n messages. Proof: c can be something like 1/8. (1/4 for n power of 2, but deterioration for general n.) But we won't be careful. Enough: Find an oriented ``line'' of each size n that is power of 2, that can (we get to choose schedule) result in enough messages ``internally'' (i.e., regardless of context--note distinction from Lynch 15.12, mentioned above). Do this by induction on the power of 2. Observation: Can always get one such line ==> can get as many as you like. Reason: Residual setting also qualifies. Let's do the induction step. Consider 3 n-process lines, L, M, and N, each of which can generate m internal msgs. (Why *three*? Note that there might be (at most) *one* such line that needs *no* further communication-- e.g., because it knows it includes an extreme uid that always wins.) Wlog, assume the m-msg. executions are maximal. (I.e., no further internal msgs. are possible.) We show that at least one of the 6 properly oriented 2-line concatenations can generate an *additional* n/2 internal msgs. (triggered by additional communication across the ``seam''). (Slightly off? Need only Omega(n).) The resulting recurrence yields the desired Omega(n log n) lower bound. Suppose the conclusion is false. Then each of the possible concatenations has a maximal continuation that involves only the ``half lines'' adjacent to the ``seam.'' (In fact, each has *only* such continuations.) (Draw a picture.) This leads to erroneous leader election in some ring consisting of 2 or 3 of L, M, and N. For example: Note that either N;M or M;N must yield a leader; wlog, say N;M does. Therefore, M;L does not, and L;N does not. Therefore, L;M does, and N;L does. Therefore, N;L;M yields *two* leaders!