This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
9/14/2021
Randomness in Computing
LECTURE 3Last time• Probability amplification
• Verifying matrix multiplication
Today• Finish verifying matrix
multiplication
• Probability amplification:
Bayesian approach
• Randomized Min-Cut
Sofya Raskhodnikova;Randomness in Computing
Useful conditional probability facts
Let A be an event and let 𝐸1, … , 𝐸𝑛 be mutually disjoint
events whose union is Ω.
• Total probability law.
Pr 𝐴 =
𝑖∈ 𝑛
Pr[𝐴 ∩ 𝐸𝑖] =
𝑖∈ 𝑛
Pr[𝐴 ∣ 𝐸𝑖] ⋅ Pr 𝐸𝑖 .
• Bayes’ Law. Assume Pr 𝐴 ≠ 0. Then, for all 𝑗 ∈ 𝑛 ,
Pr 𝐸𝑗 𝐴 =Pr[𝐸𝑗 ∩ 𝐴]
Pr[𝐴]
=Pr 𝐴|𝐸𝑗 ⋅ Pr 𝐸𝑗
σ𝑖∈ 𝑛 Pr[𝐴 ∣ 𝐸𝑖] ⋅ Pr[𝐸𝑖].
9/14/2021 Sofya Raskhodnikova; Randomness in Computing
Tennis match
You will play a tennis match against opponent X or Y.
If X is chosen, you win with probability 0.7.
If Y is chosen, you win with probability 0.3.
Your opponent is chosen by flipping a coin with bias 0.6
in favor of X.
What is your probability of winning?
9/14/2021 Sofya Raskhodnikova; Randomness in Computing
Review question: tennis match
You will play a tennis match against opponent X or Y.
If X is chosen, you win with probability 0.7.
If Y is chosen, you win with probability 0.3.
Your opponent is chosen by flipping a coin with bias 0.6 in favor of X.
What is your probability of winning?
A. < 0.3
B. In the interval [0.3,0.4).
C. In the interval [0.4,0.55).
D. In the interval [0.55,0.7).
E. ≥0.7
9/14/2021 Sofya Raskhodnikova; Randomness in Computing
Review question: balls and bins
We have two bins with balls.
• Bin 1 contains 3 black balls and 2 white balls.
• Bin 2 contains 1 black ball and 1 white ball.
We pick a bin uniformly at random. Then we pick a ball
uniformly at random from that bin.
What is the probability that we picked bin 1, given that we
picked a white ball?
9/14/2021 Sofya Raskhodnikova; Randomness in Computing
Task: Given three 𝑛 × 𝑛 matrices 𝐴, 𝐵, 𝐶, verify if 𝐴 ⋅ 𝐵 = 𝐶.
Idea: Pick a random vector ത𝒓 and check if 𝐴 ⋅ 𝐵 ⋅ ത𝒓 = 𝐶 ⋅ ത𝒓.
Running time: Three matrix-vector multiplications: O 𝑛2 time.
Correctness: If 𝐴 ⋅ 𝐵 = 𝐶, the algorithm always accepts.
Probability Amplification: With 𝑘 repetitions, error probability ≤ 2−𝑘
9/14/2021 Sofya Raskhodnikova; Randomness in Computing
O(𝒏𝟐) multiplications for each matrix-vector product
§1.3 (MU) Verifying Matrix Multiplication
1. Choose a random 𝑛-bit vector ҧ𝑟 by making each bit 𝑟𝑖independently 0 or 1 with probability 1/2 each.
2. 𝐀𝐜𝐜𝐞𝐩𝐭 if 𝐴 ⋅ (𝐵 ⋅ ത𝒓) = 𝐶 ⋅ ത𝒓; o. w. 𝐫𝐞𝐣𝐞𝐜𝐭.
(input: 𝑛 × 𝑛 matrices A, B, C)Algorithm Basic Frievalds
Theorem
If 𝐴 ⋅ 𝐵 ≠ 𝐶, Basic-Frievalds accepts with probability ≤ 1/2.
Analysis of Error Probability
Proof: Suppose 𝐴 ⋅ 𝐵 ≠ 𝐶 and let 𝐷 = 𝐴𝐵 − 𝐶
𝐴 ⋅ 𝐵 ⋅ ത𝒓 ≠ 𝐶 ⋅ ത𝒓
𝐷 has a nonzero entry.
9/14/2021 Sofya Raskhodnikova; Randomness in Computing
Theorem
If 𝐴 ⋅ 𝐵 ≠ 𝐶, Basic-Frievalds accepts with probability ≤ 1/2.
Principle of Deferred Decisions
Idea: It does not matter in which order 𝑟𝑘 are chosen!
• First choose 𝑟1, … , 𝑟6, 𝑟8, … , 𝑟𝑛. Then 𝑟7• Before 𝑟7 is chosen, the RHS of our equation is determined: