1 fingerprinting techniques. 2 is x equal to y? = ? = ?

29
1 Fingerprinting techniques

Upload: robyn-foster

Post on 12-Jan-2016

222 views

Category:

Documents


1 download

TRANSCRIPT

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

1

Fingerprinting techniques

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

2

Is X equal to Y?

=?

=?

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

3

Are Two Matrices Identical?

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

4

The problem

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

A B=?

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

5

Naïve approach

• Comparing all elements.• Needs n2 comparisons.

Can we reduce the number of comparisons if a small probability

of error is allowed?

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

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.

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

7

Fingerprinting

A B=?

=?

A r B r

Only n comparisons.

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

8

Error Probability?

Observation

Theorem

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

9

Proof

Let . We show that

Under the condition , there is a row of that has non-zero elements. Let be the non-zero elements in row of , where . Clearly,

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

10

Bounding the probability

We can pretend that is the last random choice of . When all the other elements of are determined, at most one choice of can satisfy the equality

Note that it is possible that neither choice of can satisfy the equality. However, it is impossible that both choices do, since is nonzero.

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

11

Therefore, …

0.5

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

12

Criticism: Computing Ar takes Ω(n2) time.

A B=?

=?

A r B r

Only n comparisons.

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

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(n3) time for matrix multiplication and O(n2) time for comparison.– Or, the fast matrix multiplication takes O(n2.37)

time.

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

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.

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

15

Fingerprinting

A C=?

=?

B r C r

Only n comparisons.

B

A

Only O(n2) comparisons.Only O(n2) operations

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

16

Error Probability?

Observation

Theorem

Proof: Straightforward from the previous theorem.

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

17

Are two Polynomials Identical?

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

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).

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

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.

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

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.

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

21

Error Probability?

Observation

Theorem

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

22

Proof

Under the condition that when can ?

Yes, has to be a root of the degree-2n polynomial

Since has at most 2n roots, randomly choosing an from , no matter what is, has probability at most 0.5 to satisfy .

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

23

Are Two Strings Identical?

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

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.

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

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?

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

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 2≦ n2 log2 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.

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

27

Error Probability?

Observation

Theorem:

where and .

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

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?)

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

29

Proof

Under the condition that can ?

Yes, has to be a (prime) divisor of .

Since , by the well-known Prime Number Theorem, has choices. Since is an n-bit number prime divisors. As a result, the probability that the randomly chosen p happens to be one of those prime divisor of is .