Docsity

Algorithms - Homework 4 Solutions | COM SCI 0280D, Assignments of Algorithms and Programming

Toggle sidebar
bg1
Jeffrey Hellrung
Wednesday, May 02, 2007
Com Sci 280D, HW 4
1. Exercise 5.2: Consider a synchronous system in which processors fail by clean crashes, that is, in a
round, a processor either sends all its messages or none. Design an algorithm that solves the consensus
problem in one round.
Solution
A similar algorithm as before works; that is, in the first round, all processors send their inputs to all
other processors. Due to the clean failure of faulty processors, each non-faulty processor will receive
the same set of messages, hence each non-faulty processor can choose to output the minimal input
received, and all will choose the same output.
1
pf3

Partial preview of the text

Download Algorithms - Homework 4 Solutions | COM SCI 0280D and more Assignments Algorithms and Programming in PDF only on Docsity!

Wednesday, May 02, 2007 Com Sci 280D, HW 4

  1. Exercise 5.2: Consider a synchronous system in which processors fail by clean crashes, that is, in a round, a processor either sends all its messages or none. Design an algorithm that solves the consensus problem in one round. Solution A similar algorithm as before works; that is, in the first round, all processors send their inputs to all other processors. Due to the clean failure of faulty processors, each non-faulty processor will receive the same set of messages, hence each non-faulty processor can choose to output the minimal input received, and all will choose the same output.

Wednesday, May 02, 2007 Com Sci 280D, HW 4

  1. Use the BG simulation (the one with agreement on every read statement) to show that there is no read-write code to get consensus among 100 processors with just one failure. I.e., the purported code guarantees consensus in all runs in which 99 processors take infinitely many steps. Solution The idea is to use a reduction to asynchronous wait-free consensus between 2 processors, which is not solvable. Each processor p 0 and p 1 each simulate all 100 processors via the BG simulation. If one of these two simulating processors fails, it fails while executing the code on some simulated processor, so, in effect, that single simulated processor fails, and the other simulating processor can continue to simulate the remaining non-faulty simulated processors, and eventually arrive at consensus. This is a contradiction. [The entire proof is outlined in detail in the book, Section 5.3.]