Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDAAshish Duggal
Push Down Automata (PDA) is part of TOC (Theory of Computation)
From this presentation you will get all the information related to PDA also it will help you to easily understand this topic. There is also one example.
This PPT is very helpful for Computer science and Computer Engineer
(B.C.A., M.C.A., B.TECH. , M.TECH.)
This document discusses randomized algorithms. It begins by listing different categories of algorithms, including randomized algorithms. Randomized algorithms introduce randomness into the algorithm to avoid worst-case behavior and find efficient approximate solutions. Quicksort is presented as an example randomized algorithm, where randomness improves its average runtime from quadratic to linear. The document also discusses the randomized closest pair algorithm and a randomized algorithm for primality testing. Both introduce randomness to improve efficiency compared to deterministic algorithms for the same problems.
P, NP, NP-Complete, and NP-Hard
Reductionism in Algorithms
NP-Completeness and Cooks Theorem
NP-Complete and NP-Hard Problems
Travelling Salesman Problem (TSP)
Travelling Salesman Problem (TSP) - Approximation Algorithms
PRIMES is in P - (A hope for NP problems in P)
Millennium Problems
Conclusions
The document describes the steps of knowledge engineering for representing electronic circuits in first-order logic. It outlines identifying the task, assembling relevant knowledge about gates and circuits, deciding on vocabulary to represent components, encoding general knowledge about the domain as axioms, encoding a specific adder circuit as an example, posing queries to verify the circuit's functionality, and debugging the knowledge base by perturbing it to identify errors. Developing a knowledge base in first-order logic is a careful process of analyzing the problem domain, structuring representations, and encoding necessary logical rules for inferences.
The document discusses Turing machines and their properties. It introduces the Church-Turing thesis that any problem that can be solved by an algorithm can be modeled by a Turing machine. It then describes different types of Turing machines, such as multi-track, nondeterministic, two-way, multi-tape, and multidimensional Turing machines. The document provides examples of Turing machines that accept specific languages and evaluate mathematical functions through their transition tables and diagrams.
Design and Analysis of Algorithm help to design the algorithms for solving different types of problems in Computer Science. It also helps to design and analyze the logic of how the program will work before developing the actual code for a program.
The document discusses classical AI planning and different planning approaches. It introduces state-space planning which searches for a sequence of state transformations, and plan-space planning which searches for a plan satisfying certain conditions. It also discusses hierarchical planning which decomposes tasks into simpler subtasks, and universal classical planning which uses different refinement techniques including state-space and plan-space refinements. Classical planning makes simplifying assumptions but its principles can still be applied to games with some workarounds.
Join dependency occurs when a table can be recreated by joining multiple tables, with each table containing a subset of the original table's attributes. A join dependency exists if the join of two relations over a common attribute is equal to the original relation. Relations that have a join dependency between them form a lossless-join decomposition of the original relation.
Automata theory studies abstract computing devices and the types of tasks they are capable of. Alan Turing pioneered this field in the 1930s by studying Turing machines. The theory examines questions like which tasks can and cannot be performed by different models of machines. It also considers the distinction between what is computable versus the complexity of computation. Common concepts include finite automata, formal languages, and the Chomsky hierarchy for classifying language types. Proofs in automata theory involve techniques like deduction, induction, contradiction, and establishing results by definition.
- NP-hard problems are at least as hard as problems in NP. A problem is NP-hard if any problem in NP can be reduced to it in polynomial time.
- Cook's theorem states that if the SAT problem can be solved in polynomial time, then every problem in NP can be solved in polynomial time.
- Vertex cover problem is proven to be NP-hard by showing that independent set problem reduces to it in polynomial time, meaning there is a polynomial time algorithm that converts any instance of independent set into an instance of vertex cover.
- Therefore, if there was a polynomial time algorithm for vertex cover, it could be used to solve independent set in polynomial time. Since independent set is NP-complete
This document provides an introduction to finite automata. It defines key concepts like alphabets, strings, languages, and finite state machines. It also describes the different types of automata, specifically deterministic finite automata (DFAs) and nondeterministic finite automata (NFAs). DFAs have a single transition between states for each input, while NFAs can have multiple transitions. NFAs are generally easier to construct than DFAs. The next class will focus on deterministic finite automata in more detail.
The document discusses first-order logic (FOL) and its advantages over propositional logic for representing knowledge. It introduces the basic elements of FOL syntax, such as constants, predicates, functions, variables, and connectives. It provides examples of FOL expressions and discusses how objects and relations between objects can be represented. It also covers quantification in FOL using universal and existential quantifiers.
The document discusses the greedy method algorithmic approach. It provides an overview of greedy algorithms including that they make locally optimal choices at each step to find a global optimal solution. The document also provides examples of problems that can be solved using greedy methods like job sequencing, the knapsack problem, finding minimum spanning trees, and single source shortest paths. It summarizes control flow and applications of greedy algorithms.
The document discusses algorithm analysis and asymptotic notation. It defines algorithm analysis as comparing algorithms based on running time and other factors as problem size increases. Asymptotic notation such as Big-O, Big-Omega, and Big-Theta are introduced to classify algorithms based on how their running times grow relative to input size. Common time complexities like constant, logarithmic, linear, quadratic, and exponential are also covered. The properties and uses of asymptotic notation for equations and inequalities are explained.
The branch-and-bound method is used to solve optimization problems by traversing a state space tree. It computes a bound at each node to determine if the node is promising. Better approaches traverse nodes breadth-first and choose the most promising node using a bounding heuristic. The traveling salesperson problem is solved using branch-and-bound by finding an initial tour, defining a bounding heuristic as the actual cost plus minimum remaining cost, and expanding promising nodes in best-first order until finding the minimal tour.
Dynamic programming is an algorithm design technique that solves problems by breaking them down into smaller overlapping subproblems and storing the results of already solved subproblems, rather than recomputing them. It is applicable to problems exhibiting optimal substructure and overlapping subproblems. The key steps are to define the optimal substructure, recursively define the optimal solution value, compute values bottom-up, and optionally reconstruct the optimal solution. Common examples that can be solved with dynamic programming include knapsack, shortest paths, matrix chain multiplication, and longest common subsequence.
This document discusses Bayesian learning and the Bayes theorem. Some key points:
- Bayesian learning uses probabilities to calculate the likelihood of hypotheses given observed data and prior probabilities. The naive Bayes classifier is an example.
- The Bayes theorem provides a way to calculate the posterior probability of a hypothesis given observed training data by considering the prior probability and likelihood of the data under the hypothesis.
- Bayesian methods can incorporate prior knowledge and probabilistic predictions, and classify new instances by combining predictions from multiple hypotheses weighted by their probabilities.
The document discusses the importance of algorithms and their role in problem solving. It defines what an algorithm is and explains that they are sets of instructions to solve problems efficiently. The document outlines different algorithm design techniques and how algorithms shape applications like search engines, recommendations, and maps. It also discusses qualities of good algorithms like correctness, termination, and performance and analyzing algorithms through pseudocode and empirical testing.
The document discusses regular expressions and how they can be used to represent languages accepted by finite automata. It provides examples of how to:
1. Construct regular expressions from languages and finite state automata. Regular expressions can be built by defining expressions for subparts of a language and combining them.
2. Convert finite state automata to equivalent regular expressions using state elimination techniques. Intermediate states are replaced with regular expressions on transitions until a single state automaton remains.
3. Convert regular expressions to equivalent finite state automata by building epsilon-nondeterministic finite automata (ε-NFAs) based on the structure of the regular expression.
The document provides an introduction to automata theory and finite state automata (FSA). It defines an automaton as an abstract computing device or mathematical model used in computer science and computational linguistics. The reading discusses pioneers in automata theory like Alan Turing and his development of Turing machines. It then gives an overview of finite state automata, explaining concepts like states, transitions, alphabets, and using a example of building an FSA for a "sheeptalk" language to demonstrate these components.
Here are the steps to construct an NFA-ε equivalent to the given regular expressions:
1. ε + a b (a+b)*
- States: q0, q1, q2
- Transitions: q0 -> q1 on ε, q0 -> q2 on a, q1 -> q1 on a/b, q1 -> q2 on b
- Start state: q0
- Final states: q2
2. (0+1)* (00+11)
- States: q0, q1, q2, q3
- Transitions: q0 -> q0 on 0/1, q0 -> q1 on 0/1
Fundamentals of the Analysis of Algorithm EfficiencySaranya Natarajan
This document discusses analyzing the efficiency of algorithms. It introduces the framework for analyzing algorithms in terms of time and space complexity. Time complexity indicates how fast an algorithm runs, while space complexity measures the memory required. The document outlines steps for analyzing algorithms, including measuring input size, determining the basic operations, calculating frequency counts of operations, and expressing efficiency in Big O notation order of growth. Worst-case, best-case, and average-case time complexities are also discussed.
A multi-head Turing machine has a single tape with multiple heads that can read and write to the tape independently. Each head can move left, right, or stay in the same position. This type of Turing machine is as powerful as a standard single-tape Turing machine.
The halting problem asks if it is possible to determine if a Turing machine will halt or run infinitely given its program and input. It is proven to be unsolvable - there is no general algorithm that can correctly determine if all Turing machine programs will halt for all inputs.
Knowledge representation and reasoning (KR) is the field of artificial intelligence (AI) dedicated to representing information about the world in a form that a computer system can utilize to solve complex tasks such as diagnosing a medical condition or having a dialog in a natural language
The document discusses Turing machines. It begins by introducing Alan Turing as the father of the Turing machine model. A Turing machine is a general model of a CPU that can manipulate data through a finite set of states and symbols. It consists of a tape divided into cells that can be read from and written to by a tape head. The tape head moves left and right across the cells. The document then provides examples of constructing Turing machines to accept specific languages, such as the language "aba" and checking for palindromes of even length strings. Transition tables are used to represent the state transitions of the Turing machines.
The document describes pushdown automata (PDA). A PDA has a tape, stack, finite control, and transition function. It accepts or rejects strings by reading symbols on the tape, pushing/popping symbols on the stack, and changing state according to the transition function. The transition function defines the possible moves of the PDA based on the current state, tape symbol, and stack symbol. If the PDA halts in a final state with an empty stack, the string is accepted. PDAs can recognize any context-free language. Examples are given of PDAs for specific languages.
This document provides an introduction and overview of CS344: Introduction to Artificial Intelligence course at IIT Bombay. The key points are:
- The course will be taught 3 times a week by Dr. Pushpak Bhattacharyya and TAs. Topics will include search, logic, knowledge representation, neural networks, computer vision, and planning.
- Foundational concepts in AI that will be covered include the Church-Turing hypothesis, Turing machines, the physical symbol system hypothesis, and limits of computability and automation.
- Fuzzy logic will be introduced as a way to model human reasoning with imprecise information using linguistic variables and fuzzy set theory.
The document discusses the "golden years" of AI in the 1960s, including notable projects like ELIZA, Shakey the robot, and the Blocks World simulations with SHRDLU. It also covers the inherent limitations of computability, such as the halting problem showing that some decision problems cannot be solved algorithmically. Finally, it introduces the idea of a Physical Symbol System and the hypothesis that such systems are capable of general intelligent action if they can designate and interpret physical symbols.
Automata theory studies abstract computing devices and the types of tasks they are capable of. Alan Turing pioneered this field in the 1930s by studying Turing machines. The theory examines questions like which tasks can and cannot be performed by different models of machines. It also considers the distinction between what is computable versus the complexity of computation. Common concepts include finite automata, formal languages, and the Chomsky hierarchy for classifying language types. Proofs in automata theory involve techniques like deduction, induction, contradiction, and establishing results by definition.
- NP-hard problems are at least as hard as problems in NP. A problem is NP-hard if any problem in NP can be reduced to it in polynomial time.
- Cook's theorem states that if the SAT problem can be solved in polynomial time, then every problem in NP can be solved in polynomial time.
- Vertex cover problem is proven to be NP-hard by showing that independent set problem reduces to it in polynomial time, meaning there is a polynomial time algorithm that converts any instance of independent set into an instance of vertex cover.
- Therefore, if there was a polynomial time algorithm for vertex cover, it could be used to solve independent set in polynomial time. Since independent set is NP-complete
This document provides an introduction to finite automata. It defines key concepts like alphabets, strings, languages, and finite state machines. It also describes the different types of automata, specifically deterministic finite automata (DFAs) and nondeterministic finite automata (NFAs). DFAs have a single transition between states for each input, while NFAs can have multiple transitions. NFAs are generally easier to construct than DFAs. The next class will focus on deterministic finite automata in more detail.
The document discusses first-order logic (FOL) and its advantages over propositional logic for representing knowledge. It introduces the basic elements of FOL syntax, such as constants, predicates, functions, variables, and connectives. It provides examples of FOL expressions and discusses how objects and relations between objects can be represented. It also covers quantification in FOL using universal and existential quantifiers.
The document discusses the greedy method algorithmic approach. It provides an overview of greedy algorithms including that they make locally optimal choices at each step to find a global optimal solution. The document also provides examples of problems that can be solved using greedy methods like job sequencing, the knapsack problem, finding minimum spanning trees, and single source shortest paths. It summarizes control flow and applications of greedy algorithms.
The document discusses algorithm analysis and asymptotic notation. It defines algorithm analysis as comparing algorithms based on running time and other factors as problem size increases. Asymptotic notation such as Big-O, Big-Omega, and Big-Theta are introduced to classify algorithms based on how their running times grow relative to input size. Common time complexities like constant, logarithmic, linear, quadratic, and exponential are also covered. The properties and uses of asymptotic notation for equations and inequalities are explained.
The branch-and-bound method is used to solve optimization problems by traversing a state space tree. It computes a bound at each node to determine if the node is promising. Better approaches traverse nodes breadth-first and choose the most promising node using a bounding heuristic. The traveling salesperson problem is solved using branch-and-bound by finding an initial tour, defining a bounding heuristic as the actual cost plus minimum remaining cost, and expanding promising nodes in best-first order until finding the minimal tour.
Dynamic programming is an algorithm design technique that solves problems by breaking them down into smaller overlapping subproblems and storing the results of already solved subproblems, rather than recomputing them. It is applicable to problems exhibiting optimal substructure and overlapping subproblems. The key steps are to define the optimal substructure, recursively define the optimal solution value, compute values bottom-up, and optionally reconstruct the optimal solution. Common examples that can be solved with dynamic programming include knapsack, shortest paths, matrix chain multiplication, and longest common subsequence.
This document discusses Bayesian learning and the Bayes theorem. Some key points:
- Bayesian learning uses probabilities to calculate the likelihood of hypotheses given observed data and prior probabilities. The naive Bayes classifier is an example.
- The Bayes theorem provides a way to calculate the posterior probability of a hypothesis given observed training data by considering the prior probability and likelihood of the data under the hypothesis.
- Bayesian methods can incorporate prior knowledge and probabilistic predictions, and classify new instances by combining predictions from multiple hypotheses weighted by their probabilities.
The document discusses the importance of algorithms and their role in problem solving. It defines what an algorithm is and explains that they are sets of instructions to solve problems efficiently. The document outlines different algorithm design techniques and how algorithms shape applications like search engines, recommendations, and maps. It also discusses qualities of good algorithms like correctness, termination, and performance and analyzing algorithms through pseudocode and empirical testing.
The document discusses regular expressions and how they can be used to represent languages accepted by finite automata. It provides examples of how to:
1. Construct regular expressions from languages and finite state automata. Regular expressions can be built by defining expressions for subparts of a language and combining them.
2. Convert finite state automata to equivalent regular expressions using state elimination techniques. Intermediate states are replaced with regular expressions on transitions until a single state automaton remains.
3. Convert regular expressions to equivalent finite state automata by building epsilon-nondeterministic finite automata (ε-NFAs) based on the structure of the regular expression.
The document provides an introduction to automata theory and finite state automata (FSA). It defines an automaton as an abstract computing device or mathematical model used in computer science and computational linguistics. The reading discusses pioneers in automata theory like Alan Turing and his development of Turing machines. It then gives an overview of finite state automata, explaining concepts like states, transitions, alphabets, and using a example of building an FSA for a "sheeptalk" language to demonstrate these components.
Here are the steps to construct an NFA-ε equivalent to the given regular expressions:
1. ε + a b (a+b)*
- States: q0, q1, q2
- Transitions: q0 -> q1 on ε, q0 -> q2 on a, q1 -> q1 on a/b, q1 -> q2 on b
- Start state: q0
- Final states: q2
2. (0+1)* (00+11)
- States: q0, q1, q2, q3
- Transitions: q0 -> q0 on 0/1, q0 -> q1 on 0/1
Fundamentals of the Analysis of Algorithm EfficiencySaranya Natarajan
This document discusses analyzing the efficiency of algorithms. It introduces the framework for analyzing algorithms in terms of time and space complexity. Time complexity indicates how fast an algorithm runs, while space complexity measures the memory required. The document outlines steps for analyzing algorithms, including measuring input size, determining the basic operations, calculating frequency counts of operations, and expressing efficiency in Big O notation order of growth. Worst-case, best-case, and average-case time complexities are also discussed.
A multi-head Turing machine has a single tape with multiple heads that can read and write to the tape independently. Each head can move left, right, or stay in the same position. This type of Turing machine is as powerful as a standard single-tape Turing machine.
The halting problem asks if it is possible to determine if a Turing machine will halt or run infinitely given its program and input. It is proven to be unsolvable - there is no general algorithm that can correctly determine if all Turing machine programs will halt for all inputs.
Knowledge representation and reasoning (KR) is the field of artificial intelligence (AI) dedicated to representing information about the world in a form that a computer system can utilize to solve complex tasks such as diagnosing a medical condition or having a dialog in a natural language
The document discusses Turing machines. It begins by introducing Alan Turing as the father of the Turing machine model. A Turing machine is a general model of a CPU that can manipulate data through a finite set of states and symbols. It consists of a tape divided into cells that can be read from and written to by a tape head. The tape head moves left and right across the cells. The document then provides examples of constructing Turing machines to accept specific languages, such as the language "aba" and checking for palindromes of even length strings. Transition tables are used to represent the state transitions of the Turing machines.
The document describes pushdown automata (PDA). A PDA has a tape, stack, finite control, and transition function. It accepts or rejects strings by reading symbols on the tape, pushing/popping symbols on the stack, and changing state according to the transition function. The transition function defines the possible moves of the PDA based on the current state, tape symbol, and stack symbol. If the PDA halts in a final state with an empty stack, the string is accepted. PDAs can recognize any context-free language. Examples are given of PDAs for specific languages.
This document provides an introduction and overview of CS344: Introduction to Artificial Intelligence course at IIT Bombay. The key points are:
- The course will be taught 3 times a week by Dr. Pushpak Bhattacharyya and TAs. Topics will include search, logic, knowledge representation, neural networks, computer vision, and planning.
- Foundational concepts in AI that will be covered include the Church-Turing hypothesis, Turing machines, the physical symbol system hypothesis, and limits of computability and automation.
- Fuzzy logic will be introduced as a way to model human reasoning with imprecise information using linguistic variables and fuzzy set theory.
The document discusses the "golden years" of AI in the 1960s, including notable projects like ELIZA, Shakey the robot, and the Blocks World simulations with SHRDLU. It also covers the inherent limitations of computability, such as the halting problem showing that some decision problems cannot be solved algorithmically. Finally, it introduces the idea of a Physical Symbol System and the hypothesis that such systems are capable of general intelligent action if they can designate and interpret physical symbols.
This document defines and provides examples of different types of functions, including:
- Constant functions which always output the same number.
- Identity functions where the output is equal to the input.
- Polynomial functions defined by expressions involving powers of the variable.
- Absolute value functions which output the absolute value of the input.
- Square root functions which output the square root of the input.
- Rational functions where the output is a rational expression involving the input.
It also discusses the domain and range of these different function types.
The document discusses different types of knowledge that may need to be represented in AI systems, including objects, events, performance, and meta-knowledge. It also discusses representing knowledge at two levels: the knowledge level containing facts, and the symbol level containing representations of objects defined in terms of symbols. Common ways of representing knowledge mentioned include using English, logic, relations, semantic networks, frames, and rules. The document also discusses using knowledge for applications like learning, reasoning, and different approaches to machine learning such as skill refinement, knowledge acquisition, taking advice, problem solving, induction, discovery, and analogy.
The document discusses representing knowledge using predicate logic. It provides examples of representing simple facts and relationships using predicates, variables, and quantification. It also discusses issues like representing classes and instances, exceptions to general rules, and using computable predicates to efficiently represent relationships that can be computed rather than explicitly stated.
Knowledge representation and Predicate logicAmey Kerkar
1. The document discusses knowledge representation and predicate logic.
2. It explains that knowledge representation involves representing facts through internal representations that can then be manipulated to derive new knowledge. Predicate logic allows representing objects and relationships between them using predicates, quantifiers, and logical connectives.
3. Several examples are provided to demonstrate representing simple facts about individuals as predicates and using quantifiers like "forall" and "there exists" to represent generalized statements.
Mobile-First SEO - The Marketers Edition #3XEDigitalAleyda Solís
How to target your SEO process to a reality of more people searching on mobile devices than desktop and an upcoming mobile first Google index? Check it out.
The document discusses time and space complexity analysis of algorithms. Time complexity measures the number of steps to solve a problem based on input size, with common orders being O(log n), O(n), O(n log n), O(n^2). Space complexity measures memory usage, which can be reused unlike time. Big O notation describes asymptotic growth rates to compare algorithm efficiencies, with constant O(1) being best and exponential O(c^n) being worst.
I am Justin M. I am an Algorithm Exam Expert at programmingexamhelp.com. I hold a Bachelor of software engineering from, the University of Massachusetts Amherst, United States. I have been helping students with their exams for the past 9 years. You can hire me to take your exam in Algorithm.
Visit programmingexamhelp.com or email [email protected]. You can also call on +1 678 648 4277 for any assistance with the Algorithm Exam.
Problem set3 | Theory of Computation | Akash Anand | MTH 401A | IIT KanpurVivekananda Samiti
This document outlines 9 problems related to theory of computation. It asks the reader to: 1) Design Turing machines for various languages; 2) Determine complexity classes for other languages; 3) Prove undecidability of determining equivalence of context-free grammars; 4) Determine recursively enumerability of languages; 5) Prove decidability of the Post Correspondence Problem over a 1-letter alphabet; 6) Show a generalized game of Go-Moku is in PSPACE; 7) Show satisfiability of formulas in conjunctive normal form (SAT) is NP-Complete; 8) Prove properties of 2-SAT and 3-SAT problems; 9) Show a solitaire game problem is NP
The presentation covered time and space complexity, average and worst case analysis, and asymptotic notations. It defined key concepts like time complexity measures the number of operations, space complexity measures memory usage, and worst case analysis provides an upper bound on running time. Common asymptotic notations like Big-O, Omega, and Theta were explained, and how they are used to compare how functions grow relative to each other as input size increases.
The document discusses fundamentals of analyzing algorithm efficiency, including:
- Measuring an algorithm's time efficiency based on input size and number of basic operations.
- Using asymptotic notations like O, Ω, Θ to classify algorithms by order of growth.
- Analyzing worst-case, best-case, and average-case efficiencies.
- Setting up recurrence relations to analyze recursive algorithms like merge sort.
On Optimization of Network-coded Scalable Multimedia Service MulticastingAndrea Tassi
In the near future, the delivery of multimedia multicast services over next-generation networks is likely to become one of the main pillars of future cellular networks. In this extended abstract, we address the issue of efficiently multicasting layered video services by defining a novel optimization paradigm that is based on an Unequal Error Protection implementation of Random Linear Network Coding, and aims to ensure target service coverages by using a limited amount of radio resources.
When models are defined implicitly as systems of differential equations with no closed form solution, the choice of discretization grid for their approximation represents a trade-off between accuracy of the estimated solution and computational resources. We apply principles of statistical design to a class of sequential probability based models of discretization uncertainty for selecting the optimal discretization grid adaptively. Our proposal is compared to other approaches in the literature.
This document contains lecture notes on asymptotic notation for analyzing algorithms. It defines big O, Ω, and Θ notation for describing the worst-case, best-case, and average-case time complexity of algorithms. It explains that these notations describe the upper and lower bounds of the growth rate of an algorithm's run time as the problem size increases. The document also provides examples of using asymptotic notation to classify common functions and discusses properties like how complexity is affected by addition, subtraction, multiplication, and more.
For any programming homework help queries, call +1 678 648 4277 or email [email protected]. This document provides 5 problems related to algorithm analysis and data structures. Problem 1 involves solving recurrences using recursion trees and the Master Theorem. Problem 2 involves choosing appropriate sorting algorithms for different scenarios. Problem 3 describes an algorithm to locate a friend on an island using binary search. Problem 4 describes an efficient chat database. Problem 5 involves merging booking schedules.
The document discusses algorithm analysis and computational complexity, specifically focusing on time complexity and big O notation. It defines key concepts like best case, average case, and worst case scenarios. Common time complexities like constant, logarithmic, linear, quadratic, and exponential functions are examined. Examples are provided to demonstrate how to calculate the time complexity of different algorithms using big O notation. The document emphasizes that worst case analysis is most useful for program design and comparing algorithms.
ON THE DUALITY FEATURE OF P-CLASS PROBLEMS AND NP COMPLETE PROBLEMScscpconf
In term of computational complexity, P-class (abbreviated as P) problems are polynomial-time
solvable by deterministic Turing machine while NP complete (abbreviated as NPC) problems
are polynomial-time solvable by nondeterministic Turing machine. P and NPC problems are
regularly treated in different classes. Determining whether or not it is possible to solve NPC
problems quickly, is one of the principal unsolved problems in computer science today. In this
paper, a new perspective is provided: both P problems and NPC problems have the duality
feature in terms of computational complexity of asymptotic efficiency of algorithms.
This document summarizes key concepts in cryptography and number theory relevant to public key cryptography algorithms like RSA. It discusses number theoretic concepts like prime numbers, modular arithmetic, discrete logarithms, and one-way functions. It then provides an overview of the RSA algorithm, explaining how it uses the difficulty of factoring large numbers to enable secure public key encryption and digital signatures.
Traveling Salesman Problem in Distributed Environmentcsandit
In this paper, we focus on developing parallel algorithms for solving the traveling salesman problem (TSP) based on Nicos Christofides algorithm released in 1976. The parallel algorithm
is built in the distributed environment with multi-processors (Master-Slave). The algorithm is installed on the computer cluster system of National University of Education in Hanoi,
Vietnam (ccs1.hnue.edu.vn) and uses the library PJ (Parallel Java). The results are evaluated and compared with other works.
TRAVELING SALESMAN PROBLEM IN DISTRIBUTED ENVIRONMENTcscpconf
The document describes developing a parallel algorithm for solving the traveling salesman problem (TSP) based on Christofides' algorithm. It discusses implementing Christofides' algorithm in a distributed environment using multiple processors. The parallel algorithm divides the graph vertices and distance matrix across slave processors, which calculate the minimum spanning tree in parallel. The master processor then finds odd-degree vertices, performs matching, and finds the Hamiltonian cycle to solve TSP. The algorithm is tested on a computer cluster using graphs of 20,000 and 30,000 nodes, showing improved runtime over the sequential algorithm.
The document discusses the analysis of algorithms, including time and space complexity analysis. It covers key aspects of analyzing algorithms such as determining the basic operation, input size, and analyzing best-case, worst-case, and average-case time complexities. Specific examples are provided, such as analyzing the space needed to store real numbers and analyzing the time complexity of sequential search. Order of growth and asymptotic analysis techniques like Big-O, Big-Omega, and Big-Theta notation are also explained.
NP completeness. Classes P and NP are two frequently studied classes of problems in computer science. Class P is the set of all problems that can be solved by a deterministic Turing machine in polynomial time.
This document discusses dynamic programming and greedy algorithms. It begins by defining dynamic programming as a technique for solving problems with overlapping subproblems. Examples provided include computing the Fibonacci numbers and binomial coefficients. Greedy algorithms are introduced as constructing solutions piece by piece through locally optimal choices. Applications discussed are the change-making problem, minimum spanning trees using Prim's and Kruskal's algorithms, and single-source shortest paths. Floyd's algorithm for all pairs shortest paths and optimal binary search trees are also summarized.
This document discusses dynamic programming and greedy algorithms. It begins by defining dynamic programming as a technique for solving problems with overlapping subproblems. It provides examples of dynamic programming approaches to computing Fibonacci numbers, binomial coefficients, the knapsack problem, and other problems. It also discusses greedy algorithms and provides examples of their application to problems like the change-making problem, minimum spanning trees, and single-source shortest paths.
* Brief History
* Differences Between Web 1.0 and Web 2.0
* The Web as Platform
* Harnessing Collective Intelligence
* Blogging and the Wisdom of Crowds
* Data is the Next Intel Inside
* End of the Software Release Cycle
* Lightweight Programming Models
* Software Above the Level of a Single Device
* Rich User Experiences
* Core Competencies
* Differences between Websites and Web Applications
* Research Techniques for Knowing Your Users
* Task Analysis
* UI/UX Design Principles for Web Applications
This document discusses tools and techniques for structured problem solving and program development, including top-down design, pseudocode, and logic diagrams. It provides an example of using top-down refinement to develop an algorithm for calculating a class average based on quiz grades. Various flow charting symbols are also presented and explained. Finally, an assignment is given to develop a flow chart or algorithm to sort apples from a large box into baskets by color.
Abstract data types (ADTs) specify operations on data without defining implementation. Common ADTs include sets, lists, stacks, queues, maps, trees and graphs. Sets contain unique elements; lists are ordered; stacks use last-in first-out access; queues use first-in first-out access; maps store key-value pairs; trees link parent nodes to children; and graphs link vertices with edges. Core operations for collections include adding, removing and accessing elements.
Computational thinking involves representing real-world problems in a computational format. It is helpful for understanding why computation has become so useful. Computational representations relate a target domain to a representation domain where work is easier. They have advantages like automation, easy storage and transmission, and flexibility as computational representations of behavior can capture many kinds of behavior. Computational thinking is seeing how to create a computational representation of something of interest by identifying important things and behaviors. Common computational thinking patterns are useful in many situations.
The document discusses different number systems including decimal, binary, octal, and hexadecimal. It provides details on how to convert between these number systems including techniques for converting from one base to another through intermediary bases. Examples are provided for converting between decimal, binary, octal, and hexadecimal. Common powers that are used with different number systems are also defined.
* Introduction
* Define "video game"
* Video Game Industry Overview
* Aspects of Game Development
* Game Development Community
* Careers Available in Game Development
* Testimonies
* Options for Developing Required Skillset
* Other Avenues for Career Development
The document discusses the Model-View-Controller (MVC) pattern, which separates an application into three main components: the model, the view, and the controller. The model manages the application's data logic and rules. The view displays the data to the user. The controller handles input and converts it to commands for the model and view. An example PHP MVC application is provided to illustrate how the components work together. Benefits of MVC include flexibility, testability, and separation of concerns between the three components.
This document discusses MySQL transactions. It defines transactions as sequential groups of data manipulation language (DML) statements that are performed atomically as a single unit. The document outlines the ACID properties that transactions provide - atomicity, consistency, isolation, and durability. It provides a sample banking transaction scenario and explains the SQL syntax used for transactions, including START TRANSACTION, COMMIT, and ROLLBACK statements.
This document discusses MySQL cursors, which allow iteration through result sets from SELECT statements. Cursors are read-only and non-scrollable, pointing directly to actual data rows. Cursor usage involves declaring a cursor for a SELECT, opening the cursor, fetching rows into variables, and closing the cursor. An example demonstrates declaring a cursor for student emails, fetching emails into a variable, and building an email list string.
MySQL views allow users to create virtual tables based on the result set of SELECT statements. Views can reference tables but have restrictions like not allowing subqueries or system variables. The CREATE VIEW statement is used to define a view with an AS clause specifying the SELECT statement. Views offer benefits like easier maintenance and security but can impact performance.
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfTechSoup
In this webinar we will dive into the essentials of generative AI, address key AI concerns, and demonstrate how nonprofits can benefit from using Microsoft’s AI assistant, Copilot, to achieve their goals.
This event series to help nonprofits obtain Copilot skills is made possible by generous support from Microsoft.
What You’ll Learn in Part 2:
Explore real-world nonprofit use cases and success stories.
Participate in live demonstrations and a hands-on activity to see how you can use Microsoft 365 Copilot in your own work!
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Andre Hora
Exceptions allow developers to handle error cases expected to occur infrequently. Ideally, good test suites should test both normal and exceptional behaviors to catch more bugs and avoid regressions. While current research analyzes exceptions that propagate to tests, it does not explore other exceptions that do not reach the tests. In this paper, we provide an empirical study to explore how frequently exceptional behaviors are tested in real-world systems. We consider both exceptions that propagate to tests and the ones that do not reach the tests. For this purpose, we run an instrumented version of test suites, monitor their execution, and collect information about the exceptions raised at runtime. We analyze the test suites of 25 Python systems, covering 5,372 executed methods, 17.9M calls, and 1.4M raised exceptions. We find that 21.4% of the executed methods do raise exceptions at runtime. In methods that raise exceptions, on the median, 1 in 10 calls exercise exceptional behaviors. Close to 80% of the methods that raise exceptions do so infrequently, but about 20% raise exceptions more frequently. Finally, we provide implications for researchers and practitioners. We suggest developing novel tools to support exercising exceptional behaviors and refactoring expensive try/except blocks. We also call attention to the fact that exception-raising behaviors are not necessarily “abnormal” or rare.
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMaxim Salnikov
Imagine if apps could think, plan, and team up like humans. Welcome to the world of AI agents and agentic user interfaces (UI)! In this session, we'll explore how AI agents make decisions, collaborate with each other, and create more natural and powerful experiences for users.
Exploring Wayland: A Modern Display Server for the FutureICS
Wayland is revolutionizing the way we interact with graphical interfaces, offering a modern alternative to the X Window System. In this webinar, we’ll delve into the architecture and benefits of Wayland, including its streamlined design, enhanced performance, and improved security features.
Societal challenges of AI: biases, multilinguism and sustainabilityJordi Cabot
Towards a fairer, inclusive and sustainable AI that works for everybody.
Reviewing the state of the art on these challenges and what we're doing at LIST to test current LLMs and help you select the one that works best for you
Adobe After Effects Crack FREE FRESH version 2025kashifyounis067
🌍📱👉COPY LINK & PASTE ON GOOGLE http://drfiles.net/ 👈🌍
Adobe After Effects is a software application used for creating motion graphics, special effects, and video compositing. It's widely used in TV and film post-production, as well as for creating visuals for online content, presentations, and more. While it can be used to create basic animations and designs, its primary strength lies in adding visual effects and motion to videos and graphics after they have been edited.
Here's a more detailed breakdown:
Motion Graphics:
.
After Effects is powerful for creating animated titles, transitions, and other visual elements to enhance the look of videos and presentations.
Visual Effects:
.
It's used extensively in film and television for creating special effects like green screen compositing, object manipulation, and other visual enhancements.
Video Compositing:
.
After Effects allows users to combine multiple video clips, images, and graphics to create a final, cohesive visual.
Animation:
.
It uses keyframes to create smooth, animated sequences, allowing for precise control over the movement and appearance of objects.
Integration with Adobe Creative Cloud:
.
After Effects is part of the Adobe Creative Cloud, a suite of software that includes other popular applications like Photoshop and Premiere Pro.
Post-Production Tool:
.
After Effects is primarily used in the post-production phase, meaning it's used to enhance the visuals after the initial editing of footage has been completed.
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDinusha Kumarasiri
AI is transforming APIs, enabling smarter automation, enhanced decision-making, and seamless integrations. This presentation explores key design principles for AI-infused APIs on Azure, covering performance optimization, security best practices, scalability strategies, and responsible AI governance. Learn how to leverage Azure API Management, machine learning models, and cloud-native architectures to build robust, efficient, and intelligent API solutions
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentShubham Joshi
A secure test infrastructure ensures that the testing process doesn’t become a gateway for vulnerabilities. By protecting test environments, data, and access points, organizations can confidently develop and deploy software without compromising user privacy or system integrity.
Get & Download Wondershare Filmora Crack Latest [2025]saniaaftab72555
Copy & Past Link 👉👉
https://dr-up-community.info/
Wondershare Filmora is a video editing software and app designed for both beginners and experienced users. It's known for its user-friendly interface, drag-and-drop functionality, and a wide range of tools and features for creating and editing videos. Filmora is available on Windows, macOS, iOS (iPhone/iPad), and Android platforms.
PDF Reader Pro Crack Latest Version FREE Download 2025mu394968
🌍📱👉COPY LINK & PASTE ON GOOGLE https://dr-kain-geera.info/👈🌍
PDF Reader Pro is a software application, often referred to as an AI-powered PDF editor and converter, designed for viewing, editing, annotating, and managing PDF files. It supports various PDF functionalities like merging, splitting, converting, and protecting PDFs. Additionally, it can handle tasks such as creating fillable forms, adding digital signatures, and performing optical character recognition (OCR).
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...Andre Hora
Unittest and pytest are the most popular testing frameworks in Python. Overall, pytest provides some advantages, including simpler assertion, reuse of fixtures, and interoperability. Due to such benefits, multiple projects in the Python ecosystem have migrated from unittest to pytest. To facilitate the migration, pytest can also run unittest tests, thus, the migration can happen gradually over time. However, the migration can be timeconsuming and take a long time to conclude. In this context, projects would benefit from automated solutions to support the migration process. In this paper, we propose TestMigrationsInPy, a dataset of test migrations from unittest to pytest. TestMigrationsInPy contains 923 real-world migrations performed by developers. Future research proposing novel solutions to migrate frameworks in Python can rely on TestMigrationsInPy as a ground truth. Moreover, as TestMigrationsInPy includes information about the migration type (e.g., changes in assertions or fixtures), our dataset enables novel solutions to be verified effectively, for instance, from simpler assertion migrations to more complex fixture migrations. TestMigrationsInPy is publicly available at: https://github.com/altinoalvesjunior/TestMigrationsInPy.
Join Ajay Sarpal and Miray Vu to learn about key Marketo Engage enhancements. Discover improved in-app Salesforce CRM connector statistics for easy monitoring of sync health and throughput. Explore new Salesforce CRM Synch Dashboards providing up-to-date insights into weekly activity usage, thresholds, and limits with drill-down capabilities. Learn about proactive notifications for both Salesforce CRM sync and product usage overages. Get an update on improved Salesforce CRM synch scale and reliability coming in Q2 2025.
Key Takeaways:
Improved Salesforce CRM User Experience: Learn how self-service visibility enhances satisfaction.
Utilize Salesforce CRM Synch Dashboards: Explore real-time weekly activity data.
Monitor Performance Against Limits: See threshold limits for each product level.
Get Usage Over-Limit Alerts: Receive notifications for exceeding thresholds.
Learn About Improved Salesforce CRM Scale: Understand upcoming cloud-based incremental sync.
F-Secure Freedome VPN 2025 Crack Plus Activation New Versionsaimabibi60507
Copy & Past Link 👉👉
https://dr-up-community.info/
F-Secure Freedome VPN is a virtual private network service developed by F-Secure, a Finnish cybersecurity company. It offers features such as Wi-Fi protection, IP address masking, browsing protection, and a kill switch to enhance online privacy and security .
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Eric D. Schabell
It's time you stopped letting your telemetry data pressure your budgets and get in the way of solving issues with agility! No more I say! Take back control of your telemetry data as we guide you through the open source project Fluent Bit. Learn how to manage your telemetry data from source to destination using the pipeline phases covering collection, parsing, aggregation, transformation, and forwarding from any source to any destination. Buckle up for a fun ride as you learn by exploring how telemetry pipelines work, how to set up your first pipeline, and exploring several common use cases that Fluent Bit helps solve. All this backed by a self-paced, hands-on workshop that attendees can pursue at home after this session (https://o11y-workshops.gitlab.io/workshop-fluentbit).
Interactive Odoo Dashboard for various business needs can provide users with dynamic, visually appealing dashboards tailored to their specific requirements. such a module that could support multiple dashboards for different aspects of a business
✅Visit And Buy Now : https://bit.ly/3VojWza
✅This Interactive Odoo dashboard module allow user to create their own odoo interactive dashboards for various purpose.
App download now :
Odoo 18 : https://bit.ly/3VojWza
Odoo 17 : https://bit.ly/4h9Z47G
Odoo 16 : https://bit.ly/3FJTEA4
Odoo 15 : https://bit.ly/3W7tsEB
Odoo 14 : https://bit.ly/3BqZDHg
Odoo 13 : https://bit.ly/3uNMF2t
Try Our website appointment booking odoo app : https://bit.ly/3SvNvgU
👉Want a Demo ?📧 [email protected]
➡️Contact us for Odoo ERP Set up : 091066 49361
👉Explore more apps: https://bit.ly/3oFIOCF
👉Want to know more : 🌐 https://www.axistechnolabs.com/
#odoo #odoo18 #odoo17 #odoo16 #odoo15 #odooapps #dashboards #dashboardsoftware #odooerp #odooimplementation #odoodashboardapp #bestodoodashboard #dashboardapp #odoodashboard #dashboardmodule #interactivedashboard #bestdashboard #dashboard #odootag #odooservices #odoonewfeatures #newappfeatures #odoodashboardapp #dynamicdashboard #odooapp #odooappstore #TopOdooApps #odooapp #odooexperience #odoodevelopment #businessdashboard #allinonedashboard #odooproducts
2. Efficiency
●A computer program should be totally correct, but
it should also
oexecute as quickly as possible (time-efficiency)
ouse memory wisely (storage-efficiency)
●How do we compare programs (or algorithms in
general) with respect to execution time?
ovarious computers run at different speeds due to different
processors
ocompilers optimize code before execution
othe same algorithm can be written differently depending on the
programming language used
(C) 2010 Thomas J Cortina, Carnegie Mellon University
3. Order of Complexity
●For very large n, we express the number of operations
as the order of complexity.
●Order of complexity for worst-case behavior is often
expressed using Big-O notation:
Number of operations Order of Complexity
n O(n)
n/2 + 6 O(n)
2n + 9 O(n)
Usually doesn't
matter what the
constants are...
we are only
concerned about
the highest power
of n.(C) 2010 Thomas J Cortina, Carnegie Mellon University
4. O(n) ("Linear")
n
(amount of data)
Number of
Operations
n
n/2 + 6
2n + 9
(C) 2010 Thomas J Cortina, Carnegie Mellon University
5. Order of Complexity
Number of operations Order of Complexity
n2 O(n2)
2n2 + 7 O(n2)
n2/2 + 5n + 2 O(n2)
Usually doesn't
matter what the
constants are...
we are only
concerned about
the highest power
of n.
(C) 2010 Thomas J Cortina, Carnegie Mellon University
6. O(n2) ("Quadratic")
n
(amount of data)
Number of
Operations
n2/2 + 5n + 22n2 + 7
n2
(C) 2010 Thomas J Cortina, Carnegie Mellon University
7. Order of Complexity
Number of operations Order of Complexity
log2n O(log n)
log10n O(log n)
2(log2n) + 5 O(log n)
The logarithm base
is not written in
big O notation
since all that matters
is that the function
is logarithmic.
(C) 2010 Thomas J Cortina, Carnegie Mellon University
8. O(log n) ("Logarithmic")
n
(amount of data)
Number of
Operations
log2 n
log10 n
2(log2 n) + 5
(C) 2010 Thomas J Cortina, Carnegie Mellon University
9. Comparing Big O Functions
n
(amount of data)
Number of
Operations
O(2n)
O(1)
O(n log n)
O(log n)
O(n2)
O(n)
(C) 2010 Thomas J Cortina, Carnegie Mellon University
10. Searching & Sorting
WORST CASE Order Of Complexity on N data elements
●Linear Search O(N)
●Binary Search O(log N)
●Selection Sort O(N2)
●Bubble Sort O(N2)
●Merge Sort O(N log N)
●Quick Sort O(N2)
●Sort + Binary Search O(N log N) + O(log N)
= O(N log N)
(C) 2010 Thomas J Cortina, Carnegie Mellon University
11. Comparing Algorithms
●Assume an algorithm processes n data values. If each
operation takes 1 s to execute, how many s will it take
to run the algorithm on 100 data values if the algorithm
has the following number of computations?
Number of Computations Execution Time
n 100 s
n • log2 n 665 s
n2 10,000 s
n3 1,000,000 s = 1 sec
2n > 1030 s
n! > 10160 s
(C) 2010 Thomas J Cortina, Carnegie Mellon University
12. Decision Problems
●A specific set of computations are classified as
decision problems.
●An algorithm describes a decision problem if its
output is simply YES or NO, depending on
whether a certain property holds for its input.
●Example:
Given a set of n shapes,
can these shapes be
arranged into a rectangle?
(C) 2010 Thomas J Cortina, Carnegie Mellon University
13. Monkey Puzzle Problem
●Given:
oA set of n square cards whose sides are imprinted with
the upper and lower halves of colored monkeys.
on is a square number, such that n = m2.
oCards cannot be rotated.
●Problem:
oDetermine if an arrangement of the n cards in an
m X m grid exists such that each adjacent pair of cards
display the upper and lower half of a monkey of the
same color.
Source: www.dwheeler.com (2002)(C) 2010 Thomas J Cortina, Carnegie Mellon University
15. Analysis
Simple algorithm:
●Pick one card for each cell of m X m grid.
●Verify if each pair of touching edges make a full
monkey of the same color.
●If not, try another arrangement until a solution is
found or all possible arrangements are checked.
●Answer "YES" if a solution is found. Otherwise,
answer "NO" if all arrangements are analyzed and
no solution is found.
(C) 2010 Thomas J Cortina, Carnegie Mellon University
16. Analysis
If there are n = 9 cards (m = 3):
To fill the first cell, we have 9 card choices.
To fill the second cell, we have 8 card
choices left.
To fill the third cell, we have 7 card choices
remaining.
etc.The total number of unique arrangements for n = 9 cards is:
9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1 = 362,880
(C) 2010 Thomas J Cortina, Carnegie Mellon University
17. Analysis
For n cards, the number of arrangements to examine is
n! (n factorial)
If we can analyze one arrangement in a microsecond:
n Time to analyze all arrangements
9 362,880 s = 0.36288 s
16 20,922,789,888,000 s
≈ 242 days
25 15,511,210,043,330,985,984,000,000 s
≈ 491,520,585,955 years(C) 2010 Thomas J Cortina, Carnegie Mellon University
18. Map Coloring
●Given a map of n territories, can the map be
colored using k colors such that no two
adjacent territories are colored with the same
color?
●k=4: Answer is always yes.
●k=2: Only if the map contains no point that is
the junction of an odd number of territories.
(C) 2010 Thomas J Cortina, Carnegie Mellon University
20. Map Coloring
●Given a map of 48 territories, can the map be colored
using 3 colors such that no two adjacent territories are
colored with the same color?
oPick a color for California (3 choices)
oPick a color for Nevada (3 choices)
o...
●There are 348 = 79,766,443,076,872,509,863,361
possible colorings.
●No one has come up with a better algorithmic solution
that works in general for any map, so far.(C) 2010 Thomas J Cortina, Carnegie Mellon University
21. Classifications
●Algorithms that are O(nk) for some
fixed k are polynomial-time algorithms.
oO(1), O(log n), O(n), O(n log n), O(n2)
oreasonable, tractable
●All other algorithms are super-polynomial-
time algorithms.
oO(2n), O(n!), O(nn)
ounreasonable, intractable
(C) 2010 Thomas J Cortina, Carnegie Mellon University
22. Traveling Salesperson
●Given: a weighted graph of nodes
representing cities and edges representing
flight paths (weights represent cost)
●Is there a route that takes the salesperson
through every city and back to the starting
city with cost no more than k?
oThe salesperson can visit a city only once (except
for the start and end of the trip).
(C) 2010 Thomas J Cortina, Carnegie Mellon University
24. Traveling Salesperson
●If there are n cities, what is the maximum number of
routes that we might need to compute?
●Worst-case: There is a flight available between
every pair of cities.
●Compute cost of every possible route.
oPick a starting city
oPick the next city (n-1 choices remaining)
oPick the next city (n-2 choices remaining)
o...
●Maximum number of routes: (n-1)! = O(n!)
how to
build
a
route
(C) 2010 Thomas J Cortina, Carnegie Mellon University
25. P and NP
●The class P consists of all those decision problems
that can be solved on a deterministic sequential
machine (e.g. a computer) in an amount of time that
is polynomial with respect to the size of the input
●The class NP consists of all those decision problems
whose positive solutions can be verified in
polynomial time given the right information.
from Wikipedia
(C) 2010 Thomas J Cortina, Carnegie Mellon University
26. NP Complete
●The class NPC consists of all those problems in NP
that are least likely to be in P.
oEach of these problems is called NP Complete.
oMonkey puzzle, Traveling salesperson, Hamiltonian path,
map coloring, satisfiability are all in NPC.
●Every problem in NPC can be transformed to another
problem in NPC.
oIf there were some way to solve one of these problems in
polynomial time, we should be able to solve all of these
problems in polynomial time.
(C) 2010 Thomas J Cortina, Carnegie Mellon University
27. Complexity Classes
NP Problems
P Problems
NP Complete
Problems
But does P = NP?
If P ≠ NP, then all decision problems can be broken
down into this classification scheme.
If P = NP, then all three classes are one and the same.
The Clay Mathematics Institute is offering a $1M prize
for the first person to prove P = NP or P ≠ NP.
(http://www.claymath.org/millennium/P_vs_NP/)
We know that P < NP, since
any problem that can be solved
in polynomial time can certainly
have a solution verified in
polynomial time.
(C) 2010 Thomas J Cortina, Carnegie Mellon University
29. It gets worse...
●Tractable Problems
oProblems that have reasonable, polynomial-time
solutions
●Intractable Problems
oProblems that have no reasonable, polynomial-time
solutions
●Noncomputable Problems
oProblems that have no algorithms at all to solve
them
(C) 2010 Thomas J Cortina, Carnegie Mellon University
30. Noncomputability and
Undecidability
●An algorithmic problem that has no algorithm is
called noncomputable.
●If the noncomputable algorithm requires a yes/no
answer, the problem is called undecidable.
●Example:
oGiven any set of any number of different tile designs
(examples shown above), with an infinite number of
each type of tile, can we tile any area with these tiles so
that like colored edges touch?
oThis problem is undecidable!
(C) 2010 Thomas J Cortina, Carnegie Mellon University
31. Tiling Problem
YES
Note the periodicity in the tiling.
(C) 2010 Thomas J Cortina, Carnegie Mellon University
32. Tiling Problem
NO
For this 3 X 3 room, if we try all 39
tiling configurations, no tiling works.
(C) 2010 Thomas J Cortina, Carnegie Mellon University
33. Tiling Problem
●Possible algorithm:
oIf we find a repeating pattern, report YES.
oIf we find a floor we cannot tile, report NO.
●BUT: there are some tilings which have no
repeating pattern!
(C) 2010 Thomas J Cortina, Carnegie Mellon University
34. Tiling Problem
●The only way to know if this set of tiles
can tile every finite-sized floor is to evaluate every
possible floor.
●BUT: there are an infinite number of finite-sized
floors!
oSo we could never answer YES in this case.
●This problem is undecidable.
(C) 2010 Thomas J Cortina, Carnegie Mellon University
35. Another Undecidable Problem:
The Barber Paradox
Suppose there is a town with one
male barber; and that every man in
the town keeps himself clean-shaven:
some shave themselves and some
are shaved by the barber. Only the
barber can shave another man. The
barber shaves all and only those men
who do not shave themselves.
Does the barber shave himself?(C) 2010 Thomas J Cortina, Carnegie Mellon University
36. Program Termination
●Can we determine if a program will terminate given a
valid input?
●Example:
1. Input x
2. While x is not equal to 1, do the following:
(a) Subtract 2 from x.
●Does this algorithm terminate when x = 15105?
●Does this algorithm terminate when x = 2008?
(C) 2010 Thomas J Cortina, Carnegie Mellon University
37. Program Termination
●Another Example:
1. Input x
2. While x is not equal to 1, do the following:
(a) If x is even, divide x by 2.
(b) Otherwise, Set x to 3x + 1.
●Does this algorithm terminate for x = 15?
●Does this algorithm terminate for x = 105?
●Does this algorithm terminate for any positive x?
(C) 2010 Thomas J Cortina, Carnegie Mellon University
38. The Halting Problem
●Can we write a general program Q that takes
as its input any program P and an input I and determines if
program P will terminate (halt) when run with input I?
oIt will answer YES if P terminates successfully on input I.
oIt will answer NO if P never terminates on input I.
●This computational problem is undecidable!
oNo such general program Q can exist!
oIt doesn’t matter how powerful the computer is.
oIt doesn’t matter how much time we devote to the computation.
oThe proof of this involves contradiction.
(C) 2010 Thomas J Cortina, Carnegie Mellon University