Randomized Algorithms - PowerPoint PPT Presentation

1 / 5
About This Presentation
Title:

Randomized Algorithms

Description:

the Legendre symbol. 1 if x is a quadratic residue. modulo p -1 otherwise ... Legendre symbols can be computed in polynomial time. Lemma: Euler Criterion ... – PowerPoint PPT presentation

Number of Views:66
Avg rating:3.0/5.0
Slides: 6
Provided by: kenpo7
Category:

less

Transcript and Presenter's Notes

Title: Randomized Algorithms


1
Randomized Algorithms
  • A deterministic algorithm with the capability of
    making random choices

Quicksort
Worst-case ?(n2)
Expected running-time O( n log n)
Randomized Quicksort
Both algorithms work correctly
2
Primarily Testing
  • PRIME given a positive integer n in the binary
    form, determine whether n is a prime number
  • GOAL a randomized algorithm that solves PRIME in
    polynomial time, with an arbitrarily small error
    probability ?
  • Set Zn, for any n gt 0
  • Zn x ? N ?0 lt x lt n, gcd(x, n) 1
  • If a number p is prime, then
  • Zp 1, 2, , p - 1

3
  • For any prime p and x ? Zp
  • the Legendre symbol
  • 1 if x is a quadratic residue
  • modulo p
  • -1 otherwise
  • a number x is a quadratic residue modulo p if for
    any x ? Zp
  • x ? y2 mod p for some y ? Zp
  • Fact. Legendre symbols can be computed in
    polynomial time
  • Lemma Euler Criterion
  • For all primes p gt 2 and x ? Zp

4
  • Randomized Algorithm for PRIME
  • Input n, ?
  • k ? - ?log ??
  • for i ? 1 to k do
  • choose random x in the range
  • 1, , n - 1
  • if gcd(x, n) ? 1 then
  • output NO and halt
  • if
    then
  • output NO and halt
  • output YES and halt

5
  • The randomized algorithm for PRIME outputs NO
    with probability ? 1 - ?, thanks to
  • Lemma
  • If n is an odd, composite number,
  • A x ? Zn ?gcd(x, n) 1 and

  • is a proper subgroup of Zn and, hence, has size
    ?A? ? (n - 1) / 2
Write a Comment
User Comments (0)
About PowerShow.com