text
stringlengths
1
6.06k
source
stringclasses
375 values
page
int64
0
1.49k
book
stringclasses
375 values
chunk_index
int64
0
0
We consider the case where one correct process ρ mistakenly triggers a <crash, π> event for some correct process π. In the case where id(π) = 0, id(ρ) = 1, π proposes A, ρ proposes B: ● π broadcasts its proposal A and immediately decides for A. ● ρ believes that π crashed, and broadcasts and decides B. This breaks the agreement property of consensus. Solution 1 - Algorithm I 3
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/4. consensus_sol.pdf
2
4. consensus_sol
0
Solution 1 - Algorithm II We consider the case where one faulty process ρ mistakenly triggers a <crash, π> event for some correct process π. In the case where N = 2, id(π) = 0, id(ρ) = 1, π proposes A, ρ proposes B: ● π broadcasts its proposal A. ● ρ believes that π crashed, and broadcasts its proposal B. 4
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/4. consensus_sol.pdf
3
4. consensus_sol
0
Solution 1 - Algorithm II ● ρ delivers its own proposal B. Since N = 2, ρ decides B. ● ρ crashes before π gets its proposal. π correctly triggers <crash, ρ> and, since N = 2, decides A. This breaks the uniform agreement property of uniform consensus. 5
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/4. consensus_sol.pdf
4
4. consensus_sol
0
Exercise 2 (Consensus & Eventually perfect failure detector) Explain why any fail-noisy consensus algorithm (one that uses an eventually perfect failure detector ◇P) actually solves uniform consensus (and not only the non-uniform variant). 6
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/4. consensus_sol.pdf
5
4. consensus_sol
0
● We consider an algorithm that uses an eventually perfect failure detector. By contradiction, we assume that the algorithm satisfies agreement, but not uniform agreement. We consider two executions A and B of the algorithm. ● In A, two processes π and ρ decide differently, and π crashes. Let t denote the time when ρ decides. ● In B, π does not crash, but every process that suspects π in A also suspects π in B at the same moment of its execution. No process that suspects π restores π before t. All messages from π are delayed: none of its messages is delivered before t. Solution 2 7
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/4. consensus_sol.pdf
6
4. consensus_sol
0
● It is easy to see that ρ receives exactly the same messages and indications from the failure detector in A and B, and thus decides differently from π also in B. ● However, in B, π never failed. Therefore, if the algorithm violates uniform agreement, it also violates agreement. Solution 2 8
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/4. consensus_sol.pdf
7
4. consensus_sol
0
Exercise 3 (Consensus & Correct majority) Explain why any fail-noisy consensus algorithm (one that uses an eventually perfect failure detector ◇P) requires a majority of the processes to be correct. More precisely, provide a “bad run” in the case where the majority of processes is faulty. 9
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/4. consensus_sol.pdf
8
4. consensus_sol
0
Consider a system with an even number N of processes. Let A, B denote two distinct subsets of N/2 processes that propose values A and B respectively. By contradiction, let us assume that an algorithm exists that achieves consensus when N/2 processes fail. The two following executions are valid: ● Execution 1. All processes in A crash at the beginning without issuing any message. All the processes in B still achieve consensus and, by validity, decide B. Let TB denote the time when the last process decides on a value. ● Execution 2. All processes in B crash at the beginning without issuing any message. All the processes in A still achieve consensus and, by validity, decide A. Let TA denote the time when the last process decides on a value. Solution 3 10
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/4. consensus_sol.pdf
9
4. consensus_sol
0
Let us now consider the following Execution 3. All the processes in A are suspected by each process in B, and vice versa (at the same time as Executions 1 and 2, respectively). No message between a process in A and a process in B is delivered before max(TA, TB). No process restores any process in the other group before max(TA, TB). It is immediate to see that a process in A cannot distinguish between Executions 2 and 3. Similarly, a process in B cannot distinguish between Executions 1 and 3. Therefore, all processes in A decide A, all processes in B decide B, and agreement is violated. Solution 3 11
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/4. consensus_sol.pdf
10
4. consensus_sol
0
Sequential Objects A sequential object is a tuple T = (Q, q0, O, R, ∆), where: ● Q is a set of states. ● q0∈ Q is an initial state. ● O is a set of operations. ● R is a set of responses. ● ∆ ⊆ (Q × Π × O) × (Q × R) is a relation that associates a state, a process, and an operation to a set of possible new states and responses. Processes invoke operations on the object. As a result, they get responses back, and the state of the object is updated to a new value, following from ∆. 12
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/4. consensus_sol.pdf
11
4. consensus_sol
0
Guided Exercise 4 (Asset Transfer Object) Define a sequential object representing Asset Transfer, i.e., an object that allows processes to exchange units of currency. 13
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/4. consensus_sol.pdf
12
4. consensus_sol
0
Solution 4 (Asset Transfer Object) 14
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/4. consensus_sol.pdf
13
4. consensus_sol
0
Bonus Exercise 5 (Total Order & Asset Transfer) Use Total Order Broadcast to implement an Asset Transfer sequential object. 15
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/4. consensus_sol.pdf
14
4. consensus_sol
0
Solution 5 ● Every process initializes a balance[] array with the initial, agreed upon balances of each process. ● Upon requesting a payment, a process TO-broadcasts a message [PAY, source, recipient, amount]. ● Upon TO-delivering a message [PAY, source, recipient, amount], a process verifies if balance[source] is at least amount. If so, it subtracts amount from balance[source] and adds it to balance[recipient]. Since every process receives the same sequence of operations, the outcome of each operation is the same at every process. Correct processes successfully issue operations and agree on the balance of every process at any point in time. 16
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/4. consensus_sol.pdf
15
4. consensus_sol
0
SIGNAL PROCESSING FOR AUDIO AND ACOUSTICS Dr. Christof Faller Autumn Semester 2008 Teaching assistant: Fritz Menzer, Francisco Pinto Final Exam - Solution Tuesday Jan. 13th, 2009 Solution 1. Various Topics (6 points) 1. By delaying the stereo signals, the precedence effect results in that listeners will perceive the instruments at their real positions. 2. At low frequencies ITD are more relevant and at high frequencies ILD are more relevant for localization. 3. The steering delayed microphone signals have delays relative to each other which are a multiple of a period. Thus, the microphone signals are coherent and the aliasing beam occurs. 4. A four microphone beamformer can steer three nulls and thus eliminate three free field interferers. 5. The blocking matrix has orthogonal rows which sum of to zero, e.g. 1 −1 . 6. A linear combination of B-format signals has two zeros and thus two interferers can be eliminated. 1
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/2008_final_solution.pdf
0
2008_final_solution
0
Solution 2. Noise Cancelation System (7 points) 1. For the noise to be canceled at the meeting table, i.e., at rs = Rs and rw = Rw, the total pressure generated by the noise source plus the line source must be zero. Therefore, PS(Rs, ω) = −PW (Rw, ω). 2. Following the result in (1), PS(Rs, ω) = −PW (Rw, ω) r2π jk S(ω)e−jkRs √Rs = −W(ω)e−jkRw Rw S(ω) = − r jk 2π √Rs Rw e−jk(Rw−Rs)W(ω) . The filter H(ω) is then given by H(ω) = − r jk 2π √Rs Rw e−jk(Rw−Rs) . 3. At distance d, the measured noise signal is W ′(ω) = W(ω) e−jkd d . In this case we get S(ω) = H(ω)dejkdW ′(ω) = − r jk 2π √Rs Rw e−jk(Rw−Rs)(Rw −Rs)ejk(Rw−Rs)W ′(ω) = − r jk 2π √Rs(Rw −Rs) Rw W ′(ω) . Accordingly, H′(ω) = − r jk 2π √Rs(Rw −Rs) Rw . This means that the new filter H′(ω) does not need to compensate for the delay between the noise source and the line source. 4. This problem could be solved with a line-array of two microphones placed on the line-array of loudspeakers (line source). The noise signal would be the input of one of the microphones, whereas the angle of arrival α would be given by τ = l cos α c , where τ is the signal delay and l the distance between the two microphones. 2
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/2008_final_solution.pdf
1
2008_final_solution
0
Solution 3. Interaural coherence (7 points) 1. sL(t) = 1 + cos(φ0 −θ) 2 n1(t) + 1 + cos(φ0 + θ) 2 n2(t) sR(t) = 1 + cos(φ0 + θ) 2 n1(t) + 1 + cos(φ0 −θ) 2 n2(t) 2. IC1 = max d E(sL(t)sR(t + d)) p E(s2 L(t)E(s2 R(t + d)) Let sL(t) = an1(t) + bn2(t) sR(t) = bn1(t) + an2(t) , with a = 1 + cos(φ0 −θ) 2 and b = 1 + cos(φ0 + θ) 2 . Using the same calculation as in the solution of exercise 37, we find E <unk>s2 L(t) = E <unk>s2 R(t + d) = (a2 + b2)σ2 and E(sL(t)sR(t + d)) = E(abn1(t)n2(t + d)) + E(abn2(t)n2(t + d)) . Therefore max d E(sL(t)sR(t + d)) = 2abσ2 and IC1 = 2ab a2 + b2 = 2(1 + cos(φ0 + θ))(1 + cos(φ0 −θ)) (1 + cos(φ0 + θ))2 + (1 + cos(φ0 −θ))2 3. This case is very similar to the one above, with one main difference: There is a time difference τ. Using the same calculation as above, we find E(e2 L(t) = E(e2 R(t + d)) = (α2 + β2)σ2 and E(eL(t)eR(t + d)) = E(αβn1(t)n2(t −τ + d)) + E(αβn2(t −τ)n2(t + d)) . Therefore max d E(eL(t)eR(t + d)) = α
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/2008_final_solution.pdf
2
2008_final_solution
0
(t −τ + d)) + E(αβn2(t −τ)n2(t + d)) . Therefore max d E(eL(t)eR(t + d)) = αβσ2 (note that there are two maxima at d = τ and d = −τ). Consequently, IC2 = αβ α2 + β2 4. IC2 = 0.3/(1.09) ≈0.28 IC1,60circ ≈ 0.83 IC1,90circ = 0.6 IC1,120circ ≈ 0.26 IC1,150circ = 0 Obviously φ0 = 120◦gives an IC1 close to IC2. 5. If you have a constraint on φ0 (e.g. φ0 = 45◦), you can still decrease the interaural coherence if you use supercardioids or even dipole microphones (think of the first implementation of stereo by Blumlein!). 3
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/2008_final_solution.pdf
2
2008_final_solution
0
Solution 4. Listener envelopment (5 points) 1. Given the equation for the lateral fraction (course notes eq. 7.15), one should use an omni- directional microphone for recording the impulse response at the denominator, and a dipole microphone for the impulse response at the numerator. By pointing the dipole microphone perpendicularly to the direction of the source, one immediately gets the cos(α(t)) response. 2. omni (y1(t)) dipole (y2(t)) 3. In order to measure the impulse responses h1(t) and h2(t), we emit a sweep from the position of source s(t). This sweep is then recorded with two microphones as described above. Let the omni-directional microphone record the signal y1(t) and the dipole microphone record y2(t). Taking the Fourier transform of s(t), y1(t), and y2(t), we can express H1(ω) = Y1(ω) S(ω) H2(ω) = Y2(ω) S(ω) Doing the inverse Fourier transform, we get h1(t) and h2(t) 4. LF∞ 80 = R ∞ 80 h2 2(t)dt R ∞ 0 h2 1(t)dt 4
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/2008_final_solution.pdf
3
2008_final_solution
0
Solution 5. STFT and Audio Coding (7 points) 1. To perform a STFT of 3 blocks, we define a DFT matrix Ψ of size L 3 × L 3 . The STFT transform matrix ̃Ψ is then ̃Ψ = <unk> <unk> Ψ Ψ Ψ <unk> <unk>, and has size L × L. 2. The transform matrix is given by ̃Ψ = <unk> <unk> Ψ0 Ψ1 Ψ0 Ψ1 Ψ0 Ψ1 <unk> <unk>, where Ψ0 and Ψ1 are the left and right halves of the DFT matrix, such that Ψ = Ψ0 Ψ1 . 3. For the STFT to be reversible, the window functions must be power complementary, i.e., wa (n) ws (n) + wa n + W 2 ws n + W 2 = 1 . Additionally, wa n + W 2 = √ 2 sin π <unk>n + W 2 W ! + sin 3π <unk>n + W 2 W ! = √ 2 sin πn W + π 2 + sin 3πn W + 3π 2 = − √ 2 cos πn W + cos 3πn W . By visual inspection, it is clear that the sines and cosines must be squared so that we can apply the property sin2 a + cos2 a = 1. Following the given hint, we can define ws (n) = √ 2 sin <unk> πn W −sin <unk> 3πn W , such that wa (n) ws (n) = √ 2 sin πn W + sin 3πn W √ 2 sin πn W −sin 3πn W = 2 sin2 πn W −sin2 3πn W and wa n + W 2 ws n + W 2 = − √ 2 cos πn W + cos 3πn W − √ 2 cos πn W −cos 3πn W = 2 cos2 πn W −cos2 3πn W and finally wa (n) ws (n) + wa n + W 2 ws n + W 2 = 2 sin2 πn W + 2 cos2 πn W −sin2 3πn W −cos2 3πn W = 2 −1 = 1 . 5
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/2008_final_solution.pdf
4
2008_final_solution
0
4. The first STFT block is mostly composed of harmonic components, where each component generates a masking effect over its neighboring frequencies. The resulting masked threshold curve is approximately the sum of the masking effect generated by all harmonics. In the second case, the dominant spectral component is a narrow-band noise, which generates a much stronger masking effect, and thus a higher masked threshold. Finally, the third case is a combination of both tone masking and noise masking, and where the differences in signal-to-mask ratio are most noticeable. 5. The masked threshold curve found in (4) represents the maximum quantization noise power that can be tolerated at each frequency without introducing perceivable artifacts. It is also known that the quantization noise power of a uniform quantizer is given by ∆2 12 , where ∆ is the quantization step. Thus, for each spectral coefficient k, we obtain a quantizer with step ∆(k) = p 12m(k), where m(k) is the masked threshold curve. In practice, however, different quantizers are used only for groups of coefficients called coding bands, instead of individual coefficients. 6
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/2008_final_solution.pdf
5
2008_final_solution
0
Solution 6. Wavefield Synthesis (7 points) 1. While the plane array system has a larger listening area where the soundfield is reconstructed correctly, the line array system is only correct in one listening point and approximately correct on a listener line. 2. Further limitations arise from the fact that the loudspeaker array has limited size (truncation effects) and from the finite loudspeaker spacing (aliasing). 3. The loudspeaker signal is (substitute values into formula in script): ̃Qi(ω) = r jk 2π r b a + bS(ω)e−jkr √r cos(θ)e , (1) with r = p a2 + (c −d)2 and θ = tan−1 <unk> c−d a . 4. Note the following observations, regarding (1): • k = ωs/v. • e−jωsr/v corresponds to the time domain delay of r/v. • √j corresponds to a phase modification of π/4. With these observations, the time domain version of (1) can be written: ̃qi(t) = r ωs 2πv r b a + b cos(ωst −r v + π 4 ) 1 √r cos(θ)e . 5. The aliasing frequency formula in the script is solved for α, α = sin−1 c 2ef0 , which determines the sector [−α, α]. 7
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/2008_final_solution.pdf
6
2008_final_solution
0
Advanced Algorithms April 14, 2022 Lecture 15: Polynomial Identity Testing and Matchings Notes by Ola Svensson1 These notes are based on the lecture notes of Lecture 7 in Shayan Oveis Gharan’s course “CSE 521: Design and Analysis of Algorithms I” available here: http://courses.cs.washington.edu/courses/cse521/17wi/ In this lecture, we continue our discussion of randomized algorithms. We will discuss polynomial identity testing and its applications. In particular, we will see how to quickly check whether AB = C for matrices A, B, C and to solve the matching problem by calculating a determinant! 1 Polynomial Identity Testing and Schwartz-Zippel Lemma Given two polynomials p(x) and q(x), we’d like to find out whether they are identical, i.e. whether they produce identical outputs given any input x. In other words, we’d like to test whether the equation p(x) −q(x) = 0 is identically true for all x ∈Rd. Definition 1 A monomial is a function defined as the product of powers of variables with nonnegative exponents. A constant coefficient may be present. The degree of a monomial is the sum of all the exponents involved. Definition 2 A polynomial is a function defined as the sum of monomials. In a polynomial, each component monomial is also referred to as a term. The degree of a polynomial is the largest degree of any monomial with nonzero coefficient. Example 1 Some examples of polynomials: • 2x + 3xy2 is a polynomial of two variables with degree 3. It has two monomials: x with coefficient 2 and xy2 with coefficient 3. • 0x3 + 4x2 + 3x −1 is a polynomial of a single variable with degree 2. • The determinant of a matrix A = [Ai,j]n×n is a polynomial of n2 variables with degree n: det(A) = X σ:[n]→[n] sgn(σ) n Y i=1 Ai,σ
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Lecture15.pdf
0
Lecture15
0
= [Ai,j]n×n is a polynomial of n2 variables with degree n: det(A) = X σ:[n]→[n] sgn(σ) n Y i=1 Ai,σ(i), where σ is a permutation defined on [n] = {1, . . . , n} and sgn(σ) is either +1 or −1 depending on the nature of the permutation σ. One naive way to test the identity of p and q is to simply make the list of all monomials for each polynomial and compare the resulting lists. Unfortunately, it is often impratical to do so. For instance, the determinant function consists of n! terms, so listing them would cost us exponential time. For such polynomials, we are only afforded with oracle access, where we may inquire the output of the polynomial for a specific input. For instance, if we assign specific values to all terms in matrix Ai,j = xi,j for all i, j, we can compute the determinant in O(n3) time using the LU decomposition. The determinant example inspires the following formulation: 1Disclaimer: These notes were written as notes for the lecturer. They have not been peer-reviewed and may contain inconsistent notation, typos, and omit citations of relevant works. 1
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Lecture15.pdf
0
Lecture15
0
Definition 3 (Polynomial Identity Testing) Given polynomials p and q defined over a common set of variables x, we’d like to determine whether p(x) −q(x) = 0 is true for all values of x. We are only given oracle access: no individual term of p or q is known, but we may evaluate p and q at any specific input x. Example 2 First consider a polynomial of a single variable of degree n p(x) = a0xn + a1xn−1 + . . . + an−1x + an. Is p identical to zero? It suffices to evaluate p at (n + 1) distinct values of x, e.g. p(1), p(2), . . . , p(n + 1). If any of them evaluates to nonzero, p is clearly not identical to zero. If, on the other hand, all of the (n + 1) values are zero, then p is indeed identical to zero. Why is that? By the Fundamental Theorem of Algebra, any nonzero polynomial of degree d has at most d real roots. If p were not identical to zero, then since it has degree n, it would have at most n real roots. Since p(1) = p(2) = · · · = p(n + 1) = 0, p has at least (n + 1) roots and thus p must be identically zero. The multivariate case is not so simple, as multivariate polynomials may have infinitely many roots. For instance, the polynomial x2 −y has uncountably many roots, namely any (x, y) satisfying y = √x. So even with an infinitely long list of roots for p, we cannot know for certain whether p is identically zero or not. All hope is not lost, however; it turns out that it’s quite unlikely for any nonzero polynomial to evaluate to zero, provided that inputs are selected randomly: Lemma 4 (The Schwartz-Zippel Lemma) Let p(x1, . . . , xn) be a nonzero polynomial of n variables with degree d. Let S be a finite subset
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Lecture15.pdf
1
Lecture15
0
The Schwartz-Zippel Lemma) Let p(x1, . . . , xn) be a nonzero polynomial of n variables with degree d. Let S be a finite subset of R, with at least d elements in it. If we assign x1, . . . , xn values from S independently and uniformly at random, then P[p(x1, . . . , xn) = 0] ≤d |S|. This is an amazing result — all it takes is to pick a set S and try random inputs. If the polynomial p evaluates to zero, it is highly unlikely that p is nonzero: the probability that p evaluates to zero when it’s not identically zero is quite small, especially when |S| ≫d. What’s also amazing is that there is (yet) no deterministic counterpart to this randomized procedure. In fact, finding a deterministic algorithm for polynomial identity testing would lead to many interesting results, with impact akin to P=NP [KI04]. Before jumping to the full proof of the Schwartz-Zippel Lemma, let’s first prove a simpler instance. 2 Matrix Identity Testing Suppose we are given three n × n matrices A, B, and C. We’d like to test whether AB = C. Yes, we could simply multiply A by B, but that would cost O(n3) time. It turns out we can do better, by turning to a randomized approach. Let S be a finite subset of R, and let’s build a random vector x ∈Rn by choosing each coordinate xi independently and uniformly at random from S: xi ∼Uniform(S) 2
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Lecture15.pdf
1
Lecture15
0
We test whether ABx = Cx; if ABx = Cx, then we conclude AB = C. This procedure costs at most O(n2), involving three matrix-vector multiplications. The cost is even lower when the matrices are sparse. Now how likely is the false positive under this regime? That is, if AB <unk>= C, how likely is the outcome ABx = Cx? We will show that the false positive is highly unlikely: Theorem 5 If AB <unk>= C, then Pxi∼S[ABx <unk>= Cx] ≥1 −1 |S|. This theorem can be directly proven by an application of Theorem 4. But, here we give a direct proof. It turns out that the proof below is in a sense similar to the proof of Theorem 4, but it is tuned to the case when p, q have degree 1. Proof First, let’s write AB and C in terms of row vectors: AB = <unk> <unk> a1 ... an <unk> <unk>, C = <unk> <unk> c1 ... cn <unk> <unk>. Since AB <unk>= C, they should differ in at least one row: ai <unk>= ci for some i. We will show that the inner products ⟨ai, x⟩and ⟨ci, x⟩are most likely different: P[⟨ai, x⟩<unk>= ⟨ci, x⟩] ≥1 −1 |S| Notice that ⟨ai, x⟩and ⟨ci, x⟩are really 1-degree polynomials of variables x1, . . . xn, so we could simply apply Schwartz-Zippel Lemma and be done with the proof. But for the sake of learning, let’s produce a direct proof that does not depend on the lemma. In fact, the proof here will help us build a proof for the lemma as well. To show P[⟨ai, x⟩<unk>= ⟨ci, x⟩] ≥1 −1/|S|, we employ a technique known as the principle of deferred decision: random choices are made only when they become relevant to the algorithm at hand. Since ai <unk>= ci, there exists a coordinate j such that ai,j <unk>=
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Lecture15.pdf
2
Lecture15
0
technique known as the principle of deferred decision: random choices are made only when they become relevant to the algorithm at hand. Since ai <unk>= ci, there exists a coordinate j such that ai,j <unk>= ci,j. Now, set x1, . . . xn except xj arbitrarily. Since all xi’s are chosen independently of one another, the randomness of xj is preserved when other xi’s get fixed. Now how likely is the event n X k=1 aikxk − n X k=1 cikxk = 0? (1) Equation (1) can be re-written as xj(aij −cij) = − X k<unk>=j (aik −cik)xk. (2) Since all other xi’s are fixed, and ai,j <unk>= ci,j, equation (2) holds for only one value of xj. So at most one value from S will satisfy the equation, i.e., ∴ Pxj∼S[⟨ai, x⟩= ⟨ci, x⟩] ≤1 |S|. Since other xi’s don’t affect the choice of xj, the probability is not affected when we let other xi’s be random: Px∼S[⟨ai, x⟩= ⟨ci, x⟩] ≤1 |S|. Deferred decision is a great tool to use, but we ought to be careful: any analysis we make after fixing certain variables must hold regardless of their values (hence the world “arbitrarily”). The proof of the Schwartz-Zippel Lemma will show how not to use deferred decision. 3
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Lecture15.pdf
2
Lecture15
0
3 Proof of Schwartz-Zippel Lemma Proof [Proof of Lemma 4] We proceed by strong induction. Base case: n = 1. The problem is reduced to the univariate case presented in Example 2. Inductive step. Suppose that lemma holds for any polynomial with less than n variables; let’s show that it would also hold if we have n variables. First, fix x1, . . . , xn−1 arbitrarily. Then all values in p(x1, . . . , xn) are known except for xn, so p becomes a univariate polynomial of xn of degree k, for some k ≤d: p(xn) = akxk n + ak−1xk−1 n + . . . + a1x1 n + a0. We’ve reduced the problem to the univariate case again, so the probability for p to be zero is small: P[p(xn) = 0] ≤k |S| ≤d |S|. (3) So are we done? No. We still would need to argue that the probability in (3) would be unaffected by the choice of x1, . . . , xn−1. Unfortunately, this is not the case. Say, an adversary could come and choose x1, . . . , xn−1 such that the resulting polynomial of xn is identically 0. In this case, P[p = 0] = 1, and the induction hypothesis does not imply anything. How can we salvage this argument? Intuitively, we should argue that the adverserial scenario dis- cussed above will be “rare.” To that end, we make use of the long division for polynomials [CLO08]: Let p(x) be a polynomial with degree d and d(x) be a polynomial with degree k ≤d. Then we can write p(x) as follows: p(x) = d(x)q(x) + r(x) where the quotient q(x) has degree at most (d −k) and the remainder r
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Lecture15.pdf
3
Lecture15
0
write p(x) as follows: p(x) = d(x)q(x) + r(x) where the quotient q(x) has degree at most (d −k) and the remainder r(x) has degree at most k −1. The polynomial d(x) is the divisor. Let k be the largest degree xn in all monomials of p. So p can be “divided” by xk n as follows: p(x1, . . . , xn) = xk nq(x1, . . . , xn−1) + r(x1, . . . , xn), where q is a polynomial of x1, . . . , xn−1 of degree (d −k) and the degree of xn in r is at most degree (k −1). Now, we again use the principle of defferred decision. First, we assign values to x1, . . . , xn−1 uniformly at random from S, and we save the randomness of xn for later use. Using the inductive assumption, we have Px1,...,xn−1∼S[q(x1, . . . , xn−1) = 0] ≤d −k |S| . (4) Observe that if q <unk>= 0, then p(x1, . . . , xn) is a univariate polynomial in xn, and the coefficient of xk n is nonzero. So, conditioned on q <unk>= 0, p(x1, . . . ,n ) is a univariate polynomial which is not identically 0. Since the degree of this polynomial is k, for a random value of S, it is zero with probability at most k/|S|, i.e., Pxn∼S [p = 0|q <unk>= 0] ≤k |S|. (5) We can now finish the proof using equations (4) and (5). by Bayes rule, P[p = 0] = P [p = 0|q = 0] · P [
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Lecture15.pdf
3
Lecture15
0
] ≤k |S|. (5) We can now finish the proof using equations (4) and (5). by Bayes rule, P[p = 0] = P [p = 0|q = 0] · P [q = 0] + P [p = 0|q <unk>= 0] P [q <unk>= 0] ≤ P [q = 0] + P [p = 0|q <unk>= 0] ≤ d −k |S| + k |S| = d |S|. 4
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Lecture15.pdf
3
Lecture15
0
4 Bipartite Graph Matching Polynomial identity testing can be use to determine the existence of a perfect matching within a given bipartite graph G = (X, Y, E). Definition 6 A bipartite graph G = (X, Y, E) is a graph where every edge in E connects a vertex in X to a vertex in Y . Definition 7 A matching of graph G is a subset of edges in E that do not share any common vertex. A perfect matching of a graph G is a matching that involves every vertex in G. There is a deterministic algorithm that finds a perfect matching in O(|E| p |X| + |Y |). Now let’s build a randomized algorithm. First, define the adjacency matrix as follows: Aij = ( xij if vertices xi and yj are connected with an edge 0 otherwise Let’s assume |X| = |Y |, so that the adjacency matrix is a square. (If X and Y had different number of vertices, we would not have any perfect matching by definition.) Example 3 Consider the following n-by-n bipartite graph and biadjacency matrix A: u3 u2 u1 v2 v1 v3 A = <unk> <unk> xu1v1 0 0 0 xu2v2 xu2v3 0 xu3v2 xu3v3 <unk> <unk> Then det(A) = xu1v1xu2v2xu3v3 −xu1v1xu2v3xu3v2 , where the two monomials correspond to the two perfect matchings. Theorem 8 Graph G has a perfect matching if and only if the determinant det(A) is not identical to zero. Proof [⇒] Suppose G has a perfect matching. That is, there is a bijection f that maps each xi ∈X to a unique yj ∈Y . (Since it is a matching, no two vertices in X will be mapped to the same vertex in Y . Since the matching is perfect, no vertex in Y will be left out.) Therefore, we can see f as a permutation on the set of integers [
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Lecture15.pdf
4
Lecture15
0
X will be mapped to the same vertex in Y . Since the matching is perfect, no vertex in Y will be left out.) Therefore, we can see f as a permutation on the set of integers [n] = {1, 2, . . . , n}. It follows that n Y i=1 Ai,f(i) = n Y i=1 xi,f(i) is a nonzero monomial of the polynomial det(A), recall the formula for the determinant: det(A) = X σ:[n]→[n] sgn(σ) n Y i=1 Ai,σ(i), 5
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Lecture15.pdf
4
Lecture15
0
In particular, when σ = f in the above polynomial we get a monomial with a nonzero coefficient. This monomial is different from all other monomials of det(A), i.e., there is no cancellations. This means that det(A) is not a zero polynomial. [⇐] Now, suppose det(A) is not identical to zero. That is, for some values of xij’s, the determinant becomes nonzero. Recalling that det(A) = X σ:[n]→[n] sgn(σ) n Y i=1 Ai,σ(i), The nonzero determinant means that, for at least one permutation σ : [n] →[n], all terms Ai,σ(i) for 1 ≤i ≤m are set to be variables xi,σ(i), not to zeros. But this indicates that each vertex xi ∈X got matched to vertex yσ(i) ∈Y . Since σ is a bijection, the corresponding matching is perfect. The above theorem gives a simple and efficient algorithm to test if a given bipartite graph has a perfect matching. By Schwartz-Zippel lemma it is enough to assign values to xi,j from a set S of numbers of size |S| ≥n2. Then, if G has a perfect matching, det(A) <unk>= 0 with probability at least 1 −1/n. The disadvantage of this algorithm is that it doesn’t give us the perfect matching; it only tells us whether G has one or not. How do we find the perfect matching? For a bipartite graph G, we choose a big set |S| ≫n and set xij = 2wij where wij is chosen independently and uniformly at random from S. Then, we can show that, with high probability, there is a unique minimum weight perfect (see exercises). This means that we can write det(A) = 2w(M)(±1 + [even number]), where w(M) is the sum of the weight of edges of the minimum weight prefect matching. Having this in hand, all we need to do is to test for every edge of G if that edge is a part
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Lecture15.pdf
5
Lecture15
0
number]), where w(M) is the sum of the weight of edges of the minimum weight prefect matching. Having this in hand, all we need to do is to test for every edge of G if that edge is a part of the minimum weight perfect matching. Note that w(M) is uniquely defined in the above, given det(A); in particular, w(M) is the the largest exponent of 2 that divides det(A). For every edge (xi, yj), we delete the edge and test if the weight the of the minimum weight perfect matching decreases to w(M) −wi,j. If this happens, then (xi, yj) ∈M and otherwise it is not. This algorithm can be implemented in parallel in O(polylog(n)) time using polynomially many processors. 5 Remarks on General Graph Matching It turns out the idea in the previous section generalizes to find perfect matchings in general graph, although the proof is a lot more difficult. We begin by constructing skew-symmetric matrix (also called Tutte matrix) as follows: Aij = <unk> <unk> <unk> <unk> <unk> xij if vertices vi and vj are connected with an edge, i < j −xij if vertices vi and vj are connected with an edge, i ≥j 0 otherwise Theorem 9 Graph G has a perfect matching if and only if the determinant det(A) is not identical to zero. We omit the proof. How difficult is to test det(A) against zero? We don’t want to spend O(n3) time to compute the determinant. It turns out that there is a parallel algorithm that comptues the determinant using poly(n) processors in O(log2(n)) time [Mul86]. 6
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Lecture15.pdf
5
Lecture15
0
Homework I, Advanced Algorithms 2022 Solutions to many homework problems, including problems on this set, are available on the Internet, either in exactly the same formulation or with some minor perturbation. It is not acceptable to copy such solutions. It is hard to make strict rules on what information from the Internet you may use and hence whenever in doubt contact Michael Kapralov. You are, however, allowed to discuss problems in groups of up to three students; it is sufficient to hand in one solution per group. 1 Problem 1 Let <unk>x be an extreme point of the LP mentioned in the problem. First we claim that none of the following structures can found on the support of <unk>x: – Structure 1 : Even Cycles – Structure 2 : A path P of length ≥3, where P = (v1, v2, . . . , vn) and x(v1,v2) = x(vn−1,vn) = 1. – Structure 3 : Odd cycles C1 and C2 connected by a path of length ≥1, i.e. C1 = (v1, v2, . . . , v2n+1) and C2 = (w1, w2, . . . , w2m+1), and a path P = (v1 = u1, u2 . . . , uk−1, uk = w1) such that ∀i ∈[k], ui /∈C1 ∪C2 and C1 ∩C2 = ∅. – Structure 4 : Odd cycles sharing a single vertex. i.e. C1 and C2 are odd cycles such that |C1 ∩C2| = 1. – Structure 5 : An odd cycle with a path incident on it, i.e. C = (v1, v2, . . . , v2n+1) is an odd cycle and P = (v1 = u1, u2 . . . uk) is an incident path where x(uk−1,uk) = 1. Given these claims we will first show what the question asks, and then we’ll give the individual proofs of the claims which are rather mechanical and follows the standard technique
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Homework_I__Advanced_Algorithms_2022_solutions.pdf
0
Homework_I__Advanced_Algorithms_2022_solutions
0
where x(uk−1,uk) = 1. Given these claims we will first show what the question asks, and then we’ll give the individual proofs of the claims which are rather mechanical and follows the standard technique of changing x values in the support by + or −ε. Theorem. Every extreme point solution to the linear program in the problem is supported on a disjoint union of odd length cycles and stars. Proof. Intuitively, we will prove the theorem by traversing the support of the extreme point starting from a vertex and reasoning about the potential paths and cycles we encounter along the way. This process terminates as our graph is finite and we will argue that if the support avoids all the 5 structures described previously, then only odd cycles and stars remain. More formally pick any vertex v and start traversing any edge adjacent to v, repeating this process until either one of the two happen. Page 1 (of 6) Advanced Algorithms • Spring 2022 Michael Kapralov, Ola Svensson
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Homework_I__Advanced_Algorithms_2022_solutions.pdf
0
Homework_I__Advanced_Algorithms_2022_solutions
0
v3 v1 v2 v4 Figure 1: Cycles sharing more than one vertex. v1, v2, v3, v4 is an even cycle. (1a) You land on an already visited vertex. (1b) The vertex you are visiting doesn’t have any other edge you can traverse. (2a) You land on an already visited vertex during either of the walks. (2b) The vertex you are visiting doesn’t have any other edge you can traverse. Note that by claim 1, all of the cycles formed by this walk have to be of odd length. Now let’s examine all of the different cases. Case (1a) + (2a) : In this case, we have two connected odd cycles. Either – The cycles are connected by a path, which is not possible by Claim 3. – The cycles share a single vertex, which is not possible by Claim 4. – The cycles share more than one vertex. Let C1 and C2 be the set of edges in the two cycles. Both of them must be odd length cycles, i.e. |C1| and |C2| are odd numbers. Then (C1 ∪C2) \ (C1 ∩C2) is a also cycle. It has length |C1| + |C2| −2|C1 ∩C2|, which is an even number. Since there are no even length cycles, this case is not possible by Claim 1. Refer to Figure 1. Case (1a) + (2b) or (1b) + (2a) : In this case, either – We have an odd cycle connected to a path. Since we made sure that there are no other incident edge in the end vertex of the path, we know that the x value of the last edge of the path is at least 1. Hence we can use Claim 5 to show that this case is not possible. – We have an odd cycle that is not connected to anything. Case (1b) + (2b) : In this case, we have a path such that both end edges have value at least 1. By Claim 2, we know that this path is of length at most 2. Conclusion : We have shown that the only acceptable structure in an extreme point are odd length cycles that are their own connected components, or path
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Homework_I__Advanced_Algorithms_2022_solutions.pdf
1
Homework_I__Advanced_Algorithms_2022_solutions
0
value at least 1. By Claim 2, we know that this path is of length at most 2. Conclusion : We have shown that the only acceptable structure in an extreme point are odd length cycles that are their own connected components, or paths of length at most 2. But the connected components of paths of length less than 2 are exactly stars. We can now conclude that an extreme point is supported on a disjoint union of odd length cycles and stars. Page 2 (of 6) Advanced Algorithms • Spring 2022 Michael Kapralov, Ola Svensson
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Homework_I__Advanced_Algorithms_2022_solutions.pdf
1
Homework_I__Advanced_Algorithms_2022_solutions
0
Proving the claims Proof of Non-Existence of Structure 1. Let x be a feasible solution of the linear problem, and let C = {e1, . . . , e2n} be a cycle of even length supporting x. Let ε = 1 2 mine∈[2n] xe. We define the following two feasible solutions y and z : yek = <unk> <unk> <unk> xek + ε if k ≤2n and k is even, xek −ε if k ≤2n and k is odd, xek otherwise. zek = <unk> <unk> <unk> xek −ε if k ≤2n and k is even, xek + ε if k ≤2n and k is odd, xek otherwise. We have x = 1 2(y + z), so we only need to prove that y and z are indeed feasible, and are different from x. Note that by definition, ε > 0, which guarantees that y <unk>= x, and ε < xe for all e ∈C which guarantees that y, z ≥0. (Note that this is valid for all the proofs, so for the subsequent proofs, we will only prove that P e∈δ(v) ye ≥1, ∀v Finally, for u ∈V , we have P e∈δ(v) ze = P e∈δ(v) ye = P e∈δ(v) xe ≥1 by construction. This ensures that y and z are feasible, and that x is not an extreme point. Non-Existence of Structure 2. Let ε = 1 2 min e∈P xe and define the following points : ye = <unk> <unk> <unk> xe + ε if e = (v2j−1, v2j), e /∈{(v1, v2), (vn−1, vn)}, xe −ε if e = (v2j, v2j+1), e /∈{(v1, v2), (vn−1, vn)}, xe otherwise. ze = <unk> <unk> <unk> xe −ε if e = (v2j−1, v2j), e /∈{(v1, v2), (vn−1, vn), xe + ε if e = (
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Homework_I__Advanced_Algorithms_2022_solutions.pdf
2
Homework_I__Advanced_Algorithms_2022_solutions
0
= <unk> <unk> <unk> xe −ε if e = (v2j−1, v2j), e /∈{(v1, v2), (vn−1, vn), xe + ε if e = (v2j, v2j+1), e /∈{(v1, v2), (vn−1, vn), xe otherwise. Because the two end edges have value at least1, the end vertices are not affected by the change of value, and still verify the constraints. On the other hand, the vertices that are in the interior of the path also verify the constraints, because they are all connected to one edge whose value reduced by ε, and one edge whose value increased by ε. Proof of Non-Existence of Structure 3. Suppose that P is a path of even length. Let ε = 1 4 min e∈C1∪C2∪P xe and define the following points : ye = <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> xe + ε if e = (v2j−1, v2j) or e = (v1, v2n+1), xe −ε if e = (v2j, v2j+1), xe −2ε if e = (u2j−1, u2j), xe + 2ε if e = (u2j, u2j+1), xe −ε if e = (w2j−1, w2j) or e = (w1, w2m+1), xe + ε if e = (w2j, w2j+1), xe otherwise. zk = <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> xe −ε if e = (v2j−1, v2j) or e = (v1, v2n+1), xe + ε if e = (v2j, v2j+1), xe + 2ε if e = (u2j−1, u2j), xe −2ε if e = (u2j, u2j+1), xe + ε if e = (w2j−1
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Homework_I__Advanced_Algorithms_2022_solutions.pdf
2
Homework_I__Advanced_Algorithms_2022_solutions
0
j+1), xe + 2ε if e = (u2j−1, u2j), xe −2ε if e = (u2j, u2j+1), xe + ε if e = (w2j−1, w2j) or e = (w1, w2m+1), xe −ε if e = (w2j, w2j+1), xe otherwise. Refer to Figure 2. One can check that y is indeed a feasible solution. With similar ideas to the Page 3 (of 6) Advanced Algorithms • Spring 2022 Michael Kapralov, Ola Svensson
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Homework_I__Advanced_Algorithms_2022_solutions.pdf
2
Homework_I__Advanced_Algorithms_2022_solutions
0
v3 v1 u2 w1 v2 w3 w2 +ε −2ε +2ε −ε +ε −ε −ε +ε Figure 2: Odd cycles with even path in between previous proofs, one can prove that the vertices that are in the middle of the path or in the cycles still verify the constraints of the LP. The only new vertices to consider are v1 and w1 (which are the vertices where the cycles and the path connect). We have X e∈δ(v1) ye = X e∈δ(v1)\(C1∪C2∪P) ye + (x(v1,v2) + ε) + (x(v1,v2n+1) + ε) + (x(v1,u2) −2ε) = X e∈δ(v1) xe ≥1 So u1 and w1 verify the constraints of the LP, and we showed that y is feasible. If P is a path of odd length then the following points still work, refer to Figure 3.: ye = <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> xe + ε if e = (v2j−1, v2j) or e = (v1, v2n+1), xe −ε if e = (v2j, v2j+1), xe −2ε if e = (u2j−1, u2j), xe + 2ε if e = (u2j, u2j+1), xe + ε if e = (w2j−1, w2j) or e = (w1, w2m+1), xe −ε if e = (w2j, w2j+1), xe otherwise. zk = <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> xe −ε if e = (v2j−1, v2j) or e = (v1, v2n+1), xe + ε if e = (v2j, v2j+1), xe + 2ε if e = (u2j−1, u2j), xe −2ε
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Homework_I__Advanced_Algorithms_2022_solutions.pdf
3
Homework_I__Advanced_Algorithms_2022_solutions
0
or e = (v1, v2n+1), xe + ε if e = (v2j, v2j+1), xe + 2ε if e = (u2j−1, u2j), xe −2ε if e = (u2j, u2j+1), xe −ε if e = (w2j−1, w2j) or e = (w1, w2m+1), xe + ε if e = (w2j, w2j+1), xe otherwise. Proof of Non-Existence of Structure 4. The proof of this claim is completely analogous to the proof of claim 3, with a path of length 0 Proof of Non-Existence of Structure 5. Let ε = 1 4 min e∈C∪P xe and define the following points : Page 4 (of 6) Advanced Algorithms • Spring 2022 Michael Kapralov, Ola Svensson
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Homework_I__Advanced_Algorithms_2022_solutions.pdf
3
Homework_I__Advanced_Algorithms_2022_solutions
0
v3 v1 w1 v2 w3 w2 +ε −2ε −ε +ε +ε +ε −ε Figure 3: Odd cycles with odd path in between ye = <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> xe + ε if e = (v2j−1, v2j) or e = (v1, v2n+1), xe −ε if e = (v2j, v2j+1), xe −2ε if e = (u2j−1, u2j), and e <unk>= (uk−1, uk) xe + 2ε if e = (u2j, u2j+1), and e <unk>= (uk−1, uk) xe otherwise. , ze = <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> <unk> xe −ε if e = (v2j−1, v2j) or e = (v1, v2n+1), xe + ε if e = (v2j, v2j+1), xe + 2ε if e = (u2j−1, u2j), and e <unk>= (uk−1, uk) xe −2ε if e = (u2j, u2j+1), and e <unk>= (uk−1, uk) xe otherwise. Proving that y is feasible is completely analogous to Claims 2 and 3. 2 Problem 2 We are given a matrix A ∈Rn×kn and we want to find out whether its columns can be partitioned into k bases of Rn. Consider the following bipartite graph G = (L∪R, E). L = [nk] and R = [k]. Here E will denote both the edges of this bipartite graph and the ground set of the two matroids. The edge set E = {(i, j) | i ∈[nk], j ∈[k]}. Thus this is the complete bipartite graph on [nk]×[k]. L denotes the columns of the matrix and R denotes the partitions. An edge (i.j) is picked in the solution if column i is assigned to partition j. Thus
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Homework_I__Advanced_Algorithms_2022_solutions.pdf
4
Homework_I__Advanced_Algorithms_2022_solutions
0
]. L denotes the columns of the matrix and R denotes the partitions. An edge (i.j) is picked in the solution if column i is assigned to partition j. Thus on a high level we want the following constraints to be met: 1. Each column is assigned to exactly one such partition 2. Each partition has linearly independent columns assigned to it. In total if there are nk edges satisfying these two conditions then we have a partition that we require. Now let’s formalise these notions. Formal Solution: Let G be the graph as defined above, and E is its edge set. Let’s model the constraints as matroids. Let M1 = (E, I1). Here I1 = {F ⊆E | |F ∩δ(v)| ≤1 ∀v ∈L}. The edges incident on vertices in L form a partition {δ(v)}v∈L, thus M1 is a partition matroid. Let M2 = (E, I2). Here I2 = {F ⊆E | rank(ANF (v)) = |NF (v)| ∀v ∈R}. Here NF (v) = {u ∈ V | {u, v} ∈F} and AX for any X ⊆[nk] denotes the matrix of columns indexed by X. Thus Page 5 (of 6) Advanced Algorithms • Spring 2022 Michael Kapralov, Ola Svensson
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Homework_I__Advanced_Algorithms_2022_solutions.pdf
4
Homework_I__Advanced_Algorithms_2022_solutions
0
all columns assigned to a vertex v ∈R are linearly independent. However a vertex v ∈L might have multiple edges incident to it but that’s fine. We need to prove that M2 is indeed a matroid. 1. Property 1 - Let Y ∈I2 and suppose X ⊆Y . Let v ∈R. Thus rank(ANY (v) = |NY (v)|). Thus the columns indexed by NY (v) are linearly independent which also implies all the columns in X are linearly independent. Thus rank(ANX(v)) = |NX(v)| and X ∈I2. 2. Property 2 - Let X, Y ∈I2 such that |Y | > |X|. Thus there must exist atleast one vertex v ∈R such that |NY (v)| > |NX(v)|. (Otherwise |Y | = P v∈R |NY (v)| ≤P v∈R |NX(v)| = |X|). Since X, Y ∈I2, rank(ANX(v)) < rank(ANY (v)). Thus there must exist u ∈L, such that {u, v} ∈Y and u /∈span(ANX(v)). (Otherwise there would be more linearly independent vectors than the dimension of the subspace spanned by columns of NX(v)). Thus {u, v} /∈X and add the edge {u, v} to X. Since u didn’t lie in the span of ANX(v), columns in NX(v)∪{u} are linearly independent. All other edges remain same, so no other vertex in R has its incident columns changed. Thus X ∪{u, v} ∈I2. Consider M1 ∩M2 and put weight function of e ∈E as 1 ∀e ∈E. Now we can run the matroid intersection algorithm to check if there exists a base of weight nk. Clearly a base of weight nk exists if and only if there is a partition of the nk columns into k bases of Rn. Page
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Homework_I__Advanced_Algorithms_2022_solutions.pdf
5
Homework_I__Advanced_Algorithms_2022_solutions
0
matroid intersection algorithm to check if there exists a base of weight nk. Clearly a base of weight nk exists if and only if there is a partition of the nk columns into k bases of Rn. Page 6 (of 6) Advanced Algorithms • Spring 2022 Michael Kapralov, Ola Svensson
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/Homework_I__Advanced_Algorithms_2022_solutions.pdf
5
Homework_I__Advanced_Algorithms_2022_solutions
0
Digital 3D Geometry Processing Digital Fabrica<unk>on Prof. Dr. Mark Pauly Julian Paneza EPFL
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
0
08_Digital_Fabrication
0
1 2 Digital fabrica<unk>on: bringing digital geometry to the physical world Fabrica<unk>on technologies Subtrac<unk>ve Laser cu<unk>ng CNC (computer numerical control) turning/milling Addi<unk>ve 3D prin<unk>ng How to design parts for 3d prin<unk>ng
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
1
08_Digital_Fabrication
0
3 Laser cu<unk>ng Cut/engrave flat sheets with a laser Supports many materials (wood, metal, paper, acrylic, ...)
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
2
08_Digital_Fabrication
0
4 Laser cu<unk>ng 0:00 / 1:15
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
3
08_Digital_Fabrication
0
5 Laser cu<unk>ng: how it works Mirrors direct laser beam to precise (x, y) loca<unk>on Laser intensity/exposure <unk>me tuned for the material and desired effect (cu<unk>ng vs engraving)
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
4
08_Digital_Fabrication
0
6 Laser cu<unk>ng Machine specs Work area: 610 x 457mm Laser power: 60W Cuts paper, cardboard, wood, PMMA (Plexiglas) Universal Laser Systems, Model: VLS4.60
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
5
08_Digital_Fabrication
0
Laser cu<unk>ng: from file to object Design is just an image; mode chosen by color: vector cu<unk>ng, vector engraving, raster engraving
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
6
08_Digital_Fabrication
0
78 Laser cu<unk>ng: tutorial Open a vector graphics program (e.g., Illustrator or Inkscape) Create a new 610x457mm document. Note: units must be mm, color mode RGB. Import/draw your design Apply proper colors and line sizes Cu<unk>ng lines red (255, 0, 0) Engraving lines blue (0, 0, 255) Raster images grayscale Line thickness 0.01mm Export the design as a PDF, send to laser cuzer
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
7
08_Digital_Fabrication
0
9 Laser cu<unk>ng Great for fabrica<unk>ng 2D or 2.5D designs Can also produce 3D shapes:
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
8
08_Digital_Fabrication
0
10 Laser cu<unk>ng: designing sliced parts Rhino/Grasshopper
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
9
08_Digital_Fabrication
0
11 Laser cu<unk>ng: 3D shapes by folding Pepakura Designer
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
10
08_Digital_Fabrication
0
12 Laser cu<unk>ng: curved surfaces
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
11
08_Digital_Fabrication
0
Sheet metal/paper only bend into developable surfaces (K = 0) Inser<unk>ng cuts enables stretching, permi<unk>ng nonzero Gaussian curvature, K Beyond Developable: Konakovic et al. 2016 0:00 / 0:20
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
12
08_Digital_Fabrication
0
13 CNC turning (lathes) Rapidly spin material, insert cu<unk>ng tool Great for surfaces of revolu<unk>on, screw threads, etc. Glacern Machine Tools - YouTube 0:00 / 0:54
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
13
08_Digital_Fabrication
0
14 CNC milling Rota<unk>ng cuzer, complex inser<unk>on paths (5- axis) Produce much more general 3D shapes 0:00 / 1:59
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
14
08_Digital_Fabrication
0
15 CNC milling: advantages Great accuracy Large parts Great mechanical proper<unk>es: part is solid material, not built from slices
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
15
08_Digital_Fabrication
0
CNC milling: limita<unk>ons Wasteful: material milled away is lost Geometry limita<unk>ons: cu<unk>ng tool must reach all surfaces Planning tool paths/selec<unk>ng cu<unk>ng tools can be challenging Higher fixed-costs Slower turnaround <unk>me Usually large, expensive and dangerous Infill Op<unk>miza<unk>on: Wu et al. 2017
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
16
08_Digital_Fabrication
0
16 Desktop CNC milling Pocket NC Version 2 - YouTube 0:00 / 0:28
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
17
08_Digital_Fabrication
0
17 18 3D prin<unk>ng Slice 3D object into many layers Fabricate layers one at a <unk>me, from bozom to top
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
18
08_Digital_Fabrication
0
19 3D prin<unk>ng: advantages Pay only for the material you use Material isn’t wasted like in CNC milling Cost and fabrica<unk>on <unk>me independent of complexity Objects with highly complex topology can be fabricated “Just click print” Less complicated planning process than CNC Shorter turn-around <unk>me Infill Op<unk>miza<unk>on: Wu et al. 2017
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
19
08_Digital_Fabrication
0
Applica<unk>ons: industrial design Rensselaer Polytechnic Ins<unk>tute
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
20
08_Digital_Fabrication
0
20 21 Applica<unk>ons: customized products Makerbot Makerbot
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
21
08_Digital_Fabrication
0
22 Applica<unk>ons: aerospace Boeing 787 - Wikipedia Titanium Part for 787 - Norsk Titanium Boeing is saving $3 million on each 787 jet using 3D prin<unk>ng (by avoiding material waste).
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
22
08_Digital_Fabrication
0
23 Applica<unk>ons: medical/dental Robohand Amos Dudley
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
23
08_Digital_Fabrication
0
24 Applica<unk>ons: new materials James Zhou 0:00 / 0:04 Create new materials by prin<unk>ng microstructure
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
24
08_Digital_Fabrication
0
25 Applica<unk>ons: shoes Adidas and Carbon3D Spa<unk>ally varying proper<unk>es for op<unk>mal sports performance
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
25
08_Digital_Fabrication
0
26 Applica<unk>ons: mechanical clock! Christoph Laimer - YouTube 0:00 / 0:45
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
26
08_Digital_Fabrication
0
27 3D prin<unk>ng: technologies Fused Deposi<unk>on Modeling (FDM) Stereolithography (SLA) Selec<unk>ve Laser Sintering/Mel<unk>ng (SLS/SLM) Material Je<unk>ng (MJP) ...
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
27
08_Digital_Fabrication
0
28 FDM technology 3D Hubs Extrude melted plas<unk>c through a nozzle to form each layer
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
28
08_Digital_Fabrication
0
29 FDM limita<unk>ons Lower resolu<unk>on; limited by nozzle diameter spa<unk>al precision of extruder head flow of melted plas<unk>c Poor bonding between layers (anisotropic proper<unk>es) 3D Hubs
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
29
08_Digital_Fabrication
0
3D Hubs 30 FDM free-form use: wireprint 0:00 / 0:16
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
30
08_Digital_Fabrication
0
31 FDM free-form use: weaving / flowers Vessel - David Lobser drooloop flowers - Mark Peeters 0:00 / 0:05
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
31
08_Digital_Fabrication
0
32 SLA Technology 3D Hubs Cure liquid resin into a solid by shining UV light
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
32
08_Digital_Fabrication
0
33 3D prin<unk>ng: Laser SLA (Form 2) formlabs form 2
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
33
08_Digital_Fabrication
0
34 3D prin<unk>ng: Laser SLA (Form 2) form 2 in ac<unk>on 0:00 / 0:14
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
34
08_Digital_Fabrication
0
35 3D prin<unk>ng: DLP SLA (B9 Creator) Project and cure en<unk>re layer geometry simultaneously
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
35
08_Digital_Fabrication
0
36 SLA pros and cons Advantages Excellent resolu<unk>on (25um layer height) Layers almost perfectly bind; isotropic proper<unk>es Wide range of resins to choose from Disadvantages Requires cleaning and curing postprocess (place in UV oven) Color and mechanical proper<unk>es shiW over <unk>me as curing con<unk>nues
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
36
08_Digital_Fabrication
0
37 SLS/SLM Technology 3D Hubs Laser shines into a bed of plas<unk>c or metal powder, fusing or mel<unk>ng the par<unk>cles into a solid part.
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
37
08_Digital_Fabrication
0
38 Material Je<unk>ng Technology 3D Hubs
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
38
08_Digital_Fabrication
0
39 3D prin<unk>ng: what can go wrong?
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
39
08_Digital_Fabrication
0
40 3D prin<unk>ng: support structure The defect on the overhanging feature is caused by insufficient support; support structure required. SLA can print overhangs, but not local minima (e.g., bear hand).
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
40
08_Digital_Fabrication
0
41 3D prin<unk>ng: support structure removal Removing support can be difficult or completely intractable.
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
41
08_Digital_Fabrication
0
42 3D prin<unk>ng: support structure for SLS 3D Hubs SLS doesn’t need support structure!
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
42
08_Digital_Fabrication
0
43 3D prin<unk>ng: support structure for Mul<unk>jet 3D Hubs Mul<unk>jet printers can print with dissolvable support!
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
43
08_Digital_Fabrication
0
44 3D prin<unk>ng: stringing and gaps (FDM) Stringing can be fixed by lowering temperature/speed or asking printer to retract filament. Gaps can be fixed by increasing the extrusion rate.
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
44
08_Digital_Fabrication
0
45 3D prin<unk>ng: warping (FDM and SLA) First few layers can warp/peel from build plaworm. Consider prin<unk>ng on “raW.”
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
45
08_Digital_Fabrication
0
46 3D prin<unk>ng: design rules Minimum thickness constraints
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
46
08_Digital_Fabrication
0
47 3D prin<unk>ng: design rules Minimum thickness constraints Support requirements
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
47
08_Digital_Fabrication
0
48 3D prin<unk>ng: design rules Minimum thickness constraints Support requirements Clearance requirements
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
48
08_Digital_Fabrication
0
49 3D prin<unk>ng: design rules Minimum thickness constraints Support requirements Clearance requirements No enclosed voids (SLA/SLS)
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
49
08_Digital_Fabrication
0
50 Op<unk>mizing for 3D prin<unk>ng What exactly can we op<unk>mize? Prin<unk>ng parameters Support structure The design itself
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
50
08_Digital_Fabrication
0
51 Op<unk>mizing prin<unk>ng parameters Adjust orienta<unk>on/slicing to minimize print error keep prints fast: use adap<unk>ve slicing!
/home/ricoiban/GEMMA/mnlp_chatsplaining/RAG/08_Digital_Fabrication.pdf
51
08_Digital_Fabrication
0