140 likes | 254 Views
Problem 1 Solution. (a) True (b) True (c) False (d) False (e) False (f) True (g) False. (h) False ( i ) True (j) True. Problem 2 Solution. (a) 5 (b) 2T - 1 (c) 4T - 4 (d) 4T - 4. Problem 3 Solution. (a) map(t) if t.A < 10 emit(0, t) Reduce(key, val ) for each v in val
E N D
Problem 1 Solution • (a) True • (b) True • (c) False • (d) False • (e) False • (f) True • (g) False • (h) False • (i) True • (j) True
Problem 2 Solution • (a) 5 • (b) 2T - 1 • (c) 4T - 4 • (d) 4T - 4
Problem 3 Solution • (a) map(t) if t.A < 10 emit(0, t) Reduce(key, val) for each v in val emit(v)
Problem 3 Solution • (b) map(t) emit(t.B, t.B) Reduce(key, val) emit(“X”, key)
Problem 3 Solution • (c) map(t) emit(t.B, t) Reduce(key, val) for each r in val for each s in val if r.rel=“R” and s.rel=“S” emit(“X”, r.A, r.B, s.C)
Problem 4 Solution • (b)
Problem 4 Solution • (c)
Problem 5 Solution • (a) G1 • G2
Problem 5 Solution • (b)
Problem 6 Solution • (a) N33 • (b) N1 • (c)
Problem 6 Solution • (d)
Problem 6 Solution • (e)
Problem 6 Solution • (f)
Problem 7 Solution • Blank 1 MyState.diam := w.diam • Blank 2 MyState.dist := w.dist + 1 • Blank 3 MyState.thru:= f • Blank 4 if MyState.dist > MyState.diam then MyState.diam := MyState.dist