text
stringlengths
1
6.06k
source
stringclasses
375 values
page
int64
0
1.49k
book
stringclasses
375 values
chunk_index
int64
0
0
Characteristics of clustering methods Robustness: sensitivity to noise and outliers, sensitivity to the processing order User interaction: incorporation of user constraints (e.g., number of clusters, max size of clusters), interpretability and usability 7
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
6
09 - Unsupervised learning
0
Example: clusters & outliers x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x xx x x x x x x x x x x x x x x x x x x x x x Outlier Cluster 8
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
7
09 - Unsupervised learning
0
A typical clustering example Note: Above is 2D; real scenarios often much more high-dimensional, e.g., 10,000-dimensional for 100x100 images. 9 Input Output
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
8
09 - Unsupervised learning
0
Some use cases for clustering 10 • Data exploration (especially for high-dimensional data, where visualization fails) • Partitioning of data for more fine-grained subsequent analysis • Marketing: building personas • Supporting data labeling for supervised learning • Supporting feature discretization for supervised lear...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
9
09 - Unsupervised learning
0
Here we don’t require that clusters extract meaningful structure, but that they give a coarse-grained version of the data. Clustering for condensation/compression 11
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
10
09 - Unsupervised learning
0
Beware of “cluster bias”! • Human beings conceptualize the world through categories represented as exemplars (Rosch 1973, Estes 1994). • We tend to see cluster structure whether it is there or not. • Works well for dogs, but... 12
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
11
09 - Unsupervised learning
0
Cluster bias 13
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
12
09 - Unsupervised learning
0
Cluster bias • Clustering is used more than it should be, because people assume an underlying domain has discrete classes in it • Especially true for characteristics of people, e.g., Myers-Briggs personality types like “ENTP”. • In reality the underlying data is often continuous. • In such cases, continuous models (e.g...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
13
09 - Unsupervised learning
0
• Central portion: more of a continuum than discrete clusters • Other methods (e.g., dimensionality reduction) may be more appropriate than discrete clustering models Netflix 15
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
14
09 - Unsupervised learning
0
Terminology • Hierarchical clustering: clusters form a tree-shaped hierarchy. Can be computed bottom-up or top-down. • Flat clustering: no inter-cluster structure. • Hard clustering: items assigned to a unique cluster. • Soft clustering: cluster membership is a probability distribution over all clusters 16
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
15
09 - Unsupervised learning
0
Clustering is a hard problem! 17
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
16
09 - Unsupervised learning
0
Why is it hard? ◼Clustering in 2 dimensions looks easy ◼Clustering small amounts of data looks easy ◼And in these special cases, it actually is often easy, but... ◼... many applications involve not 2, but hundreds or thousands of dimensions (and large amounts of data) ◼High-dimensional spaces are different (“curse of d...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
17
09 - Unsupervised learning
0
Clustering problem: galaxies ◼A catalog of 2 billion “sky objects” represents objects by their radiation in 7 dimensions (frequency bands) ◼Problem: Cluster into similar objects, e.g., galaxies, nearby stars, quasars, etc. ◼Sloan Digital Sky Survey [link] 19
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
18
09 - Unsupervised learning
0
Clustering problem: movies ◼Intuitively: Movies divide into categories/genres, and customers prefer a few categories ▪But what are categories really? ▪—> take a data-driven approach! ◼Represent a movie by a set of customers who watched it (“collaborative filtering”) ◼Similar movies have similar sets of customers, and v...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
19
09 - Unsupervised learning
0
Clustering problem: movies Space of all movies: ◼Think of a space with one dimension for each customer ▪Values in a dimension may be 0 or 1 only ▪A movie is a point in this space (x1, x2,..., xk), where xi = 1 iff the i-th customer watched the movie ◼For Amazon/Netflix, the dimensionality is in the millions ◼Task: Find...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
20
09 - Unsupervised learning
0
Clustering problem: documents Finding topics: ◼Represent a document by a vector (x1, x2,..., xk), where xi = 1 iff the i-th word appears in the document (in any position) ◼Idea: documents with similar sets of words are about same topic 22
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
21
09 - Unsupervised learning
0
Cosine, Jaccard, Euclidean distances ◼In both examples (movies, documents) we have a choice when we thinking of data points as sets of features (users, words): ▪Sets as vectors: • Measure similarity via Euclidean distance • Measure similarity via cosine distance ▪Sets as sets: Measure similarity via Jaccard index 23
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
22
09 - Unsupervised learning
0
24 Overview: Methods of clustering ◼Hierarchical methods: ▪Agglomerative (bottom up): ▪Initially, each point is a cluster ▪Repeatedly combine the two “nearest” clusters into one ▪Divisive (top down): ▪Start with one cluster and recursively split it ◼Flat methods (a.k.a. point assignment methods): ▪Maintain a set of clu...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
23
09 - Unsupervised learning
0
Agglomerative hierarchical clustering ◼Key operation: Repeatedly combine two nearest clusters ◼Three important questions: ▪1) How to represent a cluster of more than one point? ▪2) How to determine the “nearness” of clusters? ▪3) When to stop combining clusters? 25
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
24
09 - Unsupervised learning
0
◼Key operation: Repeatedly combine two nearest clusters ◼(1) How to represent a cluster of many points? ▪Euclidean case: each cluster has a centroid = average of its points ▪What about non-Euclidean case? ◼(2) How to determine “nearness” of clusters? ▪Euclidean case: measure cluster distances by distances of centroids ...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
25
09 - Unsupervised learning
0
Example: Hierarchical clustering 27
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
26
09 - Unsupervised learning
0
Non-Euclidean case: clustroids ◼(1) How to represent a cluster of many points? clustroid = actual data point that is “closest” to the other points ◼Possible meanings of “closest”: ▪Smallest average distance to other points (a.k.a. medoid) ▪Smallest sum of squares of distances to other points ▪Smallest maximum distance ...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
27
09 - Unsupervised learning
0
Defining “nearness” of clusters ◼(2) How do you determine the “nearness” of clusters? ▪Approach 1: Intercluster distance = minimum of the distances between any two points, one from each cluster; or average of distances; or distance between centroids/clustroids; etc. ▪Approach 2: Pick a notion of “cohesion” (“tightness”...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
28
09 - Unsupervised learning
0
Cohesion ◼Approach 2.1: Use the diameter of the merged cluster = maximum distance between points in the merged cluster ◼Approach 2.2: Use the average distance between points in the merged cluster 30
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
29
09 - Unsupervised learning
0
31 How many branching points are there in a dendrogram for a dataset with N data points? POLLING TIME ● Scan QR code or go to https://web.speakup.info/ room/join/66626
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
30
09 - Unsupervised learning
0
Implementation ◼Naïve implementation of hierarchical clustering: ▪At each step, compute pairwise distances between all pairs of clusters, then merge ▪O(N3), where N is the number of data points ◼Careful implementation using priority queue can reduce time to O(N2 log N) ▪Still too expensive for really big datasets 32
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
31
09 - Unsupervised learning
0
33 Overview: Methods of clustering ◼Hierarchical methods: ▪Agglomerative (bottom up): ▪Initially, each point is a cluster ▪Repeatedly combine the two “nearest” clusters into one ▪Divisive (top down): ▪Start with one cluster and recursively split it ◼Flat methods (a.k.a. point assignment methods): ▪Maintain a set of clu...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
32
09 - Unsupervised learning
0
K-means 34 The gorilla among the point-assignment clustering algorithms
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
33
09 - Unsupervised learning
0
●Goal: assign each data point to one of k clusters such that the total distance of points to their centroids is minimized ●Solved by a simple greedy algorithm (Lloyd’s algorithm): Locally minimize the “distance” (usually squared Euclidean distance) from data points to their respective centroids: • Find the closest clus...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
34
09 - Unsupervised learning
0
K-means clustering 36
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
35
09 - Unsupervised learning
0
How long to iterate? • For fixed number of iterations • or until no change in assignments (guaranteed to happen) • or until only small change in cluster “tightness” (sum of [squared] distances from points to centroids) K-means clustering 37
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
36
09 - Unsupervised learning
0
We need to pick some points for the first round of the algorithm: • Random sample: Pick a random subset of k points from the dataset. • K-Means++: Iteratively construct a random sample with good spacing across the dataset. Note: Finding an optimal k-means clustering is NP-hard. The above help avoid bad configurations. ...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
37
09 - Unsupervised learning
0
Start: Choose first cluster center at random from the data points Iterate: • For every remaining data point x, compute the distance D(x) from x to the closest previously selected cluster center. • Choose a remaining point x randomly with probability proportional to D(x)2, and make it a new cluster center. Intuitively, ...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
38
09 - Unsupervised learning
0
K-means properties • Greedy algorithm with random initialization – solution may be suboptimal & vary significantly with different initial points • Very simple convergence proofs • Performance is O(nk) per iteration — not bad, and can be heuristically improved n = number of points in the dataset, k = number clusters • M...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
39
09 - Unsupervised learning
0
K-means drawbacks Often terminates at a local but non-global optimum (mitigated by smart initialization such k-means++, or by re-running multiple times with different initializations) Requires the notion of a mean Requires specifying k (number of clusters) in advance Doesn’t handle noisy data and outliers well Clusters...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
40
09 - Unsupervised learning
0
How to choose k? For k = 1, 2, 3, ... Run k-means with k clusters For each data point i, compute “silhouette width” S = average of s(i) over all i Plot S against k Pick k for which S is greatest 42 a(i): avg. distance to points in own cluster b(i): avg. distance to points in closest other cluster S
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
41
09 - Unsupervised learning
0
DBSCAN • “Density-based spatial clustering of applications with noise” • Motivation: Centroid-based clustering methods like k-means favor clusters that are spherical, and have great difficulty with anything else • But with real data we often have: 43
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
42
09 - Unsupervised learning
0
DBSCAN • DBSCAN performs density-based clustering, and follows the shape of dense neighborhoods of points. • Def.: core points have at least minPts neighbors in a sphere of diameter ε around them. • The red points here are core points with at least minPts = 3 neighbors in an ε-sphere around them. 44
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
43
09 - Unsupervised learning
0
DBSCAN • More definitions (!): • Core points can directly reach neighbors in their ε-sphere • From non-core points, no other points can be reached • Point q is density-reachable from p if there is a series of points p = p1, ..., pn = q such that pi+1 is directly reachable from pi • All points not density-reachable from...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
44
09 - Unsupervised learning
0
DBSCAN clusters • Even more definitions: • Points p, q are density-connected if there is a point o such that both p and q are density-reachable from o. • A cluster is a set of points which are mutually density-connected. • That is, if a point is density-reachable from a cluster point, it is part of the cluster as well....
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
45
09 - Unsupervised learning
0
DBSCAN algorithm 47
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
46
09 - Unsupervised learning
0
• DBSCAN uses all-pairs point distances, but using an efficient indexing structure, each RangeQuery (for finding neighbors within ε-sphere) takes only O(log n) time • The algorithm overall can be made to run in O(n log n) • Fast neighbor search becomes progressively harder (higher constants) in higher dimensions, due t...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
47
09 - Unsupervised learning
0
Give us feedback on this lecture here: https://go.epfl.ch/ada2022-lec9-feedback ●What did you (not) like about this lecture? ●What was (not) well explained? ●On what would you like more (fewer) details? ●... 49
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
48
09 - Unsupervised learning
0
Clustering for segmentation Task: break an image into regions of points with similar features (Brox and Malik, ECCV 2010). 50
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
49
09 - Unsupervised learning
0
https://arxiv.org/abs/2012.00174 51
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/09 - Unsupervised learning.pdf
50
09 - Unsupervised learning
0
Distributed Algorithms Fall 2020 Links & Gossip - solutions 1st exercise session, 28/09/2020 Matteo Monti <matteo.monti@epfl.ch> Jovan Komatovic <jovan.komatovic@epfl.ch>
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
0
1.b gossip_sol
0
Graphs Example graph (V, E): ● V = {a, b, c, d, e} ● E = {(a, b), (b, c), (b, e), (e, d)} a b d c e A graph is a couple (V, E) where V is a set of vertices and E ⊆ V2 is a set of edges. Two vertices are adjacent (or neighbors) iff an edge exists between them. In the example, a and b are adjacent; a and d are not adjace...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
1
1.b gossip_sol
0
Graphs (undirected) Example graph (V, E): ● V = {a, b, c, d, e} ● E = {(a, b), (b, a), (b, c), (c, b), (b, e), (e, b), (e, d), (d, e)} a b d c e An undirected graph is a graph (V, E) such that (a, b) ∈ E if and only if (b, a) ∈ E. We use undirected graphs to model networks of processes: ● Each vertex represents a proce...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
2
1.b gossip_sol
0
Some paths in (V, E): ● (a, b) ● (a, b, c) ● (a, b, e, d) While ● (a, c, e) is not a path: a and c are not adjacent! Paths a b d c e A path is a sequence of distinct vertices (v1, ..., vN) such that, for all i ∈ [1, N - 1], vi and vi+1 are adjacent.
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
3
1.b gossip_sol
0
Connectivity a b d c e Two distinct vertices a and z are connected if and only if at least one path (a, ..., z) exists in the graph. A graph is connected if any two distinct vertices are connected. a b d c e A connected graph A disconnected graph
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
4
1.b gossip_sol
0
Exercise 1 (connectivity) Prove that connectivity is a symmetric property on an undirected graph: let a, b be vertices such that a is connected with b. Prove that b is connected with a. Hint: you can do it constructively.
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
5
1.b gossip_sol
0
Exercise 1 (solution) ● If a is connected to b, then a path p exists from a to b. Let p = (a, v1, ..., vN, b). ● Since the graph is undirected, if v is adjacent to w, then w is adjacent to v. ● Therefore, the sequence p’ = (b, vN, ..., v1, a) is also a path. ● Since p’ begins in b and ends in a, a path exists between b...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
6
1.b gossip_sol
0
Exercise 2 (connectivity) Prove that connectivity is a transitive property on an undirected graph: let a, b, c be vertices such that a is connected with b and b is connected with c. Prove that a is connected with c. Hint: double-check the definition of a path.
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
7
1.b gossip_sol
0
● Let p = (v1, ..., vN) and q = (w1, ..., wM) be the paths from a to b and from b to c, respectively. We have v1 = a, vN = w1 = b, wM = c. ● We note that (v1, ..., vN, w2, ..., wM) is in general not a path, as the vertices are not guaranteed to be disjoint. ● If a ∈ q, then a and c are trivially connected. Indeed, a su...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
8
1.b gossip_sol
0
Exercise 3 (connectivity) Write a procedure (pseudocode or any programming language) that inputs an undirected graph G = (V, E) and outputs true if and only if the G is connected. Hint: use the results from Exercises 1 and 2.
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
9
1.b gossip_sol
0
We start by noting that, since connectivity is symmetric and transitive, we only need to check if any node is connected to every other. We can implement the following algorithm: ● Pick any vertex v from V. Initialize a frontier set F = {v}. Initialize an interior set I = ∅. ● Until F is empty: ○ Pick an element f from ...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
10
1.b gossip_sol
0
Gossip Example: diffusion of a message m from process e. ● e issues m a b d c e We use an undirected graph to represent which processes can communicate. Upon receiving a new message m, a process forwards m to all its neighbors.
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
11
1.b gossip_sol
0
Gossip Example: diffusion of a message m from process e. ● e issues m. ● b and d receive m. a b d c e We use an undirected graph to represent which processes can communicate. Upon receiving a new message m, a process forwards m to all its neighbors.
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
12
1.b gossip_sol
0
Gossip Example: diffusion of a message m from process e. ● e issues m. ● b and d receive m. ● a and c receive m. a b d c e We use an undirected graph to represent which processes can communicate. Upon receiving a new message m, a process forwards m to all its neighbors. Gossip is correct if and only if, if the sender i...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
13
1.b gossip_sol
0
Exercise 4 (gossip) Prove that gossip is correct if and only if the subgraph of correct processes is connected. Note: prove both directions of the implication! Hint: induction is your friend.
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
14
1.b gossip_sol
0
If the subgraph of correct processes is connected, then gossip is correct. Let G = (V, E) be the gossip network, let N = |V|, let s be the sender. By induction: ● Let s be the sender. We obviously have that s eventually delivers the message m. ● Let VL denote the set of vertices that are connected to s by a path no lon...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
15
1.b gossip_sol
0
If gossip is correct, then the subgraph of correct processes is connected. Let G = (V, E) be the gossip network, let N = |V|, let s be the sender. ● Let v ≠ s be a correct process. Regardless of the crashes, v eventually delivers m. Therefore, v eventually receives m from a correct process. ● We use induction similarly...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
16
1.b gossip_sol
0
Exercise 5 (gossip) In the following system, exactly one process crashes. What is the minimum number of edges we need to add so that gossip is always correct? a b d c e
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
17
1.b gossip_sol
0
Exercise 5 (solution) In the following system, exactly one process crashes. What is the minimum number of edges we need to add so that gossip is always correct? a b d c e
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
18
1.b gossip_sol
0
k-connectivity Two paths p, p’ connecting two vertices a and z are disjoint if they have no vertex in common, except a and z: p = (a, b, ..., y, z) p’ = (a, b’, ..., y’, z) {a, b, ..., y, z} ∩ {a, b’, ..., y’, z} = {a, z} A graph is k-connected if and only if k disjoint paths exist between any two vertices of the graph...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
19
1.b gossip_sol
0
Robustness Gossip is robust to k failures if and only if it is always correct, as long as no more than k nodes are crashed. a b d e A fully connected gossip graph is robust to N failures, where N is the number of processes.
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
20
1.b gossip_sol
0
Exercise 6 (robustness) Prove that, if the gossip graph is (k+1)-connected, then gossip is k-robust. Is the converse also true? Find a counterexample if not. Hint: contradiction is your friend.
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
21
1.b gossip_sol
0
● By contradiction, let us assume that gossip is (k + 1)-connected, but k processes exist such that, if they all crash, then two correct processes a and b are no longer connected. ● By hypothesis, (k + 1) distinct paths p1, ..., pk + 1 exist between a and b. ● If some i exists such that no process crashes in pi, then a...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
22
1.b gossip_sol
0
Technically: But does it still work for N > 2 ? Exercise 6 (solution) a b
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
23
1.b gossip_sol
0
Random failures Suppose that processes can fail independently with probability f. What is the probability that two correct processes can communicate in the presence of failures? It depends on their connectivity! e.g. α β x Probability of failure f α, β can communicate iff x has not failed => α, β communicate with proba...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
24
1.b gossip_sol
0
Exercise 7 (random failures on series topology) Suppose that processes xi , i=1, ..., n can fail independently with probability f. What is the probability that a and b can communicate? a x1 β x2 xn
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
25
1.b gossip_sol
0
● Each process survives (i.e., it does not fail) with independent probability (1 - f). ● Therefore, all processes survive with probability (1 - f)n. Exercise 7 (solution)
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
26
1.b gossip_sol
0
Exercise 8 (random failures on parallel topology) Suppose that processes xi , i=1, ..., n can fail independently with probability f. What is the probability that a and b can communicate? a x1 xn x2 β . . .
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
27
1.b gossip_sol
0
Exercise 8 (solution) ● Each process fails with independent probability f. ● Therefore, all processes fail with probability fn. ● Finally, at least one process survives with probability (1 - fn).
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
28
1.b gossip_sol
0
Exercise 9 (random failures on series/parallel topology) Suppose that processes xij , i=1, ..., n, j=1, ..., m can fail independently with probability f. Prove that a and b can communicate with probability 1 - [1 - (1-f)m]n. a x11 β x12 x1m x21 x22 x2m xn1 xn2 xnm . . .
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
29
1.b gossip_sol
0
● As we proved in Exercise 7, every branch fails with independent probability g = 1 - (1 - f)m. ● We can now consider each branch as if it was one of the processes in Exercise 8. The probability that no branch fails is 1 - gn = 1 - [1 - (1-f)m]n. Exercise 9 (solution)
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
30
1.b gossip_sol
0
An Erdös-Renyi graph is defined by the values of N(N - 1)/2 independent Bernoulli random variables: Eij ~ Bernoulli(p) Eij = Eji with i, j ∈ V. Vertices i and j are adjacent iff Eij = 1. Erdös-Renyi graphs An Erdös-Renyi graph G(N, p) is a random undirected graph with N vertices, such that any two distinct vertices hav...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
31
1.b gossip_sol
0
Bonus Exercise 10 (Erdös-Renyi graphs) What distribution underlies the number of edges in an Erdös-Renyi G(N, p)? What distribution underlies the degree (i.e., number of links) of any vertex? Are the degrees of any two vertices independently distributed? Hint: how is the sum of Bernoulli variables distributed?
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
32
1.b gossip_sol
0
Let C(N, p) denote the probability of a random graph G(N, p) being connected. It is possible to prove that: lim[N→∞] G(N, p) = 0 iff p < ln(N) / N lim[N→∞] G(N, p) = 1 iff p > ln(N) / N A large Erdös-Renyi graph is almost surely connected, as long as each vertex has an expected degree larger than ln(N). We can use Erdö...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
33
1.b gossip_sol
0
Bonus Exercise 11 (Erdös-Renyi graphs) Write a distributed procedure that runs on N processes to build an Erdös-Renyi graph G(N, ln(N)/N). We assume no failures. Each process can invoke: ● A procedure rand(x) that returns a real number between 0 and x, independently picked with uniform probability. ● A procedure connec...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/1.b gossip_sol.pdf
34
1.b gossip_sol
0
Exercise Set XII, Advanced Algorithms 2021 These exercises are for your own benefit. Feel free to collaborate and share your answers with other students. Solve as many problems as you can and ask for help if you get stuck for too long. Problems marked * are more difficult but also more fun :). These problems are taken ...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Exercises12-sol_1.pdf
0
Exercises12-sol_1
0
with probability at least 1 −(1 −1/3)10 = 1 −(2/3)10 ≥4/5. The second event happens with probability happens with probability 2/3. (With the simplifying independence assumption) our success probability is thus at least 2/3 · 4/5 = 8/15 > 1/2. Page 1 (of 1) Advanced Algorithms • Spring 2021 Michael Kapralov
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Exercises12-sol_1.pdf
0
Exercises12-sol_1
0
CS-472: Design Technologies for Integrated Systems Exercise Problem Set 5 Solution Date: 28/10/2021 Topics: Scheduling with resource constraints, resource sharing (cf. slide sets 5 and 6) For Problems 1 to 3, consider the sequencing graph in Figure 1 (the same as in EX4 Problem 3). NOP + 1 × 2 + 3 × 4 + 5 × 6 + 7 + 8 ×...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/ex5sol.pdf
0
ex5sol
0
Problem 1 Schedule the sequencing graph using the list algorithm with at most two multipliers and one adder (at the same time per level). Assume that the multiplier takes two units of time and the adder one. Try to obtain the minimum latency subject to the resource bounds. cf: Textbook pp. 208; slide set 5 pp. 40. Ans:...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/ex5sol.pdf
1
ex5sol
0
Problem 2 Assume again that the multiplier takes two units of time and the adder one, and that at most two multipliers and one adder are available at the same time. (a) Write down the integer linear programming (ILP) inequalities describing the se- quencing graph and subject to the resource constraints. Use an upper bo...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/ex5sol.pdf
2
ex5sol
0
10 X l=1 (l · x2,l) −1 ≥0 (NOP →v2) 10 X l=1 (l · x4,l) − 10 X l=1 (l · x2,l) −2 ≥0 (v2 →v4) 10 X l=1 (l · x7,l) − 10 X l=1 (l · x4,l) −2 ≥0 (v4 →v7) 10 X l=1 (l · x10,l) − 10 X l=1 (l · x7,l) −1 ≥0 (v7 →v10) 10 X l=1 (l · x3,l) −1 ≥0 (NOP →v3) 10 X l=1 (l · x4,l) − 10 X l=1 (l · x3,l) −1 ≥0 (v3 →v4) Resource bounds: A...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/ex5sol.pdf
3
ex5sol
0
. Problem 3 Assume now all operations have unit delays. Consider an upper bound on the latency ̄λ = 5. Use a force calculation schedule the colored operation (node 5) to reduce con- currency. cf: Textbook pp. 211–215; slide set 5 pp. 45–53. Ans: The first thing to do for a force calculation is to evaluate time frames (...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/ex5sol.pdf
3
ex5sol
0
Table 1: Time frames obtained from ASAP and ALAP ( ̄λ = 5), mobility μ and probabili- ties pi(l) tS tL L1 L2 L3 L4 L5 μ pi(1) pi(2) pi(3) pi(4) pi(5) type v1 1 3 ✓ ✓ ✓ × × 2 1/3 1/3 1/3 0 0 adder v2 1 2 ✓ ✓ × × × 1 1/2 1/2 0 0 0 multiplier v3 1 2 ✓ ✓ × × × 1 1/2 1/2 0 0 0 adder v4 2 3 × ✓ ✓ × × 1 0 1/2 1/2 0 0 multipli...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/ex5sol.pdf
4
ex5sol
0
1. Self-force • L1: self_force(5, 1) = qadder(1) − 1 μ5+1(qadder(1) + qadder(2) + qadder(3)) = 1.2 −1 3(1.2 + 1.5 + 1.5) = −0.2 • L2: self_force(5, 2) = 1.5 −1 3(1.2 + 1.5 + 1.5) = 0.1 • L3: self_force(5, 3) = 1.5 −1 3(1.2 + 1.5 + 1.5) = 0.1 2. Predecessor/successor-force (PS-force) • L1: When v5 is in L1, it is not in...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/ex5sol.pdf
5
ex5sol
0
ALU 2 2 1 ALU 3 4 2 ALU 4 3 2 ALU 5 2 5 ALU 6 2 2 ALU 7 3 6 ALU 8 4 5 ALU 9 2 4 ALU cf: Slide set 6 pp. 13–15. 6
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/ex5sol.pdf
5
ex5sol
0
(a) Draw the interval and conflict graphs. Ans: 1 2 3 4 5 6 7 8 1 2 6 9 5 7 4 8 3 Figure 3: Interval graph 1 2 3 4 5 6 7 8 9 Figure 4: Conflict graph 7
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/ex5sol.pdf
6
ex5sol
0
(b) Determine the minimum number of ALUs needed using the left-edge algorithm. Show the coloring in both interval and conflict graphs. Ans: At least 4 ALUs are needed. 1 2 3 4 5 6 7 8 1 2 6 9 5 7 4 8 3 Figure 5: Colored interval graph 1 2 3 4 5 6 7 8 9 Figure 6: Colored conflict graph 8
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/ex5sol.pdf
7
ex5sol
0
SIGNAL PROCESSING FOR AUDIO AND ACOUSTICS Dr. Christof Faller Autumn Semester 2005 Teaching assistant: Thibaut Ajdler, Christophe Tournery Solution to Final Exam Monday March 6th, 2006 Exercise 1 Spatial Hearing (24 points) a) The direction of a source relates to the distance difference between the source and the left ...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/2005_final_solution.pdf
0
2005_final_solution
0
Exercise 2 Recording and Reproduction (24 points) a) The main microphone signals are a stereo or multi-channel audio signal giving already a 4 pt meaningful result when played back. The spot microphones pick up just one instrument or group of instruments. The room microphones pick up ambience or late reflections. b) Th...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/2005_final_solution.pdf
1
2005_final_solution
0
Exercise 3 Acoustics and Wave Field Synthesis (24 points) a) The B-format signals represent the sound pressure and velocity vector (in x, y, and z direc- 4 pt tion) in a single point. b) The source distribution represents a sound field as plane source signals from each direction. 4 pt Thus it is limited to represent co...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/2005_final_solution.pdf
2
2005_final_solution
0
Exercise 4 Spatial sampling (40 points) a) 6 pt p(u, ω) = 4π2δ(u −k0cos(φ))δ(ω −ω0). (1) b) Considering temporal frequency in a range of frequency [−ω1, ω1], we get the following graph: 7 pt For φ = 0 deg, the slope of the line is c. For φ = 180 deg, the slope is −c. u ω ω1 −ω1 1 c cos φ Figure 1: 2D-FT of one plane wa...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/2005_final_solution.pdf
3
2005_final_solution
0
u ω 2π ∆x ω∗ Figure 3: Spacing in the spatial axis, leads to periodicity of the spectrum along the spatial frequency axis. Exercise 5 Stereo Reproduction (50 points) We consider R0, R1, and R2 to be large enough such that the sound field in the sweet spot can be assumed to be composed of plane waves. Thus, the particle...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/2005_final_solution.pdf
4
2005_final_solution
0
y x α0 α s(0,1,2) 1 (t) R0 R1 R2 α2 α0 AE v 1 2 0 s(1) 2 (t) s(0) 2 (t) s(2) 2 (t) v(1) 1 v(2) 1 v(2) 2 v(1) 2 Figure 4: Stereo reproduction setup a) See v(1) 1 and v(1) 2 in Figure 4. 6 pt b) Let’s first express the particule velocity components for the two loudspeakers 8 pt v(1) 1 (t) = q R0 g1a1s t −R0 c (6) v(1) 2 ...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/2005_final_solution.pdf
5
2005_final_solution
0
<unk> <unk> <unk> <unk> <unk> a1g1 R0 −a2g2 R1 = a1 −a2 R0 a1g1 R0 + a2g2 R1 = a1 + a2 R0 (11) Combining the two equations in (11) a2g2 R1 + a1 −a2 R0 + a2g2 R1 = a1 + a2 R0 (12) 2a2g2 R1 = 2a2 R0 (13) g(1) 2 = R1 R0 . (14) Replacing g2 in (11) a1g1 R0 −a2R1 R0R1 = a1 R0 −a2 R0 (15) g(1) 1 = 1 (16) c) See v(2) 1 and v(...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/2005_final_solution.pdf
6
2005_final_solution
0
0 R0 a1 R0 (g1 −1) cos α0 = −a2 g2 cos α2 R2 −cos α0 R0 . (22) Combining the two equations in (22) a2 sin α0 g2 sin α2 R2 −sin α0 R0 = − a2 cos α0 g2 cos α2 R2 −cos α0 R0 (23) g2 cos α0 sin α2 R2 −sin α0 cos α0 R0 = −g2 sin α0 cos α2 R2 + sin α0 cos α0 R0 (24) g2 R2 (sin α0 cos α2 + cos α0 sin α2) = 2 sin α0 cos α0 R0 ...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/2005_final_solution.pdf
6
2005_final_solution
0