Эффективные алгоритмы, осень 2007: Вероятностные алгоритмы

  • View
    68

  • Download
    1

Embed Size (px)

Transcript

  • / 6:

    .

    Computer Science http://logic.pdmi.ras.ru/infclub/

    . (CS ) 6. 1 / 32

    http://logic.pdmi.ras.ru/~infclub/

  • 1

    2

    3

    4

    . (CS ) 6. 2 / 32

  • 1

    2

    3

    4

    . (CS ) 6. 2 / 32

  • 1

    2

    3

    4

    . (CS ) 6. 2 / 32

  • 1

    2

    3

    4

    . (CS ) 6. 2 / 32

  • 1

    2

    3

    4

    . (CS ) 6. 3 / 32

  • n n A, B , C . A B = C . A B C . O(n3), O(n2.376). , O(n2) .

    . (CS ) 6. 4 / 32

  • n n A, B , C . A B = C .

    A B C . O(n3), O(n2.376). , O(n2) .

    . (CS ) 6. 4 / 32

  • n n A, B , C . A B = C . A B C .

    O(n3), O(n2.376). , O(n2) .

    . (CS ) 6. 4 / 32

  • n n A, B , C . A B = C . A B C . O(n3), O(n2.376).

    , O(n2) .

    . (CS ) 6. 4 / 32

  • n n A, B , C . A B = C . A B C . O(n3), O(n2.376). , O(n2) .

    . (CS ) 6. 4 / 32

  • Rand-Matrix-Equiv(A, B , C )

    x {0, 1}n

    y = B x z = A y t = C x , z = t

    A (B x) = C x . .

    . (CS ) 6. 5 / 32

  • Rand-Matrix-Equiv(A, B , C )

    x {0, 1}n

    y = B x z = A y t = C x , z = t

    A (B x) = C x . .

    . (CS ) 6. 5 / 32

  • Rand-Matrix-Equiv(A, B , C )

    x {0, 1}n

    y = B x

    z = A y t = C x , z = t

    A (B x) = C x . .

    . (CS ) 6. 5 / 32

  • Rand-Matrix-Equiv(A, B , C )

    x {0, 1}n

    y = B x z = A y

    t = C x , z = t

    A (B x) = C x . .

    . (CS ) 6. 5 / 32

  • Rand-Matrix-Equiv(A, B , C )

    x {0, 1}n

    y = B x z = A y t = C x

    , z = t

    A (B x) = C x . .

    . (CS ) 6. 5 / 32

  • Rand-Matrix-Equiv(A, B , C )

    x {0, 1}n

    y = B x z = A y t = C x , z = t

    A (B x) = C x . .

    . (CS ) 6. 5 / 32

  • Rand-Matrix-Equiv(A, B , C )

    x {0, 1}n

    y = B x z = A y t = C x , z = t

    A (B x) = C x . .

    . (CS ) 6. 5 / 32

  • Rand-Matrix-Equiv(A, B , C )

    x {0, 1}n

    y = B x z = A y t = C x , z = t

    A (B x) = C x . .

    . (CS ) 6. 5 / 32

  • Rand-Matrix-Equiv(A, B , C )

    x {0, 1}n

    y = B x z = A y t = C x , z = t

    A (B x) = C x .

    .

    . (CS ) 6. 5 / 32

  • Rand-Matrix-Equiv(A, B , C )

    x {0, 1}n

    y = B x z = A y t = C x , z = t

    A (B x) = C x . .

    . (CS ) 6. 5 / 32

  • Rand-Matrix-Equiv O(n2) 1/2. , A B = C .

    , A B = C . , , , (A B C ) x = 0. d = (d1, . . . , dn) A B C ( , A B = C )., d1 = 0.

    . (CS ) 6. 6 / 32

  • Rand-Matrix-Equiv O(n2) 1/2. , A B = C .

    , A B = C .

    , , , (A B C ) x = 0. d = (d1, . . . , dn) A B C ( , A B = C )., d1 = 0.

    . (CS ) 6. 6 / 32

  • Rand-Matrix-Equiv O(n2) 1/2. , A B = C .

    , A B = C . , , , (A B C ) x = 0.

    d = (d1, . . . , dn) A B C ( , A B = C )., d1 = 0.

    . (CS ) 6. 6 / 32

  • Rand-Matrix-Equiv O(n2) 1/2. , A B = C .

    , A B = C . , , , (A B C ) x = 0. d = (d1, . . . , dn) A B C ( , A B = C ).

    , d1 = 0.

    . (CS ) 6. 6 / 32

  • Rand-Matrix-Equiv O(n2) 1/2. , A B = C .

    , A B = C . , , , (A B C ) x = 0. d = (d1, . . . , dn) A B C ( , A B = C )., d1 = 0.

    . (CS ) 6. 6 / 32

  • ()

    x n

    i=1 dixi . 0 , x1 = h(x2, . . . , xn),

    h(x2, . . . , xn) = n

    i=2 dixid1

    .

    , h , 0 1. 1/2 x1 = h(x2, . . . , xn).

    . (CS ) 6. 7 / 32

  • ()

    x

    ni=1 dixi .

    0 , x1 = h(x2, . . . , xn),

    h(x2, . . . , xn) = n

    i=2 dixid1

    .

    , h , 0 1. 1/2 x1 = h(x2, . . . , xn).

    . (CS ) 6. 7 / 32

  • ()

    x

    ni=1 dixi .

    0 , x1 = h(x2, . . . , xn),

    h(x2, . . . , xn) = n

    i=2 dixid1

    .

    , h , 0 1. 1/2 x1 = h(x2, . . . , xn).

    . (CS ) 6. 7 / 32

  • ()

    x

    ni=1 dixi .

    0 , x1 = h(x2, . . . , xn),

    h(x2, . . . , xn) = n

    i=2 dixid1

    .

    , h , 0 1.

    1/2 x1 = h(x2, . . . , xn).

    . (CS ) 6. 7 / 32

  • ()

    x

    ni=1 dixi .

    0 , x1 = h(x2, . . . , xn),

    h(x2, . . . , xn) = n

    i=2 dixid1

    .

    , h , 0 1. 1/2 x1 = h(x2, . . . , xn).

    . (CS ) 6. 7 / 32

  • 1

    2

    3

    4

    . (CS ) 6. 8 / 32

  • a b, , ( , ). : , . a mod p b mod p. 2 log2 p .

    . (CS ) 6. 9 / 32

  • a b, , ( , ).

    : , . a mod p b mod p. 2 log2 p .

    . (CS ) 6. 9 / 32

  • a b, , ( , ). : , .

    a mod p b mod p. 2 log2 p .

    . (CS ) 6. 9 / 32

  • a b, , ( , ). : , . a mod p b mod p.

    2 log2 p .

    . (CS ) 6. 9 / 32

  • a b, , ( , ). : , . a mod p b mod p. 2 log2 p .

    . (CS ) 6. 9 / 32

  • (prime distribution function)(n) , n.

    :

    limn

    (n)n/ ln n

    = 1.

    . (CS ) 6. 10 / 32

  • (prime distribution function)(n) , n.

    :

    limn

    (n)n/ ln n

    = 1.

    . (CS ) 6. 10 / 32

  • Rand-String-Equiv(a, b)

    |a| = |b| = n, N = n2 log2 n2. p [2..N]. , a mod p = b mod p. .

    Rand-String-Equiv O(1/n) O(log n) .

    . (CS ) 6. 11 / 32

  • Rand-String-Equiv(a, b)

    |a| = |b| = n, N = n2 log2 n2.

    p [2..N]. , a mod p = b mod p. .

    Rand-String-Equiv O(1/n) O(log n) .

    . (CS ) 6. 11 / 32

  • Rand-String-Equiv(a, b)

    |a| = |b| = n, N = n2 log2 n2. p [2..N].

    , a mod p = b mod p. .

    Rand-String-Equiv O(1/n) O(log n) .

    . (CS ) 6. 11 / 32

  • Rand-String-Equiv(a, b)

    |a| = |b| = n, N = n2 log2 n2. p [2..N]. , a mod p = b mod p.

    .

    Rand-String-Equiv O(1/n) O(log n) .

    . (CS ) 6. 11 / 32

  • Rand-String-Equiv(a, b)

    |a| = |b| = n, N = n2 log2 n2. p [2..N]. , a mod p = b mod p. .

    Rand-String-Equiv O(1/n) O(log n) .

    . (CS ) 6. 11 / 32

  • Rand-String-Equiv(a, b)

    |a| = |b| = n, N = n2 log2 n2. p [2..N]. , a mod p = b mod p. .

    Rand-String-Equiv O(1/n) O(log n) .

    . (CS ) 6. 11 / 32

  • :2 log2 p 2 log2 N = 2 log2(n2 log2 n2) = O(log2 n). , a = b, p (a b) 0 mod p. p

    |{p P : (a b) 0 mod p}| n.

    ,

    O(

    nN/ lnN

    )= O

    (n(log n2 + log log n2)

    n2 log n2

    )= O

    (1n

    ).

    . (CS ) 6. 12 / 32

  • :2 log2 p 2 log2 N = 2 log2(n2 log2 n2) = O(log2 n).

    , a = b, p (a b) 0 mod p. p

    |{p P : (a b) 0 mod p}| n.

    ,

    O(

    nN/ lnN

    )= O

    (n(log n2 + log log n2)

    n2 log n2

    )= O

    (1n

    ).

    . (CS ) 6. 12 / 32

  • :2 log2 p 2 log2 N = 2 log2(n2 log2 n2) = O(log2 n). , a = b, p (a b) 0 mod p.

    p

    |{p P : (a b) 0 mod p}| n.

    ,

    O(

    nN/ lnN

    )= O

    (n(log n2 + log log n2)

    n2 log n2

    )= O

    (1n

    ).

    . (CS ) 6. 12 / 32

  • :2 log2 p 2 log2 N = 2 log2(n2 log2 n2) = O(log2 n). , a = b, p (a b) 0 mod p. p

    |{p P : (a b) 0 mod p}| n.

    ,

    O(

    nN/ lnN

    )= O

    (n(log n2 + log log n2)

    n2 log n2

    )= O

    (1n

    ).

    . (CS ) 6. 12 / 32

  • :2 log2 p 2 log2 N = 2 log2(n2 log2 n2) = O(log2 n). , a = b, p (a b) 0 mod p. p

    |{p P : (a b) 0 mod p}| n.

    ,

    O(

    nN/ lnN

    )= O

    (n(log n2 + log log n2)

    n2 log n2

    )= O

    (1n

    ).

    . (CS ) 6. 12 / 32

  • 1

    2

    3

    4

    . (CS ) 6. 13 / 32

  • f (x1, . . . , xn), f = 0 (f 0 ). , , , , , 0 . . : . 0, , 0. 0, .

    . (CS ) 6. 14 / 32

  • f (x1, . . . , xn), f = 0 (f 0 ).

    , , , , , 0 . . : . 0, , 0. 0, .

    . (CS ) 6. 14 / 32

  • f (x1, . . . , xn), f = 0 (f 0 ). , , , , , 0 . .

    : . 0, , 0. 0, .

    . (CS ) 6. 14 / 32

  • f (x1, . . . , xn), f = 0 (f 0 ). , , , , , 0 . . : .

    0, , 0. 0, .

    . (CS ) 6. 14 / 32

  • f (x1, . . . , xn), f = 0 (f 0 ). , , , , , 0 . . : . 0, , 0.

    0, .

    . (CS ) 6. 14 / 32

  • f (x1, . . . , xn), f = 0 (f 0 ). , , , , , 0 . . : . 0, , 0. 0, .

    . (CS ) 6. 14 / 32

  • F , f (x1, . . . , xn) n . f