Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Fingerprinting techniques. 2 Is X equal to Y? = ? = ?

Similar presentations


Presentation on theme: "1 Fingerprinting techniques. 2 Is X equal to Y? = ? = ?"— Presentation transcript:

1 1 Fingerprinting techniques

2 2 Is X equal to Y? = ? = ?

3 3 Are Two Matrices Identical?

4 4 The problem Input: two n-by-n matrices A and B. Output: determining whether A = B? A B = ?

5 5 Naïve approach Comparing all elements. Needs n 2 comparisons. Can we reduce the number of comparisons if a small probability of error is allowed?

6 6 Fingerprinting approach 1.Choose an n-element column vector r, –where each element of r is either 0 or 1 independently and equally likely. –Comment: As a matter of fact, 0 and 1 can be any two distinct numbers. 2.Compare Ar and Br, and output whether they are identical.

7 7 Fingerprinting A B = ? = ? A r B r Only n comparisons.

8 8 Error Probability?

9 9 Proof

10 10 Bounding the probability

11 11 Therefore, …

12 12 Criticism: Computing Ar takes Ω(n 2 ) time. A B = ? = ? A r B r Only n comparisons.

13 13 More interesting example: Is AB = C? Input: three n-by-n matrices A, B, C. Output: determining whether AB = C. Naïve approach takes O(n 3 ) time for matrix multiplication and O(n 2 ) time for comparison. –Or, the fast matrix multiplication takes O(n 2.37 ) time.

14 14 Fingerprinting approach Choose an n-element column vector r, –where each element of r is either 0 or 1 independently and equally likely. –Comment: As a matter of fact, 0 and 1 can be any two distinct numbers. Compare ABr and Cr, and output whether they are identical.

15 15 Fingerprinting A C = ? = ? B r C r Only n comparisons. B A Only O(n 2 ) comparisons. Only O(n 2 ) operations

16 16 Error Probability?

17 17 Are two Polynomials Identical?

18 18 Is A(x)*B(x) = C(x)? Input: –A(x) and B(x) are two degree-n polynomials. –C(x) is a degree-2n polynomial. Output: –Determine whether the product of A(x) and B(x) is equal to C(x).

19 19 Naïve approach Multiplying A(x) and B(x) takes Ω(n log n) time –e.g., using Fast Fourier Transform. Comparing A(x)*B(x) and C(x) takes Ω(n) time.

20 20 Fingerprinting approach 1.Let R consist of arbitrary 4n distinct numbers. 2.Choose a number r from R uniformly at random. 3.Evaluate A(r)*B(r) and C(r), and output whether they are identical. Time complexity –O(n) for computation; –O(1) for comparison.

21 21 Error Probability?

22 22 Proof

23 23 Are Two Strings Identical?

24 24 The problem Input: Two n bit strings A and B. Output: determining whether A = B. Naïve approach requires comparing all n bits of both strings.

25 25 The story Each of Alice and Bob maintains a copy of the same n-bit database. They have to make sure that both copies are indeed identical. Can they discover inconsistency with high probability by comparing only poly-log number of bits?

26 26 Fingerprinting approach Let a (resp., b) be the n-bit number whose binary representation is A (resp., B). Randomly choose a polylog(n)-bit prime number p. –(For example, p ≦ 2n 2 log 2 n.) Alice compute the remainder r of a divided by p. Bob compute the remainder s of b divided by p. Output whether r = s.

27 27 Error Probability?

28 28 Two Facts Prime Number Theorem –The number of primes smaller than m is asymptotically m/ln m. Observation –The number of distinct prime divisors of an n- bit number is O(n). (Why?)

29 29 Proof


Download ppt "1 Fingerprinting techniques. 2 Is X equal to Y? = ? = ?"

Similar presentations


Ads by Google