Factoring and Testing Primes in Small Space Viliam Geffert P.J.Šafárik University, Košice, Slovakia Dana Pardubská Comenius University, Bratislava, Slovakia
Factoring and Testing Primes in Small Space Viliam Geffert P.J.Šafárik University, Košice, Slovakia Dana Pardubská Comenius University, Bratislava, Slovakia
n is a prime
n is a prime if it cannot evenly be divided by any number other than 1 and itself
Euclid [280 B.C. ]: infinite number of primes
n is a prime if it cannot evenly be divided by any number other than 1 and itself Euclid [280 B.C. ]: infinite number of primes J.Hadamard, C.J.de la Valée Poussin [1896]:
n is a prime if it cannot evenly be divided by any number other than 1 and itself Euclid [280 B.C. ]: infinite number of primes J.Hadamard, C.J.de la Valée Poussin [1896]: Prime Number Theorem
n is a prime if it cannot evenly be divided by any number other than 1 and itself Euclid [280 B.C. ]: infinite number of primes J.Hadamard, C.J.de la Valée Poussin [1896]: Prime Number Theorem p m = (1 + o(1) ). m. ln m - p m denotes the m-th prime
Fundamental Theorem of Arithmetic - Factoring n = p i 1 k i 1. p i 2 k i 2. …. p i ℓ k i ℓ k i j > 0, integer
Fundamental Theorem of Arithmetic - Factoring n = p i 1 k i 1. p i 2 k i 2. …. p i ℓ k i ℓ k i j > 0, integer Factoring is computationally very hard
Fundamental Theorem of Arithmetic - Factoring n = p i 1 k i 1. p i 2 k i 2. …. p i ℓ k i ℓ k i j > 0, integer Factoring is computationally very hard - utilized to design secure cryptographic systems (data transmission over internet)
Primes= { n | n is a prime } - n binary coded
Primes= { n | n is a prime } - n binary coded un-Primes= {1 n | n is a prime }
Primes= { n | n is a prime } - n binary coded un-Primes= {1 n | n is a prime } Agrawal, Kayal, Saxena [2004]: Primes ϵ P
Primes= { n | n is a prime } - n binary coded un-Primes= {1 n | n is a prime } Agrawal, Kayal, Saxena [2004]: Primes ϵ P - no factorization, if n is composite
Primes= { n | n is a prime } - n binary coded un-Primes= {1 n | n is a prime } Agrawal, Kayal, Saxena [2004]: Primes ϵ P - no factorization, if n is composite P.Shor [1994]: polynomial time quantum algorithm for factoring
Primes= { n | n is a prime } - n binary coded un-Primes= {1 n | n is a prime } Agrawal, Kayal, Saxena [2004]: Primes ϵ P - no factorization, if n is composite P.Shor [1994]: polynomial time quantum algorithm for factoring How much space is sufficient?
(1) un-Primes ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n)
(1) un-Primes ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n) n
(1) un-Primes ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n) n
(1) un-Primes ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n) n
(1) un-Primes ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n) n O(loglog n) bits
(1) un-Primes ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n) n O(loglog n) bits
(1) un-Primes ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n)
(1) un-Primes ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n) ? Is n a prime ? … … YES: P PP
(1) un-Primes ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n) ? Is n a prime ? … … YES: … x1x1 1 … NO: x2x2 CC C P PP
(1) un-Primes ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n) ? Is n a prime ? … … YES: … x1x1 1 … NO: x2x2 - space below loglog n CC C P PP
(1) un-Primes ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n) ? Is n a prime ? … … YES: … x1x1 1 … NO: x2x2 … WRONG GUESS: - space above loglog n W CC C P PP
(1) un-Primes ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n)
(1) un-Primes ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n) (2) un-Composites ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n)
(1) un-Primes ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n) (2) un-Composites ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n) - (2) is not a trivial consequence of (1), since it is not known whether ASPACE(loglog n) is closed under complement
(1) un-Primes ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n) (2) un-Composites ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n) - (2) is not a trivial consequence of (1), since it is not known whether ASPACE(loglog n) is closed under complement - additional bonus - factoring
Algorithm based on “elementary school” primality testing: for X = 2, 3,..., n-1 do if X divides n then “n is composite” end “n is prime”
O(loglog n) space due to
- Modular representation (based on Chinese Remainder Theorem)
O(loglog n) space due to - Modular representation (based on Chinese Remainder Theorem) M = p 1. p 2. …. p m n = (z 1, …, z m ), z i = n mod p i
O(loglog n) space due to - Modular representation (based on Chinese Remainder Theorem) M = p 1. p 2. …. p m n = (z 1, …, z m ), z i = n mod p i memory space: log p m O(loglog n)
O(loglog n) space due to - Modular representation (based on Chinese Remainder Theorem) M = p 1. p 2. …. p m n = (z 1, …, z m ), z i = n mod p i memory space: log p m O(loglog n) - Scalar representation
O(loglog n) space due to - Modular representation (based on Chinese Remainder Theorem) M = p 1. p 2. …. p m n = (z 1, …, z m ), z i = n mod p i memory space: log p m O(loglog n) - Scalar representation n = α. M, α ϵ 0,1)
O(loglog n) space due to - Modular representation (based on Chinese Remainder Theorem) M = p 1. p 2. …. p m n = (z 1, …, z m ), z i = n mod p i memory space: log p m O(loglog n) - Scalar representation n = α. M, α ϵ 0,1) -- truncated to 3. loglog n bits
__ Z = (z 1, …, z m ), Z < √MM = p 1. p 2. …. p m M 0 Z
__ Z = (z 1, …, z m ), Z < √MM = p 1. p 2. …. p m M 0 Z In reality
__ Z = (z 1, …, z m ), Z < √MM = p 1. p 2. …. p m M 0 Z Z In reality
__ Z = (z 1, …, z m ), Z < √MM = p 1. p 2. …. p m M 0 Z
__ Z = (z 1, …, z m ), Z < √MM = p 1. p 2. …. p m m O(log Z) M 0 Z
__ Z = (z 1, …, z m ), Z < √MM = p 1. p 2. …. p m m O(log Z) p m O(m. log m) O(log Z. loglog Z) M 0 Z
__ Z = (z 1, …, z m ), Z < √MM = p 1. p 2. …. p m m O(log Z) p m O(m. log m) O(log Z. loglog Z) log p m O(loglog Z) M 0 Z
__ Z = (z 1, …, z m ), Z < √MM = p 1. p 2. …. p m ? Is Z a prime ? M 0 Z
__ Z = (z 1, …, z m ), Z < √MM = p 1. p 2. …. p m ? Is Z a prime ? if z i = 0 then “ Z is a composite ” M 0 Z
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 ? Is Z a prime ? M 0 Z
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 Z is a prime iff X = (x 1, …, x m ), X ϵ {2, …, Z-1} X does not divide Z M 0 Z X
M 0 Z X __ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 Z is a prime iff X = (x 1, …, x m ), X ϵ {2, …, Z-1} X does not divide Z Z
M 0 Z X __ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 Z is a prime iff X = (x 1, …, x m ), X ϵ {2, …, Z-1} X does not divide Z Z branching universally at each X ϵ {2, …, Z-1}
M 0 Z X __ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 Z is a prime iff X = (x 1, …, x m ), X ϵ {2, …, Z-1} X does not divide Z Z branching universally at each X ϵ {2, …, Z-1}
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 Z is a prime iff X = (x 1, …, x m ), X ϵ {2, …, Z-1} X does not divide Z M 0 Z X Z X
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 Z is a prime iff X = (x 1, …, x m ), X ϵ {2, …, Z-1} X does not divide Z M 0 Z X
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} ? X divides Z ? M 0 Z X
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} ? X divides Z ? if x i = 0 then “ X does not divide Z ” M 0 Z X
M 0 Z X __ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} ? X divides Z ? Z X
M 0 Z X __ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} ? X divides Z ? Z x i required, for some i X
M 0 Z X __ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} ? X divides Z ? Z log p m space log p m O(loglog Z) x i required, for some i compute p i X
M 0 Z X __ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} ? X divides Z ? Z log p m space log p m O(loglog Z) x i required, for some i compute p i existentially guess x i ϵ {0, …, p i -1} X xixi
M 0 Z X __ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} ? X divides Z ? Z split universally compute p i existentially guess x i ϵ {0, …, p i -1} X xixi xixi
M 0 Z X __ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} ? X divides Z ? Z split universally - one parallel process verifies the guessed value x i X xixi xixi pipi pipi pipi xixi
M 0 Z X __ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} ? X divides Z ? Z X xixi - one parallel process executes the main program, assuming the guessed value x i is correct
M 0 Z X __ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} ? X divides Z ? Z z i required, for some i X
M 0 Z X __ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} ? X divides Z ? Z log p m space log p m O(loglog Z) z i required, for some i compute p i X
M 0 Z X __ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} ? X divides Z ? Z log p m space log p m O(loglog Z) z i required, for some i compute p i existentially guess z i ϵ {0, …, p i -1} X zizi
M 0 Z X __ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} ? X divides Z ? Z split universally compute p i existentially guess z i ϵ {0, …, p i -1} X zizi zizi
M 0 Z X __ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} ? X divides Z ? Z split universally - one parallel process verifies the guessed value z i X zizi zizi
M 0 Z X __ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} ? X divides Z ? Z split universally - one parallel process verifies the guessed value z i X zizi pipi pipi zizi zizi
M 0 Z X __ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} ? X divides Z ? Z X zizi - one parallel process executes the main program, assuming the guessed value z i is correct
M 0 Z X __ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} ? X divides Z ? Z X log p m O(loglog Z) z 1, z 2, …, z m x 1, x 2, …, x m
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} ? X divides Z ? if x i = 0 then “ X does not divide Z ” M 0 Z X
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0, x i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} ? X divides Z ? M 0 Z X
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0, x i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} X divides Z iff X [M] -1 [M] * Z Z M 0 Z X
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0, x i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} X divides Z iff X [M] -1 [M] * Z Z M= p 1. p 2. …. p m M 0 Z X
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0, x i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} X divides Z iff X [M] -1 [M] * Z Z M= p 1. p 2. …. p m X [M] * Y= (X * Y) mod M = (x 1 [p 1 ] * y 1, …, x m [p m ] * y m ) M 0 Z X
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0, x i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} X divides Z iff X [M] -1 [M] * Z Z M= p 1. p 2. …. p m X [M] * Y= (X * Y) mod M = (x 1 [p 1 ] * y 1, …, x m [p m ] * y m ) X [M] -1 : X [M] * X [M] -1 = 1 X [M] -1 = (x 1 [ p 1] -1, …, x m [ p m] -1 ), i: x i ≠ 0 M 0 Z X
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0, x i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} X divides Z iff X [M] -1 [M] * Z Z M 0 Z X
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0, x i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} X divides Z iff X [M] -1 [M] * Z Z Y = (y 1, …, y m ) M 0 Z X Y
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0, x i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} X divides Z iff X [M] -1 [M] * Z Z if Y Z then “ X divides Z ” else “ X does not divide Z ” Y = (y 1, …, y m ) M 0 Z X Y
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0, x i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} X divides Z iff X [M] -1 [M] * Z Z if Y Z then “ X divides Z ” else “ X does not divide Z ” Y = (y 1, …, y m ) M 0 Z X Y Z X
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0, x i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} X divides Z iff X [M] -1 [M] * Z Z if Y Z then “ X divides Z ” else “ X does not divide Z ” Y = (y 1, …, y m ) M 0 Z X Y Z X z 1, z 2, …, z m x 1, x 2, …, x m
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0, x i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} X divides Z iff X [M] -1 [M] * Z Z if Y Z then “ X divides Z ” else “ X does not divide Z ” Y = (y 1, …, y m ) M 0 Z X Y Z X y i required, for some i z 1, z 2, …, z m x 1, x 2, …, x m
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0, x i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} X divides Z iff X [M] -1 [M] * Z Z if Y Z then “ X divides Z ” else “ X does not divide Z ” Y = (y 1, …, y m ) M 0 Z X Y Z X y i required, for some i compute x i z 1, z 2, …, z m x 1, x 2, …, x m
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0, x i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} X divides Z iff X [M] -1 [M] * Z Z if Y Z then “ X divides Z ” else “ X does not divide Z ” Y = (y 1, …, y m ) M 0 Z X Y Z X y i required, for some i compute x i compute z i z 1, z 2, …, z m x 1, x 2, …, x m
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0, x i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} X divides Z iff X [M] -1 [M] * Z Z if Y Z then “ X divides Z ” else “ X does not divide Z ” Y = (y 1, …, y m ) M 0 Z X Y Z X y i required, for some i compute x i compute z i y i := x i [ p i] -1 [p i ] * z i z 1, z 2, …, z m x 1, x 2, …, x m
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0, x i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} X divides Z iff X [M] -1 [M] * Z Z if Y Z then “ X divides Z ” else “ X does not divide Z ” Y = (y 1, …, y m ) M 0 Z X Y
__ Z = (z 1, …, z m ), Z < √M, i : z i ≠ 0, x i ≠ 0 X = (x 1, …, x m ), X ϵ {2, …, Z-1} X divides Z iff X [M] -1 [M] * Z Z - to solve the problem we only need an algorithm deciding whether Y Z - for any given Y Y = (y 1, …, y m ) M 0 Z X Y
__ Z = (z 1, …, z m ), 0 Z < √M Y = (y 1, …, y m ), 0 Y < M ? Y Z ? M 0 Z Y
__ Z = (z 1, …, z m ), 0 Z < √M Y = (y 1, …, y m ), 0 Y < M ? Y Z ? Thm: Let Z = (z 1, …, z m ) and Y = (y 1, …, y m ) be two numbers in the residual representation, Z M/2. M 0 Z Y
__ Z = (z 1, …, z m ), 0 Z < √M Y = (y 1, …, y m ), 0 Y < M ? Y Z ? Thm: Let Z = (z 1, …, z m ) and Y = (y 1, …, y m ) be two numbers in the residual representation, Z M/2. If the values z i and y i can effectively be computed in O(log p m ) space, for each given i {1, …, m}, M 0 Z Y
__ Z = (z 1, …, z m ), 0 Z < √M Y = (y 1, …, y m ), 0 Y < M ? Y Z ? Thm: Let Z = (z 1, …, z m ) and Y = (y 1, …, y m ) be two numbers in the residual representation, Z M/2. If the values z i and y i can effectively be computed in O(log p m ) space, for each given i {1, …, m}, then the question of whether Y Z can also be decided in O(log p m ) space. M 0 Z Y
__ Z = (z 1, …, z m ), 0 Z < √M Y = (y 1, …, y m ), 0 Y < M ? Y Z ? Idea: convert Y and Z into scalar representation: M 0 Z Y
__ Z = (z 1, …, z m ), 0 Z < √M Y = (y 1, …, y m ), 0 Y < M ? Y Z ? Idea: convert Y and Z into scalar representation: Y = α y. M α y, α z ϵ 0,1) Z = α z. M M 0 Z Y
__ Z = (z 1, …, z m ), 0 Z < √M Y = (y 1, …, y m ), 0 Y < M ? Y Z ? Idea: convert Y and Z into scalar representation: Y = α y. M α y, α z ϵ 0,1) Z = α z. M M 0 Z Y
__ Z = (z 1, …, z m ), 0 Z < √M Y = (y 1, …, y m ), 0 Y < M ? Y Z ? Idea: convert Y and Z into scalar representation: Y = α y. M α y, α z ϵ 0,1) Z = α z. M Y Z iff α y α z M 0 Z Y
__ Z = (z 1, …, z m ), 0 Z < √M Y = (y 1, …, y m ), 0 Y < M ? Y Z ? Idea: convert Y and Z into scalar representation: Y = α y. M α y, α z ϵ 0,1) Z = α z. M Y Z iff α y α z -- trunctated to 3. loglog n bits M 0 Z Y
__ Z = (z 1, …, z m ), 0 Z < √M Y = (y 1, …, y m ), 0 Y < M ? Y Z ? M 0 Z Y
__ Z = (z 1, …, z m ), 0 Z < √M Y = (y 1, …, y m ), 0 Y < M ? Y Z ? if Y M / 2 then “ Y > Z ” M 0 Z Y
Z = (z 1, …, z m ), 0 Z < M / 2 Y = (y 1, …, y m ), 0 Y < M / 2 ? Y Z ? M 0 Z Y
Z = (z 1, …, z m ), 0 Z < M / 2 Y = (y 1, …, y m ), 0 Y < M / 2 Y Z iff Z [M] - Y M / 2 M 0 Z Y
Z = (z 1, …, z m ), 0 Z < M / 2 Y = (y 1, …, y m ), 0 Y < M / 2 Y Z iff Z [M] - Y M / 2 W = (w 1, …, w m ) M 0 Z Y W
Z = (z 1, …, z m ), 0 Z < M / 2 Y = (y 1, …, y m ), 0 Y < M / 2 Y Z iff Z [M] - Y M / 2 if W M / 2 then “ Y Z ” else “ Y > Z ” W = (w 1, …, w m ) M 0 Z Y W
Z = (z 1, …, z m ), 0 Z < M / 2 Y = (y 1, …, y m ), 0 Y < M / 2 Y Z iff Z [M] - Y M / 2 if W M / 2 then “ Y Z ” else “ Y > Z ” W = (w 1, …, w m ) M 0 Z Y W X Z
Z = (z 1, …, z m ), 0 Z < M / 2 Y = (y 1, …, y m ), 0 Y < M / 2 Y Z iff Z [M] - Y M / 2 if W M / 2 then “ Y Z ” else “ Y > Z ” W = (w 1, …, w m ) M 0 Z Y W Z X z 1, z 2, …, z m x 1, x 2, …, x m y 1, y 2, …, y m
Z = (z 1, …, z m ), 0 Z < M / 2 Y = (y 1, …, y m ), 0 Y < M / 2 Y Z iff Z [M] - Y M / 2 if W M / 2 then “ Y Z ” else “ Y > Z ” W = (w 1, …, w m ) M 0 Z Y W Z X w i required, for some i z 1, z 2, …, z m x 1, x 2, …, x m y 1, y 2, …, y m
Z = (z 1, …, z m ), 0 Z < M / 2 Y = (y 1, …, y m ), 0 Y < M / 2 Y Z iff Z [M] - Y M / 2 if W M / 2 then “ Y Z ” else “ Y > Z ” W = (w 1, …, w m ) M 0 Z Y W Z X w i required, for some i compute z i z 1, z 2, …, z m x 1, x 2, …, x m y 1, y 2, …, y m
Z = (z 1, …, z m ), 0 Z < M / 2 Y = (y 1, …, y m ), 0 Y < M / 2 Y Z iff Z [M] - Y M / 2 if W M / 2 then “ Y Z ” else “ Y > Z ” W = (w 1, …, w m ) M 0 Z Y W Z X z 1, z 2, …, z m x 1, x 2, …, x m y 1, y 2, …, y m w i required, for some i compute z i compute y i
Z = (z 1, …, z m ), 0 Z < M / 2 Y = (y 1, …, y m ), 0 Y < M / 2 Y Z iff Z [M] - Y M / 2 if W M / 2 then “ Y Z ” else “ Y > Z ” W = (w 1, …, w m ) M 0 Z Y W Z X w i required, for some i compute z i compute y i w i := z i [p i ] - y i z 1, z 2, …, z m x 1, x 2, …, x m y 1, y 2, …, y m
Z = (z 1, …, z m ), 0 Z < M / 2 Y = (y 1, …, y m ), 0 Y < M / 2 Y Z iff Z [M] - Y M / 2 if W M / 2 then “ Y Z ” else “ Y > Z ” W = (w 1, …, w m ) M 0 Z Y W
Z = (z 1, …, z m ), 0 Z < M / 2 Y = (y 1, …, y m ), 0 Y < M / 2 Y Z iff Z [M] - Y M / 2 - to decide whether Y Z, we only need an algorithm deciding whether W M / 2 - for any given W W = (w 1, …, w m ) M 0 Z Y W
W = (w 1, …, w m ), 0 W < M = p 1. …. p m ? W M / 2 ? M 0 W
W = (w 1, …, w m ), 0 W < M = p 1. …. p m ? W M / 2 ? - convert W to scalar representation: M 0 W
W = (w 1, …, w m ), 0 W < M = p 1. …. p m ? W M / 2 ? - convert W to scalar representation: W = α. M α ϵ 0,1) M 0 W
W = (w 1, …, w m ), 0 W < M = p 1. …. p m ? W M / 2 ? - convert W to scalar representation: W = α. M α ϵ 0,1) M 0 W
W = (w 1, …, w m ), 0 W < M = p 1. …. p m ? W M / 2 ? - convert W to scalar representation: W = α. M α ϵ 0,1) W M / 2 iff α 1 / 2 M 0 W
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i α := 0.00 for i := 1, …, m do c := 1 for j := 1, …, m do if j ≠ i then c := c [p i ]. p j end c := c [ p i] -1 ; c := c [p i ]. w i φ := c / p i α := α [1] + φ end
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i α := 0.00 for i := 1, …, m do c := 1 for j := 1, …, m do if j ≠ i then c := c [p i ]. p j end c := c [ p i] -1 ; c := c [p i ]. w i φ := c / p i α := α [1] + φ end integer arithmetic modulo p i
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i α := 0.00 for i := 1, …, m do c := 1 for j := 1, …, m do if j ≠ i then c := c [p i ]. p j end c := c [ p i] -1 ; c := c [p i ]. w i φ := c / p i α := α [1] + φ end integer arithmetic modulo p i O(log p m ) space
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i α := 0.00 for i := 1, …, m do c := 1 for j := 1, …, m do if j ≠ i then c := c [p i ]. p j end c := c [ p i] -1 ; c := c [p i ]. w i φ := c / p i α := α [1] + φ end integer arithmetic modulo p i O(log p m ) space log p m O(loglog Z)
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i α := 0.00 for i := 1, …, m do c := 1 for j := 1, …, m do if j ≠ i then c := c [p i ]. p j end c := c [ p i] -1 ; c := c [p i ]. w i φ := c / p i α := α [1] + φ end real arithmetic
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i α := 0.00 for i := 1, …, m do c := 1 for j := 1, …, m do if j ≠ i then c := c [p i ]. p j end c := c [ p i] -1 ; c := c [p i ]. w i φ := c / p i α := α [1] + φ end real arithmetic O(loglog Z) space
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i α := 0.00 for i := 1, …, m do c := 1 for j := 1, …, m do if j ≠ i then c := c [p i ]. p j end c := c [ p i] -1 ; c := c [p i ]. w i φ := c / p i α := α [1] + φ end real arithmetic O(loglog Z) space truncated to ℓ 3. loglog(Z) bits
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i α := 0.00 for i := 1, …, m do c := 1 for j := 1, …, m do if j ≠ i then c := c [p i ]. p j end c := c [ p i] -1 ; c := c [p i ]. w i φ := c / p i α := α [1] + φ end real arithmetic O(loglog Z) space truncated to ℓ 3. loglog(Z) bits numeric error 1 ε 2 ℓ 2p m
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i numeric error 1 ε 2 ℓ 2p m M 0 ½.M
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i numeric error 1 ε 2 ℓ 2p m M 0 ½.M α.M ε
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i numeric error 1 ε 2 ℓ 2p m M 0 ½.M α.M ε
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i numeric error 1 ε 2 ℓ 2p m M 0 ½.M α.M ε
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i numeric error 1 ε 2 ℓ 2p m M 0 ½.M α.M ε
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i M’= M / p m W’= (w 1, …, w m-1 ) W ½. M iff W’ ½. M’ numeric error 1 ε 2 ℓ 2p m M 0 ε M’M’ 0 ½.M ’ M p m M p m M p m M p m α ’.M ’ ε
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i M’= M / p m W’= (w 1, …, w m-1 ) W ½. M iff W’ ½. M’ re-run for m := m-1 numeric error 1 ε 2 ℓ 2p m M 0 ε M’M’ 0 ½.M ’ M p m M p m M p m M p m α ’.M ’ ε
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i m := m-1 numeric error 1 ε 2 ℓ 2p m M 0 ε M’M’ 0 ½.M ’ M p m M p m M p m M p m α ’.M ’ ε
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i m := m-1 numeric error 1 ε 2 ℓ 2p m M 0 ε M’M’ 0 ½.M ’ M p m M p m M p m M p m α ’.M ’ ε
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i α := 0.00 for i := 1, …, m do c := 1 for j := 1, …, m do if j ≠ i then c := c [p i ]. p j end c := c [ p i] -1 ; c := c [p i ]. w i φ := c / p i α := α [1] + φ end m := m-1 numeric error 1 ε 2 ℓ 2p m M 0 ε M’M’ 0 ½.M ’ M p m M p m M p m M p m α ’.M ’ ε
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i α := 0.00 for i := 1, …, m do c := 1 for j := 1, …, m do if j ≠ i then c := c [p i ]. p j end c := c [ p i] -1 ; c := c [p i ]. w i φ := c / p i α := α [1] + φ end m := m-1 numeric error 1 ε 2 ℓ 2p m M 0 ε M’M’ 0 ½.M ’ M p m M p m M p m M p m α ’.M ’ ε
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i α := 0.00 for i := 1, …, m do c := 1 for j := 1, …, m do if j ≠ i then c := c [p i ]. p j end c := c [ p i] -1 ; c := c [p i ]. w i φ := c / p i α := α [1] + φ end numeric error 1 ε 2 ℓ 2p m M 0 ε M’M’ 0 ½.M ’ α ’.M ’ ε
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i α := 0.00 for i := 1, …, m do c := 1 for j := 1, …, m do if j ≠ i then c := c [p i ]. p j end c := c [ p i] -1 ; c := c [p i ]. w i φ := c / p i α := α [1] + φ end numeric error 1 ε 2 ℓ 2p m M 0 ε M’M’ 0 ½.M ’ α ’.M ’ ε
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i α := 0.00 for i := 1, …, m do c := 1 for j := 1, …, m do if j ≠ i then c := c [p i ]. p j end c := c [ p i] -1 ; c := c [p i ]. w i φ := c / p i α := α [1] + φ end numeric error 1 ε 2 ℓ 2p m M 0 ε M’M’ 0 ½.M ’ α ’.M ’ ε
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i α := 0.00 for i := 1, …, m do c := 1 for j := 1, …, m do if j ≠ i then c := c [p i ]. p j end c := c [ p i] -1 ; c := c [p i ]. w i φ := c / p i α := α [1] + φ end numeric error 1 ε 2 ℓ 2p m M 0 ε M’M’ 0 ½.M ’ εα ’.M ’
ε W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i α := 0.00 for i := 1, …, m do c := 1 for j := 1, …, m do if j ≠ i then c := c [p i ]. p j end c := c [ p i] -1 ; c := c [p i ]. w i φ := c / p i α := α [1] + φ end numeric error 1 ε 2 ℓ 2p m M 0 ε M’M’ 0 ½.M ’ α ’.M ’
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i α := 0.00 for i := 1, …, m do c := 1 for j := 1, …, m do if j ≠ i then c := c [p i ]. p j end c := c [ p i] -1 ; c := c [p i ]. w i φ := c / p i α := α [1] + φ end numeric error 1 ε 2 ℓ 2p m M 0 ε M’M’ 0 ε
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i α := 0.00 for i := 1, …, m do c := 1 for j := 1, …, m do if j ≠ i then c := c [p i ]. p j end c := c [ p i] -1 ; c := c [p i ]. w i φ := c / p i α := α [1] + φ end numeric error 1 ε 2 ℓ 2p m M 0 ε M’M’ 0 m := m-1 ε
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i α := 0.00 for i := 1, …, m do c := 1 for j := 1, …, m do if j ≠ i then c := c [p i ]. p j end c := c [ p i] -1 ; c := c [p i ]. w i φ := c / p i α := α [1] + φ end numeric error 1 ε 2 ℓ 2p m M 0 ε M’M’ 0 m := m-1 ε
W = (w 1, …, w m ), 0 W < M = p 1. …. p m m m α = [1] Σ ( [p i ] Π p j ) [ p i] -1 [p i ]. w i / p i 1 / 2 ? i=1 j=1, j i α := 0.00 for i := 1, …, m do c := 1 for j := 1, …, m do if j ≠ i then c := c [p i ]. p j end c := c [ p i] -1 ; c := c [p i ]. w i φ := c / p i α := α [1] + φ end numeric error 1 ε 2 ℓ 2p m M 0 ε M’M’ 0 m := m-1 … repeated until the question W M / 2 is solved ε
un-Primes, un-Composites ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n)
un-Primes, un-Composites ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n) ϵ accept-ASPACE x REVERSALS(loglog n)
un-Primes, un-Composites ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n) ϵ accept-ASPACE x REVERSALS(loglog n) --optimal, cannot be improved
un-Primes, un-Composites ϵ accept-ASPACE(loglog n) ϵ pebble-DSPACE(loglog n) ϵ accept-ASPACE x REVERSALS(loglog n) --optimal, cannot be improved below loglog n, only regular languages accepted (even with the help of alternation)
LDSPACE(log n) un-DSPACE(loglog n) NLNSPACE(log n) un-NSPACE(loglog n) PASPACE(log n) un-ASPACE(loglog n) PspaceDSPACE(n O(1) ) un-DSPACE(log O(1) n)|| NSPACE(n O(1) )un-NSPACE(log O(1) n) ExptimeASPACE(n O(1) ) un-ASPACE(log O(1) n)
LDSPACE(log n) un-DSPACE(loglog n) NLNSPACE(log n) un-NSPACE(loglog n) PASPACE(log n) un-ASPACE(loglog n) PspaceDSPACE(n O(1) ) un-DSPACE(log O(1) n)|| NSPACE(n O(1) )un-NSPACE(log O(1) n) ExptimeASPACE(n O(1) ) un-ASPACE(log O(1) n) Primes
LDSPACE(log n) un-DSPACE(loglog n) NLNSPACE(log n) un-NSPACE(loglog n) PASPACE(log n) un-ASPACE(loglog n) PspaceDSPACE(n O(1) ) un-DSPACE(log O(1) n)|| NSPACE(n O(1) )un-NSPACE(log O(1) n) ExptimeASPACE(n O(1) ) un-ASPACE(log O(1) n) Primes un-Primes
LDSPACE(log n) un-DSPACE(loglog n) NLNSPACE(log n) un-NSPACE(loglog n) PASPACE(log n) un-ASPACE(loglog n) PspaceDSPACE(n O(1) ) un-DSPACE(log O(1) n)|| NSPACE(n O(1) )un-NSPACE(log O(1) n) ExptimeASPACE(n O(1) ) un-ASPACE(log O(1) n) Primes un-Primes +factoring
LDSPACE(log n) un-DSPACE(loglog n) NLNSPACE(log n) un-NSPACE(loglog n) PASPACE(log n) un-ASPACE(loglog n) PspaceDSPACE(n O(1) ) un-DSPACE(log O(1) n)|| NSPACE(n O(1) )un-NSPACE(log O(1) n) ExptimeASPACE(n O(1) ) un-ASPACE(log O(1) n) Primes ? un-Primes +factoring
LDSPACE(log n) un-DSPACE(loglog n) NLNSPACE(log n) un-NSPACE(loglog n) PASPACE(log n) un-ASPACE(loglog n) Positive answer: Primes ? un-Primes +factoring
LDSPACE(log n) un-DSPACE(loglog n) NLNSPACE(log n) un-NSPACE(loglog n) PASPACE(log n) un-ASPACE(loglog n) Positive answer: -- deterministic factoring in polynomial time Primes ? un-Primes +factoring
LDSPACE(log n) un-DSPACE(loglog n) NLNSPACE(log n) un-NSPACE(loglog n) PASPACE(log n) un-ASPACE(loglog n) Positive answer: -- deterministic factoring in polynomial time (breaking cryptographic security) Primes ? un-Primes +factoring
LDSPACE(log n) un-DSPACE(loglog n) NLNSPACE(log n) un-NSPACE(loglog n) PASPACE(log n) un-ASPACE(loglog n) Negative answer: Primes ? un-Primes +factoring
LDSPACE(log n) un-DSPACE(loglog n) NLNSPACE(log n) un-NSPACE(loglog n) PASPACE(log n) un-ASPACE(loglog n) Negative answer: un-L accept-ASPACE(loglog n) Primes ? un-Primes +factoring
LDSPACE(log n) un-DSPACE(loglog n) NLNSPACE(log n) un-NSPACE(loglog n) PASPACE(log n) un-ASPACE(loglog n) Negative answer: un-L accept-ASPACE(loglog n) L ASPACE(log n) = P Primes ? un-Primes +factoring
LDSPACE(log n) un-DSPACE(loglog n) NLNSPACE(log n) un-NSPACE(loglog n) PASPACE(log n) un-ASPACE(loglog n) Negative answer: un-L accept-ASPACE(loglog n) L ASPACE(log n) = P NSPACE(log n) Primes ? un-Primes +factoring
LDSPACE(log n) un-DSPACE(loglog n) NLNSPACE(log n) un-NSPACE(loglog n) PASPACE(log n) un-ASPACE(loglog n) Negative answer: un-L accept-ASPACE(loglog n) L ASPACE(log n) = P NSPACE(log n) Primes ? NL versus NP un-Primes +factoring
LDSPACE(log n) un-DSPACE(loglog n) NLNSPACE(log n) un-NSPACE(loglog n) PASPACE(log n) un-ASPACE(loglog n) PspaceDSPACE(n O(1) ) un-DSPACE(log O(1) n)|| NSPACE(n O(1) )un-NSPACE(log O(1) n) ExptimeASPACE(n O(1) ) un-ASPACE(log O(1) n) Primes ? un-Primes +factoring
LDSPACE(log n) un-DSPACE(loglog n) NLNSPACE(log n) un-NSPACE(loglog n) PASPACE(log n) un-ASPACE(loglog n) PspaceDSPACE(n O(1) ) un-DSPACE(log O(1) n)|| NSPACE(n O(1) )un-NSPACE(log O(1) n) ExptimeASPACE(n O(1) ) un-ASPACE(log O(1) n) Primes ? un-Primes +factoring Primes ?
Thank You for Your Attention
Thank You for Your Attention
Thank You for Your Attention