Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
8 views

Automata Group Assignment

good

Uploaded by

yaikobdiriba1
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Automata Group Assignment

good

Uploaded by

yaikobdiriba1
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

GAMBELLA UNIVERSITY

FACILITY OF NATURAL AND COMPUTATIONAL SCIENCE

DEPARTMENT OF COMPUTER SCIENCE

COURSE TITLE: AUTOMAT A AND COMPLEXITY


rd
GROUP ASSIGNMENT FOR 3 YEAR , 1st Sem.

S/No GROUP NAME OF STUDENTS ID No


1
2
3
4
5

SUBMITTED TO : Mr. Getachew Abera


SUBMISSION DATE :
Computational complexity
Computational complexity theory studies the complexity of algorithms and problems. It aims to identify
the computational resources required to solve a problem, such as time, space, or communication, and
to determine the limitations and possibilities of algorithmic efficiency.

Algorithm analysis is an important part of a broader computational complexity theory, which provides
theoretical estimates for the resources needed by any algorithm which solves a given computational
problem.

• This resource can be expressed in terms of execution time (time efficiency, the most common factor) or
memory (space efficiency).

• Time Complexity: Determine the approximate number of operations required to solve a problem of size
n.

• Space Complexity: Determine the approximate memory required to solve a problem of size n.

• These estimates provide an insight into reasonable directions of search for efficient algorithms.

• The algorithm analysis can be expressed using Big O notation.

There are several major problems in computational complexity theory that remain open and actively
researched. Here are a few examples:

1. P versus NP problem: As I mentioned earlier, this is one of the most famous open problems in computer
science. It asks whether every problem that can be verified in polynomial time can also be solved in
polynomial time.
2. Complexity of specific problems: There are many important computational problems for which the
complexity is not yet well understood. Examples include the traveling salesman problem, graph
isomorphism, and factoring large integers.
3. Circuit lower bounds: Despite many efforts, there is still no known general technique for proving lower
bounds on the size of Boolean circuits that compute specific functions. This is a major open problem in
computational complexity theory.
4. De-randomization: Randomized algorithms are often more efficient than deterministic algorithms, but it
is not known whether every randomized algorithm can be converted into an equally efficient deterministic
algorithm.
5. Quantum complexity theory: Quantum computers have the potential to solve certain problems much
faster than classical computers, but the study of quantum complexity theory is still in its early stages.

Big-O notation
is the most commonly used notation for specifying asymptotic complexity, that is, for estimating the rate
of growth of complexity functions.

• The function f(n) is O(g(n)) if there exist positive numbers c and N such that f(n) ≤ c.g(n) for all n ≥ N.

• Example: f(n) = n2 + 5n, f(n)=O(n2 ) Big O Notation Classes Constant Time Complexity O(1):
Simplest of all complexities Or not complex at all.
• If an operation always completes in the same amount of CPU time regardless of the input size, it is
called a constant time operation.

• If it always uses the same amount of memory regardless of the input size, it is called a constant space
operation.

• Example: if an algorithm increment each number of length n , this algorithm runs in O(n) time and
performs O(1) work for each elements. Logarithmic time : log n

• An algorithm is said to take logarithmic time when T(n) = O(log n).

• Where the time complexity of a function only grows logarithmically in relation to the input. An
example of logarithmic effort is the binary search for a specific element in a sorted array of size n. Linear
time O (n):

• An algorithm is said to take linear time, the running time increases at most linearly with the size of the
input.

• More precisely, this means that there is a constant c such that the running time is at most cn for every
input of size n.

• If an algorithm’s time/space usage only grows linearly with the number of elements in the input, then it
has linear time/space complexity.

• Linear time is the best possible time complexity in situations where the algorithm has to sequentially
read its entire input. Quasilinear Time O(n log n) :

• The effort grows slightly faster than linear because the linear component is multiplied by a logarithmic
one. Quadratic Time O(n²) :

• The time grows linearly to the square of the number of input elements: If the number of input elements n
doubles, then the time simply multiplies. Exponential time O(2n ) :

• An algorithm is said to be exponential time, if T(n) is upper bounded by 2(n) , where (n) is some
polynomial in n.

• More formally, an algorithm is exponential time if T(n) is bounded by O(2 nk) for some constant k.

Big O Notation Order

Here are, once again, the described complexity classes, sorted in ascending order of complexity (for
sufficiently large values of n):

1. O(1) – constant time

2. O(log n) – logarithmic time

3. O(n) – linear time

4. O(n log n) – quasilinear time

5. O(n²) – quadratic time


Constant Time: O(1)
When your algorithm is not dependent on the input size n, it is said to have a constant time complexity
with order O(1). This means that the run time will always be the same regardless of the input size.

Logarithm Time: O(log n)


When the input size decreases on each iteration or step, an algorithm is said to have logarithmic time
complexity.

the runtime does not depend on the input size but rather on half the input size.

Linear Time: O(n)


You get linear time complexity when the running time of an algorithm increases linearly with the size of
the input. This means that when a function has an iteration that iterates over an input size of n, it is said to
have a time complexity of order O(n).

O(n log n) – quasilinear time

 The term “quasilinear” arises from the combination of two components:


 Linear: The n component signifies linear growth.
 Logarithmic: The log n component accounts for the logarithmic factor.

Quasilinear time complexity refers to an algorithm whose runtime grows almost linearly with the input
size.

 Specifically, if an algorithm’s time complexity is T(n) = O(n log n) for any constant k, it falls into the
quasilinear category.
 Another way to express this is that quasilinear time algorithms are also O(n^(1+ε)) for every ε > 0.
 In simpler terms, quasilinear time algorithms perform faster than any polynomial in n with an exponent
strictly greater than 1.

Quadratic Time: O(n^2)


When you perform nested iteration, meaning having a loop in a loop, the time complexity is quadratic,
which is horrible.

P Class Problem Vs NP Class Problem

P Class Problem:
A P class problem can be solved in "polynomial time," which means that an algorithm exists for its
solution such that the number of steps in the algorithm is bounded by a polynomial function of n, where n
corresponds to the length of the input for the problem. This problem is easy to understand and tractable.
NP Class Problem:
A problem is said to be Nondeterministic polynomial time that can be solvable in polynomial time by a
nondeterministic Turing machine. The solutions to the NP class problem are hard to find since they are
being solved by a non-deterministic machine.

Sr. No P class Problem NP class Problem


1. P problems are a set of problems that NP problems are problems that can be solved in
can be solved in polynomial time by nondeterministic polynomial time.
deterministic algorithms.
2. P Problems can be solved and verified
The solution to NP problems cannot be obtained in
in polynomial time. polynomial time, but if the solution is given, it can
be verified in polynomial time.
3. P problems are a subset of NP NP Problems are a superset of P problems.
problems.
4. All P problems are deterministic in All the NP problems are non-deterministic in
nature. nature.
5. It takes polynomial time to solve a It takes non-deterministic polynomial time to
problem like n, n^2, n*logn, etc. quickly check a problem.
6. The solution to P class problems is The solution to NP class problems is hard to find.
easy to find.

7. Examples of P problems are: Examples of NP problems are the Traveling


Selection sort, Linear Search salesman problem and the knapsack problem.

Polynomial time reduction and NP -completeness


 Exploring some time complexity limits of polynomial time algorithmic solutions
 In computational complexity theory, a polynomial-time reduction is a method for solving one
problem using another.

Polynomial time reduction :


A decision problem is NP-hard if the time complexity on a deterministic machine is within a polynomial
factor of the complexity of any problem in NP.

A problem is NP-complete if it is NP-hard and in NP.

Definition: A language L is said to be polynomial time reducible or reducible in polynomial time to a


language U if the map reduction between them can be computed in polynomial time – This is, the time
complexity of the Turing machine that computes the reduction mapping is bounded above by a
polynomial function in the length of the input string.

Example of polynomial time reducible languages


Definition: A clause is a Boolean formula consisting of a set of Boolean variables connected by the
logical or. A Boolean formula is said to be in conjunctive normal form (CNF) if it consists of clauses
connected by the logical and.

Notations: 3CNF denotes the set of all conjunctive normal forms whose clauses involve at most 3
Boolean variables 3SAT denotes the set of all satisfiable Boolean formulas in 3CNF (Thus, 3SAT is a
subset of 3CNF) 3 Example (cont.) Definition: An n-clique in an undirected graph is a fully connected
(this is, all-to-all) n-node sub-graph of the graph n-Clique denotes the set of all undirected graphs
possessing an n-clique.

 3SAT is reducible to n-Clique in polynomial time.


The class NP:
Definition: A language (problem) L is said to be NP (or to be in the class NP) if its best known time
complexity bound is achieved by a nondeterministic decider which, on each input string produces either a
polynomial time accepting branch, or its longest rejection branch is polynomial bounded.

Observation: A direct application lead us to the conclusion that the transformation of the
nondeterministic TM to a deterministic TM will render exponential time complexity.

 Non-polynomial time conveys a larger class of problems, including those without any known NP
solution.
 If any NP-complete problem can be solved in polynomial time, then every problem in NP can be
solved in polynomial time. NP-complete problems are the hardest problems in the NP set.

Cook’s Theorem
In computational complexity theory, the Cook–Levin theorem, also known as Cook's theorem, states
that the Boolean satisfiability problem is NP-complete. That is, it is in NP, and any problem in NP can be
reduced in polynomial time by a deterministic Turing machine to the Boolean satisfiability problem.

Cook’s Theorem proves that satisfiability is NP-complete by reducing all non-deterministic Turing
machines to SAT. Each Turing machine has access to a two-way infinite tape (read/write) and a finite
state control, which serves as the program.

A program for a non-deterministic TM is:

1. Space on the tape for guessing a solution and certificate to permit verification.

2. A finite set of tape symbols

3. A finite set of states Θ for the machine, including the start state q0 and final states

Z yes, Z no

4. A transition function, which takes the current machine state, and current tape symbol and returns the
new state, symbol, and head position. We know a problem is in NP if we have a NDTM program to solve
it in worst-case time p[n], where p is a polynomial and n is the size of the input.

You might also like