# Introduction to computer science

Save this PDF as:

Size: px
Start display at page:

## Transcription

1 Introduction to computer science Michael A. Nielsen University of Queensland Goals: 1. Introduce the notion of the computational complexity of a problem, and define the major computational complexity classes. 2. Explain how to compute reversibly.

2 Q: Is there a general algorithm to determine whether a mathematical conjecture is true or false? Church-Turing: NO! Computer science Turing Machine Ad hoc empirical justification! Church-Turing thesis: Any algorithmic process can be simulated on a Turing machine an idealized and rigorously defined mathematical model of a computing device.

3 Turing machines Many different models of computation are equivalent to the Turing machine (TM). We will use a model other than the TM for reasons of both pedagogy and utility. Program: INPUT x = I like quantum information science PROGRAM FOR j = 1:LENGTH(x) OUTPUT x NEXT Input: Workspace: Output:

4 How to number programs and their inputs The program and input for a universal computer can be uniquely encoded as a pair of positive integers. INPUT x = I like quantum information science binary PROGRAM FOR j = 1:LENGTH(x) OUTPUT x NEXT binary

5 The halting problem Does program number x halt on input of x? hx ( ) 0 if program x halts on input x 1 otherwise Is there an algorithm to solve the halting problem, that is, to compute h(x)? PROGRAM: TURING(x) Suppose such an algorithm exists. Let T be the program number for TURING. Contradiction! IF h(x) = 1 THEN HALT ELSE loop forever h(t) = 0 TURING(T) halts h(t) = 1

6 Exercise: Show that there is no algorithm to determine whether program number x halts with input y. Exercise: Show that there is no algorithm to determine whether program number x halts with input 0.

7 What is the relationship of the halting problem to Hilbert s problem? Conjecture: Program number x halts on input of x. No algorithm exists to prove or refute this conjecture, in general. Isn t this a rather artificial conjecture? Conjecture: Topological space X is topologically equivalent to topological space Y. Many other natural mathematical conjectures cannot be algorithmically decided.

8 Computational complexity theory Goal: A general theory of the resources needed to solve computational problems. What types of resources? time space energy What types of computational problems? composing a poem sorting a database optimization decision problem

9 Decision problems A decision problem is a computational problem with a yes or no answer. Example: Is the number n prime? Why focus on decision problems? Decision problems are simple: This makes it easy to develop a rigorous mathematical theory. Decision problems are surprisingly general: Many other problems can be recast in terms of decision problems that are essentially equivalent.

10 Recasting other problems as decision problems Multiplication problem: What is the product of m and n? Multiplication decision problem: Is the kth bit of the product of m and n a one? Time required to solve one of these problems is the same (to within a small overhead) as the time required to solve the other. Factoring problem: What is the smallest non-trivial factor of n? Factoring decision problem: Does n have a non-trivial factor smaller than k? Time required to solve one of these problems is the same (to within a small overhead) as the time required to solve the other.

11 insoluble soluble Efficiency insoluble soluble hard easy Nomenclature: easy = tractable = efficiently computable hard = intractable = not efficiently computable Definition: A problem is easy if there is a Turing machine to solve the problem that runs in time polynomial in the size of the problem input. Otherwise the problem is hard. This definition is usually applied to both decision problems and more general problems.

12 Why polynomial-time = easy It s a rule of thumb: in practice, problems with polynomial-time solutions are usually found to be easily soluble, while problems without are usually found to be rather difficult. In practice, a super-polynomial algorithm whose running log( n ) time as a function of the input size, n, is n is likely preferable to a poly-time algorithm taking time n. The way to think about the polynomial versus non-polynomial distinction is as a first-cut analysis. Finer distinctions can wait until later.

13 Why polynomial-time = easy Christos H. Papadimitriou, Computational Complexity : It should not come as a surprise that our choice of polynomial algorithms as the mathematical concept that is supposed to capture the informal notion of practically efficient computation is open to criticism from all sides. [ ] Ultimately, our argument for our choice must be this: Adopting polynomial worst-case performance as our criterion of efficiency results in an elegant and useful theory that says something meaningful about practical computation, and would be impossible without this simplification.

14 Our first computational complexity class: P Definition: The set of all decision problems soluble in polynomial time on a Turing machine is denoted P. decision problems P easy problems Terminology: Multiplication is in P means The multiplication decision problem is in P. Factoring is thought not to be in P means The factoring decision problem is thought not to be in P. Technical caveat: Allowing the Turing machine to do random coin flips appears to help. The set of all decision problems soluble on a (randomized) Turing machine is denoted BPP.

15 The strong Church-Turing thesis Doesn t the definition of P depend upon the computational model used in the statement of the definition, namely, the Turing machine? Church-Turing thesis: Any algorithmic process can be simulated on a Turing machine. Strong Church-Turing thesis: Any physically reasonable algorithmic process can be simulated on a Turing machine, with at most a polynomial slowdown in the number of steps required to do the simulation. Ad hoc empirical justification! The strong Church-Turing thesis implies that the problems in P are precisely those for which a polynomial-time solution is the best possible, in any physically reasonable model of computation.

16 The strong Church-Turing thesis Strong Church-Turing thesis: Any physically reasonable algorithmic process can be simulated on a Turing machine, with at most a polynomial slowdown in the number of steps required to do the simulation. Deutsch: Maybe computers based on quantum mechanics might violate the strong Church-Turing thesis? Nonetheless, a remarkably wide range of computational models satisfy the strong Church-Turing thesis, and it can serve as the basis for a useful theory of computational complexity.

17 Many important problems aren t known to be in P Example: Factoring. Example: The traveling salesman problem (TSP). 22 km 23 km 15 km 12 km 19 km 14 km 16 km Goal: Find the shortest tour through all the cities. Traveling salesman decision problem: Given a network and a number, k, is there a tour through all the cities of length less than k? It is widely believed that neither of these problems is in P.

18 Witnesses Determining whether 7747 has a factor less than 70 is thought to be hard. Verifying that 61 is a factor of 7747 (= 127 x 61) less than 70 is easy: just check that 61 < 70 and use the efficient long-division algorithm you learnt in school. The factoring decision problem has witnesses to yes instances of the problem informally, solutions to the factoring problem, which can be checked in polynomial time. It does not follow that there are easily-checkable witnesses for no instances, like Does 7747 have a factor less than 60? TSP seems to be hard, but also has easily-checked witnesses for yes instances.

19 NP Definition: The complexity class NP consists of all decision problems for which yes instances of the problem have witnesses checkable in polynomial time on a Turing machine. Examples: The factoring and TSP decision problems. Example: The Hamiltonian cycle problem: is there a tour that goes through each vertex in the graph exactly once? Many important optimization problems are in NP it is often hard to find a solution, but easy to verify a solution once it is found.

20 The relationship of P to NP decision problems NP P P NP: Yes instances for problems in P can be verified in polynomial time, even without a witness. Is P NP? (US) \$1,000,000 dollars for a solution:

21 Why proving P NP is harder than it looks Intuition: There is no better way of finding a solution than searching through most possible witness. Example: The Hamiltonian cycle problem: is there a tour that goes through each vertex in the graph exactly once? Intuition: To determine whether there is a Hamiltonian cycle, the best way is to search through all possible cycles. Euler s problem: Is there a tour of a graph that visits each edge exactly once? Exercise: Prove Euler s theorem: A connected graph contains an Euler cycle iff each vertex has an even number of incident edges. Use this to argue that Euler s problem is in P.

22 Example: Graph isomorphism problem Graph 1 Graph 2 Problem: Is Graph 1 isomorphic to Graph 2? Worked exercise: Prove that the graph isomorphism problem is in NP. Research problem: Prove that the graph isomorphism problem is not in P.

23 Reducibility We say problem X is reducible to problem Y if, given an oracle to solve problem Y in one step, there is an algorithm to solve problem X in polynomial time. Example: The Hamiltonian cycle problem can be reduced to the travelling salesman problem. Does this graph have a Hamiltonian cycle? 1km 1km 1km 1km 1km 1km 1km Is there a tour of less than 8 kilometers?

24 Ladner The structure of NP NP NPcomplete NPI P Definition: A problem is NP-complete if it is in NP and every other problem in NP reduces to it. Not obvious that NP-complete problems even exist! Cook-Levin Theorem: Provided the first example of an NP-complete problem the satisfiability problem. Thousands of other problems are now known to be NP-complete, including the travelling salesman and Hamiltonian cycle problems. Many people believe that quantum computers won t efficiently solve NP-complete problems, but maybe can solve some problems in NPI. Candidates for NPI include factoring and graph isomorphism.

25 Research problem: Find an efficient quantum algorithm to solve the graph isomorphism problem.

26 The circuit model of computation Real computers are finite devices, not infinite, like the Turing machine. We will investigate a circuit model of computation, and explain how to define computational complexity classes in that model. Quantum computers are most conveniently understood in terms of the quantum circuit model of computation.

27 Examples of circuits x x x x 1 NOT x x x y NAND 1 x y y y x controlled-not gate (CNOT) x NOT AND 0 Basic elements wires (memory) x 0 NAND 1 one- and two-bit gates fanout ancilla bits in pre-prepared states.

28 Universality in the circuit model Exercise: Prove that the NAND gate can be used to simulate the AND, XOR and NOT gates, provided wires, fanout, and ancilla are available. Exercise: Prove that the NAND gate, wires, fanout and ancilla can be used to compute an arbitrary function f(.) with n input bits, and one output bit. (Hint: Induct on n.) We say that the NAND gate, wires, fanout and ancilla form a universal set of operations for computation. Exercise: Prove that there is a function f(.), as above, that takes at least 2 n gates to compute.

29 The circuit model and complexity classes Can we connect the circuit model to complexity classes like P and NP? Basic idea is to introduce a family of circuits, C n, indexed by the problem size, n. n-bit input Main point is that (modulo some technicalities) a problem is in P iff there is a family of circuits to solve the problem, C n, containing a number of elements polynomial in n. Technicalities (in brief): Our intrepid engineer needs a construction algorithm (i.e. a Turing machine) to build the circuit C n, given n. This algorithm should run in polynomial time. Such a circuit family is called a uniform circuit family. C n

30 Irreversibility of circuit elements NAND 1 0 NAND 1 From the output of the NAND gate it is impossible to determine if the input was (0,1), (1,0), or (0,0). The NAND gate is irreversible: there is no logic gate capable of inverting the NAND. Landauer s principle: Any irreversible operation in a circuit is necessarily accompanied by the dissipation of heat. Can we compute without dissipating heat? The trick is to compute using only reversible circuit elements! Importance to us: not heat dissipation, but the fact that quantum gates are most naturally viewed as reversible gates.

31 Some reversible circuit elements x x x x x y y x y y y x The Toffoli gate (or controlled-controlled-not). x x x x x y y y y y z z x y z z x y z

32 How to compute using reversible circuit elements Idea: embed irreversible gates in reversible gates, making use of extra ancilla bits. Example: The reversible NAND gate. x y 1 x y 1 x y

33 How to compute using reversible circuit elements Example: fanout. x x 0 x

34 Up to constant factors the resource requirements in the two models are the same, so complexity classes like P and NP do not change in a reversible circuit model of computation. How to compute using reversible circuit elements Original circuit: uses NAND gates, wires, fanout, and ancilla x f f( x) Reversible circuit: uses CNOT and Toffoli gates, wires, and ancilla x f( x) f ' 0,0,...,0 gx

35 Can we eliminate the garbage? z z f( x) x 0,0,...,0 f ' f( x) g x ( f ') 1 x 0,0,...,0 Canonical form: (x,z) ( xz, fx ( )) Complexity classes like P and NP are again unchanged. Exercise: Show that it is impossible to do universal computation using only one- and two-bit reversible logic gates.

36 Digression: what can be measured in quantum mechanics? Computer science can inspire fundamental questions about physics. We may take an informatic approach to physics. (Compare the physical approach to information.) Problem: What measurements can be performed in quantum mechanics?

37 Digression: what can be measured in quantum mechanics? Traditional approach to quantum measurements: A quantum measurement is described by an observable, M, that is, a Hermitian operator acting on the state space of the system. Measuring a system prepared in an eigenstate of M gives the corresponding eigenvalue of M as the measurement outcome. The question now presents itself Can every observable be measured? The answer theoretically is yes. In practice it may be very awkward, or perhaps even beyond the ingenuity of the experimenter, to devise an apparatus which could measure some particular observable, but the theory always allows one to imagine that the measurement could be made. - Paul A. M. Dirac

38 The halting observable Consider a quantum system with an infinite-dimensional state space with orthonormal basis 0, 1, 2,K M h( x) x x x = 0 Can we build a measuring device capable of measuring the halting observable? Yes: Would give us a procedure to solve the halting problem. No: There is an interesting class of superselection rules controlling what observables may, in fact, be measured.

39 Research problem: Is the halting observable really measurable? If so, how? If not, why not?

### Computational complexity theory

Computational complexity theory Goal: A general theory of the resources needed to solve computational problems What types of resources? Time What types of computational problems? decision problem Decision

### Classical Information and Bits

p. 1/24 Classical Information and Bits The simplest variable that can carry information is the bit, which can take only two values, 0 or 1. Any ensemble, description, or set of discrete values can be quantified

### NP-Completeness I. Lecture 19. 19.1 Overview. 19.2 Introduction: Reduction and Expressiveness

Lecture 19 NP-Completeness I 19.1 Overview In the past few lectures we have looked at increasingly more expressive problems that we were able to solve using efficient algorithms. In this lecture we introduce

### NP-complete? NP-hard? Some Foundations of Complexity. Prof. Sven Hartmann Clausthal University of Technology Department of Informatics

NP-complete? NP-hard? Some Foundations of Complexity Prof. Sven Hartmann Clausthal University of Technology Department of Informatics Tractability of Problems Some problems are undecidable: no computer

### Diagonalization. Ahto Buldas. Lecture 3 of Complexity Theory October 8, 2009. Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach.

Diagonalization Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach. Ahto Buldas Ahto.Buldas@ut.ee Background One basic goal in complexity theory is to separate interesting complexity

### Page 1. CSCE 310J Data Structures & Algorithms. CSCE 310J Data Structures & Algorithms. P, NP, and NP-Complete. Polynomial-Time Algorithms

CSCE 310J Data Structures & Algorithms P, NP, and NP-Complete Dr. Steve Goddard goddard@cse.unl.edu CSCE 310J Data Structures & Algorithms Giving credit where credit is due:» Most of the lecture notes

### 2 Elements of classical computer science

2 Elements of classical computer science 11 Good references for the material of this section are [3], Chap. 3, [5], Secs. 2 and 3, [7], Sec. 6.1, and [11] as a nice readable account of complexit with some

### A Working Knowledge of Computational Complexity for an Optimizer

A Working Knowledge of Computational Complexity for an Optimizer ORF 363/COS 323 Instructor: Amir Ali Ahmadi TAs: Y. Chen, G. Hall, J. Ye Fall 2014 1 Why computational complexity? What is computational

### Notes on Complexity Theory Last updated: August, 2011. Lecture 1

Notes on Complexity Theory Last updated: August, 2011 Jonathan Katz Lecture 1 1 Turing Machines I assume that most students have encountered Turing machines before. (Students who have not may want to look

### Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

Outline NP-completeness Examples of Easy vs. Hard problems Euler circuit vs. Hamiltonian circuit Shortest Path vs. Longest Path 2-pairs sum vs. general Subset Sum Reducing one problem to another Clique

### P versus NP, and More

1 P versus NP, and More Great Ideas in Theoretical Computer Science Saarland University, Summer 2014 If you have tried to solve a crossword puzzle, you know that it is much harder to solve it than to verify

### NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

NP-Completeness CptS 223 Advanced Data Structures Larry Holder School of Electrical Engineering and Computer Science Washington State University 1 Hard Graph Problems Hard means no known solutions with

### Why? A central concept in Computer Science. Algorithms are ubiquitous.

Analysis of Algorithms: A Brief Introduction Why? A central concept in Computer Science. Algorithms are ubiquitous. Using the Internet (sending email, transferring files, use of search engines, online

### OHJ-2306 Introduction to Theoretical Computer Science, Fall 2012 8.11.2012

276 The P vs. NP problem is a major unsolved problem in computer science It is one of the seven Millennium Prize Problems selected by the Clay Mathematics Institute to carry a \$ 1,000,000 prize for the

### Universality in the theory of algorithms and computer science

Universality in the theory of algorithms and computer science Alexander Shen Computational models The notion of computable function was introduced in 1930ies. Simplifying (a rather interesting and puzzling)

### CS 3719 (Theory of Computation and Algorithms) Lecture 4

CS 3719 (Theory of Computation and Algorithms) Lecture 4 Antonina Kolokolova January 18, 2012 1 Undecidable languages 1.1 Church-Turing thesis Let s recap how it all started. In 1990, Hilbert stated a

### Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar

Complexity Theory IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar Outline Goals Computation of Problems Concepts and Definitions Complexity Classes and Problems Polynomial Time Reductions Examples

### 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008

MIT OpenCourseWare http://ocw.mit.edu 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

### CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 313]

CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 313] File Structures A file is a collection of data stored on mass storage (e.g., disk or tape) Why on mass storage? too big to fit

### 1. Nondeterministically guess a solution (called a certificate) 2. Check whether the solution solves the problem (called verification)

Some N P problems Computer scientists have studied many N P problems, that is, problems that can be solved nondeterministically in polynomial time. Traditionally complexity question are studied as languages:

### Introduction to Algorithms. Part 3: P, NP Hard Problems

Introduction to Algorithms Part 3: P, NP Hard Problems 1) Polynomial Time: P and NP 2) NP-Completeness 3) Dealing with Hard Problems 4) Lower Bounds 5) Books c Wayne Goddard, Clemson University, 2004 Chapter

### THE TURING DEGREES AND THEIR LACK OF LINEAR ORDER

THE TURING DEGREES AND THEIR LACK OF LINEAR ORDER JASPER DEANTONIO Abstract. This paper is a study of the Turing Degrees, which are levels of incomputability naturally arising from sets of natural numbers.

### Computer Algorithms. NP-Complete Problems. CISC 4080 Yanjun Li

Computer Algorithms NP-Complete Problems NP-completeness The quest for efficient algorithms is about finding clever ways to bypass the process of exhaustive search, using clues from the input in order

### Complexity Classes P and NP

Complexity Classes P and NP MATH 3220 Supplemental Presentation by John Aleshunas The cure for boredom is curiosity. There is no cure for curiosity Dorothy Parker Computational Complexity Theory In computer

### Theory of Computation Prof. Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology, Madras

Theory of Computation Prof. Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture No. # 31 Recursive Sets, Recursively Innumerable Sets, Encoding

### Chapter 1. Computation theory

Chapter 1. Computation theory In this chapter we will describe computation logic for the machines. This topic is a wide interdisciplinary field, so that the students can work in an interdisciplinary context.

### The Classes P and NP

The Classes P and NP We now shift gears slightly and restrict our attention to the examination of two families of problems which are very important to computer scientists. These families constitute the

### NP-Completeness and Cook s Theorem

NP-Completeness and Cook s Theorem Lecture notes for COM3412 Logic and Computation 15th January 2002 1 NP decision problems The decision problem D L for a formal language L Σ is the computational task:

### What Has Quantum Mechanics to Do With Factoring? Things I wish they had told me about Peter Shor s algorithm

What Has Quantum Mechanics to Do With Factoring? Things I wish they had told me about Peter Shor s algorithm 1 Question: What has quantum mechanics to do with factoring? Answer: Nothing! 2 Question: What

### Lecture 7: NP-Complete Problems

IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Basic Course on Computational Complexity Lecture 7: NP-Complete Problems David Mix Barrington and Alexis Maciel July 25, 2000 1. Circuit

### NP-completeness and the real world. NP completeness. NP-completeness and the real world (2) NP-completeness and the real world

-completeness and the real world completeness Course Discrete Biological Models (Modelli Biologici Discreti) Zsuzsanna Lipták Imagine you are working for a biotech company. One day your boss calls you

### 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008

MIT OpenCourseWare http://ocw.mit.edu 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

### Quantum Computing. Robert Sizemore

Quantum Computing Robert Sizemore Outline Introduction: What is quantum computing? What use is quantum computing? Overview of Quantum Systems Dirac notation & wave functions Two level systems Classical

### Lecture 9 - Message Authentication Codes

Lecture 9 - Message Authentication Codes Boaz Barak March 1, 2010 Reading: Boneh-Shoup chapter 6, Sections 9.1 9.3. Data integrity Until now we ve only been interested in protecting secrecy of data. However,

### 2.1 Complexity Classes

15-859(M): Randomized Algorithms Lecturer: Shuchi Chawla Topic: Complexity classes, Identity checking Date: September 15, 2004 Scribe: Andrew Gilpin 2.1 Complexity Classes In this lecture we will look

### Notes on Complexity Theory Last updated: August, 2011. Lecture 1

Notes on Complexity Theory Last updated: August, 2011 Jonathan Katz Lecture 1 1 Turing Machines I assume that most students have encountered Turing machines before. (Students who have not may want to look

### Factoring & Primality

Factoring & Primality Lecturer: Dimitris Papadopoulos In this lecture we will discuss the problem of integer factorization and primality testing, two problems that have been the focus of a great amount

### ! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. !-approximation algorithm.

Approximation Algorithms Chapter Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of

### CSC 373: Algorithm Design and Analysis Lecture 16

CSC 373: Algorithm Design and Analysis Lecture 16 Allan Borodin February 25, 2013 Some materials are from Stephen Cook s IIT talk and Keven Wayne s slides. 1 / 17 Announcements and Outline Announcements

### Some Minesweeper Configurations

Some Minesweeper Configurations Richard Kaye School of Mathematics The University of Birmingham Birmingham B15 2TT RWKaye@bhamacuk http://webmatbhamacuk/rwkaye/ 31st May 2007 Contents 1 Introduction 2

### Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs

CSE599s: Extremal Combinatorics November 21, 2011 Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs Lecturer: Anup Rao 1 An Arithmetic Circuit Lower Bound An arithmetic circuit is just like

### Applied Algorithm Design Lecture 5

Applied Algorithm Design Lecture 5 Pietro Michiardi Eurecom Pietro Michiardi (Eurecom) Applied Algorithm Design Lecture 5 1 / 86 Approximation Algorithms Pietro Michiardi (Eurecom) Applied Algorithm Design

### CAD Algorithms. P and NP

CAD Algorithms The Classes P and NP Mohammad Tehranipoor ECE Department 6 September 2010 1 P and NP P and NP are two families of problems. P is a class which contains all of the problems we solve using

Approximation Algorithms Chapter Approximation Algorithms Q. Suppose I need to solve an NP-hard problem. What should I do? A. Theory says you're unlikely to find a poly-time algorithm. Must sacrifice one

### 0.1 Phase Estimation Technique

Phase Estimation In this lecture we will describe Kitaev s phase estimation algorithm, and use it to obtain an alternate derivation of a quantum factoring algorithm We will also use this technique to design

### One last point: we started off this book by introducing another famously hard search problem:

S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani 261 Factoring One last point: we started off this book by introducing another famously hard search problem: FACTORING, the task of finding all prime factors

### 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008

MIT OpenCourseWare http://ocw.mit.edu 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

### Keywords Quantum logic gates, Quantum computing, Logic gate, Quantum computer

Volume 3 Issue 10 October 2013 ISSN: 2277 128X International Journal of Advanced Research in Computer Science and Software Engineering Research Paper Available online at: www.ijarcsse.com An Introduction

### Theoretical Computer Science (Bridging Course) Complexity

Theoretical Computer Science (Bridging Course) Complexity Gian Diego Tipaldi A scenario You are a programmer working for a logistics company Your boss asks you to implement a program that optimizes the

### U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, 2009. Notes on Algebra

U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, 2009 Notes on Algebra These notes contain as little theory as possible, and most results are stated without proof. Any introductory

### Lecture 13 - Basic Number Theory.

Lecture 13 - Basic Number Theory. Boaz Barak March 22, 2010 Divisibility and primes Unless mentioned otherwise throughout this lecture all numbers are non-negative integers. We say that A divides B, denoted

### Graph Theory Problems and Solutions

raph Theory Problems and Solutions Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles November, 005 Problems. Prove that the sum of the degrees of the vertices of any finite graph is

### Revised Version of Chapter 23. We learned long ago how to solve linear congruences. ax c (mod m)

Chapter 23 Squares Modulo p Revised Version of Chapter 23 We learned long ago how to solve linear congruences ax c (mod m) (see Chapter 8). It s now time to take the plunge and move on to quadratic equations.

### ! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. #-approximation algorithm.

Approximation Algorithms 11 Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of three

### 6.080/6.089 GITCS Feb 12, 2008. Lecture 3

6.8/6.89 GITCS Feb 2, 28 Lecturer: Scott Aaronson Lecture 3 Scribe: Adam Rogal Administrivia. Scribe notes The purpose of scribe notes is to transcribe our lectures. Although I have formal notes of my

### On the Relationship between Classes P and NP

Journal of Computer Science 8 (7): 1036-1040, 2012 ISSN 1549-3636 2012 Science Publications On the Relationship between Classes P and NP Anatoly D. Plotnikov Department of Computer Systems and Networks,

### Lecture 2: Universality

CS 710: Complexity Theory 1/21/2010 Lecture 2: Universality Instructor: Dieter van Melkebeek Scribe: Tyson Williams In this lecture, we introduce the notion of a universal machine, develop efficient universal

### Introduction to Algorithms Review information for Prelim 1 CS 4820, Spring 2010 Distributed Wednesday, February 24

Introduction to Algorithms Review information for Prelim 1 CS 4820, Spring 2010 Distributed Wednesday, February 24 The final exam will cover seven topics. 1. greedy algorithms 2. divide-and-conquer algorithms

### Chapter. NP-Completeness. Contents

Chapter 13 NP-Completeness Contents 13.1 P and NP......................... 593 13.1.1 Defining the Complexity Classes P and NP...594 13.1.2 Some Interesting Problems in NP.......... 597 13.2 NP-Completeness....................

### SIMS 255 Foundations of Software Design. Complexity and NP-completeness

SIMS 255 Foundations of Software Design Complexity and NP-completeness Matt Welsh November 29, 2001 mdw@cs.berkeley.edu 1 Outline Complexity of algorithms Space and time complexity ``Big O'' notation Complexity

### Lecture 19: Introduction to NP-Completeness Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY 11794 4400

Lecture 19: Introduction to NP-Completeness Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Reporting to the Boss Suppose

### Guessing Game: NP-Complete?

Guessing Game: NP-Complete? 1. LONGEST-PATH: Given a graph G = (V, E), does there exists a simple path of length at least k edges? YES 2. SHORTEST-PATH: Given a graph G = (V, E), does there exists a simple

### WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT? introduction Many students seem to have trouble with the notion of a mathematical proof. People that come to a course like Math 216, who certainly

### Theorem (informal statement): There are no extendible methods in David Chalmers s sense unless P = NP.

Theorem (informal statement): There are no extendible methods in David Chalmers s sense unless P = NP. Explication: In his paper, The Singularity: A philosophical analysis, David Chalmers defines an extendible

### Quantum Computability and Complexity and the Limits of Quantum Computation

Quantum Computability and Complexity and the Limits of Quantum Computation Eric Benjamin, Kenny Huang, Amir Kamil, Jimmy Kittiyachavalit University of California, Berkeley December 7, 2003 This paper will

### Introduction to Logic in Computer Science: Autumn 2006

Introduction to Logic in Computer Science: Autumn 2006 Ulle Endriss Institute for Logic, Language and Computation University of Amsterdam Ulle Endriss 1 Plan for Today Now that we have a basic understanding

### Informatique Fondamentale IMA S8

Informatique Fondamentale IMA S8 Cours 4 : graphs, problems and algorithms on graphs, (notions of) NP completeness Laure Gonnord http://laure.gonnord.org/pro/teaching/ Laure.Gonnord@polytech-lille.fr Université

### Notes on NP Completeness

Notes on NP Completeness Rich Schwartz November 10, 2013 1 Overview Here are some notes which I wrote to try to understand what NP completeness means. Most of these notes are taken from Appendix B in Douglas

### ! X is a set of strings. ! Instance: string s. ! Algorithm A solves problem X: A(s) = yes iff s! X.

Decision Problems 8.2 Definition of NP Decision problem. X is a set of strings. Instance: string s. Algorithm A solves problem X: A(s) = yes iff s X. Polynomial time. Algorithm A runs in polytime if for

### Quantum and Non-deterministic computers facing NP-completeness

Quantum and Non-deterministic computers facing NP-completeness Thibaut University of Vienna Dept. of Business Administration Austria Vienna January 29th, 2013 Some pictures come from Wikipedia Introduction

### 136 CHAPTER 4. INDUCTION, GRAPHS AND TREES

136 TER 4. INDUCTION, GRHS ND TREES 4.3 Graphs In this chapter we introduce a fundamental structural idea of discrete mathematics, that of a graph. Many situations in the applications of discrete mathematics

### FOUNDATIONS OF ALGEBRAIC GEOMETRY CLASS 22

FOUNDATIONS OF ALGEBRAIC GEOMETRY CLASS 22 RAVI VAKIL CONTENTS 1. Discrete valuation rings: Dimension 1 Noetherian regular local rings 1 Last day, we discussed the Zariski tangent space, and saw that it

### Integer multiplication

Integer multiplication Suppose we have two unsigned integers, A and B, and we wish to compute their product. Let A be the multiplicand and B the multiplier: A n 1... A 1 A 0 multiplicand B n 1... B 1 B

### MATHEMATICS: CONCEPTS, AND FOUNDATIONS Vol. III - Logic and Computer Science - Phokion G. Kolaitis

LOGIC AND COMPUTER SCIENCE Phokion G. Kolaitis Computer Science Department, University of California, Santa Cruz, CA 95064, USA Keywords: algorithm, Armstrong s axioms, complete problem, complexity class,

### SUBGROUPS OF CYCLIC GROUPS. 1. Introduction In a group G, we denote the (cyclic) group of powers of some g G by

SUBGROUPS OF CYCLIC GROUPS KEITH CONRAD 1. Introduction In a group G, we denote the (cyclic) group of powers of some g G by g = {g k : k Z}. If G = g, then G itself is cyclic, with g as a generator. Examples

### Algebraic Computation Models. Algebraic Computation Models

Algebraic Computation Models Ζυγομήτρος Ευάγγελος ΜΠΛΑ 201118 Φεβρουάριος, 2013 Reasons for using algebraic models of computation The Turing machine model captures computations on bits. Many algorithms

### Chapter 7: Products and quotients

Chapter 7: Products and quotients Matthew Macauley Department of Mathematical Sciences Clemson University http://www.math.clemson.edu/~macaule/ Math 42, Spring 24 M. Macauley (Clemson) Chapter 7: Products

### Chapter 1. NP Completeness I. 1.1. Introduction. By Sariel Har-Peled, December 30, 2014 1 Version: 1.05

Chapter 1 NP Completeness I By Sariel Har-Peled, December 30, 2014 1 Version: 1.05 "Then you must begin a reading program immediately so that you man understand the crises of our age," Ignatius said solemnly.

### Discrete Mathematics & Mathematical Reasoning Chapter 10: Graphs

Discrete Mathematics & Mathematical Reasoning Chapter 10: Graphs Kousha Etessami U. of Edinburgh, UK Kousha Etessami (U. of Edinburgh, UK) Discrete Mathematics (Chapter 6) 1 / 13 Overview Graphs and Graph

### P vs NP problem in the field anthropology

Research Article P vs NP problem in the field anthropology Michael.A. Popov, Oxford, UK Email Michael282.eps@gmail.com Keywords P =?NP - complexity anthropology - M -decision - quantum -like game - game-theoretical

### Notes from Week 1: Algorithms for sequential prediction

CS 683 Learning, Games, and Electronic Markets Spring 2007 Notes from Week 1: Algorithms for sequential prediction Instructor: Robert Kleinberg 22-26 Jan 2007 1 Introduction In this course we will be looking

### CAs and Turing Machines. The Basis for Universal Computation

CAs and Turing Machines The Basis for Universal Computation What We Mean By Universal When we claim universal computation we mean that the CA is capable of calculating anything that could possibly be calculated*.

### Euler Paths and Euler Circuits

Euler Paths and Euler Circuits An Euler path is a path that uses every edge of a graph exactly once. An Euler circuit is a circuit that uses every edge of a graph exactly once. An Euler path starts and

### [Refer Slide Time: 05:10]

Principles of Programming Languages Prof: S. Arun Kumar Department of Computer Science and Engineering Indian Institute of Technology Delhi Lecture no 7 Lecture Title: Syntactic Classes Welcome to lecture

### Discuss the size of the instance for the minimum spanning tree problem.

3.1 Algorithm complexity The algorithms A, B are given. The former has complexity O(n 2 ), the latter O(2 n ), where n is the size of the instance. Let n A 0 be the size of the largest instance that can

### The Basics of Graphical Models

The Basics of Graphical Models David M. Blei Columbia University October 3, 2015 Introduction These notes follow Chapter 2 of An Introduction to Probabilistic Graphical Models by Michael Jordan. Many figures

### Answers to some of the exercises.

Answers to some of the exercises. Chapter 2. Ex.2.1 (a) There are several ways to do this. Here is one possibility. The idea is to apply the k-center algorithm first to D and then for each center in D

### JUST-IN-TIME SCHEDULING WITH PERIODIC TIME SLOTS. Received December May 12, 2003; revised February 5, 2004

Scientiae Mathematicae Japonicae Online, Vol. 10, (2004), 431 437 431 JUST-IN-TIME SCHEDULING WITH PERIODIC TIME SLOTS Ondřej Čepeka and Shao Chin Sung b Received December May 12, 2003; revised February

### The finite field with 2 elements The simplest finite field is

The finite field with 2 elements The simplest finite field is GF (2) = F 2 = {0, 1} = Z/2 It has addition and multiplication + and defined to be 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 0 0 0 = 0 0 1 = 0

### Computability Theory

CSC 438F/2404F Notes (S. Cook and T. Pitassi) Fall, 2014 Computability Theory This section is partly inspired by the material in A Course in Mathematical Logic by Bell and Machover, Chap 6, sections 1-10.

### Introduction to NP-Completeness Written and copyright c by Jie Wang 1

91.502 Foundations of Comuter Science 1 Introduction to Written and coyright c by Jie Wang 1 We use time-bounded (deterministic and nondeterministic) Turing machines to study comutational comlexity of

### Discrete Mathematics Problems

Discrete Mathematics Problems William F. Klostermeyer School of Computing University of North Florida Jacksonville, FL 32224 E-mail: wkloster@unf.edu Contents 0 Preface 3 1 Logic 5 1.1 Basics...............................

### Markov Algorithm. CHEN Yuanmi December 18, 2007

Markov Algorithm CHEN Yuanmi December 18, 2007 1 Abstract Markov Algorithm can be understood as a priority string rewriting system. In this short paper we give the definition of Markov algorithm and also

### 3. Equivalence Relations. Discussion

3. EQUIVALENCE RELATIONS 33 3. Equivalence Relations 3.1. Definition of an Equivalence Relations. Definition 3.1.1. A relation R on a set A is an equivalence relation if and only if R is reflexive, symmetric,

### ECS 120 Lesson 17 Church s Thesis, The Universal Turing Machine

ECS 120 Lesson 17 Church s Thesis, The Universal Turing Machine Oliver Kreylos Monday, May 7th, 2001 In the last lecture, we looked at the computation of Turing Machines, and also at some variants of Turing

### Reading 13 : Finite State Automata and Regular Expressions

CS/Math 24: Introduction to Discrete Mathematics Fall 25 Reading 3 : Finite State Automata and Regular Expressions Instructors: Beck Hasti, Gautam Prakriya In this reading we study a mathematical model

### 2.3 Scheduling jobs on identical parallel machines

2.3 Scheduling jobs on identical parallel machines There are jobs to be processed, and there are identical machines (running in parallel) to which each job may be assigned Each job = 1,,, must be processed

### Approximation Algorithms

Approximation Algorithms or: How I Learned to Stop Worrying and Deal with NP-Completeness Ong Jit Sheng, Jonathan (A0073924B) March, 2012 Overview Key Results (I) General techniques: Greedy algorithms