randomized algorithms cs648

27
Randomized Algorithms CS648 Lecture 5 Algebraic Techniques Frievald’s Algorithm Fingerprinting Techniques 1

Upload: chace

Post on 04-Jan-2016

57 views

Category:

Documents


0 download

DESCRIPTION

Randomized Algorithms CS648. Lecture 5 Algebraic Techniques Frievald’s Algorithm Fingerprinting Techniques. Frievald’s technique Application Matrix Product verification. Frievald’s Algorithm ( Rusins Frievald , 1977). Problem: Given three -by- matrices , , and , determine if . - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Randomized Algorithms CS648

Randomized AlgorithmsCS648

Lecture 5• Algebraic Techniques

• Frievald’s Algorithm

• Fingerprinting Techniques

1

Page 2: Randomized Algorithms CS648

FRIEVALD’S TECHNIQUEAPPLICATION

MATRIX PRODUCT VERIFICATION

2

Page 3: Randomized Algorithms CS648

Frievald’s Algorithm(Rusins Frievald, 1977)

Problem: Given three -by-matrices , , and , determine if .

Best deterministic algorithm: • ;• Verify if ?

3

≟ ⨯

12…𝑛

2

𝑪 𝑨 𝑩

Time complexity: , current value of

Page 4: Randomized Algorithms CS648

Frievald’s Algorithm(Rusins Frievald, 1977)

4

≟⨯

𝑪

𝑨 𝑩

⨯ 0

0

0

0

𝒙 𝒚

𝒛𝒙

Page 5: Randomized Algorithms CS648

Frievald’s Algorithm(Rusins Frievald, 1977)

RandomProductVerify(,,) Let be a -by-matrix (vector) whose elements are selected randomly uniformly and independently from {0,1}. ; ; If() output “AB=C”

else output “AB≠C”

Time complexity:

5

Page 6: Randomized Algorithms CS648

Frievald’s Algorithm(Analyzing error probability)

Question: If , what is the probability that the algorithm outputs “AB=C” ?

Let = Observation: If , then surely is not a null matrix.

Error Probability of the algorithm = P( )

()

6

𝑫 ∙ 𝒙=𝟎

null vector

Page 7: Randomized Algorithms CS648

Frievald’s Algorithm(Analyzing error probability)

) depends upon . So what to do ? Our goal is to get an upper bound on this probability. So we start with the least information about , which is: There is at least one non-zero element in . Let this element be . • P() = P() P()

So we need to focus on the product of th row and vector .

7

12…𝑛

2

𝑫 𝒙

𝑘

𝑖

Page 8: Randomized Algorithms CS648

Frievald’s Algorithm(Analyzing error probability)

P() = P( + … + = 0)

The underlying sample space has elementary events. Convince yourself that it is indeed difficult to calculate this probability from standard tools which you know.

Here we shall introduce a yet another simple but very powerful probability tool…

8

12…𝑛

2

𝑫 𝒙

𝑘

𝑖

Page 9: Randomized Algorithms CS648

Probability tool:Partition of sample space

A set of events ,…, defined over a probability space (,P) is said to induce a partition of if• = • =∅ for all

Theorem: (Partition theorem) Given an event , we can express P() in terms of a given partition as:

P() = ) = )∙ using conditional probability

9

Ω𝜀𝐀1

𝐀 2𝐀 3

𝐀 4

𝐀5

𝐀 6

Page 10: Randomized Algorithms CS648

Question: When to use the Partition theorem ?

Let be an event defined over a probability space (,P). Suppose it turns out that it is not easy to calculate or get a good bound on P() directly using the standard tools. In such situation, one may explore the following possibility:Try to design a partition {,…, } of the sample space such that ) is easy to calculate. This may be used to calculate ).

IMPORTANT: Most of the times, ) turns out to be independent of . In this case, ) can be bounded directly as follows.

If |) for every possible value of , then

P() = )∙ ∙

10

Page 11: Randomized Algorithms CS648

Frievald’s Algorithm(Analyzing error probability)

P( + … + = 0 ) = ??

Suggestion: Think of some suitable partition of that will enable you to use the partition theorem effectively to calculate P().

We shall use the partition defined by the values taken by all the random variables excluding .

Think over this partition before proceeding further.

11

𝜀

Page 12: Randomized Algorithms CS648

Frievald’s Algorithm(Analyzing error probability)

P( + … + = 0 ) = ?? Question: What is the probability of conditioned on any arbitrary but fixed values taken by all ?Answer: Consider any values We are interested in the probability of event conditioned on “”. This probability can be expressed as :))

)

12

≠0

𝜀

Could be 0, 1 or some other number

Page 13: Randomized Algorithms CS648

Frievald’s Algorithm(Analyzing error probability)

Theorem: The probability that algorithm RandomProductVerify(,,) makes an error is at most .

Note: There is nothing magical about . If each element of the random vector is selected randomly uniformly and independently from a set of values, the

corresponding probability of error will be .

Question: How to reduce the error probability to ?Answer: repeat the algorithm times. (think over this answer carefully before proceeding further)

13

Page 14: Randomized Algorithms CS648

Frievald’s Algorithm(reducing the error probability)

RandomProductVerify(,,) Repeat times{ Let be a -by-matrix (vector) whose elements are selected randomly uniformly and independently from {0,1}. ; ; If() { output “AB ≠ C” ; break} } output “AB = C”

Time complexity: Error probability:

14

Page 15: Randomized Algorithms CS648

Frievald’s Algorithm (final result)

Theorem: Given three -by-matrices , , and , there is a Randomized Monte Carlo algorithm which determines . The running time is , and the error probability is less than .

15

Page 16: Randomized Algorithms CS648

FINGERPRINTINGAPPLICATION

CRYPTOGRAPHY

16

Page 17: Randomized Algorithms CS648

PRIME NUMBERS(SOME BASIC FACTS)

17

Page 18: Randomized Algorithms CS648

How many primes less than ?

18

Primes less than

100 25

1000 168

10000 1229

100000 9592

1000000 78498

Page 19: Randomized Algorithms CS648

How many primes less than ?

Theorem: The number of primes less than is .[An elementary proof: Paul Erdӧs, 1949 ]

Notation: the number of primes less than .

19

Page 20: Randomized Algorithms CS648

Prime factors of a number ?

Question: How many prime factors are for a positive integer ?

Answer: less than .Proof: just use • unique prime factorization theorem (every integer can be uniquely

expressed as product of powers of prime numbers. For example: 3500=)• The fact that every prime factor must be

20

Page 21: Randomized Algorithms CS648

21

Aim: To determine if File A identical to File B by communicating fewest bits ?

File A File B

Page 22: Randomized Algorithms CS648

Question: What is a File ?Answer:

A bit string.

22

Page 23: Randomized Algorithms CS648

Visualize a file as a binary number

File A = … File B = …

= =

(trivial) Observation: File A = File B if and only if

Question: How large a number can (or ) be ?Answer: less than .

23

Page 24: Randomized Algorithms CS648

RandomEqualityChecking-Protocol(,)

Processing at the sender computer : 1. Let be a prime number selected randomly uniformly from []

2. mod ;3. sender sends (,) to receiver .

Processing at the receiver computer:4. (,) is received from sender.

5. mod ;6. If() send “A=B” to the sender else send “A≠B” to the sender Number of Bits transmitted:

24

Page 25: Randomized Algorithms CS648

RandomEqualityChecking-Protocol(bounding the error probability)

Question: If , what is the probability that the protocol concludes “A=B” ?

Let = Observation: If , then surely .

The protocol makes an error iff

() divides “is one of the prime factors of ” Error probability = ??

25

How many prime factors can have ?

at most since is less than .

𝑛𝜋(𝑡 )

How many choices are there for ?

since is a random prime number from

Page 26: Randomized Algorithms CS648

RandomEqualityChecking-Protocol(bounding the error probability)

Lemma: The probability RandomEqualityChecking-Protocol makes an error is .

Question: How large should be in order to achieve error probability < ?Answer: Pick > log . ≈ . > > for

Bits transmitted: = O()

26

Page 27: Randomized Algorithms CS648

• Please go through the slides of this lecture carefully and patiently. You are welcome to discuss any doubt in the next class (Saturday, 17th August)

27