Verification of. Probabilistic Programs. Seminar on. Federico Olmedo. Pr[n = k] = 1 2

Size: px
Start display at page:

Download "Verification of. Probabilistic Programs. Seminar on. Federico Olmedo. Pr[n = k] = 1 2"

Transcription

1 Seminar on Verification of n := 0; repeat n := n + 1; c := coin flip(0.5) until (c=heads); return n Probabilistic Programs Pr[n = k] = 1 2 k Federico Olmedo federico.olmedo@cs.rwth-aachen.de 1

2 Seminar Details Speaker: FEDERICO OLMEDO Software Modelling and Verification Group RWTH Aachen University Structure & Schedule: Language: Pre-requisites: Previous knowledge on program logics and semantics is ONLY advised. Webpage: 6 Weekly Presentations 16:30-17:45 Room 9U10 E3 2

3 Agenda Introduction to probabilistic programs The problem of probabilistic program verification Seminar content Summary 3

4 Agenda Introduction to probabilistic programs The problem of probabilistic program verification Seminar content Summary 4

5 Probabilistic Programs Basics What is a probabilistic program? Ordinary Program + Distribution Sampling In this seminar imperative (eg. Probabilistic C) functional (eg. Church) logical (eg. CHRISM) randomly choose a process with which communicate select a random prime in interval [1, n 2 ] flip a (fair/biased) coin; Input/Output behaviour: Input Probabilistic Program Output Distribution Prob Output 5

6 Probabilistic Programs Examples c 1 := coin flip(0.5); c 2 := coin flip(0.5); return (c 1, c 2 ) n := 0; repeat n := n + 1; c := coin flip(0.5) until (c=heads); return n 6

7 Probabilistic Programs Examples c1 c 1 := coin flip(0.5); c 2 := coin flip(0.5); return (c 1, c 2 ) Output Distribution c2 h t h 1/4 1/4 t 1/4 1/4 n := 0; repeat n := n + 1; c := coin flip(0.5) until (c=heads); return n 6

8 Probabilistic Programs Examples c1 c 1 := coin flip(0.5); c 2 := coin flip(0.5); return (c 1, c 2 ) Output Distribution c2 h t h 1/4 1/4 t 1/4 1/4 n := 0; repeat n := n + 1; c := coin flip(0.5) until (c=heads); return n Output Distribution n 1 2 k 1/2 1/4 1/2 k 6

9 Probabilistic Programs Relevance Algorithms speed-up communication. cryptography Applications in several domains biology computer vision data management optimization Relevance of Randomization Solution of problem where deterministic techniques fail Probabilistic programs are simple and intuitive to understand 7

10 Probabilistic Programs Relevance Algorithms speed-up communication. cryptography Applications in several domains biology computer vision data management optimization Relevance of Randomization Solution of problem where deterministic techniques fail Probabilistic programs are simple and intuitive to understand 8

11 Probabilistic Programs Application Domain Probabilistic Programs 9

12 Probabilistic Programs Application Domain Skill Ranking System Probabilistic Programs 9

13 Probabilistic Programs Application Domain Skill Ranking System Probabilistic Programs Predator Prey Population Model 9

14 Probabilistic Programs Application Domain Skill Ranking System Probabilistic Programs Predator Prey Population Model Dining Philosophers 9

15 Probabilistic Programs Application Domain Skill Ranking System Probabilistic Programs Predator Prey Population Model Dining Philosophers Miller Rabin Primality Test 9

16 Probabilistic Programs Application Domain. Skill Ranking System Probabilistic Programs Graph Isomorphism Predator Prey Population Model Public-Key Encryption Dining Philosophers Miller Rabin Primality Test 9

17 Probabilistic Programs Relevance Algorithms speed-up communication. cryptography Applications in several domains biology computer vision data management optimization Relevance of Randomization Solution of problem where deterministic techniques fail Probabilistic programs are simple and intuitive to understand 10

18 Randomization allows speeding up algorithms Quicksort: QS(A), if ( A apple 1) then return (A); i := b A /2c; A < := {a 0 2 A a 0 < A[i]}; A > := {a 0 2 A a 0 > A[i]}; return QS(A < )++A[i]++QS(A > ) 11

19 Randomization allows speeding up algorithms Quicksort: QS(A), if ( A apple 1) then return (A); i := b A /2c; A < := {a 0 2 A a 0 < A[i]}; A > := {a 0 2 A a 0 > A[i]}; return QS(A < )++A[i]++QS(A > ) Problem of Quicksort: In the average case, it performs fairly well: On a random input of size n, it requires on average O(n log(n)) comparisons (which matches information theory lower bound). But in the worst case, it does not: There exist ill-behaved inputs of size n which require O(n 2 ) comparisons. How to narrow the gap between the worst and average case performance? 11

20 Randomization allows speeding up algorithms Quicksort: rqs(a), if ( A apple 1) then return (A); i := rand[1... A ]; A < := {a 0 2 A a 0 < A[i]}; A > := {a 0 2 A a 0 > A[i]}; return QS(A < )++A[i]++QS(A > ) Problem of Quicksort: In the average case, it performs fairly well: On a random input of size n, it requires on average O(n log(n)) comparisons (which matches information theory lower bound). But in the worst case, it does not: There exist ill-behaved inputs of size n which require O(n 2 ) comparisons. How to narrow the gap between the worst and average case performance? Choose the pivot at random! For any input, the expected number of comparisons matches the average case. No ill-behaved input. 11

21 Randomization allows speeding up algorithms Computing the cardinality of the union of sets: S 1 [ S 2 [...[ S n = X S i i X S i \ S j + X S i \ S j \ S k... i<j i<j<k Incl-Excl Principle Problem: Incl-Excl Principle yields an expensive solution, the RHS has 2 n -1 terms. Solution based on randomization: Random Sampling Technique We can approximate some properties of a set from a randomly chosen subset. P P P estimates P 12

22 Randomization allows speeding up algorithms Computing the cardinality S 1 [ S 2 [...[ S n Solution based on randomization: sample an element x 2 S 1 [ S 2 [...[ S n use cov(x ) = {i x 2 S i } to estimate S 1 [ S 2 [...[ S n. and m := S S n ; Draw a set S from S 1,..., S n with probability Pr[S i ]= S i m ; Draw an element x from S with uniform distribution; r := m cov (x ) ; return (r) It can be shown that r is an unbiased estimator of S 1 [ S 2 [...[ S n, ie E[r] = S 1 [ S 2 [...[ S n Expected value of r 13

23 Randomization allows speeding up algorithms Another application of the Random Sampling technique Approximate the area of a circle 14

24 Randomization allows speeding up algorithms Another application of the Random Sampling technique Approximate the area of a circle Sample random points in the enclosing square. The fraction of points lying in the circle approximates its area. Area( ) Area( ) N N (The approximation improves as N Nr of points hitting the circle Total nr of random points grows larger.) 14

25 Randomization allows speeding up algorithms Another application of the Random Sampling technique Approximate the area of a circle Sample random points in the enclosing square. The fraction of points lying in the circle approximates its area. Area( ) Area( ) N N (The approximation improves as N Nr of points hitting the circle Total nr of random points grows larger.) Approximate a definite integral Z b a f (x) dx Area( ) N N 14

26 Randomization allows speeding up algorithms Testing against the null polynomial Assume we have oracle access O(,..., ) to a multivariate polynomial p in R[x 1,..., x n ]. Determine whether p is identically zero. Solution based on randomization: Exploit the fact if p 6 0 and ā =(a 1,..., a n ) is chosen at random, Pr[p(ā ) = 0] is small. Theorem (Schwartz-Zippel): let S R with S = k deg(p). If each component of ā =(a 1,..., a n ) is chosen independently and uniformly from S, then Pr[p(ā )=0 p 6 0] apple 1 /k. Let S R with S = k deg(p) Draw a 1,..., a n independently and uniformly from S; if O(a 1,..., a n )=0then return ( p 0 ) else return ( p 6 0 ) Alg. outputs p 6 0 p 6 0 Alg. outputs p 0 p 0 Pr[p 6 0 output p 0 ] apple 1 k 15

27 Randomization allows speeding up algorithms Testing against the null polynomial Assume we have oracle access O(,..., ) to a multivariate polynomial p in R[x 1,..., x n ]. Determine whether p is identically zero. Solution based on randomization: Exploit the fact if p 6 0 and ā =(a 1,..., a n ) is chosen at random, Pr[p(ā ) = 0] is small. Theorem (Schwartz-Zippel): let S R with S = k deg(p). If each component of ā =(a 1,..., a n ) is chosen independently and uniformly from S, then Pr[p(ā )=0 p 6 0] apple 1 /k. Let S R with S = k deg(p) Alg. outputs p 6 0 p 6 0 For i =1...m do Draw a 1,..., a n independently and uniformly from S; Alg. outputs p 0 p 0 if O(a 1,..., a n )6=0 then return ( p 6 0 ) return ( p 0 ) Pr[p 6 0 output p 0 ] apple 1 k m 15

28 Randomization allows speeding up Algorithms Underlying techniques Abundance of Witnesses Decision problem whose output depends on the presence (resp. absence) of a witness to prove (resp. disprove) a property. Witnesses abound in a given search space. Given a witness, the property is efficiently verified. Amplification by Independent Trials Used in conjunction with the abundance of witnesses technique to reduce the error probability. Given an algorithm with error probability ε, run it n independent times to reduce the error probability to ε n. 16

29 Randomization allows speeding up Algorithms Underlying techniques Abundance of Witnesses Any ā such that p(ā ) 6= 0 Decision problem whose output depends on the presence (resp. absence) of a witness to prove (resp. disprove) a property. Witnesses abound in a given search space. Given a witness, the property is efficiently verified. Other example: primality testing [Rabin 76]. p 6 0 Any S R with S deg(p) Schwartz-Zippel theorem Amplification by Independent Trials Used in conjunction with the abundance of witnesses technique to reduce the error probability. Given an algorithm with error probability ε, run it n independent times to reduce the error probability to ε n. 16

30 Probabilistic Programs Relevance Algorithms speed-up communication. cryptography Applications in several domains biology computer vision data management optimization Relevance of Randomization Solution of problem where deterministic techniques fail Probabilistic programs are simple and intuitive to understand 17

31 Randomization circumvents the Limitations of Determinism The Dinning Philosopher Problem Theorem (Lehmann & Rabin 81) there exists no fully distributed and symmetric deterministic algorithm for the dining philosopher problem. Randomized Algorithm while (true) do (* Thinking Time *) trying := true while (trying) do s := rand{left, right} Wait until fork[s] is available and take it If fork[ s] is available then take it and set trying to false else drop fork[s] (* Eating Time *) Drop both forks Idea: Do not pick always the same fork first. Flip a coin to choose. If the second fork is not available, release the first and flip again the coin. Algorithm is deadlock-free: At any time, if there is a hungry philosopher, with probability one some philosopher will eventually eat. Algorithm can also be adapted to prevent starvation (ie the hungry philosopher will eventually eat). 18

32 Randomization circumvents the Limitations of Determinism Leader Election P1 Aim: to choose a leader node in a network. Network consists of n identical nodes P1,,Pn connected in a ring fashion. Transmission of messages is allowed between consecutive nodes in the ring. At the end of the process all nodes must agree on the election of the leader. Pn-1 Pn P5 P2 P4 P3 Theorem (Angluin 80) there exists no deterministic algorithm for carrying out the election in a ring of identical processes. Randomized Algorithm repeat s := empty list ; name := rand{1,..., K}; For i =1...n do s := s ++ [name]; send(name) to next node ; receive(name) from previous node until (at least one name in s is unique) return max{n 2 s n occus only once in s} Idea: Each nodes chooses a random name from {1,,K} and propagates it around the ring. At the end of the propagation each process has a list of the names of all the nodes. If there is a name that belongs to only one node, then this is the leader (in case of several, choose eg the largest) If there is no unique name, repeat the process. 19

33 Randomization circumvents the Limitations of Determinism Underlying technique Symmetry Breaking in Distributed Systems For many problems on distributed systems, deterministic solutions do not exists when objects are to be treaded identically. Using randomization to choose among identical objects may help solving the symmetry problem. 20

34 Probabilistic Programs Tradeoffs Advantages Reduction of time/space complexity Reduction of communication complexity in the distributed setting Allows tackling problems that have no deterministic solution Probabilistic programs are simple and easy to understand Wide range of application domains 21

35 Probabilistic Programs Tradeoffs Advantages Reduction of time/space complexity Reduction of communication complexity in the distributed setting Allows tackling problems that have no deterministic solution Probabilistic programs are simple and easy to understand Wide range of application domains Disadvantages Absolute correctness is sometimes sacrificed: probabilistic programs are correct with probability 1 Quicksort, dining philosopher, leader election Definite integral, testing against null polynomial =0 > 0 21

36 Probabilistic Programs Tradeoffs Advantages Reduction of time/space complexity Reduction of communication complexity in the distributed setting Allows tackling problems that have no deterministic solution Probabilistic programs are simple and easy to understand Wide range of application domains Disadvantages Absolute correctness is sometimes sacrificed: probabilistic programs are correct with probability 1 Running time is a random variable Quicksort, dining philosopher, leader election Definite integral, testing against null polynomial =0 > 0 LAS VEGAS ALGORITHM MONTE CARLO ALGORITHM Constant running time (always fast) 21

37 Probabilistic Programs Reliability Deterministic Algorithm Probabilistic Algorithm ALWAYS LONG ALWAYS LONG NEVER SHORT Faster, but less correct NEVER SHORT Correctness Running Time Correctness Running Time Is the probabilistic algorithm still reliable? 22

38 Probabilistic Programs Reliability Deterministic Algorithm Probabilistic Algorithm ALWAYS LONG ALWAYS LONG NEVER SHORT Faster, but less correct NEVER SHORT Correctness Running Time Correctness Running Time Is the probabilistic algorithm still reliable? Yes, absolutely! 22

39 Probabilistic Programs remain Reliable Verifying Data Consistency Goal: RI and RII must communicate to verify whether x=y (x, y 2 {0,1} n ). x=x 1...x n communication y=y 1...y n Requirement: minimize the # of bits exchanged. RI RII Theorem: any deterministic protocol requires the exchange of (at least) n bits. Randomized Algorithm Idea: use random fingerprints of x and y. Routine of R I, p := rand{i 2 [2, n 2 ] prime(i)}; s := x mod p; send(p, s) to R II ; #bits exchanged = #bits(p) + #bits(s) apple 2 log 2(n 2 ) Prot. outputs x6=y apple n 2 apple p apple n 2 x6=y Pr[x 6= y output x=y ] apple ln(n2 ) n Routine of R II, receive(p, s) from R I ; t := y mod p; if (s=t) then return ( x=y ) else return ( x6=y ) 23

40 Probabilistic Programs remain Reliable Verifying Data Consistency Goal: RI and RII must communicate to verify whether x=y (x, y 2 {0,1} n ). x=x 1...x n communication y=y 1...y n Requirement: minimize the # of bits exchanged. RI RII Theorem: any deterministic protocol requires the exchange of (at least) n bits. Randomized Algorithm Idea: use random fingerprints of x and y. Routine of R I, p := rand{i 2 [2, n 2 ] prime(i)}; s := x mod p; send(p, s) to R II ; Routine of R II, receive(p, s) from R I ; t := y mod p; if (s=t) then return ( x=y ) else return ( x6=y ) apple n 2 apple p apple n 2 #bits exchanged = #bits(p) + #bits(s) apple 2 log 2(n 2 ) Prot. outputs x6=y x6=y Pr[x 6= y output x=y ] apple ln(n2 ) n # bits exch. prob. error n= x n= x n= x n= x n= x

41 Agenda Introduction to probabilistic programs The problem of probabilistic program verification Seminar content Summary 24

42 Probabilistic Programs The Verification Problem Input/Output behaviour of probabilistic programs: Input Probabilistic Program Output Distribution Prob Output Verification of probabilistic programs: Probabilistic Program VERIFICATION Probabilistic Assertion about the Program Output Property holds with a given probability Pr[error] apple 0.02 Assertion about the expected (ie average) value of a variable E[r] apple 10 25

43 Probabilistic Programs The Verification Problem Examples of Probabilistic Assertions Cardinality of sets union m := S S n ; Draw a set S from S 1,..., S n with probability Pr[S i ]= S i m ; Draw an element x from S with uniform distribution; r := m cov (x) ; return (r) E[r] = S 1 [ S 2 [...[ S n Leader Election repeat s := empty list ; name := rand{1,..., K}; For i =1...n do s := s ++ [name]; send(name) to next node ; receive(name) from previous node until (at least one name in s is unique) return max{n 2 s n occus only once in s} Pr[termination] =1? 26

44 Probabilistic Programs The Verification Problem Let p be probability that after the random choices of the node names, at least one name is unique. We know that 0 < p < 1. Pr[term] =1 Pr[non term] =1 Pr h in all rounds, there is no unique name =1 lim (1 n!1 p)n =1 i 27

45 Probabilistic Programs The Verification Problem Let p be probability that after the random choices of the node names, at least one name is unique. We know that 0 < p < 1. Pr[term] =1 Pr[non term] =1 Pr h in all rounds, there is no unique name =1 lim (1 n!1 p)n =1 Intricacy i Probabilistic programs may terminate with probability 1, and still admit diverging executions. Insight: (set of) diverging executions have probability 0 27

46 Probabilistic Programs The Verification Problem Let p be probability that after the random choices of the node names, at least one name is unique. We know that 0 < p < 1. Pr[term] =1 Pr[non term] =1 Pr h in all rounds, there is no unique name =1 lim (1 n!1 p)n =1 i ALMOST-SURE TERMINATION (AST) Intricacy Probabilistic programs may terminate with probability 1, and still admit diverging executions. Insight: (set of) diverging executions have probability 0 27

47 Probabilistic Programs The Verification Problem Let p be probability that after the random choices of the node names, at least one name is unique. We know that 0 < p < 1. Pr[term] =1 Pr[non term] =1 Pr h in all rounds, there is no unique name =1 lim (1 n!1 p)n =1 i ALMOST-SURE TERMINATION (AST) Intricacy Probabilistic programs may terminate with probability 1, and still admit diverging executions. Another example of AST: repeat b := flip coin(); until (b = heads) Insight: (set of) diverging executions have probability 0 27

48 Probabilistic Programs The Verification Problem How to verify probabilistic assertions? It is possible to extend standard verification techniques of sequential programs: Hoare logic Weakest precondition calculus Assertions of the form {P} c {Q}, where P and Q are predicates over program states Given in terms of predicate transformer wp[c]: P( )! P( ) initial state s c s 0 final state wp[c](q) = set of initial states that lead to a final state satisfying Q {P} c {Q} is valid i P(s) =) Q(s 0 ) Example: wp[x := x+2](x 0) = x 2 Example: {x 0} x := x+2 {x 0} Connection to Hoare logic Deductive system (ie proof rules) to derive valid assertions (one rule per language construction) {P} c {Q} i P =) wp[c](q) {P }skip{p } {P [x e]}x := e{p } Transformer wp[c] the structure of c: is defined by induction on {P }s 1 {Q} {Q}s 2 {R} {P }s 1 ; s 2 {R} Proof objects are derivations (trees) wp[skip](q) =Q wp[x := e](q) =Q[x/E] wp[c 1 ; c 2 ](Q) =(wp[c 1 ] wp[c 2 ])(Q) 28

49 Agenda Introduction to probabilistic programs The problem of probabilistic program verification Seminar content Summary 29

50 Seminar Content Different extension of Hoare logic and weakest precondition calculus for probabilistic programs. Probabilistic predicate transformers [McIver & Morgan 96] Reward function final states. f :! R over the set of wp[c](f )= Expected reward of c wrt f expected value of f wrt distribution of final states Relational Hoare logics [Barthe 09, 12] Relates the executions of a program from two different initial states. Pre- and post-conditions are relations (rather than predicates) over program states. {= L } c {= L } c in non-interferent Hartog s Hoare logic [Hartog 02] {true} c {8i (iapple0) _ Pr[x=i] =( 1 /2) i } variable x is geometrically distributed 30

51 Agenda Introduction to probabilistic programs The problem of probabilistic program verification Seminar content Summary 31

52 Summary What is a probabilistic program? Probabilistic programs are simple and intuitive to understand Ordinary Program + Distribution Sampling Applications in several domains Algorithms speed-up Relevance of Randomization Solution of problem where deterministic techniques fail We can extend traditional program verification techniques to probabilistic programs. 32

Lecture 4: Two-point Sampling, Coupon Collector s problem

Lecture 4: Two-point Sampling, Coupon Collector s problem Randomized Algorithms Lecture 4: Two-point Sampling, Coupon Collector s problem Sotiris Nikoletseas Associate Professor CEID - ETY Course 2013-2014 Sotiris Nikoletseas, Associate Professor Randomized Algorithms

More information

CS145: Probability & Computing Lecture 24: Algorithms

CS145: Probability & Computing Lecture 24: Algorithms CS145: Probability & Computing Lecture 24: Algorithms Instructor: Eli Upfal Brown University Computer Science Figure credits: Bertsekas & Tsitsiklis, Introduction to Probability, 2008 Pitman, Probability,

More information

Introduction to Randomized Algorithms: Quick Sort and Quick Selection

Introduction to Randomized Algorithms: Quick Sort and Quick Selection Chapter 14 Introduction to Randomized Algorithms: Quick Sort and Quick Selection CS 473: Fundamental Algorithms, Spring 2011 March 10, 2011 14.1 Introduction to Randomized Algorithms 14.2 Introduction

More information

Chapter 6 Randomization Algorithm Theory WS 2012/13 Fabian Kuhn

Chapter 6 Randomization Algorithm Theory WS 2012/13 Fabian Kuhn Chapter 6 Randomization Algorithm Theory WS 2012/13 Fabian Kuhn Randomization Randomized Algorithm: An algorithm that uses (or can use) random coin flips in order to make decisions We will see: randomization

More information

Randomized algorithms. Inge Li Gørtz

Randomized algorithms. Inge Li Gørtz Randomized algorithms Inge Li Gørtz Randomized algorithms Today What are randomized algorithms? Properties of randomized algorithms Two examples: Median/Select. Quick-sort Randomized Algorithms Randomized

More information

Lecture 5: Two-point Sampling

Lecture 5: Two-point Sampling Randomized Algorithms Lecture 5: Two-point Sampling Sotiris Nikoletseas Professor CEID - ETY Course 2017-2018 Sotiris Nikoletseas, Professor Randomized Algorithms - Lecture 5 1 / 26 Overview A. Pairwise

More information

15-251: Great Theoretical Ideas In Computer Science Recitation 9 : Randomized Algorithms and Communication Complexity Solutions

15-251: Great Theoretical Ideas In Computer Science Recitation 9 : Randomized Algorithms and Communication Complexity Solutions 15-251: Great Theoretical Ideas In Computer Science Recitation 9 : Randomized Algorithms and Communication Complexity Solutions Definitions We say a (deterministic) protocol P computes f if (x, y) {0,

More information

Verifying Probabilistic Programs using the HOL Theorem Prover Joe Hurd p.1/32

Verifying Probabilistic Programs using the HOL Theorem Prover Joe Hurd p.1/32 Verifying Probabilistic Programs using the HOL Theorem Prover Joe Hurd joe.hurd@cl.cam.ac.uk University of Cambridge Verifying Probabilistic Programs using the HOL Theorem Prover Joe Hurd p.1/32 Contents

More information

Chapter 7 Randomization Algorithm Theory WS 2017/18 Fabian Kuhn

Chapter 7 Randomization Algorithm Theory WS 2017/18 Fabian Kuhn Chapter 7 Randomization Algorithm Theory WS 2017/18 Fabian Kuhn Randomization Randomized Algorithm: An algorithm that uses (or can use) random coin flips in order to make decisions We will see: randomization

More information

Design of Distributed Systems Melinda Tóth, Zoltán Horváth

Design of Distributed Systems Melinda Tóth, Zoltán Horváth Design of Distributed Systems Melinda Tóth, Zoltán Horváth Design of Distributed Systems Melinda Tóth, Zoltán Horváth Publication date 2014 Copyright 2014 Melinda Tóth, Zoltán Horváth Supported by TÁMOP-412A/1-11/1-2011-0052

More information

Randomized Algorithms

Randomized Algorithms Randomized Algorithms Prof. Tapio Elomaa tapio.elomaa@tut.fi Course Basics A new 4 credit unit course Part of Theoretical Computer Science courses at the Department of Mathematics There will be 4 hours

More information

Hoare Logic: Reasoning About Imperative Programs

Hoare Logic: Reasoning About Imperative Programs Hoare Logic: Reasoning About Imperative Programs COMP1600 / COMP6260 Dirk Pattinson Australian National University Semester 2, 2018 Programming Paradigms Functional. (Haskell, SML, OCaml,... ) main paradigm:

More information

CSE525: Randomized Algorithms and Probabilistic Analysis April 2, Lecture 1

CSE525: Randomized Algorithms and Probabilistic Analysis April 2, Lecture 1 CSE525: Randomized Algorithms and Probabilistic Analysis April 2, 2013 Lecture 1 Lecturer: Anna Karlin Scribe: Sonya Alexandrova and Eric Lei 1 Introduction The main theme of this class is randomized algorithms.

More information

SFM-11:CONNECT Summer School, Bertinoro, June 2011

SFM-11:CONNECT Summer School, Bertinoro, June 2011 SFM-:CONNECT Summer School, Bertinoro, June 20 EU-FP7: CONNECT LSCITS/PSS VERIWARE Part 3 Markov decision processes Overview Lectures and 2: Introduction 2 Discrete-time Markov chains 3 Markov decision

More information

In this episode of The Verification Corner, Rustan Leino talks about Loop Invariants. He gives a brief summary of the theoretical foundations and

In this episode of The Verification Corner, Rustan Leino talks about Loop Invariants. He gives a brief summary of the theoretical foundations and In this episode of The Verification Corner, Rustan Leino talks about Loop Invariants. He gives a brief summary of the theoretical foundations and shows how a program can sometimes be systematically constructed

More information

Probabilistic Methods in Concurrency. Lecture 4

Probabilistic Methods in Concurrency. Lecture 4 Probabilistic Methods in oncurrency Lecture 4 Problems in distributed systems for which only randomized solutions exist atuscia Palamidessi catuscia@lix.polytechnique.fr www.lix.polytechnique.fr/~catuscia

More information

Axiomatic Semantics. Lecture 9 CS 565 2/12/08

Axiomatic Semantics. Lecture 9 CS 565 2/12/08 Axiomatic Semantics Lecture 9 CS 565 2/12/08 Axiomatic Semantics Operational semantics describes the meaning of programs in terms of the execution steps taken by an abstract machine Denotational semantics

More information

Programming Languages and Compilers (CS 421)

Programming Languages and Compilers (CS 421) Programming Languages and Compilers (CS 421) Sasa Misailovic 4110 SC, UIUC https://courses.engr.illinois.edu/cs421/fa2017/cs421a Based in part on slides by Mattox Beckman, as updated by Vikram Adve, Gul

More information

Lecture 2: Randomized Algorithms

Lecture 2: Randomized Algorithms Lecture 2: Randomized Algorithms Independence & Conditional Probability Random Variables Expectation & Conditional Expectation Law of Total Probability Law of Total Expectation Derandomization Using Conditional

More information

6.045: Automata, Computability, and Complexity (GITCS) Class 17 Nancy Lynch

6.045: Automata, Computability, and Complexity (GITCS) Class 17 Nancy Lynch 6.045: Automata, Computability, and Complexity (GITCS) Class 17 Nancy Lynch Today Probabilistic Turing Machines and Probabilistic Time Complexity Classes Now add a new capability to standard TMs: random

More information

An Introduction to Randomized algorithms

An Introduction to Randomized algorithms An Introduction to Randomized algorithms C.R. Subramanian The Institute of Mathematical Sciences, Chennai. Expository talk presented at the Research Promotion Workshop on Introduction to Geometric and

More information

Random Variable. Pr(X = a) = Pr(s)

Random Variable. Pr(X = a) = Pr(s) Random Variable Definition A random variable X on a sample space Ω is a real-valued function on Ω; that is, X : Ω R. A discrete random variable is a random variable that takes on only a finite or countably

More information

About complexity. We define the class informally P in the following way:

About complexity. We define the class informally P in the following way: About complexity We define the class informally P in the following way: P = The set of all problems that can be solved by a polynomial time algorithm, i.e., an algorithm that runs in time O(n k ) in the

More information

Distributed Optimization. Song Chong EE, KAIST

Distributed Optimization. Song Chong EE, KAIST Distributed Optimization Song Chong EE, KAIST songchong@kaist.edu Dynamic Programming for Path Planning A path-planning problem consists of a weighted directed graph with a set of n nodes N, directed links

More information

Lecture 24: Randomized Complexity, Course Summary

Lecture 24: Randomized Complexity, Course Summary 6.045 Lecture 24: Randomized Complexity, Course Summary 1 1/4 1/16 1/4 1/4 1/32 1/16 1/32 Probabilistic TMs 1/16 A probabilistic TM M is a nondeterministic TM where: Each nondeterministic step is called

More information

Lecture 2: Axiomatic semantics

Lecture 2: Axiomatic semantics Chair of Software Engineering Trusted Components Prof. Dr. Bertrand Meyer Lecture 2: Axiomatic semantics Reading assignment for next week Ariane paper and response (see course page) Axiomatic semantics

More information

Lecture Hardness of Set Cover

Lecture Hardness of Set Cover PCPs and Inapproxiability CIS 6930 October 5, 2009 Lecture Hardness of Set Cover Lecturer: Dr. My T. Thai Scribe: Ying Xuan 1 Preliminaries 1.1 Two-Prover-One-Round Proof System A new PCP model 2P1R Think

More information

CS151 Complexity Theory. Lecture 13 May 15, 2017

CS151 Complexity Theory. Lecture 13 May 15, 2017 CS151 Complexity Theory Lecture 13 May 15, 2017 Relationship to other classes To compare to classes of decision problems, usually consider P #P which is a decision class easy: NP, conp P #P easy: P #P

More information

Factorization & Primality Testing

Factorization & Primality Testing Factorization & Primality Testing C etin Kaya Koc http://cs.ucsb.edu/~koc koc@cs.ucsb.edu Koc (http://cs.ucsb.edu/~ koc) ucsb ccs 130h explore crypto fall 2014 1/1 Primes Natural (counting) numbers: N

More information

Randomness. What next?

Randomness. What next? Randomness What next? Random Walk Attribution These slides were prepared for the New Jersey Governor s School course The Math Behind the Machine taught in the summer of 2012 by Grant Schoenebeck Large

More information

Problem Set 2. Assigned: Mon. November. 23, 2015

Problem Set 2. Assigned: Mon. November. 23, 2015 Pseudorandomness Prof. Salil Vadhan Problem Set 2 Assigned: Mon. November. 23, 2015 Chi-Ning Chou Index Problem Progress 1 SchwartzZippel lemma 1/1 2 Robustness of the model 1/1 3 Zero error versus 1-sided

More information

Axiomatic Semantics: Verification Conditions. Review of Soundness of Axiomatic Semantics. Questions? Announcements

Axiomatic Semantics: Verification Conditions. Review of Soundness of Axiomatic Semantics. Questions? Announcements Axiomatic Semantics: Verification Conditions Meeting 18, CSCI 5535, Spring 2010 Announcements Homework 6 is due tonight Today s forum: papers on automated testing using symbolic execution Anyone looking

More information

Hoare Calculus and Predicate Transformers

Hoare Calculus and Predicate Transformers Hoare Calculus and Predicate Transformers Wolfgang Schreiner Wolfgang.Schreiner@risc.uni-linz.ac.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.uni-linz.ac.at

More information

Adleman Theorem and Sipser Gács Lautemann Theorem. CS422 Computation Theory CS422 Complexity Theory

Adleman Theorem and Sipser Gács Lautemann Theorem. CS422 Computation Theory CS422 Complexity Theory Adleman Theorem and Sipser Gács Lautemann Theorem CS422 Computation Theory CS422 Complexity Theory Complexity classes, N, co N, SACE, EXTIME, H, R, RE, ALL, Complexity theorists: "Which is contained in

More information

Introduction. Pedro Cabalar. Department of Computer Science University of Corunna, SPAIN 2013/2014

Introduction. Pedro Cabalar. Department of Computer Science University of Corunna, SPAIN 2013/2014 Introduction Pedro Cabalar Department of Computer Science University of Corunna, SPAIN cabalar@udc.es 2013/2014 P. Cabalar ( Department Introduction of Computer Science University of Corunna, SPAIN2013/2014

More information

Formal Methods for Probabilistic Systems

Formal Methods for Probabilistic Systems 1 Formal Methods for Probabilistic Systems Annabelle McIver Carroll Morgan Source-level program logic Introduction to probabilistic-program logic Systematic presentation via structural induction Layout

More information

Lecture 12: Interactive Proofs

Lecture 12: Interactive Proofs princeton university cos 522: computational complexity Lecture 12: Interactive Proofs Lecturer: Sanjeev Arora Scribe:Carl Kingsford Recall the certificate definition of NP. We can think of this characterization

More information

Computational Complexity Theory

Computational Complexity Theory Computational Complexity Theory Marcus Hutter Canberra, ACT, 0200, Australia http://www.hutter1.net/ Assumed Background Preliminaries Turing Machine (TM) Deterministic Turing Machine (DTM) NonDeterministic

More information

Soundness and Completeness of Axiomatic Semantics

Soundness and Completeness of Axiomatic Semantics #1 Soundness and Completeness of Axiomatic Semantics #2 One-Slide Summary A system of axiomatic semantics is sound if everything we can prove is also true: if ` { A } c { B } then ² { A } c { B } We prove

More information

Complexity Theory. Jörg Kreiker. Summer term Chair for Theoretical Computer Science Prof. Esparza TU München

Complexity Theory. Jörg Kreiker. Summer term Chair for Theoretical Computer Science Prof. Esparza TU München Complexity Theory Jörg Kreiker Chair for Theoretical Computer Science Prof. Esparza TU München Summer term 2010 Lecture 16 IP = PSPACE 3 Goal and Plan Goal IP = PSPACE Plan 1. PSPACE IP by showing QBF

More information

Analysis of Algorithms CMPSC 565

Analysis of Algorithms CMPSC 565 Analysis of Algorithms CMPSC 565 LECTURES 38-39 Randomized Algorithms II Quickselect Quicksort Running time Adam Smith L1.1 Types of randomized analysis Average-case analysis : Assume data is distributed

More information

A Brief Introduction to Model Checking

A Brief Introduction to Model Checking A Brief Introduction to Model Checking Jan. 18, LIX Page 1 Model Checking A technique for verifying finite state concurrent systems; a benefit on this restriction: largely automatic; a problem to fight:

More information

Lecture 11: Non-Interactive Zero-Knowledge II. 1 Non-Interactive Zero-Knowledge in the Hidden-Bits Model for the Graph Hamiltonian problem

Lecture 11: Non-Interactive Zero-Knowledge II. 1 Non-Interactive Zero-Knowledge in the Hidden-Bits Model for the Graph Hamiltonian problem CS 276 Cryptography Oct 8, 2014 Lecture 11: Non-Interactive Zero-Knowledge II Instructor: Sanjam Garg Scribe: Rafael Dutra 1 Non-Interactive Zero-Knowledge in the Hidden-Bits Model for the Graph Hamiltonian

More information

Hoare Logic I. Introduction to Deductive Program Verification. Simple Imperative Programming Language. Hoare Logic. Meaning of Hoare Triples

Hoare Logic I. Introduction to Deductive Program Verification. Simple Imperative Programming Language. Hoare Logic. Meaning of Hoare Triples Hoare Logic I Introduction to Deductive Program Verification Işıl Dillig Program Spec Deductive verifier FOL formula Theorem prover valid contingent Example specs: safety (no crashes), absence of arithmetic

More information

Formal Methods for Probabilistic Systems

Formal Methods for Probabilistic Systems Formal Methods for Probabilistic Systems Annabelle McIver Carroll Morgan Source-level program logic Meta-theorems for loops Examples Relational operational model Standard, deterministic, terminating...

More information

Pseudorandom Generators

Pseudorandom Generators 8 Pseudorandom Generators Great Ideas in Theoretical Computer Science Saarland University, Summer 2014 andomness is one of the fundamental computational resources and appears everywhere. In computer science,

More information

Axiomatic Semantics: Verification Conditions. Review of Soundness and Completeness of Axiomatic Semantics. Announcements

Axiomatic Semantics: Verification Conditions. Review of Soundness and Completeness of Axiomatic Semantics. Announcements Axiomatic Semantics: Verification Conditions Meeting 12, CSCI 5535, Spring 2009 Announcements Homework 4 is due tonight Wed forum: papers on automated testing using symbolic execution 2 Questions? Review

More information

About complexity. Number theoretical algorithms

About complexity. Number theoretical algorithms Page 1 About complexity We define the class informally P in the following way: P = The set of all problems that can be solved by a polynomial time algorithm, i.e., an algorithm that runs in time O(n k

More information

Dynamic Semantics. Dynamic Semantics. Operational Semantics Axiomatic Semantics Denotational Semantic. Operational Semantics

Dynamic Semantics. Dynamic Semantics. Operational Semantics Axiomatic Semantics Denotational Semantic. Operational Semantics Dynamic Semantics Operational Semantics Denotational Semantic Dynamic Semantics Operational Semantics Operational Semantics Describe meaning by executing program on machine Machine can be actual or simulated

More information

CS Communication Complexity: Applications and New Directions

CS Communication Complexity: Applications and New Directions CS 2429 - Communication Complexity: Applications and New Directions Lecturer: Toniann Pitassi 1 Introduction In this course we will define the basic two-party model of communication, as introduced in the

More information

CS5314 Randomized Algorithms. Lecture 15: Balls, Bins, Random Graphs (Hashing)

CS5314 Randomized Algorithms. Lecture 15: Balls, Bins, Random Graphs (Hashing) CS5314 Randomized Algorithms Lecture 15: Balls, Bins, Random Graphs (Hashing) 1 Objectives Study various hashing schemes Apply balls-and-bins model to analyze their performances 2 Chain Hashing Suppose

More information

Deductive Verification

Deductive Verification Deductive Verification Mooly Sagiv Slides from Zvonimir Rakamaric First-Order Logic A formal notation for mathematics, with expressions involving Propositional symbols Predicates Functions and constant

More information

Lecture 7: Fingerprinting. David Woodruff Carnegie Mellon University

Lecture 7: Fingerprinting. David Woodruff Carnegie Mellon University Lecture 7: Fingerprinting David Woodruff Carnegie Mellon University How to Pick a Random Prime How to pick a random prime in the range {1, 2,, M}? How to pick a random integer X? Pick a uniformly random

More information

Computational Learning Theory

Computational Learning Theory Computational Learning Theory Slides by and Nathalie Japkowicz (Reading: R&N AIMA 3 rd ed., Chapter 18.5) Computational Learning Theory Inductive learning: given the training set, a learning algorithm

More information

Classical Program Logics: Hoare Logic, Weakest Liberal Preconditions

Classical Program Logics: Hoare Logic, Weakest Liberal Preconditions Chapter 1 Classical Program Logics: Hoare Logic, Weakest Liberal Preconditions 1.1 The IMP Language IMP is a programming language with an extensible syntax that was developed in the late 1960s. We will

More information

Mid-Semester Quiz Second Semester, 2012

Mid-Semester Quiz Second Semester, 2012 THE AUSTRALIAN NATIONAL UNIVERSITY Mid-Semester Quiz Second Semester, 2012 COMP2600 (Formal Methods for Software Engineering) Writing Period: 1 hour duration Study Period: 10 minutes duration Permitted

More information

Central Algorithmic Techniques. Iterative Algorithms

Central Algorithmic Techniques. Iterative Algorithms Central Algorithmic Techniques Iterative Algorithms Code Representation of an Algorithm class InsertionSortAlgorithm extends SortAlgorithm { void sort(int a[]) throws Exception { for (int i = 1; i < a.length;

More information

CMPT 307 : Divide-and-Conqer (Study Guide) Should be read in conjunction with the text June 2, 2015

CMPT 307 : Divide-and-Conqer (Study Guide) Should be read in conjunction with the text June 2, 2015 CMPT 307 : Divide-and-Conqer (Study Guide) Should be read in conjunction with the text June 2, 2015 1 Introduction The divide-and-conquer strategy is a general paradigm for algorithm design. This strategy

More information

CSE 525 Randomized Algorithms & Probabilistic Analysis Spring Lecture 3: April 9

CSE 525 Randomized Algorithms & Probabilistic Analysis Spring Lecture 3: April 9 CSE 55 Randomized Algorithms & Probabilistic Analysis Spring 01 Lecture : April 9 Lecturer: Anna Karlin Scribe: Tyler Rigsby & John MacKinnon.1 Kinds of randomization in algorithms So far in our discussion

More information

Notes on Zero Knowledge

Notes on Zero Knowledge U.C. Berkeley CS172: Automata, Computability and Complexity Handout 9 Professor Luca Trevisan 4/21/2015 Notes on Zero Knowledge These notes on zero knowledge protocols for quadratic residuosity are based

More information

Logic: The Big Picture

Logic: The Big Picture Logic: The Big Picture A typical logic is described in terms of syntax: what are the legitimate formulas semantics: under what circumstances is a formula true proof theory/ axiomatization: rules for proving

More information

Great Theoretical Ideas in Computer Science

Great Theoretical Ideas in Computer Science 15-251 Great Theoretical Ideas in Computer Science Randomness and Computation Lecture 18 (October 25, 2007) Checking Our Work Suppose we want to check p(x) q(x) = r(x), where p, q and r are three polynomials.

More information

Theoretical Cryptography, Lecture 10

Theoretical Cryptography, Lecture 10 Theoretical Cryptography, Lecture 0 Instructor: Manuel Blum Scribe: Ryan Williams Feb 20, 2006 Introduction Today we will look at: The String Equality problem, revisited What does a random permutation

More information

B(w, z, v 1, v 2, v 3, A(v 1 ), A(v 2 ), A(v 3 )).

B(w, z, v 1, v 2, v 3, A(v 1 ), A(v 2 ), A(v 3 )). Lecture 13 PCP Continued Last time we began the proof of the theorem that PCP(poly, poly) = NEXP. May 13, 2004 Lecturer: Paul Beame Notes: Tian Sang We showed that IMPLICIT-3SAT is NEXP-complete where

More information

Randomness and non-uniformity

Randomness and non-uniformity Randomness and non-uniformity JASS 2006 Course 1: Proofs and Computers Felix Weninger TU München April 2006 Outline Randomized computation 1 Randomized computation 2 Computation with advice Non-uniform

More information

Lecture 23: Alternation vs. Counting

Lecture 23: Alternation vs. Counting CS 710: Complexity Theory 4/13/010 Lecture 3: Alternation vs. Counting Instructor: Dieter van Melkebeek Scribe: Jeff Kinne & Mushfeq Khan We introduced counting complexity classes in the previous lecture

More information

fsat We next show that if sat P, then fsat has a polynomial-time algorithm. c 2010 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 425

fsat We next show that if sat P, then fsat has a polynomial-time algorithm. c 2010 Prof. Yuh-Dauh Lyuu, National Taiwan University Page 425 fsat fsat is this function problem: Let φ(x 1, x 2,..., x n ) be a boolean expression. If φ is satisfiable, then return a satisfying truth assignment. Otherwise, return no. We next show that if sat P,

More information

Theory of Computation Chapter 12: Cryptography

Theory of Computation Chapter 12: Cryptography Theory of Computation Chapter 12: Cryptography Guan-Shieng Huang Dec. 20, 2006 0-0 Introduction Alice wants to communicate with Bob secretely. x Alice Bob John Alice y=e(e,x) y Bob y??? John Assumption

More information

Approximate Counting and Markov Chain Monte Carlo

Approximate Counting and Markov Chain Monte Carlo Approximate Counting and Markov Chain Monte Carlo A Randomized Approach Arindam Pal Department of Computer Science and Engineering Indian Institute of Technology Delhi March 18, 2011 April 8, 2011 Arindam

More information

Lecture Notes 17. Randomness: The verifier can toss coins and is allowed to err with some (small) probability if it is unlucky in its coin tosses.

Lecture Notes 17. Randomness: The verifier can toss coins and is allowed to err with some (small) probability if it is unlucky in its coin tosses. CS 221: Computational Complexity Prof. Salil Vadhan Lecture Notes 17 March 31, 2010 Scribe: Jonathan Ullman 1 Interactive Proofs ecall the definition of NP: L NP there exists a polynomial-time V and polynomial

More information

Linear Congruences. The equation ax = b for a, b R is uniquely solvable if a 0: x = b/a. Want to extend to the linear congruence:

Linear Congruences. The equation ax = b for a, b R is uniquely solvable if a 0: x = b/a. Want to extend to the linear congruence: Linear Congruences The equation ax = b for a, b R is uniquely solvable if a 0: x = b/a. Want to extend to the linear congruence: ax b (mod m), a, b Z, m N +. (1) If x 0 is a solution then so is x k :=

More information

CSC 5170: Theory of Computational Complexity Lecture 5 The Chinese University of Hong Kong 8 February 2010

CSC 5170: Theory of Computational Complexity Lecture 5 The Chinese University of Hong Kong 8 February 2010 CSC 5170: Theory of Computational Complexity Lecture 5 The Chinese University of Hong Kong 8 February 2010 So far our notion of realistic computation has been completely deterministic: The Turing Machine

More information

Lecture 2: January 18

Lecture 2: January 18 CS271 Randomness & Computation Spring 2018 Instructor: Alistair Sinclair Lecture 2: January 18 Disclaimer: These notes have not been subjected to the usual scrutiny accorded to formal publications. They

More information

1 Maintaining a Dictionary

1 Maintaining a Dictionary 15-451/651: Design & Analysis of Algorithms February 1, 2016 Lecture #7: Hashing last changed: January 29, 2016 Hashing is a great practical tool, with an interesting and subtle theory too. In addition

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 10 February 19, 2013 CPSC 467b, Lecture 10 1/45 Primality Tests Strong primality tests Weak tests of compositeness Reformulation

More information

1 Randomized Computation

1 Randomized Computation CS 6743 Lecture 17 1 Fall 2007 1 Randomized Computation Why is randomness useful? Imagine you have a stack of bank notes, with very few counterfeit ones. You want to choose a genuine bank note to pay at

More information

Lecture 26: Arthur-Merlin Games

Lecture 26: Arthur-Merlin Games CS 710: Complexity Theory 12/09/2011 Lecture 26: Arthur-Merlin Games Instructor: Dieter van Melkebeek Scribe: Chetan Rao and Aaron Gorenstein Last time we compared counting versus alternation and showed

More information

Essentials on the Analysis of Randomized Algorithms

Essentials on the Analysis of Randomized Algorithms Essentials on the Analysis of Randomized Algorithms Dimitris Diochnos Feb 0, 2009 Abstract These notes were written with Monte Carlo algorithms primarily in mind. Topics covered are basic (discrete) random

More information

Lecture 1 : Probabilistic Method

Lecture 1 : Probabilistic Method IITM-CS6845: Theory Jan 04, 01 Lecturer: N.S.Narayanaswamy Lecture 1 : Probabilistic Method Scribe: R.Krithika The probabilistic method is a technique to deal with combinatorial problems by introducing

More information

Cryptography CS 555. Topic 18: RSA Implementation and Security. CS555 Topic 18 1

Cryptography CS 555. Topic 18: RSA Implementation and Security. CS555 Topic 18 1 Cryptography CS 555 Topic 18: RSA Implementation and Security Topic 18 1 Outline and Readings Outline RSA implementation issues Factoring large numbers Knowing (e,d) enables factoring Prime testing Readings:

More information

Weakest Precondition Calculus

Weakest Precondition Calculus Weakest Precondition Calculus COMP2600 Formal Methods for Software Engineering Rajeev Goré Australian National University Semester 2, 2016 (Most lecture slides due to Ranald Clouston) COMP 2600 Weakest

More information

Lecture 19: Interactive Proofs and the PCP Theorem

Lecture 19: Interactive Proofs and the PCP Theorem Lecture 19: Interactive Proofs and the PCP Theorem Valentine Kabanets November 29, 2016 1 Interactive Proofs In this model, we have an all-powerful Prover (with unlimited computational prover) and a polytime

More information

Probabilistic Guarded Commands Mechanized in HOL

Probabilistic Guarded Commands Mechanized in HOL Probabilistic Guarded Commands Mechanized in HOL Joe Hurd joe.hurd@comlab.ox.ac.uk Oxford University Joint work with Annabelle McIver (Macquarie University) and Carroll Morgan (University of New South

More information

Cryptography and Security Midterm Exam

Cryptography and Security Midterm Exam Cryptography and Security Midterm Exam Solution Serge Vaudenay 25.11.2015 duration: 1h45 no documents allowed, except one 2-sided sheet of handwritten notes a pocket calculator is allowed communication

More information

Automata-Theoretic Model Checking of Reactive Systems

Automata-Theoretic Model Checking of Reactive Systems Automata-Theoretic Model Checking of Reactive Systems Radu Iosif Verimag/CNRS (Grenoble, France) Thanks to Tom Henzinger (IST, Austria), Barbara Jobstmann (CNRS, Grenoble) and Doron Peled (Bar-Ilan University,

More information

THE SOLOVAY STRASSEN TEST

THE SOLOVAY STRASSEN TEST THE SOLOVAY STRASSEN TEST KEITH CONRAD 1. Introduction The Jacobi symbol satisfies many formulas that the Legendre symbol does, such as these: for a, b Z and odd m, n Z +, (1) a b mod n ( a n ) = ( b n

More information

Decision Procedures. Jochen Hoenicke. Software Engineering Albert-Ludwigs-University Freiburg. Winter Term 2016/17

Decision Procedures. Jochen Hoenicke. Software Engineering Albert-Ludwigs-University Freiburg. Winter Term 2016/17 Decision Procedures Jochen Hoenicke Software Engineering Albert-Ludwigs-University Freiburg Winter Term 2016/17 Jochen Hoenicke (Software Engineering) Decision Procedures Winter Term 2016/17 1 / 436 Program

More information

-bit integers are all in ThC. Th The following problems are complete for PSPACE NPSPACE ATIME QSAT, GEOGRAPHY, SUCCINCT REACH.

-bit integers are all in ThC. Th The following problems are complete for PSPACE NPSPACE ATIME QSAT, GEOGRAPHY, SUCCINCT REACH. CMPSCI 601: Recall From Last Time Lecture 26 Theorem: All CFL s are in sac. Facts: ITADD, MULT, ITMULT and DIVISION on -bit integers are all in ThC. Th The following problems are complete for PSPACE NPSPACE

More information

Time and space classes

Time and space classes Time and space classes Little Oh (o,

More information

Def :Corresponding to an underlying experiment, we associate a probability with each ω Ω, Pr{ ω} Pr:Ω [0..1] such that Pr{ω} = 1

Def :Corresponding to an underlying experiment, we associate a probability with each ω Ω, Pr{ ω} Pr:Ω [0..1] such that Pr{ω} = 1 Read : GKP 8.1,8.2 Quicksort is the sorting technique of choice although its worst-case behavior is inferior to that of many others. Why? What does average case mean? Seeking a phone number (which exists)

More information

Computational Cognitive Science

Computational Cognitive Science Computational Cognitive Science Lecture 9: A Bayesian model of concept learning Chris Lucas School of Informatics University of Edinburgh October 16, 218 Reading Rules and Similarity in Concept Learning

More information

CPSC 467: Cryptography and Computer Security

CPSC 467: Cryptography and Computer Security CPSC 467: Cryptography and Computer Security Michael J. Fischer Lecture 15 October 25, 2017 CPSC 467, Lecture 15 1/31 Primitive Roots Properties of primitive roots Lucas test Special form primes Functions

More information

An Application of First-Order Logic to a Problem in Combinatorics 1

An Application of First-Order Logic to a Problem in Combinatorics 1 An Application of First-Order Logic to a Problem in Combinatorics 1 I. The Combinatorial Background. A. Families of objects. In combinatorics, one frequently encounters a set of objects in which a), each

More information

On the Hardness of Analyzing Probabilistic Programs

On the Hardness of Analyzing Probabilistic Programs Acta Informatica manuscript No. (will be inserted by the editor) On the Hardness of Analyzing Probabilistic Programs Benjamin Lucien Kaminski Joost-Pieter Katoen Christoph Matheja Received: September 15

More information

compare to comparison and pointer based sorting, binary trees

compare to comparison and pointer based sorting, binary trees Admin Hashing Dictionaries Model Operations. makeset, insert, delete, find keys are integers in M = {1,..., m} (so assume machine word size, or unit time, is log m) can store in array of size M using power:

More information

Computer Science A Cryptography and Data Security. Claude Crépeau

Computer Science A Cryptography and Data Security. Claude Crépeau Computer Science 308-547A Cryptography and Data Security Claude Crépeau These notes are, largely, transcriptions by Anton Stiglic of class notes from the former course Cryptography and Data Security (308-647A)

More information

Space Complexity of Algorithms

Space Complexity of Algorithms Space Complexity of Algorithms So far we have considered only the time necessary for a computation Sometimes the size of the memory necessary for the computation is more critical. The amount of memory

More information

Lecture 5. 1 Review (Pairwise Independence and Derandomization)

Lecture 5. 1 Review (Pairwise Independence and Derandomization) 6.842 Randomness and Computation September 20, 2017 Lecture 5 Lecturer: Ronitt Rubinfeld Scribe: Tom Kolokotrones 1 Review (Pairwise Independence and Derandomization) As we discussed last time, we can

More information

CSC 7101: Programming Language Structures 1. Axiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11.

CSC 7101: Programming Language Structures 1. Axiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11. Axiomatic Semantics Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11 1 Overview We ll develop proof rules, such as: { I b } S { I } { I } while b do S end { I b } That allow us to verify

More information

A An Overview of Complexity Theory for the Algorithm Designer

A An Overview of Complexity Theory for the Algorithm Designer A An Overview of Complexity Theory for the Algorithm Designer A.1 Certificates and the class NP A decision problem is one whose answer is either yes or no. Two examples are: SAT: Given a Boolean formula

More information