CS September 2018

Similar documents
EE1000 Project 4 Digital Volt Meter

b. How many ternary words of length 23 with eight 0 s, nine 1 s and six 2 s?

Seven-Segment Display Driver

, each of which is a tree, and whose roots r 1. , respectively, are children of r. Data Structures & File Management

Outline. Binary Tree

ECE COMBINATIONAL BUILDING BLOCKS - INVEST 13 DECODERS AND ENCODERS

Constructive Geometric Constraint Solving

Outline. Computer Science 331. Computation of Min-Cost Spanning Trees. Costs of Spanning Trees in Weighted Graphs

0.1. Exercise 1: the distances between four points in a graph

Present state Next state Q + M N

Module graph.py. 1 Introduction. 2 Graph basics. 3 Module graph.py. 3.1 Objects. CS 231 Naomi Nishimura

An undirected graph G = (V, E) V a set of vertices E a set of unordered edges (v,w) where v, w in V

1 Introduction to Modulo 7 Arithmetic

CSE 373: More on graphs; DFS and BFS. Michael Lee Wednesday, Feb 14, 2018

QUESTIONS BEGIN HERE!

3/4/14. Today's Lecture Distributed Systems. Why Global Timing? Impact of Clock Synchronization. Time Standards. Replicated Database Update

Multipoint Alternate Marking method for passive and hybrid performance monitoring

Graphs. Graphs. Graphs: Basic Terminology. Directed Graphs. Dr Papalaskari 1

Why the Junction Tree Algorithm? The Junction Tree Algorithm. Clique Potential Representation. Overview. Chris Williams 1.

Math 61 : Discrete Structures Final Exam Instructor: Ciprian Manolescu. You have 180 minutes.

Outline. 1 Introduction. 2 Min-Cost Spanning Trees. 4 Example

S i m p l i f y i n g A l g e b r a SIMPLIFYING ALGEBRA.

Cycles and Simple Cycles. Paths and Simple Paths. Trees. Problem: There is No Completely Standard Terminology!

(2) If we multiplied a row of B by λ, then the value is also multiplied by λ(here lambda could be 0). namely

QUESTIONS BEGIN HERE!

CS 241 Analysis of Algorithms

Solutions for HW11. Exercise 34. (a) Use the recurrence relation t(g) = t(g e) + t(g/e) to count the number of spanning trees of v 1

Similarity Search. The Binary Branch Distance. Nikolaus Augsten.

12/3/12. Outline. Part 10. Graphs. Circuits. Euler paths/circuits. Euler s bridge problem (Bridges of Konigsberg Problem)

Graphs. CSC 1300 Discrete Structures Villanova University. Villanova CSC Dr Papalaskari

5/9/13. Part 10. Graphs. Outline. Circuits. Introduction Terminology Implementing Graphs

Last time: introduced our first computational model the DFA.

# 1 ' 10 ' 100. Decimal point = 4 hundred. = 6 tens (or sixty) = 5 ones (or five) = 2 tenths. = 7 hundredths.

COMP108 Algorithmic Foundations

More Foundations. Undirected Graphs. Degree. A Theorem. Graphs, Products, & Relations

Garnir Polynomial and their Properties

CSC Design and Analysis of Algorithms. Example: Change-Making Problem

CSE 373. Graphs 1: Concepts, Depth/Breadth-First Search reading: Weiss Ch. 9. slides created by Marty Stepp

Problem solving by search

Designing A Concrete Arch Bridge

10/30/12. Today. CS/ENGRD 2110 Object- Oriented Programming and Data Structures Fall 2012 Doug James. DFS algorithm. Reachability Algorithms

learning objectives learn what graphs are in mathematical terms learn how to represent graphs in computers learn about typical graph algorithms

Outline. Circuits. Euler paths/circuits 4/25/12. Part 10. Graphs. Euler s bridge problem (Bridges of Konigsberg Problem)

Section 3: Antiderivatives of Formulas

Paths. Connectivity. Euler and Hamilton Paths. Planar graphs.

CSE 373: AVL trees. Warmup: Warmup. Interlude: Exploring the balance invariant. AVL Trees: Invariants. AVL tree invariants review

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)}

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)}

Organization. Dominators. Control-flow graphs 8/30/2010. Dominators, control-dependence. Dominator relation of CFGs

Planar Upward Drawings

Page 1. Question 19.1b Electric Charge II Question 19.2a Conductors I. ConcepTest Clicker Questions Chapter 19. Physics, 4 th Edition James S.

Weighted graphs -- reminder. Data Structures LECTURE 15. Shortest paths algorithms. Example: weighted graph. Two basic properties of shortest paths

Overview. Usages of Fault Simulators. Problem and Motivation. Alternatives and Their Limitations. VLSI Design Verification and Testing

COMPLEXITY OF COUNTING PLANAR TILINGS BY TWO BARS

Exam 1 Solution. CS 542 Advanced Data Structures and Algorithms 2/14/2013

Using the Printable Sticker Function. Using the Edit Screen. Computer. Tablet. ScanNCutCanvas

Announcements. Not graphs. These are Graphs. Applications of Graphs. Graph Definitions. Graphs & Graph Algorithms. A6 released today: Risk

Walk Like a Mathematician Learning Task:

CS 461, Lecture 17. Today s Outline. Example Run

CSE303 - Introduction to the Theory of Computing Sample Solutions for Exercises on Finite Automata

Decimals DECIMALS.

CS200: Graphs. Graphs. Directed Graphs. Graphs/Networks Around Us. What can this represent? Sometimes we want to represent directionality:

Graph Isomorphism. Graphs - II. Cayley s Formula. Planar Graphs. Outline. Is K 5 planar? The number of labeled trees on n nodes is n n-2

12. Traffic engineering

Winter 2016 COMP-250: Introduction to Computer Science. Lecture 23, April 5, 2016

Integration Continued. Integration by Parts Solving Definite Integrals: Area Under a Curve Improper Integrals

UNCORRECTED SAMPLE PAGES 4-1. Naming fractions KEY IDEAS. 1 Each shape represents ONE whole. a i ii. b i ii

INTEGRALS. Chapter 7. d dx. 7.1 Overview Let d dx F (x) = f (x). Then, we write f ( x)

ECE 407 Computer Aided Design for Electronic Systems. Circuit Modeling and Basic Graph Concepts/Algorithms. Instructor: Maria K. Michael.

5/7/13. Part 10. Graphs. Theorem Theorem Graphs Describing Precedence. Outline. Theorem 10-1: The Handshaking Theorem

Jonathan Turner Exam 2-10/28/03

Module 2 Motion Instructions

Algorithmic and NP-Completeness Aspects of a Total Lict Domination Number of a Graph

Compression. Compression. Compression. This part of the course... Ifi, UiO Norsk Regnesentral Vårsemester 2005 Wolfgang Leister

DUET WITH DIAMONDS COLOR SHIFTING BRACELET By Leslie Rogalski

Tangram Fractions Overview: Students will analyze standard and nonstandard

Section 10.4 Connectivity (up to paths and isomorphism, not including)

Evans, Lipson, Wallace, Greenwood

FSA. CmSc 365 Theory of Computation. Finite State Automata and Regular Expressions (Chapter 2, Section 2.3) ALPHABET operations: U, concatenation, *

Weighted Graphs. Weighted graphs may be either directed or undirected.

SAMPLE PAGES. Primary. Primary Maths Basics Series THE SUBTRACTION BOOK. A progression of subtraction skills. written by Jillian Cockings

16.unified Introduction to Computers and Programming. SOLUTIONS to Examination 4/30/04 9:05am - 10:00am

Round 7: Graphs (part I)

Polygons POLYGONS.

CS61B Lecture #33. Administrivia: Autograder will run this evening. Today s Readings: Graph Structures: DSIJ, Chapter 12

Chapter 16. 1) is a particular point on the graph of the function. 1. y, where x y 1

TIME AND STATE IN DISTRIBUTED SYSTEMS

XML and Databases. Outline. Recall: Top-Down Evaluation of Simple Paths. Recall: Top-Down Evaluation of Simple Paths. Sebastian Maneth NICTA and UNSW

Math 166 Week in Review 2 Sections 1.1b, 1.2, 1.3, & 1.4

Instructions for Section 1

Trees as operads. Lecture A formalism of trees

Announcements. These are Graphs. This is not a Graph. Graph Definitions. Applications of Graphs. Graphs & Graph Algorithms

MAT3707. Tutorial letter 201/1/2017 DISCRETE MATHEMATICS: COMBINATORICS. Semester 1. Department of Mathematical Sciences MAT3707/201/1/2017

Register Allocation. Register Allocation. Principle Phases. Principle Phases. Example: Build. Spills 11/14/2012

The Plan. Honey, I Shrunk the Data. Why Compress. Data Compression Concepts. Braille Example. Braille. x y xˆ

Aquauno Video 6 Plus Page 1

In order to learn which questions have been answered correctly: 1. Print these pages. 2. Answer the questions.

The Procedure Abstraction Part II: Symbol Tables and Activation Records

AIR FORCE STANDARD DESIGN MILITARY WORKING DOG FACILITY

COMP 250. Lecture 29. graph traversal. Nov. 15/16, 2017

Transcription:

Loil los Distriut Systms 06. Loil los Assin squn numrs to msss All ooprtin prosss n r on orr o vnts vs. physil los: rport tim o y Assum no ntrl tim sour Eh systm mintins its own lol lo No totl orrin o vnts No onpt o hppn-whn Pul Krzyznowsi Rutrs Univrsity Fll 207 Assum multipl tors (prosss) Eh pross hs uniqu ID Eh pross hs its own inrmntin ountr 2 Hppn-or Lmport s hppn-or nottion vnt hppn or vnt..: : mss in snt, : mss ript Trnsitiv: i n thn Loil los & onurrny Assin lo vlu to h vnt i thn lo() < lo() sin tim nnot run wrs I n our on irnt prosss tht o not xhn msss, thn nithr nor r tru Ths vnts r onurrnt Othrwis, thy r usl 3 4 Thr systms: P 0, P, Evnts,,, Lol vnt ountr on h systm Systms osionlly ommunit P 2 2 3 2 5 6 Pul Krzyznowsi

Lmport s lorithm Eh mss rris timstmp o th snr s lo P 2 2 3 2 Whn mss rrivs: i rivr s lo < mss_timstmp st systm lo to (mss_timstmp + ) ls o nothin B orrin: à h ut 5 2 à ut 6 2 Clo must vn twn ny two vnts in th sm pross 7 8 Lmport s lorithm Alorithm llows us to mintin tim orrin mon rlt vnts Prtil orrin Applyin Lmport s lorithm P 2 2 6 7 2 7 W hv oo orrin whr w us to hv orrin: à h n 5 < 6 à n 6 < 7 9 0 Summry Alorithm ns monotonilly inrsin sotwr ountr Inrmnt t lst whn vnts tht n to timstmp our Eh vnt hs Lmport timstmp tth to it For ny two vnts, whr : L() < L() Prolm: Intil timstmps P 2,, : lol vnts squn i,,, : 6 7 Lmport imposs sn riv rltionship Conurrnt vnts (.., & ; i & ) my hv th sm timstmp or not 7 2 Pul Krzyznowsi 2

Uniqu timstmps (totl orrin) Uniqu (totlly orr) timstmps W n or h timstmp to uniqu Din lol loil timstmp (T i, i) T i rprsnts lol Lmport timstmp i rprsnts pross numr (lolly uniqu).., (host rss, pross ID) Compr timstmps: (T i, i) < (T, ) i n only i T i < T or T i = T n i < P. 2..3 3. 4. 5. 6..2 6.2 7.2 7.3 Dos not nssrily rlt to tul vnt orrin 3 4 Prolm: Dttin usl rltions I L() < L( ) W nnot onlu tht Exmpl Group o prosss: Ali, Bo, Ciny, Dvi Thy onurrntly moiy on ot: wht shoul w t? Eh pross ps lol ountr By looin t Lmport timstmps W nnot onlu whih vnts r uslly rlt Ali writs th vlu & sns to roup Ali: Pizz To Bo To Ciny To Dvi Solution: us vtor lo Vtor los r wy to prov th squn o vnts t pin vrsion history s on h pross tht m hns to n ot Bo rs ("Pizz", <li:>), moiis th vlu & sns to roup To Ali Ali:, Bo: Chins Bo s vrsion upts Ali s To Ciny To Dvi Rivr <li:, o:> is usl to & ollows <li: > Ali rs ("Chins", <li:, o:>), moiis th vlu & sns to roup To Bo Ali: 2, Bo: Rivr To Ciny <li: 2, o:> is usl to & Moron ollows <li:, o:> To Dvi Ali ms hns ovr Bo s 5 6 Exmpl Vtor los Ciny moiis & sns to roup Ali: 2, Bo:, Ciny: Thi Bo onurrntly moiis & sns to roup Ali: 2, Bo: 2 Chins To Ali To Bo To Dvi To Ali To Ciny To Dvi Ciny & Bo s hns r onurrnt mmrs must rsolv onlit Rivr <li: 2, o:, iny:> is onurrnt with <li:, o:2> Ruls:. Vtor initiliz to 0 t h pross V i [ ] = 0 or i, =,, N 2. Pross inrmnts its lmnt o th vtor in lol vtor or timstmpin vnt: V i [ i ] = Vi [ i ] + 3. Mss is snt rom pross P i with V i tth to it 4. Whn P rivs mss, omprs vtors lmnt y lmnt n sts lol vtor to hihr o two vlus V [ i ] = mx(v i [ i ], V [ i ]) or I =,, N For xmpl, riv: [ 0, 5, 2, ], hv: [ 2, 8, 0, ] nw timstmp: [ 2, 8, 2, ] 7 8 Pul Krzyznowsi 3

Comprin vtor timstmps Vtor timstmps Din V = V i V [ i ] = V [ i ] V V i V [ i ] V [ i ] or i = N or i = N P For ny two vnts, i thn V() < V( ) ust li Lmport s lorithm i V() < V( ) thn Two vnts r onurrnt i nithr V() V( ) nor V( ) V() 9 20 Vtor timstmps Vtor timstmps (,0,0) P (,0,0) P Evnt timstmp (,0,0) Evnt timstmp (,0,0) 2 22 Vtor timstmps Vtor timstmps (,0,0) P (2,,0) (,0,0) P (2,,0) (2,2,0) Evnt timstmp (,0,0) (2,,0) Evnt timstmp (,0,0) (2,,0) (2,2,0) 23 24 Pul Krzyznowsi 4

Vtor timstmps (,0,0) P (0,0,) (2,,0) (2,2,0) Vtor timstmps (,0,0) P (2,,0) (2,2,0) (0,0,) (2,2,2) Evnt timstmp (,0,0) (2,,0) (2,2,0) (0,0,) Evnt timstmp (,0,0) (2,,0) (2,2,0) (0,0,) (2,2,2) 25 26 Vtor timstmps (,0,0) P (2,,0) (2,2,0) (0,0,) (2,2,2) Vtor timstmps (,0,0) P (2,,0) (2,2,0) (0,0,) (2,2,2) Evnt timstmp (,0,0) (2,,0) (2,2,0) (0,0,) (2,2,2) onurrnt vnts Evnt timstmp (,0,0) (2,,0) (2,2,0) (0,0,) (2,2,2) onurrnt vnts 27 28 Vtor timstmps (,0,0) P (2,,0) (2,2,0) (0,0,) (2,2,2) Vtor timstmps (,0,0) P (2,,0) (2,2,0) (0,0,) (2,2,2) Evnt timstmp (,0,0) (2,,0) (2,2,0) (0,0,) (2,2,2) onurrnt vnts Evnt timstmp (,0,0) (2,,0) (2,2,0) (0,0,) (2,2,2) onurrnt vnts 29 30 Pul Krzyznowsi 5

Gnrlizin Vtor Timstmps A vtor n list o tupls: For prosss P,,, Eh pross hs lolly uniqu Pross ID, P i (.., MAC_rss:PID) Eh pross mintins its own timstmp: T P, T P2, Vtor: { <P, T P >, <, T P2 >, <, T P3 >, } Any on pross my hv only prtil nowl o othrs Nw timstmp or riv mss: Compr ll mthin sts o pross IDs: st to hihst o vlus Any non-mth <P, T> sts t to th timstmp For hppn-or rltion: At lst on st o pross IDs must ommon to oth timstmps Mth ll orrsponin <P, T> sts: A:<P i, T >, B:<P i, T > I T T or ll ommon prosss P, thn A B Vtor Clos Summry Vtor los iv us wy o intiyin whih vnts r uslly rlt W r urnt to t th squnin orrt But Th siz o th vtor inrss with mor tors n th ntir vtor must stor with th t. Comprison ts mor tim thn omprin two numrs Wht i msss r onurrnt? App will hv to i how to hnl onlits 3 32 Summry: Loil Clos & Prtil Orrin Cuslity I thn vnt n t vnt Conurrny I nithr nor thn on vnt nnot t th othr Th n Prtil Orrin Cusl vnts r squn Totl Orrin All vnts r squn 33 34 Pul Krzyznowsi 6